Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package top.mod.item;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.projectile.EntityThrowable;
- import net.minecraft.init.Blocks;
- import net.minecraft.init.Items;
- import net.minecraft.item.Item;
- import net.minecraft.util.DamageSource;
- import net.minecraft.util.EnumParticleTypes;
- import net.minecraft.util.datafix.DataFixer;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.util.math.RayTraceResult;
- import net.minecraft.world.World;
- public class EntityFirestaff extends EntityThrowable {
- public EntityFirestaff(World worldIn) {
- super(worldIn);
- }
- public EntityFirestaff(World worldIn, EntityLivingBase throwerIn) {
- super(worldIn, throwerIn);
- }
- public EntityFirestaff(World worldIn, double x, double y, double z) {
- super(worldIn, x, y, z);
- }
- public static void func_189662_a(DataFixer p_189662_0_) {
- EntityThrowable.func_189661_a(p_189662_0_, "knife");
- }
- @Override
- protected void onImpact(RayTraceResult result) {
- if (result.entityHit != null) {
- result.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 41.0F);
- }
- if (!this.worldObj.isRemote && this.rand.nextInt(4) == 0) {
- int i = 1;
- if (this.rand.nextInt(32) == 0) {
- i = 4;
- }
- double d0 = 0.08D;
- for (int k = 0; k < 8; ++k) {
- this.worldObj.spawnParticle(EnumParticleTypes.ITEM_CRACK, this.posX, this.posY, this.posZ,
- ((double) this.rand.nextFloat() - 0.5D) * 0.08D,
- ((double) this.rand.nextFloat() - 0.5D) * 0.08D,
- ((double) this.rand.nextFloat() - 0.5D) * 0.08D, new int[] { Item.getIdFromItem(Items.EGG) });
- {
- {
- super.onUpdate();
- int i1 = MathHelper.floor_double(this.getEntityBoundingBox().minX + 0.001D);
- int j = MathHelper.floor_double(this.getEntityBoundingBox().minY + 0.001D);
- int k1 = MathHelper.floor_double(this.getEntityBoundingBox().minZ + 0.001D);
- World world = this.worldObj;
- Entity entity = (Entity) this;
- if (true) {
- world.setBlockState(new BlockPos(i, j, k), Blocks.FLOWING_LAVA.getDefaultState(), 3);
- }
- this.kill();
- }
- if (!this.worldObj.isRemote) {
- this.setDead();
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement