2014-06-04 21:44:48 -08:00
|
|
|
package tconstruct.tools.entity;
|
2013-07-26 21:18:53 -07:00
|
|
|
|
2014-04-02 20:38:48 -04:00
|
|
|
import net.minecraft.entity.Entity;
|
2013-07-26 21:18:53 -07:00
|
|
|
import net.minecraft.entity.item.EntityItem;
|
|
|
|
|
import net.minecraft.item.ItemStack;
|
2014-04-02 20:38:48 -04:00
|
|
|
import net.minecraft.util.DamageSource;
|
2013-07-26 21:18:53 -07:00
|
|
|
import net.minecraft.world.World;
|
|
|
|
|
|
2022-09-22 19:51:23 +01:00
|
|
|
public class FancyEntityItem extends EntityItem {
|
|
|
|
|
public FancyEntityItem(World par1World, double par2, double par4, double par6) {
|
2013-07-26 21:18:53 -07:00
|
|
|
super(par1World, par2, par4, par6);
|
2014-04-02 20:38:48 -04:00
|
|
|
this.isImmuneToFire = true;
|
|
|
|
|
this.lifespan = 72000;
|
2013-07-26 21:18:53 -07:00
|
|
|
}
|
|
|
|
|
|
2022-09-22 19:51:23 +01:00
|
|
|
public FancyEntityItem(World par1World, double par2, double par4, double par6, ItemStack par8ItemStack) {
|
2013-07-26 21:18:53 -07:00
|
|
|
this(par1World, par2, par4, par6);
|
|
|
|
|
this.setEntityItemStack(par8ItemStack);
|
2022-09-22 19:51:23 +01:00
|
|
|
this.lifespan = (par8ItemStack.getItem() == null
|
|
|
|
|
? 6000
|
|
|
|
|
: par8ItemStack.getItem().getEntityLifespan(par8ItemStack, par1World));
|
2013-07-26 21:18:53 -07:00
|
|
|
}
|
|
|
|
|
|
2022-09-22 19:51:23 +01:00
|
|
|
public FancyEntityItem(World par1World) {
|
2013-07-26 21:18:53 -07:00
|
|
|
super(par1World);
|
2014-04-02 20:38:48 -04:00
|
|
|
this.isImmuneToFire = true;
|
|
|
|
|
this.lifespan = 72000;
|
|
|
|
|
}
|
2014-04-03 22:28:37 -04:00
|
|
|
|
2022-09-22 19:51:23 +01:00
|
|
|
public FancyEntityItem(World world, Entity original, ItemStack stack) {
|
2014-04-02 20:38:48 -04:00
|
|
|
this(world, original.posX, original.posY, original.posZ);
|
|
|
|
|
this.delayBeforeCanPickup = 20;
|
|
|
|
|
this.motionX = original.motionX;
|
|
|
|
|
this.motionY = original.motionY;
|
|
|
|
|
this.motionZ = original.motionZ;
|
|
|
|
|
this.setEntityItemStack(stack);
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-22 19:51:23 +01:00
|
|
|
public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) {
|
2023-01-25 23:11:58 +01:00
|
|
|
return par1DamageSource.getDamageType().equals("outOfWorld");
|
2013-07-26 21:18:53 -07:00
|
|
|
}
|
|
|
|
|
}
|