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

@@ -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;