work on entites

This commit is contained in:
Progwml6 committed 2014-01-21 18:01:00 -05:00
1 parent 780e933985
commit 1f0ab2b74a
16 files changed
+63 -53

No files matched your search

@@ -73,12 +73,12 @@ public class ArrowRender extends Render
Block block = null;
block = BlockUtils.getBlockFromItem(itemstack.getItem());
if (itemstack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(BlockUtils.getBlockFromItem(itemstack.getItem()).getRenderType()))
if (itemstack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.func_147739_a(BlockUtils.getBlockFromItem(itemstack.getItem()).func_149645_b()))
{
GL11.glRotatef(f3, 0.0F, 1.0F, 0.0F);
float f7 = 0.25F;
int j = block.getRenderType();
int j = block.func_149645_b();
if (j == 1 || j == 19 || j == 12 || j == 2)
{
@@ -72,7 +72,7 @@ public class DaggerRender extends Render
Block block = BlockUtils.getBlockFromItem(itemstack.getItem());
if (itemstack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(BlockUtils.getBlockFromItem(itemstack.getItem()).getRenderType()))
if (itemstack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.func_147739_a(BlockUtils.getBlockFromItem(itemstack.getItem()).func_149645_b()))
{
GL11.glRotatef(f3, 0.0F, 1.0F, 0.0F);
@@ -84,7 +84,7 @@ public class DaggerRender extends Render
}
float f7 = 0.25F;
int j = block.getRenderType();
int j = block.func_149645_b();
if (j == 1 || j == 19 || j == 12 || j == 2)
{
@@ -311,7 +311,7 @@ public class DaggerRender extends Render
float f2;
Block block = BlockUtils.getBlockFromItem(k);
if (par3ItemStack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(BlockUtils.getBlockFromItem(k).getRenderType()))
if (par3ItemStack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.func_147739_a(BlockUtils.getBlockFromItem(k).func_149645_b()))
{
par2TextureManager.bindTexture(TextureMap.locationBlocksTexture);
GL11.glPushMatrix();
@@ -22,7 +22,7 @@ public abstract class AbstractTab extends GuiButton
}
@Override
public void drawButton (Minecraft mc, int mouseX, int mouseY)
public void func_146112_a (Minecraft mc, int mouseX, int mouseY)
{
if (this.field_146125_m)
{
@@ -50,7 +50,7 @@ public abstract class AbstractTab extends GuiButton
}
@Override
public boolean mousePressed (Minecraft mc, int mouseX, int mouseY)
public boolean func_146116_c (Minecraft mc, int mouseX, int mouseY)
{
boolean inWindow = this.field_146124_l && this.field_146125_m && mouseX >= this.field_146128_h && mouseY >= this.field_146129_i && mouseX < this.field_146128_h + this.field_146120_f && mouseY < this.field_146129_i + this.field_146121_g;
@@ -627,14 +627,14 @@ public class TContent implements IFuelHandler
TConstructRegistry.addItemStackToDirectory("canisterRedHeart", new ItemStack(TRepo.heartCanister, 1, 2));
//Vanilla stack sizes
Item.doorWood.setMaxStackSize(16);
Item.doorIron.setMaxStackSize(16);
Item.snowball.setMaxStackSize(64);
Item.boat.setMaxStackSize(16);
Item.minecartEmpty.setMaxStackSize(3);
Item.minecartCrate.setMaxStackSize(3);
Item.minecartPowered.setMaxStackSize(3);
Item.itemsList[Block.cake.blockID].setMaxStackSize(16);
Items.wooden_door.setMaxStackSize(16);
Items.iron_door.setMaxStackSize(16);
Items.snowball.setMaxStackSize(64);
Items.boat.setMaxStackSize(16);
Items.minecartEmpty.setMaxStackSize(3);
Items.minecartCrate.setMaxStackSize(3);
Items.minecartPowered.setMaxStackSize(3);
Items.itemsList[Block.cake.blockID].setMaxStackSize(16);
//Block.torchWood.setTickRandomly(false);
}
@@ -44,12 +44,12 @@ public class TProxyCommon implements IGuiHandler
if (ID == landmineID)
{
return new ContainerLandmine(player, (TileEntityLandmine) world.getBlockTileEntity(x, y, z));
return new ContainerLandmine(player, (TileEntityLandmine) world.func_147438_o(x, y, z));
}
else if (ID < 100)
{
TileEntity tile = world.getBlockTileEntity(x, y, z);
TileEntity tile = world.func_147438_o(x, y, z);
if (tile != null && tile instanceof InventoryLogic)
{
return ((InventoryLogic) tile).getGuiContainer(player.inventory, world, x, y, z);
@@ -16,6 +16,7 @@ import net.minecraft.potion.Potion;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.util.StatCollector;
import net.minecraft.world.EnumDifficulty;
import net.minecraft.world.EnumSkyBlock;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
@@ -278,7 +279,7 @@ public class BlueSlime extends EntityLiving implements IMob, IBossDisplayData
*/
public void onUpdate ()
{
if (!this.worldObj.isRemote && this.worldObj.difficultySetting == 0 && this.getSlimeSize() > 0)
if (!this.worldObj.isRemote && this.worldObj.difficultySetting == EnumDifficulty.PEACEFUL && this.getSlimeSize() > 0)
{
this.isDead = true;
}
@@ -418,9 +419,9 @@ public class BlueSlime extends EntityLiving implements IMob, IBossDisplayData
protected void dropFewItems (boolean par1, int par2)
{
int size = this.getSlimeSize();
int j = this.getDropItemId();
Item j = this.getDropItem();
if (j > 0 && (rand.nextInt(2) == 0) || size >= 8)
if (j != null && (rand.nextInt(2) == 0) || size >= 8)
{
int k = rand.nextInt(3) + rand.nextInt(this.getSlimeSize());
@@ -431,7 +432,7 @@ public class BlueSlime extends EntityLiving implements IMob, IBossDisplayData
for (int l = 0; l < k; ++l)
{
this.dropItem(j, 1);
this.entityDropItem(new ItemStack(j), 1);
}
}
@@ -5,6 +5,7 @@ import io.netty.buffer.ByteBuf;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.BlockRail;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
@@ -408,7 +409,7 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
double var4 = 0.4D;
double var6 = 0.0078125D;
int var8 = this.worldObj.getBlockId(var45, var2, var47);
Block var8 = this.worldObj.func_147439_a(var45, var2, var47);
moveMinecartOffRail(var45, var2, var47);
if (entityFollowing != null)
@@ -571,7 +572,7 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
--var10;
}
int var12 = this.worldObj.getBlockId(var9, var10, var11);
Block var12 = this.worldObj.func_147439_a(var9, var10, var11);
return null;
}
@@ -587,7 +588,7 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
--var8;
}
int var10 = this.worldObj.getBlockId(var7, var8, var9);
Block var10 = this.worldObj.func_147439_a(var7, var8, var9);
if (BlockRail.isRailBlock(var10))
{
@@ -1444,16 +1445,21 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
}
@Override
public boolean isInvNameLocalized ()
public boolean isItemValidForSlot (int i, ItemStack itemstack)
{
// TODO Auto-generated method stub
return false;
}
@Override
public boolean isItemValidForSlot (int i, ItemStack itemstack)
public String func_145825_b ()
{
//TODO get inventory name
return null;
}
@Override
public boolean func_145818_k_ ()
{
// TODO Auto-generated method stub
return false;
}
}
@@ -101,7 +101,7 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa
this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(this.motionY, (double) f) * 180.0D / Math.PI);
}
Block i = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f);
Block i = this.worldObj.func_147439_a(this.field_145791_d, this.field_145792_e, this.field_145789_f);
i.func_149719_a(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f);
@@ -121,7 +121,7 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa
{
if (!worldObj.isRemote)
{
Block j = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f);
Block j = this.worldObj.func_147439_a(this.field_145791_d, this.field_145792_e, this.field_145789_f);
int k = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f);
if (j == this.inTile && k == this.inData)
@@ -329,7 +329,7 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa
this.field_145791_d = movingobjectposition.blockX;
this.field_145792_e = movingobjectposition.blockY;
this.field_145789_f = movingobjectposition.blockZ;
this.inTile = this.worldObj.getBlockId(this.field_145791_d, this.field_145792_e, this.field_145789_f);
this.inTile = this.worldObj.func_147439_a(this.field_145791_d, this.field_145792_e, this.field_145789_f);
this.inData = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f);
this.motionX = (double) ((float) (movingobjectposition.hitVec.xCoord - this.posX));
this.motionY = (double) ((float) (movingobjectposition.hitVec.yCoord - this.posY));
@@ -64,7 +64,7 @@ public class DaggerEntity extends RotatingBase
xTile = movingobjectposition.blockX;
yTile = movingobjectposition.blockY;
zTile = movingobjectposition.blockZ;
inTile = worldObj.getBlockId(xTile, yTile, zTile);
inTile = worldObj.func_147439_a(xTile, yTile, zTile);
motionX = (float) (movingobjectposition.hitVec.xCoord - posX);
motionY = (float) (movingobjectposition.hitVec.yCoord - posY);
motionZ = (float) (movingobjectposition.hitVec.zCoord - posZ);
@@ -5,6 +5,7 @@ import java.util.List;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -30,7 +31,7 @@ public class LaunchedPotion extends EntityThrowable
public LaunchedPotion(World par1World, EntityLivingBase par2EntityLiving, int par3)
{
this(par1World, par2EntityLiving, new ItemStack(Item.potion, 1, par3));
this(par1World, par2EntityLiving, new ItemStack(Items.potionitem, 1, par3));
}
public LaunchedPotion(World par1World, EntityLivingBase par2EntityLiving, ItemStack par3ItemStack)
@@ -42,7 +43,7 @@ public class LaunchedPotion extends EntityThrowable
@SideOnly(Side.CLIENT)
public LaunchedPotion(World par1World, double par2, double par4, double par6, int par8)
{
this(par1World, par2, par4, par6, new ItemStack(Item.potion, 1, par8));
this(par1World, par2, par4, par6, new ItemStack(Items.potionitem, 1, par8));
}
public LaunchedPotion(World par1World, double par2, double par4, double par6, ItemStack par8ItemStack)
@@ -73,7 +74,7 @@ public class LaunchedPotion extends EntityThrowable
{
if (this.potionDamage == null)
{
this.potionDamage = new ItemStack(Item.potion, 1, 0);
this.potionDamage = new ItemStack(Items.potionitem, 1, 0);
}
this.potionDamage.setItemDamage(par1);
@@ -86,7 +87,7 @@ public class LaunchedPotion extends EntityThrowable
{
if (this.potionDamage == null)
{
this.potionDamage = new ItemStack(Item.potion, 1, 0);
this.potionDamage = new ItemStack(Items.potionitem, 1, 0);
}
return this.potionDamage.getItemDamage();
@@ -99,7 +100,7 @@ public class LaunchedPotion extends EntityThrowable
{
if (!this.worldObj.isRemote)
{
List list = Item.potion.getEffects(this.potionDamage);
List list = Items.potionitem.getEffects(this.potionDamage);
if (list != null && !list.isEmpty())
{
@@ -5,8 +5,10 @@ import io.netty.buffer.ByteBuf;
import java.util.List;
import tconstruct.library.tools.AbilityHelper;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
@@ -36,7 +38,7 @@ public class RotatingBase extends Entity implements IEntityAdditionalSpawnData
xTile = -1;
yTile = -1;
zTile = -1;
inTile = 0;
inTile = Blocks.air;
onGround = false;
arrowShake = 0;
ticksInAir = 0;
@@ -179,7 +181,7 @@ public class RotatingBase extends Entity implements IEntityAdditionalSpawnData
}
if (onGround)
{
int i = worldObj.getBlockId(xTile, yTile, zTile);
Block i = worldObj.func_147439_a(xTile, yTile, zTile);
if (i != inTile)
{
onGround = false;
@@ -410,7 +412,7 @@ public class RotatingBase extends Entity implements IEntityAdditionalSpawnData
protected int xTile;
protected int yTile;
protected int zTile;
protected int inTile;
protected Block inTile;
public int arrowShake;
public EntityPlayer owner;
protected int ticksInGround;
@@ -130,14 +130,14 @@ public class FurnaceContainer extends Container
}
else if (par2 != 1 && par2 != 0)
{
if (FurnaceRecipes.smelting().getSmeltingResult(itemstack1) != null)
if (FurnaceRecipes.smelting().func_151395_a(itemstack1) != null)
{
if (!this.mergeItemStack(itemstack1, 0, 1, false))
{
return null;
}
}
else if (TileEntityFurnace.isItemFuel(itemstack1))
else if (TileEntityFurnace.func_145954_b(itemstack1))
{
if (!this.mergeItemStack(itemstack1, 1, 2, false))
{
@@ -23,7 +23,7 @@ public class SlotOpaqueBlocksOnly extends SlotBlocksOnly
if (super.isItemValid(par1ItemStack))
{
Block b = BlockUtils.getBlockFromItemStack(par1ItemStack);
return b.isOpaqueCube() && b.func_149686_d();
return b.func_149662_c() && b.func_149686_d();
}
return false;
@@ -38,9 +38,9 @@ public class Smeltery
* @param temperature How hot the block should be before liquifying. Max temp in the Smeltery is 800, other structures may vary
* @param output The result of the process in liquid form
*/
public static void addMelting (Block block, int metadata, int temperature, FluidStack output)
public static void addMelting (Item item, int metadata, int temperature, FluidStack output)
{
addMelting(new ItemStack(block, 1, metadata), block, metadata, temperature, output);
addMelting(new ItemStack(item, 1, metadata), item, metadata, temperature, output);
}
/** Adds mappings between an input and its liquid.
@@ -53,11 +53,11 @@ public class Smeltery
* @param temperature How hot the block should be before liquifying
* @param liquid The result of the process
*/
public static void addMelting (ItemStack input, Item block, int metadata, int temperature, FluidStack liquid)
public static void addMelting (ItemStack input, Item item, int metadata, int temperature, FluidStack liquid)
{
instance.smeltingList.put(Arrays.asList(input.getItem(), input.getItemDamage()), liquid);
instance.temperatureList.put(Arrays.asList(input.getItem(), input.getItemDamage()), temperature);
instance.renderIndex.put(Arrays.asList(input.getItem(), input.getItemDamage()), new ItemStack(block, input.stackSize, metadata));
instance.smeltingList.put(Arrays.asList((Item)input.getItem(), input.getItemDamage()), liquid);
instance.temperatureList.put(Arrays.asList((Item)input.getItem(), input.getItemDamage()), temperature);
instance.renderIndex.put(Arrays.asList((Item)input.getItem(), input.getItemDamage()), new ItemStack(item, input.stackSize, metadata));
}
/** Adds an alloy mixing recipe.
@@ -75,7 +75,7 @@ public class TActiveOmniMod extends ActiveToolMod
{
WorldHelper.setBlockToAir(world, x, y, z);
if (entity instanceof EntityPlayer && !((EntityPlayer) entity).capabilities.isCreativeMode)
tool.onBlockDestroyed(stack, world, bID, x, y, z, entity);
tool.onBlockDestroyed(stack, world, block, x, y, z, entity);
if (!world.isRemote)
{
ItemStack spawnme = result.copy();
@@ -76,7 +76,7 @@ public class TPacketHandler implements IPacketHandler
int x = inputStream.readInt();
int y = inputStream.readInt();
int z = inputStream.readInt();
TileEntity te = world.getBlockTileEntity(x, y, z);
TileEntity te = world.func_147438_o(x, y, z);
String toolName = inputStream.readUTF();
if (te instanceof ToolStationLogic)
@@ -95,7 +95,7 @@ public class TPacketHandler implements IPacketHandler
int x = inputStream.readInt();
int y = inputStream.readInt();
int z = inputStream.readInt();
TileEntity te = world.getBlockTileEntity(x, y, z);
TileEntity te = world.func_147438_o(x, y, z);
Short itemID = inputStream.readShort();
Short itemDamage = inputStream.readShort();
@@ -141,7 +141,7 @@ public class TPacketHandler implements IPacketHandler
boolean isShiftPressed = inputStream.readBoolean();
int fluidID = inputStream.readInt();
TileEntity te = world.getBlockTileEntity(x, y, z);
TileEntity te = world.func_147438_o(x, y, z);
if (te instanceof SmelteryLogic)
{