diff options
| author | boubou19 <miisterunknown@gmail.com> | 2024-07-02 20:48:44 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-02 20:48:44 +0200 |
| commit | 84a6dabdcc9936aaeece6d74952157996fc6bc58 (patch) | |
| tree | 846e5ff24ebbac4f5783f32497c69731f263e72e /src/main/java/gregtech | |
| parent | b2cbfcf522d9dd13ce89a38d8a5767a8a64cecd8 (diff) | |
| download | GT5-Unofficial-84a6dabdcc9936aaeece6d74952157996fc6bc58.tar.gz GT5-Unofficial-84a6dabdcc9936aaeece6d74952157996fc6bc58.tar.bz2 GT5-Unofficial-84a6dabdcc9936aaeece6d74952157996fc6bc58.zip | |
Removal of the GT Arrows (#2692)
* remove arrows
* remove arrow classes
* remove arrow usages in ItemList
* less bullshit
* sa
---------
Co-authored-by: Martin Robertz <dream-master@gmx.net>
Diffstat (limited to 'src/main/java/gregtech')
21 files changed, 14 insertions, 1653 deletions
diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index 8b55f0a73f..f515a21a45 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -46,7 +46,6 @@ import cpw.mods.fml.common.event.FMLServerAboutToStartEvent; import cpw.mods.fml.common.event.FMLServerStartedEvent; import cpw.mods.fml.common.event.FMLServerStartingEvent; import cpw.mods.fml.common.event.FMLServerStoppingEvent; -import cpw.mods.fml.common.registry.EntityRegistry; import gregtech.api.GregTech_API; import gregtech.api.enchants.Enchantment_EnderDamage; import gregtech.api.enchants.Enchantment_Hazmat; @@ -80,8 +79,6 @@ import gregtech.common.GT_Network; import gregtech.common.GT_Proxy; import gregtech.common.GT_RecipeAdder; import gregtech.common.covers.GT_Cover_FacadeAE; -import gregtech.common.entities.GT_Entity_Arrow; -import gregtech.common.entities.GT_Entity_Arrow_Potion; import gregtech.common.misc.GT_Command; import gregtech.common.misc.spaceprojects.commands.SPM_Command; import gregtech.common.misc.spaceprojects.commands.SP_Command; @@ -271,9 +268,6 @@ public class GT_Mod implements IGT_Mod { .getParentFile()); GT_PreLoad.adjustScrap(); - EntityRegistry.registerModEntity(GT_Entity_Arrow.class, "GT_Entity_Arrow", 1, GT_Values.GT, 160, 1, true); - EntityRegistry - .registerModEntity(GT_Entity_Arrow_Potion.class, "GT_Entity_Arrow_Potion", 2, GT_Values.GT, 160, 1, true); AEApi.instance() .registries() .interfaceTerminal() diff --git a/src/main/java/gregtech/api/enums/ItemList.java b/src/main/java/gregtech/api/enums/ItemList.java index ac810f8eaf..03446092fc 100644 --- a/src/main/java/gregtech/api/enums/ItemList.java +++ b/src/main/java/gregtech/api/enums/ItemList.java @@ -100,33 +100,6 @@ public enum ItemList implements IItemContainer { IC2_AdvBattery, IC2_EnergyCrystal, IC2_LapotronCrystal, - Arrow_Head_Glass_Emtpy, - Arrow_Head_Glass_Poison, - Arrow_Head_Glass_Poison_Long, - Arrow_Head_Glass_Poison_Strong, - Arrow_Head_Glass_Slowness, - Arrow_Head_Glass_Slowness_Long, - Arrow_Head_Glass_Weakness, - Arrow_Head_Glass_Weakness_Long, - Arrow_Head_Glass_Holy_Water, - Arrow_Wooden_Glass_Emtpy, - Arrow_Wooden_Glass_Poison, - Arrow_Wooden_Glass_Poison_Long, - Arrow_Wooden_Glass_Poison_Strong, - Arrow_Wooden_Glass_Slowness, - Arrow_Wooden_Glass_Slowness_Long, - Arrow_Wooden_Glass_Weakness, - Arrow_Wooden_Glass_Weakness_Long, - Arrow_Wooden_Glass_Holy_Water, - Arrow_Plastic_Glass_Emtpy, - Arrow_Plastic_Glass_Poison, - Arrow_Plastic_Glass_Poison_Long, - Arrow_Plastic_Glass_Poison_Strong, - Arrow_Plastic_Glass_Slowness, - Arrow_Plastic_Glass_Slowness_Long, - Arrow_Plastic_Glass_Weakness, - Arrow_Plastic_Glass_Weakness_Long, - Arrow_Plastic_Glass_Holy_Water, Shape_Empty, Shape_Mold_Bottle, diff --git a/src/main/java/gregtech/api/enums/OrePrefixes.java b/src/main/java/gregtech/api/enums/OrePrefixes.java index 6f7c347884..a703e8690a 100644 --- a/src/main/java/gregtech/api/enums/OrePrefixes.java +++ b/src/main/java/gregtech/api/enums/OrePrefixes.java @@ -261,16 +261,6 @@ public enum OrePrefixes { false, B[6] | B[8], M / 6, 64, -1), bulletGtLarge("Large Bullets", "Large ", " Bullet", true, true, false, false, true, false, true, false, true, false, B[6] | B[8], M / 3, 64, -1), - /** Arrow made of 1/4 Ingot/Dust + Wooden Stick. */ - arrowGtWood("Regular Arrows", "", " Arrow", true, true, false, false, true, false, true, false, true, false, B[6], - M / 4, 64, 57), - /** Arrow made of 1/4 Ingot/Dust + Plastic Stick. */ - arrowGtPlastic("Light Arrows", "Light ", " Arrow", true, true, false, false, true, false, true, false, true, false, - B[6], M / 4, 64, 58), - arrow("Arrows", "", "", false, false, true, false, false, false, false, false, true, false, B[6], -1, 64, 57), - /** consisting out of 1/4 Ingot. */ - toolHeadArrow("Arrow Heads", "", " Arrow Head", true, true, false, false, false, false, true, true, false, false, - B[6], M / 4, 64, 46), /** consisting out of 2 Ingots. */ toolHeadSword("Sword Blades", "", " Sword Blade", true, true, false, false, false, false, true, true, false, false, B[6], M * 2, 64, 32), @@ -780,11 +770,6 @@ public enum OrePrefixes { block.mNotGeneratedItems.add(Materials.Redstone); block.mNotGeneratedItems.add(Materials.Diamond); block.mNotGeneratedItems.add(Materials.Coal); - toolHeadArrow.mNotGeneratedItems.add(Materials.Glass); - toolHeadArrow.mNotGeneratedItems.add(MaterialsUEVplus.TranscendentMetal); - arrowGtPlastic.mNotGeneratedItems.add(MaterialsUEVplus.TranscendentMetal); - arrow.mNotGeneratedItems.add(MaterialsUEVplus.TranscendentMetal); - arrowGtWood.mNotGeneratedItems.add(MaterialsUEVplus.TranscendentMetal); stickLong.mNotGeneratedItems.add(Materials.Obsidian); dust.mNotGeneratedItems.add(Materials.CertusQuartzCharged); @@ -979,8 +964,6 @@ public enum OrePrefixes { toolHeadWrench.mSecondaryMaterial = new MaterialStack( Materials.Steel, ring.mMaterialAmount + screw.mMaterialAmount * 2); - arrowGtWood.mSecondaryMaterial = new MaterialStack(Materials.Wood, stick.mMaterialAmount); - arrowGtPlastic.mSecondaryMaterial = new MaterialStack(Materials.Plastic, stick.mMaterialAmount); bulletGtSmall.mSecondaryMaterial = new MaterialStack(Materials.Brass, ingot.mMaterialAmount / 9); bulletGtMedium.mSecondaryMaterial = new MaterialStack(Materials.Brass, ingot.mMaterialAmount / 6); bulletGtLarge.mSecondaryMaterial = new MaterialStack(Materials.Brass, ingot.mMaterialAmount / 3); @@ -1046,7 +1029,6 @@ public enum OrePrefixes { OrePrefixes.toolHeadUniversalSpade, OrePrefixes.toolHeadSense, OrePrefixes.toolHeadPlow, - OrePrefixes.toolHeadArrow, OrePrefixes.toolHeadBuzzSaw, OrePrefixes.turbineBlade, OrePrefixes.wireFine, @@ -1055,8 +1037,6 @@ public enum OrePrefixes { OrePrefixes.stickLong, OrePrefixes.springSmall, OrePrefixes.spring, - OrePrefixes.arrowGtWood, - OrePrefixes.arrowGtPlastic, OrePrefixes.gemChipped, OrePrefixes.gemFlawed, OrePrefixes.gemFlawless, diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index e09901b03b..72b74c3f97 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -4411,86 +4411,6 @@ public class GT_Utility { } } - /** - * THIS IS BULLSHIT!!! WHY DO I HAVE TO DO THIS SHIT JUST TO HAVE ENCHANTS PROPERLY!?! - */ - public static class GT_EnchantmentHelper { - - private static final BullshitIteratorA mBullshitIteratorA = new BullshitIteratorA(); - private static final BullshitIteratorB mBullshitIteratorB = new BullshitIteratorB(); - - private static void applyBullshit(IBullshit aBullshitModifier, ItemStack aStack) { - if (aStack != null) { - NBTTagList nbttaglist = aStack.getEnchantmentTagList(); - if (nbttaglist != null) { - try { - for (int i = 0; i < nbttaglist.tagCount(); ++i) { - short short1 = nbttaglist.getCompoundTagAt(i) - .getShort("id"); - short short2 = nbttaglist.getCompoundTagAt(i) - .getShort("lvl"); - if (Enchantment.enchantmentsList[short1] != null) - aBullshitModifier.calculateModifier(Enchantment.enchantmentsList[short1], short2); - } - } catch (Throwable e) { - /**/ - } - } - } - } - - private static void applyArrayOfBullshit(IBullshit aBullshitModifier, ItemStack[] aStacks) { - for (ItemStack itemstack : aStacks) { - applyBullshit(aBullshitModifier, itemstack); - } - } - - public static void applyBullshitA(EntityLivingBase aPlayer, Entity aEntity, ItemStack aStack) { - mBullshitIteratorA.mPlayer = aPlayer; - mBullshitIteratorA.mEntity = aEntity; - if (aPlayer != null) applyArrayOfBullshit(mBullshitIteratorA, aPlayer.getLastActiveItems()); - if (aStack != null) applyBullshit(mBullshitIteratorA, aStack); - } - - public static void applyBullshitB(EntityLivingBase aPlayer, Entity aEntity, ItemStack aStack) { - mBullshitIteratorB.mPlayer = aPlayer; - mBullshitIteratorB.mEntity = aEntity; - if (aPlayer != null) applyArrayOfBullshit(mBullshitIteratorB, aPlayer.getLastActiveItems()); - if (aStack != null) applyBullshit(mBullshitIteratorB, aStack); - } - - interface IBullshit { - - void calculateModifier(Enchantment aEnchantment, int aLevel); - } - - static final class BullshitIteratorA implements IBullshit { - - public EntityLivingBase mPlayer; - public Entity mEntity; - - BullshitIteratorA() {} - - @Override - public void calculateModifier(Enchantment aEnchantment, int aLevel) { - aEnchantment.func_151367_b(mPlayer, mEntity, aLevel); - } - } - - static final class BullshitIteratorB implements IBullshit { - - public EntityLivingBase mPlayer; - public Entity mEntity; - - BullshitIteratorB() {} - - @Override - public void calculateModifier(Enchantment aEnchantment, int aLevel) { - aEnchantment.func_151368_a(mPlayer, mEntity, aLevel); - } - } - } - public static String toSubscript(long no) { char[] chars = Long.toString(no) .toCharArray(); diff --git a/src/main/java/gregtech/common/GT_Client.java b/src/main/java/gregtech/common/GT_Client.java index 4cb063b3b5..d7bd2ad53f 100644 --- a/src/main/java/gregtech/common/GT_Client.java +++ b/src/main/java/gregtech/common/GT_Client.java @@ -88,8 +88,6 @@ import gregtech.api.util.GT_PlayedSound; import gregtech.api.util.GT_Utility; import gregtech.api.util.WorldSpawnedEventBuilder; import gregtech.common.blocks.GT_Item_Machines; -import gregtech.common.entities.GT_Entity_Arrow; -import gregtech.common.entities.GT_Entity_Arrow_Potion; import gregtech.common.render.GT_CapeRenderer; import gregtech.common.render.GT_FlaskRenderer; import gregtech.common.render.GT_FluidDisplayStackRenderer; @@ -98,7 +96,6 @@ import gregtech.common.render.GT_MultiTile_Renderer; import gregtech.common.render.GT_PollutionRenderer; import gregtech.common.render.GT_RenderDrone; import gregtech.common.render.GT_Renderer_Block; -import gregtech.common.render.GT_Renderer_Entity_Arrow; import gregtech.common.render.items.GT_MetaGenerated_Item_Renderer; import gregtech.common.tileentities.debug.GT_MetaTileEntity_AdvDebugStructureWriter; import gregtech.loaders.ExtraIcons; @@ -633,8 +630,6 @@ public class GT_Client extends GT_Proxy implements Runnable { metaGeneratedItemRenderer.registerItem(GT_Bees.combs); } new GT_MetaGenerated_Tool_Renderer(); - new GT_Renderer_Entity_Arrow(GT_Entity_Arrow.class, "arrow"); - new GT_Renderer_Entity_Arrow(GT_Entity_Arrow_Potion.class, "arrow_potions"); new GT_FlaskRenderer(); new GT_FluidDisplayStackRenderer(); MinecraftForge.EVENT_BUS.register(new NEI_GT_Config()); diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index bfd47d5c2c..4cd49429c3 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -67,7 +67,6 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.monster.EntityEnderman; -import net.minecraft.entity.monster.EntitySkeleton; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.init.Blocks; @@ -169,7 +168,6 @@ import gregtech.api.util.GT_Shaped_Recipe; import gregtech.api.util.GT_Shapeless_Recipe; import gregtech.api.util.GT_Utility; import gregtech.api.util.WorldSpawnedEventBuilder; -import gregtech.common.entities.GT_Entity_Arrow; import gregtech.common.items.GT_MetaGenerated_Item_98; import gregtech.common.items.GT_MetaGenerated_Tool_01; import gregtech.common.items.ID_MetaTool_01; @@ -1551,21 +1549,17 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { @SubscribeEvent public void onEntitySpawningEvent(EntityJoinWorldEvent aEvent) { - if ((aEvent.entity != null) && (!aEvent.entity.worldObj.isRemote)) { - if ((aEvent.entity instanceof EntityItem)) { - ((EntityItem) aEvent.entity).setEntityItemStack( - GT_OreDictUnificator.get(true, ((EntityItem) aEvent.entity).getEntityItem(), true)); - } - if ((this.mSkeletonsShootGTArrows > 0) && (aEvent.entity.getClass() == EntityArrow.class) - && (aEvent.entity.worldObj.rand.nextInt(this.mSkeletonsShootGTArrows) == 0) - && ((((EntityArrow) aEvent.entity).shootingEntity instanceof EntitySkeleton))) { - aEvent.entity.worldObj.spawnEntityInWorld( - new GT_Entity_Arrow( - (EntityArrow) aEvent.entity, - OrePrefixes.arrowGtWood.mPrefixedItems - .get(aEvent.entity.worldObj.rand.nextInt(OrePrefixes.arrowGtWood.mPrefixedItems.size())))); - aEvent.entity.setDead(); - } + if (aEvent.entity == null) { + return; + } + + if (aEvent.entity.worldObj.isRemote) { + return; + } + + if ((aEvent.entity instanceof EntityItem)) { + ((EntityItem) aEvent.entity) + .setEntityItemStack(GT_OreDictUnificator.get(true, ((EntityItem) aEvent.entity).getEntityItem(), true)); } } diff --git a/src/main/java/gregtech/common/entities/GT_Entity_Arrow.java b/src/main/java/gregtech/common/entities/GT_Entity_Arrow.java deleted file mode 100644 index 758888c720..0000000000 --- a/src/main/java/gregtech/common/entities/GT_Entity_Arrow.java +++ /dev/null @@ -1,438 +0,0 @@ -package gregtech.common.entities; - -import java.util.List; -import java.util.UUID; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.enchantment.Enchantment; -import net.minecraft.enchantment.EnchantmentHelper; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.monster.EntityCreeper; -import net.minecraft.entity.monster.EntityEnderman; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.play.server.S2BPacketChangeGameState; -import net.minecraft.potion.Potion; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import net.minecraft.world.WorldServer; -import net.minecraftforge.common.util.FakePlayerFactory; - -import com.mojang.authlib.GameProfile; - -import gregtech.api.enums.ParticleFX; -import gregtech.api.objects.ItemData; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Utility; -import gregtech.api.util.WorldSpawnedEventBuilder; - -public class GT_Entity_Arrow extends EntityArrow { - - private int mHitBlockX = -1; - private int mHitBlockY = -1; - private int mHitBlockZ = -1; - private Block mHitBlock = Blocks.air; - private int mHitBlockMeta = 0; - private boolean inGround = false; - private int mTicksAlive = 0; - private int ticksInAir = 0; - private int mKnockback = 0; - private ItemStack mArrow = null; - - public GT_Entity_Arrow(World aWorld) { - super(aWorld); - } - - public GT_Entity_Arrow(World aWorld, double aX, double aY, double aZ) { - super(aWorld, aX, aY, aZ); - } - - public GT_Entity_Arrow(World aWorld, EntityLivingBase aEntity, float aSpeed) { - super(aWorld, aEntity, aSpeed); - } - - public GT_Entity_Arrow(EntityArrow aArrow, ItemStack aStack) { - super(aArrow.worldObj); - NBTTagCompound tNBT = new NBTTagCompound(); - aArrow.writeToNBT(tNBT); - readFromNBT(tNBT); - setArrowItem(aStack); - } - - @Override - public void onUpdate() { - onEntityUpdate(); - if ((this.mArrow == null) && (!this.worldObj.isRemote)) { - setDead(); - return; - } - Entity tShootingEntity = this.shootingEntity; - if ((this.prevRotationPitch == 0.0F) && (this.prevRotationYaw == 0.0F)) { - float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); - this.prevRotationYaw = (this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D - / Math.PI)); - this.prevRotationPitch = (this.rotationPitch = (float) (Math.atan2(this.motionY, f) * 180.0D / Math.PI)); - } - if (this.mTicksAlive++ == 3000) { - setDead(); - } - Block tBlock = this.worldObj.getBlock(this.mHitBlockX, this.mHitBlockY, this.mHitBlockZ); - if (tBlock.getMaterial() != Material.air) { - tBlock.setBlockBoundsBasedOnState(this.worldObj, this.mHitBlockX, this.mHitBlockY, this.mHitBlockZ); - AxisAlignedBB axisalignedbb = tBlock - .getCollisionBoundingBoxFromPool(this.worldObj, this.mHitBlockX, this.mHitBlockY, this.mHitBlockZ); - if ((axisalignedbb != null) - && (axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ)))) { - this.inGround = true; - } - } - if (this.arrowShake > 0) { - this.arrowShake -= 1; - } - if (this.inGround) { - int j = this.worldObj.getBlockMetadata(this.mHitBlockX, this.mHitBlockY, this.mHitBlockZ); - if ((tBlock != this.mHitBlock) || (j != this.mHitBlockMeta)) { - this.inGround = false; - this.motionX *= this.rand.nextFloat() * 0.2F; - this.motionY *= this.rand.nextFloat() * 0.2F; - this.motionZ *= this.rand.nextFloat() * 0.2F; - this.mTicksAlive = 0; - this.ticksInAir = 0; - } - } else { - this.ticksInAir += 1; - Vec3 vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); - Vec3 vec3 = Vec3 - .createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); - MovingObjectPosition tVector = this.worldObj.func_147447_a(vec31, vec3, false, true, false); - vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); - vec3 = Vec3 - .createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); - if (tVector != null) { - vec3 = Vec3.createVectorHelper(tVector.hitVec.xCoord, tVector.hitVec.yCoord, tVector.hitVec.zCoord); - } - Entity tHitEntity = null; - List<Entity> tAllPotentiallyHitEntities = this.worldObj.getEntitiesWithinAABBExcludingEntity( - this, - this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ) - .expand(1.0D, 1.0D, 1.0D)); - double tLargestDistance = Double.MAX_VALUE; - for (Entity potentiallyHitEntity : tAllPotentiallyHitEntities) { - if ((potentiallyHitEntity.canBeCollidedWith()) - && ((potentiallyHitEntity != tShootingEntity) || (this.ticksInAir >= 5))) { - AxisAlignedBB axisalignedbb1 = potentiallyHitEntity.boundingBox.expand(0.3D, 0.3D, 0.3D); - MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec31, vec3); - if (movingobjectposition1 != null) { - double tDistance = vec31.distanceTo(movingobjectposition1.hitVec); - if (tDistance < tLargestDistance) { - tHitEntity = potentiallyHitEntity; - tLargestDistance = tDistance; - } - } - } - } - if (tHitEntity != null) { - tVector = new MovingObjectPosition(tHitEntity); - } - if ((tVector != null) && ((tVector.entityHit instanceof EntityPlayer entityplayer))) { - if ((entityplayer.capabilities.disableDamage) || (((tShootingEntity instanceof EntityPlayer)) - && (!((EntityPlayer) tShootingEntity).canAttackPlayer(entityplayer)))) { - tVector = null; - } - } - if (tVector != null) { - if (tVector.entityHit != null) { - ItemData tData = GT_OreDictUnificator.getItemData(this.mArrow); - - float tMagicDamage = (tVector.entityHit instanceof EntityLivingBase) - ? EnchantmentHelper - .func_152377_a(this.mArrow, ((EntityLivingBase) tVector.entityHit).getCreatureAttribute()) - : 0.0F; - float tDamage = MathHelper.ceiling_double_int( - MathHelper.sqrt_double( - this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ) - * (getDamage() - + ((tData != null) && (tData.mMaterial != null) && (tData.mMaterial.mMaterial != null) - ? tData.mMaterial.mMaterial.mToolQuality / 2.0F - 1.0F - : 0.0F))); - if (getIsCritical()) { - tDamage += this.rand.nextInt((int) (tDamage / 2.0D + 2.0D)); - } - int tFireDamage = (isBurning() ? 5 : 0) - + 4 * EnchantmentHelper.getEnchantmentLevel(Enchantment.fireAspect.effectId, this.mArrow); - int tKnockback = this.mKnockback - + EnchantmentHelper.getEnchantmentLevel(Enchantment.knockback.effectId, this.mArrow); - int tHitTimer = -1; - - int[] tDamages = onHitEntity( - tVector.entityHit, - tShootingEntity == null ? this : tShootingEntity, - this.mArrow == null ? new ItemStack(Items.arrow, 1) : this.mArrow, - (int) (tDamage * 2.0F), - (int) (tMagicDamage * 2.0F), - tKnockback, - tFireDamage, - tHitTimer); - if (tDamages != null) { - tDamage = tDamages[0] / 2.0F; - tMagicDamage = tDamages[1] / 2.0F; - tKnockback = tDamages[2]; - tFireDamage = tDamages[3]; - tHitTimer = tDamages[4]; - if ((tFireDamage > 0) && (!(tVector.entityHit instanceof EntityEnderman))) { - tVector.entityHit.setFire(tFireDamage); - } - if ((!(tHitEntity instanceof EntityPlayer)) - && (EnchantmentHelper.getEnchantmentLevel(Enchantment.looting.effectId, this.mArrow) > 0)) { - EntityPlayer tPlayer = null; - if ((this.worldObj instanceof WorldServer)) { - tPlayer = FakePlayerFactory.get( - (WorldServer) this.worldObj, - new GameProfile( - new UUID(0L, 0L), - (tShootingEntity instanceof EntityLivingBase) - ? tShootingEntity.getCommandSenderName() - : "Arrow")); - } - if (tPlayer != null) { - tPlayer.inventory.currentItem = 0; - tPlayer.inventory.setInventorySlotContents(0, getArrowItem()); - tShootingEntity = tPlayer; - tPlayer.setDead(); - } - } - DamageSource tDamageSource = DamageSource - .causeArrowDamage(this, tShootingEntity == null ? this : tShootingEntity); - if ((tDamage + tMagicDamage > 0.0F) - && (tVector.entityHit.attackEntityFrom(tDamageSource, tDamage + tMagicDamage))) { - if ((tVector.entityHit instanceof EntityLivingBase tHitLivingEntity)) { - if (tHitTimer >= 0) { - tVector.entityHit.hurtResistantTime = tHitTimer; - } - if (((tVector.entityHit instanceof EntityCreeper)) && (EnchantmentHelper - .getEnchantmentLevel(Enchantment.fireAspect.effectId, this.mArrow) > 0)) { - ((EntityCreeper) tVector.entityHit).func_146079_cb(); - } - if (!this.worldObj.isRemote) { - tHitLivingEntity - .setArrowCountInEntity(tHitLivingEntity.getArrowCountInEntity() + 1); - } - if (tKnockback > 0) { - float tKnockbackDivider = MathHelper - .sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); - if (tKnockbackDivider > 0.0F) { - tHitLivingEntity.addVelocity( - this.motionX * tKnockback * 0.6000000238418579D / tKnockbackDivider, - 0.1D, - this.motionZ * tKnockback * 0.6000000238418579D / tKnockbackDivider); - } - } - GT_Utility.GT_EnchantmentHelper.applyBullshitA( - tHitLivingEntity, - tShootingEntity == null ? this : tShootingEntity, - this.mArrow); - GT_Utility.GT_EnchantmentHelper.applyBullshitB( - (tShootingEntity instanceof EntityLivingBase) ? (EntityLivingBase) tShootingEntity - : null, - tHitLivingEntity, - this.mArrow); - if ((tHitLivingEntity != tShootingEntity) - && ((tHitLivingEntity instanceof EntityPlayer)) - && ((tShootingEntity instanceof EntityPlayerMP))) { - ((EntityPlayerMP) tShootingEntity).playerNetServerHandler - .sendPacket(new S2BPacketChangeGameState(6, 0.0F)); - } - } - if (((tShootingEntity instanceof EntityPlayer)) && (tMagicDamage > 0.0F)) { - ((EntityPlayer) tShootingEntity).onEnchantmentCritical(tVector.entityHit); - } - if ((!(tVector.entityHit instanceof EntityEnderman)) - || (((EntityEnderman) tVector.entityHit).getActivePotionEffect(Potion.weakness) - != null)) { - if (tFireDamage > 0) { - tVector.entityHit.setFire(tFireDamage); - } - playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); - setDead(); - } - } else { - this.motionX *= -0.1000000014901161D; - this.motionY *= -0.1000000014901161D; - this.motionZ *= -0.1000000014901161D; - this.rotationYaw += 180.0F; - this.prevRotationYaw += 180.0F; - this.ticksInAir = 0; - } - } - } else { - this.mHitBlockX = tVector.blockX; - this.mHitBlockY = tVector.blockY; - this.mHitBlockZ = tVector.blockZ; - this.mHitBlock = this.worldObj.getBlock(this.mHitBlockX, this.mHitBlockY, this.mHitBlockZ); - this.mHitBlockMeta = this.worldObj - .getBlockMetadata(this.mHitBlockX, this.mHitBlockY, this.mHitBlockZ); - this.motionX = ((float) (tVector.hitVec.xCoord - this.posX)); - this.motionY = ((float) (tVector.hitVec.yCoord - this.posY)); - this.motionZ = ((float) (tVector.hitVec.zCoord - this.posZ)); - float f2 = MathHelper.sqrt_double( - this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); - this.posX -= this.motionX / f2 * 0.0500000007450581D; - this.posY -= this.motionY / f2 * 0.0500000007450581D; - this.posZ -= this.motionZ / f2 * 0.0500000007450581D; - playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); - this.inGround = true; - this.arrowShake = 7; - setIsCritical(false); - if (this.mHitBlock.getMaterial() != Material.air) { - this.mHitBlock.onEntityCollidedWithBlock( - this.worldObj, - this.mHitBlockX, - this.mHitBlockY, - this.mHitBlockZ, - this); - } - if ((!this.worldObj.isRemote) - && (EnchantmentHelper.getEnchantmentLevel(Enchantment.fireAspect.effectId, this.mArrow) > 2)) { - GT_Utility - .setCoordsOnFire(this.worldObj, this.mHitBlockX, this.mHitBlockY, this.mHitBlockZ, true); - } - if (breaksOnImpact()) { - setDead(); - } - } - } - WorldSpawnedEventBuilder.ParticleEventBuilder events = new WorldSpawnedEventBuilder.ParticleEventBuilder() - .setWorld(this.worldObj); - - if (getIsCritical()) { - events.setIdenti |
