mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-28 07:55:45 +00:00
Some rendering experiements, update notes
This commit is contained in:
1 parent
6cc88f1c5a
commit
8361d1743d
14 files changed
+207
-94
No files matched your search
@@ -11,10 +11,13 @@
|
||||
package vazkii.botania.client.core.helper;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.WorldRenderer;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.IFlexibleBakedModel;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
|
||||
public final class IconHelper {
|
||||
@@ -59,4 +62,106 @@ public final class IconHelper {
|
||||
return forName(ir, item.getUnlocalizedName().replaceAll("item\\.", "") + s);
|
||||
}
|
||||
|
||||
private static String json
|
||||
|
||||
/**
|
||||
* Takes an icon, generates a "flat 3D" model in the style of held items.
|
||||
* Used for rendering icons in 3D that have no item form
|
||||
* @param sprite The texture to bake
|
||||
* @return A baked model representing the flat 3D form of the given texture
|
||||
*/
|
||||
public IFlexibleBakedModel bakeModelFromIcon(TextureAtlasSprite sprite) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* From 1.7, takes a sprite and renders it in the "flat 3D" style of held items
|
||||
* Use this ONLY for sprites that don't have a corresponding item!
|
||||
* For items, use built in methods that use the bakedmodel since those are much more efficient
|
||||
* Args: tess, maxu, minv, minu, maxv, width, height, thickness(?)
|
||||
* todo 1.8 find a replacement for this method, possibly the above bakeModelFromIcon
|
||||
*/
|
||||
public static void renderItemIn2D(Tessellator tess, float p_78439_1_, float p_78439_2_, float p_78439_3_, float p_78439_4_, int width, int height, float p_78439_7_)
|
||||
{
|
||||
WorldRenderer wr = tess.getWorldRenderer();
|
||||
wr.startDrawingQuads();
|
||||
wr.setNormal(0.0F, 0.0F, 1.0F);
|
||||
wr.addVertexWithUV(0.0D, 0.0D, 0.0D, (double)p_78439_1_, (double)p_78439_4_);
|
||||
wr.addVertexWithUV(1.0D, 0.0D, 0.0D, (double)p_78439_3_, (double)p_78439_4_);
|
||||
wr.addVertexWithUV(1.0D, 1.0D, 0.0D, (double)p_78439_3_, (double)p_78439_2_);
|
||||
wr.addVertexWithUV(0.0D, 1.0D, 0.0D, (double)p_78439_1_, (double)p_78439_2_);
|
||||
tess.draw();
|
||||
wr.startDrawingQuads();
|
||||
wr.setNormal(0.0F, 0.0F, -1.0F);
|
||||
wr.addVertexWithUV(0.0D, 1.0D, (double)(0.0F - p_78439_7_), (double)p_78439_1_, (double)p_78439_2_);
|
||||
wr.addVertexWithUV(1.0D, 1.0D, (double)(0.0F - p_78439_7_), (double)p_78439_3_, (double)p_78439_2_);
|
||||
wr.addVertexWithUV(1.0D, 0.0D, (double)(0.0F - p_78439_7_), (double)p_78439_3_, (double)p_78439_4_);
|
||||
wr.addVertexWithUV(0.0D, 0.0D, (double)(0.0F - p_78439_7_), (double)p_78439_1_, (double)p_78439_4_);
|
||||
tess.draw();
|
||||
float f5 = 0.5F * (p_78439_1_ - p_78439_3_) / (float)width;
|
||||
float f6 = 0.5F * (p_78439_4_ - p_78439_2_) / (float)height;
|
||||
wr.startDrawingQuads();
|
||||
wr.setNormal(-1.0F, 0.0F, 0.0F);
|
||||
int k;
|
||||
float f7;
|
||||
float f8;
|
||||
|
||||
for (k = 0; k < width; ++k)
|
||||
{
|
||||
f7 = (float)k / (float)width;
|
||||
f8 = p_78439_1_ + (p_78439_3_ - p_78439_1_) * f7 - f5;
|
||||
wr.addVertexWithUV((double)f7, 0.0D, (double)(0.0F - p_78439_7_), (double)f8, (double)p_78439_4_);
|
||||
wr.addVertexWithUV((double)f7, 0.0D, 0.0D, (double)f8, (double)p_78439_4_);
|
||||
wr.addVertexWithUV((double)f7, 1.0D, 0.0D, (double)f8, (double)p_78439_2_);
|
||||
wr.addVertexWithUV((double)f7, 1.0D, (double)(0.0F - p_78439_7_), (double)f8, (double)p_78439_2_);
|
||||
}
|
||||
|
||||
tess.draw();
|
||||
wr.startDrawingQuads();
|
||||
wr.setNormal(1.0F, 0.0F, 0.0F);
|
||||
float f9;
|
||||
|
||||
for (k = 0; k < width; ++k)
|
||||
{
|
||||
f7 = (float)k / (float)width;
|
||||
f8 = p_78439_1_ + (p_78439_3_ - p_78439_1_) * f7 - f5;
|
||||
f9 = f7 + 1.0F / (float)width;
|
||||
wr.addVertexWithUV((double)f9, 1.0D, (double)(0.0F - p_78439_7_), (double)f8, (double)p_78439_2_);
|
||||
wr.addVertexWithUV((double)f9, 1.0D, 0.0D, (double)f8, (double)p_78439_2_);
|
||||
wr.addVertexWithUV((double)f9, 0.0D, 0.0D, (double)f8, (double)p_78439_4_);
|
||||
wr.addVertexWithUV((double)f9, 0.0D, (double)(0.0F - p_78439_7_), (double)f8, (double)p_78439_4_);
|
||||
}
|
||||
|
||||
tess.draw();
|
||||
wr.startDrawingQuads();
|
||||
wr.setNormal(0.0F, 1.0F, 0.0F);
|
||||
|
||||
for (k = 0; k < height; ++k)
|
||||
{
|
||||
f7 = (float)k / (float)height;
|
||||
f8 = p_78439_4_ + (p_78439_2_ - p_78439_4_) * f7 - f6;
|
||||
f9 = f7 + 1.0F / (float)height;
|
||||
wr.addVertexWithUV(0.0D, (double)f9, 0.0D, (double)p_78439_1_, (double)f8);
|
||||
wr.addVertexWithUV(1.0D, (double)f9, 0.0D, (double)p_78439_3_, (double)f8);
|
||||
wr.addVertexWithUV(1.0D, (double)f9, (double)(0.0F - p_78439_7_), (double)p_78439_3_, (double)f8);
|
||||
wr.addVertexWithUV(0.0D, (double)f9, (double)(0.0F - p_78439_7_), (double)p_78439_1_, (double)f8);
|
||||
}
|
||||
|
||||
tess.draw();
|
||||
wr.startDrawingQuads();
|
||||
wr.setNormal(0.0F, -1.0F, 0.0F);
|
||||
|
||||
for (k = 0; k < height; ++k)
|
||||
{
|
||||
f7 = (float)k / (float)height;
|
||||
f8 = p_78439_4_ + (p_78439_2_ - p_78439_4_) * f7 - f6;
|
||||
wr.addVertexWithUV(1.0D, (double)f7, 0.0D, (double)p_78439_3_, (double)f8);
|
||||
wr.addVertexWithUV(0.0D, (double)f7, 0.0D, (double)p_78439_1_, (double)f8);
|
||||
wr.addVertexWithUV(0.0D, (double)f7, (double)(0.0F - p_78439_7_), (double)p_78439_1_, (double)f8);
|
||||
wr.addVertexWithUV(1.0D, (double)f7, (double)(0.0F - p_78439_7_), (double)p_78439_3_, (double)f8);
|
||||
}
|
||||
|
||||
tess.draw();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.tile;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
|
||||
@@ -43,66 +44,72 @@ public class TileSpawnerClaw extends TileMod implements IManaReceiver, IUpdatePl
|
||||
TileEntityMobSpawner spawner = (TileEntityMobSpawner) tileBelow;
|
||||
MobSpawnerBaseLogic logic = spawner.getSpawnerBaseLogic();
|
||||
|
||||
if(!((Boolean) isActivated.invoke(logic))) {
|
||||
if(!worldObj.isRemote)
|
||||
mana -= 6;
|
||||
try {
|
||||
if(!((Boolean) isActivated.invoke(logic))) {
|
||||
if(!worldObj.isRemote)
|
||||
mana -= 6;
|
||||
|
||||
if(logic.getSpawnerWorld().isRemote) {
|
||||
if(logic.spawnDelay > 0)
|
||||
--logic.spawnDelay;
|
||||
if(logic.getSpawnerWorld().isRemote) {
|
||||
if(logic.spawnDelay > 0)
|
||||
--logic.spawnDelay;
|
||||
|
||||
if(Math.random() > 0.5)
|
||||
Botania.proxy.wispFX(worldObj, getPos().getX() + 0.3 + Math.random() * 0.5, getPos().getY() - 0.3 + Math.random() * 0.25, getPos().getZ() + Math.random(), 0.6F - (float) Math.random() * 0.3F, 0.1F, 0.6F - (float) Math.random() * 0.3F, (float) Math.random() / 3F, -0.025F - 0.005F * (float) Math.random(), 2F);
|
||||
if(Math.random() > 0.5)
|
||||
Botania.proxy.wispFX(worldObj, getPos().getX() + 0.3 + Math.random() * 0.5, getPos().getY() - 0.3 + Math.random() * 0.25, getPos().getZ() + Math.random(), 0.6F - (float) Math.random() * 0.3F, 0.1F, 0.6F - (float) Math.random() * 0.3F, (float) Math.random() / 3F, -0.025F - 0.005F * (float) Math.random(), 2F);
|
||||
|
||||
logic.prevMobRotation = logic.getMobRotation();
|
||||
logic.mobRotation = (logic.getMobRotation() + 1000.0F / (logic.spawnDelay + 200.0F)) % 360.0D;
|
||||
} else if(logic.spawnDelay == -1)
|
||||
resetTimer(logic);
|
||||
logic.prevMobRotation = logic.getMobRotation();
|
||||
logic.mobRotation = (logic.getMobRotation() + 1000.0F / (logic.spawnDelay + 200.0F)) % 360.0D;
|
||||
} else if(logic.spawnDelay == -1)
|
||||
resetTimer(logic);
|
||||
|
||||
if(logic.spawnDelay > 0) {
|
||||
--logic.spawnDelay;
|
||||
return;
|
||||
}
|
||||
if(logic.spawnDelay > 0) {
|
||||
--logic.spawnDelay;
|
||||
return;
|
||||
}
|
||||
|
||||
boolean flag = false;
|
||||
boolean flag = false;
|
||||
|
||||
int spawnCount = ReflectionHelper.getPrivateValue(MobSpawnerBaseLogic.class, logic, LibObfuscation.SPAWN_COUNT);
|
||||
int spawnRange = ReflectionHelper.getPrivateValue(MobSpawnerBaseLogic.class, logic, LibObfuscation.SPAWN_RANGE);
|
||||
int maxNearbyEntities = ReflectionHelper.getPrivateValue(MobSpawnerBaseLogic.class, logic, LibObfuscation.MAX_NEARBY_ENTITIES);
|
||||
int spawnCount = ReflectionHelper.getPrivateValue(MobSpawnerBaseLogic.class, logic, LibObfuscation.SPAWN_COUNT);
|
||||
int spawnRange = ReflectionHelper.getPrivateValue(MobSpawnerBaseLogic.class, logic, LibObfuscation.SPAWN_RANGE);
|
||||
int maxNearbyEntities = ReflectionHelper.getPrivateValue(MobSpawnerBaseLogic.class, logic, LibObfuscation.MAX_NEARBY_ENTITIES);
|
||||
|
||||
for(int i = 0; i < spawnCount; ++i) {
|
||||
Entity entity = EntityList.createEntityByName(logic.getEntityNameToSpawn(), logic.getSpawnerWorld());
|
||||
for(int i = 0; i < spawnCount; ++i) {
|
||||
Entity entity = EntityList.createEntityByName(logic.getEntityNameToSpawn(), logic.getSpawnerWorld());
|
||||
|
||||
if (entity == null)
|
||||
return;
|
||||
if (entity == null)
|
||||
return;
|
||||
|
||||
int j = logic.getSpawnerWorld().getEntitiesWithinAABB(entity.getClass(), new AxisAlignedBB(logic.func_177221_b(), logic.func_177221_b().add(1, 1, 1)).expand(spawnRange * 2, 4.0D, spawnRange * 2)).size();
|
||||
int j = logic.getSpawnerWorld().getEntitiesWithinAABB(entity.getClass(), new AxisAlignedBB(logic.func_177221_b(), logic.func_177221_b().add(1, 1, 1)).expand(spawnRange * 2, 4.0D, spawnRange * 2)).size();
|
||||
|
||||
if (j >= maxNearbyEntities) {
|
||||
resetTimer(logic);
|
||||
return;
|
||||
}
|
||||
if (j >= maxNearbyEntities) {
|
||||
resetTimer(logic);
|
||||
return;
|
||||
}
|
||||
|
||||
double d2 = logic.func_177221_b().getX() + (logic.getSpawnerWorld().rand.nextDouble() - logic.getSpawnerWorld().rand.nextDouble()) * spawnRange;
|
||||
double d3 = logic.func_177221_b().getY() + logic.getSpawnerWorld().rand.nextInt(3) - 1;
|
||||
double d4 = logic.func_177221_b().getZ() + (logic.getSpawnerWorld().rand.nextDouble() - logic.getSpawnerWorld().rand.nextDouble()) * spawnRange;
|
||||
EntityLiving entityliving = entity instanceof EntityLiving ? (EntityLiving)entity : null;
|
||||
entity.setLocationAndAngles(d2, d3, d4, logic.getSpawnerWorld().rand.nextFloat() * 360.0F, 0.0F);
|
||||
double d2 = logic.func_177221_b().getX() + (logic.getSpawnerWorld().rand.nextDouble() - logic.getSpawnerWorld().rand.nextDouble()) * spawnRange;
|
||||
double d3 = logic.func_177221_b().getY() + logic.getSpawnerWorld().rand.nextInt(3) - 1;
|
||||
double d4 = logic.func_177221_b().getZ() + (logic.getSpawnerWorld().rand.nextDouble() - logic.getSpawnerWorld().rand.nextDouble()) * spawnRange;
|
||||
EntityLiving entityliving = entity instanceof EntityLiving ? (EntityLiving)entity : null;
|
||||
entity.setLocationAndAngles(d2, d3, d4, logic.getSpawnerWorld().rand.nextFloat() * 360.0F, 0.0F);
|
||||
|
||||
if(entityliving == null || entityliving.getCanSpawnHere()) {
|
||||
if(!worldObj.isRemote)
|
||||
logic.func_98265_a(entity);
|
||||
logic.getSpawnerWorld().playAuxSFX(2004, logic.func_177221_b(), 0);
|
||||
if(entityliving == null || entityliving.getCanSpawnHere()) {
|
||||
if(!worldObj.isRemote)
|
||||
logic.func_98265_a(entity);
|
||||
logic.getSpawnerWorld().playAuxSFX(2004, logic.func_177221_b(), 0);
|
||||
|
||||
if (entityliving != null)
|
||||
entityliving.spawnExplosionParticle();
|
||||
if (entityliving != null)
|
||||
entityliving.spawnExplosionParticle();
|
||||
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (flag)
|
||||
resetTimer(logic);
|
||||
if (flag)
|
||||
resetTimer(logic);
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
Botania.instance.handleIMC();
|
||||
} catch (InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import java.math.RoundingMode;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -61,20 +62,24 @@ public class Vector3
|
||||
return new Vector3(this);
|
||||
}
|
||||
|
||||
public static Vector3 fromBlockPos(BlockPos pos) {
|
||||
return new Vector3(pos.getX(), pos.getY(), pos.getZ());
|
||||
}
|
||||
|
||||
public static Vector3 fromEntity(Entity e) {
|
||||
return new Vector3(e.posX, e.posY, e.posZ);
|
||||
}
|
||||
|
||||
public static Vector3 fromEntityCenter(Entity e) {
|
||||
return new Vector3(e.posX, e.posY - e.yOffset + e.height / 2, e.posZ);
|
||||
return new Vector3(e.posX, e.posY - /*e.yOffset todo 1.8 */ 0 + e.height / 2, e.posZ);
|
||||
}
|
||||
|
||||
public static Vector3 fromTileEntity(TileEntity e) {
|
||||
return new Vector3(e.xCoord, e.yCoord, e.zCoord);
|
||||
return fromBlockPos(e.getPos());
|
||||
}
|
||||
|
||||
public static Vector3 fromTileEntityCenter(TileEntity e) {
|
||||
return new Vector3(e.xCoord + 0.5, e.yCoord + 0.5, e.zCoord + 0.5);
|
||||
return fromTileEntity(e).add(0.5);
|
||||
}
|
||||
|
||||
public Vector3 set(double d, double d1, double d2) {
|
||||
|
||||
@@ -18,14 +18,14 @@ import vazkii.botania.common.lib.LibOreDict;
|
||||
public final class ModPureDaisyRecipes {
|
||||
|
||||
public static void init() {
|
||||
BotaniaAPI.registerPureDaisyRecipe("stone", ModBlocks.livingrock, 0);
|
||||
BotaniaAPI.registerPureDaisyRecipe("logWood", ModBlocks.livingwood, 0);
|
||||
BotaniaAPI.registerPureDaisyRecipe("stone", ModBlocks.livingrock.getDefaultState());
|
||||
BotaniaAPI.registerPureDaisyRecipe("logWood", ModBlocks.livingwood.getDefaultState());
|
||||
|
||||
BotaniaAPI.registerPureDaisyRecipe("netherrack", Blocks.cobblestone, 0);
|
||||
BotaniaAPI.registerPureDaisyRecipe("soulSand", Blocks.sand, 0);
|
||||
BotaniaAPI.registerPureDaisyRecipe("ice", Blocks.packed_ice, 0);
|
||||
BotaniaAPI.registerPureDaisyRecipe(LibOreDict.BLAZE_BLOCK, Blocks.obsidian, 0);
|
||||
BotaniaAPI.registerPureDaisyRecipe(Blocks.water, Blocks.snow, 0);
|
||||
BotaniaAPI.registerPureDaisyRecipe("netherrack", Blocks.cobblestone.getDefaultState());
|
||||
BotaniaAPI.registerPureDaisyRecipe("soulSand", Blocks.sand.getDefaultState());
|
||||
BotaniaAPI.registerPureDaisyRecipe("ice", Blocks.packed_ice.getDefaultState());
|
||||
BotaniaAPI.registerPureDaisyRecipe(LibOreDict.BLAZE_BLOCK, Blocks.obsidian.getDefaultState());
|
||||
BotaniaAPI.registerPureDaisyRecipe(Blocks.water, Blocks.snow.getDefaultState());
|
||||
}
|
||||
|
||||
}
|
||||
+1
-3
@@ -16,7 +16,6 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -24,7 +23,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
@@ -124,7 +122,7 @@ public class ItemTerrasteelHelm extends ItemTerrasteelArmor implements IManaDisc
|
||||
GlStateManager.rotate(180F, 1F, 0F, 0F);
|
||||
GlStateManager.translate(-0.26F, 0.15F, -0.39F);
|
||||
GlStateManager.scale(0.5F, 0.5F, 0.5F);
|
||||
ItemRenderer.renderItemIn2D(Tessellator.getInstance(), f1, f2, f, f3, willIcon.getIconWidth(), willIcon.getIconHeight(), 1F / 16F);
|
||||
IconHelper.renderItemIn2D(Tessellator.getInstance(), f1, f2, f, f3, willIcon.getIconWidth(), willIcon.getIconHeight(), 1F / 16F);
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ package vazkii.botania.common.item.equipment.bauble;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -18,6 +18,7 @@ import java.util.Map;
|
||||
import net.minecraft.block.BlockLiquid;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -113,7 +114,7 @@ public class ItemIcePendant extends ItemBauble implements IBaubleRender {
|
||||
@Override
|
||||
public void onPlayerBaubleRender(ItemStack stack, RenderPlayerEvent event, RenderType type) {
|
||||
if(type == RenderType.BODY) {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
Helper.rotateIfSneaking(event.entityPlayer);
|
||||
boolean armor = event.entityPlayer.getCurrentArmor(2) != null;
|
||||
GlStateManager.rotate(180F, 1F, 0F, 0F);
|
||||
|
||||
@@ -14,6 +14,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -221,7 +222,7 @@ public class ItemItemFinder extends ItemBauble implements IBaubleRender {
|
||||
float f3 = gemIcon.getMaxV();
|
||||
boolean armor = event.entityPlayer.getCurrentArmor(3) != null;
|
||||
Helper.translateToHeadLevel(event.entityPlayer);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
GlStateManager.rotate(90F, 0F, 1F, 0F);
|
||||
GlStateManager.rotate(180F, 1F, 0F, 0F);
|
||||
GlStateManager.translate(-0.4F, 0.1F, armor ? -0.3F : -0.25F);
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.common.item.equipment.bauble;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
@@ -13,7 +13,7 @@ package vazkii.botania.common.item.equipment.bauble;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -108,7 +108,8 @@ public class ItemTinyPlanet extends ItemBauble implements IBaubleRender {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
GlStateManager.translate(0.25F, -0.5F, 0F);
|
||||
GlStateManager.scale(0.5F, 0.5F, 0.5F);
|
||||
RenderBlocks.getInstance().renderBlockAsItem(ModBlocks.tinyPlanet, 0, 1F);
|
||||
Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlockBrightness(ModBlocks.tinyPlanet.getDefaultState(), 1.0F);
|
||||
// RenderBlocks.getInstance().renderBlockAsItem(ModBlocks.tinyPlanet, 0, 1F); todo 1.8
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ import java.util.List;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
@@ -26,6 +26,7 @@ import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
|
||||
@@ -62,6 +63,15 @@ public class ItemManaResource extends ItemMod implements IFlowerComponent, IElve
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onTextureStitch(TextureStitchEvent.Pre evt) {
|
||||
tailIcon = IconHelper.forName(evt.map, "tail");
|
||||
phiFlowerIcon = IconHelper.forName(evt.map, "phiFlower");
|
||||
goldfishIcon = IconHelper.forName(evt.map, "goldfish");
|
||||
nerfBatIcon = IconHelper.forName(evt.map, "nerfBat");
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||
boolean rightEvent = event.action == Action.RIGHT_CLICK_AIR;
|
||||
@@ -128,19 +138,6 @@ public class ItemManaResource extends ItemMod implements IFlowerComponent, IElve
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
icons = new IIcon[types];
|
||||
for(int i = 0; i < icons.length; i++)
|
||||
icons[i] = IconHelper.forName(par1IconRegister, LibItemNames.MANA_RESOURCE_NAMES[i]);
|
||||
|
||||
tailIcon = IconHelper.forName(par1IconRegister, "tail");
|
||||
phiFlowerIcon = IconHelper.forName(par1IconRegister, "phiFlower");
|
||||
goldfishIcon = IconHelper.forName(par1IconRegister, "goldfish");
|
||||
nerfBatIcon = IconHelper.forName(par1IconRegister, "nerfBat");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getColorFromItemStack(ItemStack par1ItemStack, int par2) {
|
||||
|
||||
@@ -104,10 +104,10 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWi
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIconIndex(ItemStack par1ItemStack) {
|
||||
return isFlying(par1ItemStack) ? iconFlying : iconIdle;
|
||||
}
|
||||
// @Override todo 1.8
|
||||
// public IIcon getIconIndex(ItemStack par1ItemStack) {
|
||||
// return isFlying(par1ItemStack) ? iconFlying : iconIdle;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public EnumAction getItemUseAction(ItemStack par1ItemStack) {
|
||||
@@ -119,12 +119,6 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWi
|
||||
return 720000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
iconIdle = IconHelper.forItem(par1IconRegister, this, 0);
|
||||
iconFlying = IconHelper.forItem(par1IconRegister, this, 1);
|
||||
}
|
||||
|
||||
public boolean isFlying(ItemStack stack) {
|
||||
return ItemNBTHelper.getBoolean(stack, TAG_FLYING, false);
|
||||
}
|
||||
@@ -150,7 +144,7 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWi
|
||||
if(tile.getCurrentMana() >= COST && tile.isEnabled()) {
|
||||
int range = 5;
|
||||
int rangeY = 3;
|
||||
List<EntityPlayer> players = world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(te.xCoord + 0.5 - range, te.yCoord + 0.5 - rangeY, te.zCoord + 0.5 - range, te.xCoord + 0.5 + range, te.yCoord + 0.5 + rangeY, te.zCoord + 0.5 + range));
|
||||
List<EntityPlayer> players = world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(te.getPos().add(-0.5 + range, -0.5 + rangeY, -0.5 + range), te.getPos().add(0.5 + range, 0.5 + rangeY, 0.5 + range)));
|
||||
for(EntityPlayer p : players) {
|
||||
if(p.motionY > 0.3 && p.motionY < 2 && !p.isSneaking()) {
|
||||
p.motionY = 2.8;
|
||||
|
||||
Reference in new issue
Block a user