From 55f64675b42ac8d3c557cc850f78664bee006f6f Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Sat, 28 Jan 2023 19:32:44 -0800 Subject: [ci skip] spotlessApply with the new settings --- .../core/entity/EntityPrimedMiningExplosive.java | 26 ++-- .../gtPlusPlus/core/entity/EntityTeleportFX.java | 25 ++-- .../core/entity/EntityTeslaTowerLightning.java | 25 ++-- .../core/entity/InternalEntityRegistry.java | 84 ++++++++++--- .../entity/ai/batking/EntityAIBatKingAttack.java | 111 ++++++++--------- .../core/entity/item/ItemEntityGiantEgg.java | 26 ++-- .../core/entity/monster/EntityBatKing.java | 135 ++++++++++++--------- .../entity/monster/EntityGiantChickenBase.java | 19 ++- .../core/entity/monster/EntitySickBlaze.java | 40 +++--- .../entity/monster/EntityStaballoyConstruct.java | 39 +++--- .../projectile/EntityHydrofluoricAcidPotion.java | 23 ++-- .../entity/projectile/EntityLightningAttack.java | 19 ++- .../projectile/EntitySulfuricAcidPotion.java | 23 ++-- .../entity/projectile/EntityThrowableBomb.java | 29 ++--- .../core/entity/projectile/EntityToxinball.java | 42 +++---- .../entity/projectile/EntityToxinballSmall.java | 18 +-- 16 files changed, 374 insertions(+), 310 deletions(-) (limited to 'src/main/java/gtPlusPlus/core/entity') diff --git a/src/main/java/gtPlusPlus/core/entity/EntityPrimedMiningExplosive.java b/src/main/java/gtPlusPlus/core/entity/EntityPrimedMiningExplosive.java index 63d94fafee..ec189bf6ae 100644 --- a/src/main/java/gtPlusPlus/core/entity/EntityPrimedMiningExplosive.java +++ b/src/main/java/gtPlusPlus/core/entity/EntityPrimedMiningExplosive.java @@ -1,13 +1,15 @@ package gtPlusPlus.core.entity; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.world.explosions.ExplosionHandler; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityTNTPrimed; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; +import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.core.world.explosions.ExplosionHandler; + public class EntityPrimedMiningExplosive extends EntityTNTPrimed { + /** How long the fuse is */ private EntityLivingBase tntPlacedBy; @@ -19,8 +21,8 @@ public class EntityPrimedMiningExplosive extends EntityTNTPrimed { this.yOffset = this.height / 2.0F; } - public EntityPrimedMiningExplosive( - final World world, final double x, final double y, final double z, final EntityLivingBase placingEntity) { + public EntityPrimedMiningExplosive(final World world, final double x, final double y, final double z, + final EntityLivingBase placingEntity) { this(world); this.setPosition(x, y, z); final float f = (float) (Math.random() * Math.PI * 2.0D); @@ -364,11 +366,17 @@ public class EntityPrimedMiningExplosive extends EntityTNTPrimed { ExplosionHandler explode = new ExplosionHandler(); explode.createExplosion(this.worldObj, this, this.posX, this.posY, this.posZ, f, false, true); - /*this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, f, true); - this.worldObj.createExplosion(this, this.posX+MathUtils.randDouble(-10, 10), this.posY, this.posZ+MathUtils.randDouble(-10, 10), f+MathUtils.randFloat(-5F, 5F), true); - this.worldObj.createExplosion(this, this.posX+MathUtils.randDouble(-10, 10), this.posY, this.posZ+MathUtils.randDouble(-10, 10), f+MathUtils.randFloat(-5F, 5F), true); - this.worldObj.createExplosion(this, this.posX+MathUtils.randDouble(-10, 10), this.posY, this.posZ+MathUtils.randDouble(-10, 10), f+MathUtils.randFloat(-5F, 5F), true); - this.worldObj.createExplosion(this, this.posX+MathUtils.randDouble(-10, 10), this.posY, this.posZ+MathUtils.randDouble(-10, 10), f+MathUtils.randFloat(-5F, 5F), true);*/ + /* + * this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, f, true); + * this.worldObj.createExplosion(this, this.posX+MathUtils.randDouble(-10, 10), this.posY, + * this.posZ+MathUtils.randDouble(-10, 10), f+MathUtils.randFloat(-5F, 5F), true); + * this.worldObj.createExplosion(this, this.posX+MathUtils.randDouble(-10, 10), this.posY, + * this.posZ+MathUtils.randDouble(-10, 10), f+MathUtils.randFloat(-5F, 5F), true); + * this.worldObj.createExplosion(this, this.posX+MathUtils.randDouble(-10, 10), this.posY, + * this.posZ+MathUtils.randDouble(-10, 10), f+MathUtils.randFloat(-5F, 5F), true); + * this.worldObj.createExplosion(this, this.posX+MathUtils.randDouble(-10, 10), this.posY, + * this.posZ+MathUtils.randDouble(-10, 10), f+MathUtils.randFloat(-5F, 5F), true); + */ } /** diff --git a/src/main/java/gtPlusPlus/core/entity/EntityTeleportFX.java b/src/main/java/gtPlusPlus/core/entity/EntityTeleportFX.java index ca4229bec3..d010624b8c 100644 --- a/src/main/java/gtPlusPlus/core/entity/EntityTeleportFX.java +++ b/src/main/java/gtPlusPlus/core/entity/EntityTeleportFX.java @@ -1,7 +1,5 @@ package gtPlusPlus.core.entity; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.init.Items; @@ -10,7 +8,11 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.MathHelper; import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class EntityTeleportFX extends Entity { + /** 'x' location the eye should float towards. */ private double targetX; /** 'y' location the eye should float towards. */ @@ -20,7 +22,6 @@ public class EntityTeleportFX extends Entity { private int despawnTimer; private boolean shatterOrDrop; - private static final String __OBFID = "CL_00001716"; public EntityTeleportFX(final World p_i1757_1_) { super(p_i1757_1_); @@ -42,8 +43,8 @@ public class EntityTeleportFX extends Entity { return p_70112_1_ < (d1 * d1); } - public EntityTeleportFX( - final World p_i1758_1_, final double p_i1758_2_, final double p_i1758_4_, final double p_i1758_6_) { + public EntityTeleportFX(final World p_i1758_1_, final double p_i1758_2_, final double p_i1758_4_, + final double p_i1758_6_) { super(p_i1758_1_); this.despawnTimer = 0; this.setSize(0.25F, 0.25F); @@ -106,9 +107,8 @@ public class EntityTeleportFX extends Entity { final float f = MathHelper.sqrt_double((this.motionX * this.motionX) + (this.motionZ * this.motionZ)); this.rotationYaw = (float) ((Math.atan2(this.motionX, this.motionZ) * 180.0D) / Math.PI); - for (this.rotationPitch = (float) ((Math.atan2(this.motionY, f) * 180.0D) / Math.PI); - (this.rotationPitch - this.prevRotationPitch) < -180.0F; - this.prevRotationPitch -= 360.0F) { + for (this.rotationPitch = (float) ((Math.atan2(this.motionY, f) * 180.0D) / Math.PI); (this.rotationPitch + - this.prevRotationPitch) < -180.0F; this.prevRotationPitch -= 360.0F) { ; } @@ -181,8 +181,13 @@ public class EntityTeleportFX extends Entity { this.setDead(); if (this.shatterOrDrop) { - this.worldObj.spawnEntityInWorld(new EntityItem( - this.worldObj, this.posX, this.posY, this.posZ, new ItemStack(Items.ender_eye))); + this.worldObj.spawnEntityInWorld( + new EntityItem( + this.worldObj, + this.posX, + this.posY, + this.posZ, + new ItemStack(Items.ender_eye))); } else { this.worldObj.playAuxSFX( 2003, diff --git a/src/main/java/gtPlusPlus/core/entity/EntityTeslaTowerLightning.java b/src/main/java/gtPlusPlus/core/entity/EntityTeslaTowerLightning.java index 7d471bff4a..15563ef508 100644 --- a/src/main/java/gtPlusPlus/core/entity/EntityTeslaTowerLightning.java +++ b/src/main/java/gtPlusPlus/core/entity/EntityTeslaTowerLightning.java @@ -1,12 +1,9 @@ package gtPlusPlus.core.entity; -import gtPlusPlus.api.damage.DamageTeslaTower; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.random.XSTR; -import gtPlusPlus.core.util.minecraft.EntityUtils; import java.util.List; import java.util.Random; import java.util.UUID; + import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; import net.minecraft.entity.effect.EntityWeatherEffect; @@ -17,12 +14,20 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.EnumDifficulty; import net.minecraft.world.World; +import gtPlusPlus.api.damage.DamageTeslaTower; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.random.XSTR; +import gtPlusPlus.core.util.minecraft.EntityUtils; + public class EntityTeslaTowerLightning extends EntityWeatherEffect { + /** Declares which state the lightning bolt is in. Whether it's in the air, hit the ground, etc. */ private int lightningState; /** A random long that is used to change the vertex of the lightning rendered in RenderLightningBolt */ public long boltVertex; - /** Determines the time before the EntityLightningBolt is destroyed. It is a random integer decremented over time. */ + /** + * Determines the time before the EntityLightningBolt is destroyed. It is a random integer decremented over time. + */ private int boltLivingTime; private final UUID boltID; @@ -30,8 +35,8 @@ public class EntityTeslaTowerLightning extends EntityWeatherEffect { private final Entity boltValidDamageTarget; - public EntityTeslaTowerLightning( - World p_i1703_1_, double p_i1703_2_, double p_i1703_4_, double p_i1703_6_, Entity valid, UUID owner) { + public EntityTeslaTowerLightning(World p_i1703_1_, double p_i1703_2_, double p_i1703_4_, double p_i1703_6_, + Entity valid, UUID owner) { super(p_i1703_1_); Logger.INFO("Plasma Bolt - Created."); Random rand = new XSTR(p_i1703_1_.getSeed()); @@ -44,8 +49,7 @@ public class EntityTeslaTowerLightning extends EntityWeatherEffect { this.boltOwnerID = owner; // Puts fires out - if (!p_i1703_1_.isRemote - && p_i1703_1_.getGameRules().getGameRuleBooleanValue("doFireTick") + if (!p_i1703_1_.isRemote && p_i1703_1_.getGameRules().getGameRuleBooleanValue("doFireTick") && (p_i1703_1_.difficultySetting == EnumDifficulty.NORMAL || p_i1703_1_.difficultySetting == EnumDifficulty.HARD) && p_i1703_1_.doChunksNearChunkExist( @@ -139,8 +143,7 @@ public class EntityTeslaTowerLightning extends EntityWeatherEffect { this.lightningState = 1; this.boltVertex = rand.nextLong(); // Puts fires out. - if (!this.worldObj.isRemote - && this.worldObj.getGameRules().getGameRuleBooleanValue("doFireTick") + if (!this.worldObj.isRemote && this.worldObj.getGameRules().getGameRuleBooleanValue("doFireTick") && this.worldObj.doChunksNearChunkExist( MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), diff --git a/src/main/java/gtPlusPlus/core/entity/InternalEntityRegistry.java b/src/main/java/gtPlusPlus/core/entity/InternalEntityRegistry.java index 39ee41f45a..e4f82ea80e 100644 --- a/src/main/java/gtPlusPlus/core/entity/InternalEntityRegistry.java +++ b/src/main/java/gtPlusPlus/core/entity/InternalEntityRegistry.java @@ -25,7 +25,13 @@ public class InternalEntityRegistry { // EntityRegistry.registerGlobalEntityID(EntityPrimedMiningExplosive.class, "MiningCharge", // EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(0, 0, 0), Utils.rgbtoHexValue(125, 125, 125)); EntityRegistry.registerModEntity( - EntityPrimedMiningExplosive.class, "MiningCharge", mEntityID++, GTplusplus.instance, 64, 20, true); + EntityPrimedMiningExplosive.class, + "MiningCharge", + mEntityID++, + GTplusplus.instance, + 64, + 20, + true); // EntityRegistry.registerGlobalEntityID(EntitySulfuricAcidPotion.class, "throwablePotionSulfuric", // EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(200, 0, 200), Utils.rgbtoHexValue(125, 125, @@ -53,44 +59,92 @@ public class InternalEntityRegistry { // EntityRegistry.registerGlobalEntityID(EntityToxinballSmall.class, "toxinBall", // EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(0, 25, 0), Utils.rgbtoHexValue(0, 125, 0)); EntityRegistry.registerModEntity( - EntityToxinballSmall.class, "toxinBall", mEntityID++, GTplusplus.instance, 64, 20, true); + EntityToxinballSmall.class, + "toxinBall", + mEntityID++, + GTplusplus.instance, + 64, + 20, + true); // EntityRegistry.registerGlobalEntityID(EntityStaballoyConstruct.class, "constructStaballoy", // EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(0, 75, 0), Utils.rgbtoHexValue(50, 220, 50)); EntityRegistry.registerModEntity( - EntityStaballoyConstruct.class, "constructStaballoy", mEntityID++, GTplusplus.instance, 64, 20, true); + EntityStaballoyConstruct.class, + "constructStaballoy", + mEntityID++, + GTplusplus.instance, + 64, + 20, + true); ItemCustomSpawnEgg.registerEntityForSpawnEgg( - 0, "constructStaballoy", Utils.rgbtoHexValue(20, 200, 20), Utils.rgbtoHexValue(20, 20, 20)); + 0, + "constructStaballoy", + Utils.rgbtoHexValue(20, 200, 20), + Utils.rgbtoHexValue(20, 20, 20)); // EntityRegistry.registerGlobalEntityID(EntitySickBlaze.class, "sickBlaze", // EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(0, 75, 0), Utils.rgbtoHexValue(75, 175, 75)); - EntityRegistry.registerModEntity( - EntitySickBlaze.class, "sickBlaze", mEntityID++, GTplusplus.instance, 64, 20, true); + EntityRegistry + .registerModEntity(EntitySickBlaze.class, "sickBlaze", mEntityID++, GTplusplus.instance, 64, 20, true); ItemCustomSpawnEgg.registerEntityForSpawnEgg( - 1, "sickBlaze", Utils.rgbtoHexValue(40, 180, 40), Utils.rgbtoHexValue(75, 75, 75)); + 1, + "sickBlaze", + Utils.rgbtoHexValue(40, 180, 40), + Utils.rgbtoHexValue(75, 75, 75)); // EntityRegistry.registerGlobalEntityID(EntityTeslaTowerLightning.class, "plasmaBolt", // EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(255, 0, 0), Utils.rgbtoHexValue(125, 125, // 125)); EntityRegistry.registerModEntity( - EntityTeslaTowerLightning.class, "plasmaBolt", mEntityID++, GTplusplus.instance, 64, 5, true); + EntityTeslaTowerLightning.class, + "plasmaBolt", + mEntityID++, + GTplusplus.instance, + 64, + 5, + true); EntityRegistry.registerModEntity( - EntityThrowableBomb.class, "EntityThrowableBomb", mEntityID++, GTplusplus.instance, 64, 10, true); + EntityThrowableBomb.class, + "EntityThrowableBomb", + mEntityID++, + GTplusplus.instance, + 64, + 10, + true); EntityRegistry.registerModEntity( - EntityLightningAttack.class, "EntityLightningAttack", mEntityID++, GTplusplus.instance, 64, 20, true); + EntityLightningAttack.class, + "EntityLightningAttack", + mEntityID++, + GTplusplus.instance, + 64, + 20, + true); /** * Globals, which generate spawn eggs. (Currently required for Giant chicken spawning) */ EntityRegistry.registerModEntity( - EntityGiantChickenBase.class, "bigChickenFriendly", mEntityID++, GTplusplus.instance, 64, 20, true); + EntityGiantChickenBase.class, + "bigChickenFriendly", + mEntityID++, + GTplusplus.instance, + 64, + 20, + true); ItemCustomSpawnEgg.registerEntityForSpawnEgg( - 2, "bigChickenFriendly", Utils.rgbtoHexValue(255, 0, 0), Utils.rgbtoHexValue(175, 175, 175)); - EntityRegistry.registerModEntity( - EntityBatKing.class, "batKing", mEntityID++, GTplusplus.instance, 64, 20, true); + 2, + "bigChickenFriendly", + Utils.rgbtoHexValue(255, 0, 0), + Utils.rgbtoHexValue(175, 175, 175)); + EntityRegistry + .registerModEntity(EntityBatKing.class, "batKing", mEntityID++, GTplusplus.instance, 64, 20, true); ItemCustomSpawnEgg.registerEntityForSpawnEgg( - 3, "batKing", Utils.rgbtoHexValue(175, 175, 0), Utils.rgbtoHexValue(0, 175, 175)); + 3, + "batKing", + Utils.rgbtoHexValue(175, 175, 0), + Utils.rgbtoHexValue(0, 175, 175)); } } diff --git a/src/main/java/gtPlusPlus/core/entity/ai/batking/EntityAIBatKingAttack.java b/src/main/java/gtPlusPlus/core/entity/ai/batking/EntityAIBatKingAttack.java index 810c3eadff..1cfb2154b1 100644 --- a/src/main/java/gtPlusPlus/core/entity/ai/batking/EntityAIBatKingAttack.java +++ b/src/main/java/gtPlusPlus/core/entity/ai/batking/EntityAIBatKingAttack.java @@ -1,9 +1,5 @@ package gtPlusPlus.core.entity.ai.batking; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.entity.monster.EntityBatKing; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.EntityUtils; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IRangedAttackMob; import net.minecraft.entity.ai.EntityAIBase; @@ -11,31 +7,30 @@ import net.minecraft.pathfinding.PathEntity; import net.minecraft.pathfinding.PathPoint; import net.minecraft.util.MathHelper; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.entity.monster.EntityBatKing; +import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.core.util.minecraft.EntityUtils; + public class EntityAIBatKingAttack extends EntityAIBase { private final Ranged mRangedAI; private final Melee mMeleeAI; private boolean mIsMelee = false; - /** The Bat King in control of this AI. */ + /** The Bat King in control of this AI. */ private final EntityBatKing mAttackingEntity; /** The PathEntity of our entity. */ private PathEntity mEntityPathEntity; - /** The current target of Bat King in control of this AI. */ + /** The current target of Bat King in control of this AI. */ private EntityLivingBase mEntityTarget; private final Class mClassTarget; - public EntityAIBatKingAttack( - EntityBatKing aAttacker, - Class aClassTarget, - double aMovementSpeed, - int someInt, - int aMaxRangedAttackTime, - float someFloat, - boolean aLongMemory) { + public EntityAIBatKingAttack(EntityBatKing aAttacker, Class aClassTarget, double aMovementSpeed, int someInt, + int aMaxRangedAttackTime, float someFloat, boolean aLongMemory) { mRangedAI = new Ranged(this, aMovementSpeed, someInt, 5, someFloat); mMeleeAI = new Melee(this, aClassTarget, aMovementSpeed, aLongMemory); mAttackingEntity = aAttacker; @@ -138,8 +133,10 @@ public class EntityAIBatKingAttack extends EntityAIBase { this.mIsMelee = false; } if (aisMeleeNow != this.mIsMelee) { - Logger.INFO("Bat King changed combat style from " + (aisMeleeNow ? "Melee" : "Ranged") + " to " - + (this.mIsMelee ? "Melee" : "Ranged")); + Logger.INFO( + "Bat King changed combat style from " + (aisMeleeNow ? "Melee" : "Ranged") + + " to " + + (this.mIsMelee ? "Melee" : "Ranged")); } } @@ -148,8 +145,8 @@ public class EntityAIBatKingAttack extends EntityAIBase { private final EntityAIBatKingAttack parentAI; /** - * A decrementing tick that spawns a ranged attack once this value reaches 0. It - * is then set back to the maxRangedAttackTime. + * A decrementing tick that spawns a ranged attack once this value reaches 0. It is then set back to the + * maxRangedAttackTime. */ private int rangedAttackTime; @@ -164,11 +161,7 @@ public class EntityAIBatKingAttack extends EntityAIBase { private float field_96562_i; private float field_82642_h; // Max range - public Ranged( - EntityAIBatKingAttack aParent, - double aMovementSpeed, - int someInt, - int aMaxRangedAttackTime, + public Ranged(EntityAIBatKingAttack aParent, double aMovementSpeed, int someInt, int aMaxRangedAttackTime, float someFloat) { this.rangedAttackTime = -1; this.parentAI = aParent; @@ -191,8 +184,7 @@ public class EntityAIBatKingAttack extends EntityAIBase { * Returns whether an in-progress EntityAIBase should continue executing */ public boolean continueExecuting() { - return parentAI.shouldExecute() - || !parentAI.getBatKing().getNavigator().noPath(); + return parentAI.shouldExecute() || !parentAI.getBatKing().getNavigator().noPath(); } /** @@ -213,11 +205,10 @@ public class EntityAIBatKingAttack extends EntityAIBase { maxRangedAttackTime = MathUtils.balance(maxRangedAttackTime, 20, 40); } - double d0 = parentAI.getBatKing() - .getDistanceSq( - parentAI.mEntityTarget.posX, - parentAI.mEntityTarget.boundingBox.minY, - parentAI.mEntityTarget.posZ); + double d0 = parentAI.getBatKing().getDistanceSq( + parentAI.mEntityTarget.posX, + parentAI.mEntityTarget.boundingBox.minY, + parentAI.mEntityTarget.posZ); boolean flag = parentAI.getBatKing().getEntitySenses().canSee(parentAI.mEntityTarget); if (flag) { @@ -229,8 +220,7 @@ public class EntityAIBatKingAttack extends EntityAIBase { if (d0 <= (double) this.field_82642_h && this.mCooldownTime >= 20) { parentAI.getBatKing().getNavigator().clearPathEntity(); } else { - if (parentAI.getBatKing() - .getNavigator() + if (parentAI.getBatKing().getNavigator() .tryMoveToEntityLiving(parentAI.mEntityTarget, this.entityMoveSpeed)) { Logger.INFO("Doing Ranged Ai Task."); } else { @@ -244,8 +234,14 @@ public class EntityAIBatKingAttack extends EntityAIBase { if (--this.rangedAttackTime == 0) { if (d0 > (double) this.field_82642_h || !flag) { - Logger.INFO("Stopping ranged attack. " + flag + "|" + (d0 > (double) this.field_82642_h) + "|" + d0 - + "|" + (double) this.field_82642_h); + Logger.INFO( + "Stopping ranged attack. " + flag + + "|" + + (d0 > (double) this.field_82642_h) + + "|" + + d0 + + "|" + + (double) this.field_82642_h); return; } @@ -276,15 +272,13 @@ public class EntityAIBatKingAttack extends EntityAIBase { private final EntityAIBatKingAttack parentAI; /** - * An amount of decrementing ticks that allows the entity to attack once the - * tick reaches 0. + * An amount of decrementing ticks that allows the entity to attack once the tick reaches 0. */ int attackTick; /** The speed with which the mob will approach the target */ double speedTowardsTarget; /** - * When true, the mob will continue chasing its target, even if it can't find a - * path to them right now. + * When true, the mob will continue chasing its target, even if it can't find a path to them right now. */ boolean longMemory; @@ -296,8 +290,8 @@ public class EntityAIBatKingAttack extends EntityAIBase { private int failedPathFindingPenalty; - public Melee( - EntityAIBatKingAttack aParent, Class aClassTarget, double aMoveToTargetSpeed, boolean aLongMemory) { + public Melee(EntityAIBatKingAttack aParent, Class aClassTarget, double aMoveToTargetSpeed, + boolean aLongMemory) { this.parentAI = aParent; this.classTarget = aClassTarget; this.speedTowardsTarget = aMoveToTargetSpeed; @@ -322,8 +316,8 @@ public class EntityAIBatKingAttack extends EntityAIBase { return false; } else { if (--this.field_75445_i <= 0) { - parentAI.mEntityPathEntity = - parentAI.mAttackingEntity.getNavigator().getPathToEntityLiving(entitylivingbase); + parentAI.mEntityPathEntity = parentAI.mAttackingEntity.getNavigator() + .getPathToEntityLiving(entitylivingbase); this.field_75445_i = 4 + parentAI.mAttackingEntity.getRNG().nextInt(7); return parentAI.mEntityPathEntity != null; } else { @@ -337,12 +331,9 @@ public class EntityAIBatKingAttack extends EntityAIBase { */ public boolean continueExecuting() { EntityLivingBase entitylivingbase = parentAI.mAttackingEntity.getAttackTarget(); - return entitylivingbase == null - ? false - : (!entitylivingbase.isEntityAlive() - ? false - : (!this.longMemory - ? !parentAI.mAttackingEntity.getNavigator().noPath() + return entitylivingbase == null ? false + : (!entitylivingbase.isEntityAlive() ? false + : (!this.longMemory ? !parentAI.mAttackingEntity.getNavigator().noPath() : parentAI.mAttackingEntity.isWithinHomeDistance( MathHelper.floor_double(entitylivingbase.posX), MathHelper.floor_double(entitylivingbase.posY), @@ -370,8 +361,8 @@ public class EntityAIBatKingAttack extends EntityAIBase { public void updateTask() { EntityLivingBase entitylivingbase = parentAI.mAttackingEntity.getAttackTarget(); parentAI.mAttackingEntity.getLookHelper().setLookPositionWithEntity(entitylivingbase, 30.0F, 30.0F); - double d0 = parentAI.mAttackingEntity.getDistanceSq( - entitylivingbase.posX, entitylivingbase.boundingBox.minY, entitylivingbase.posZ); + double d0 = parentAI.mAttackingEntity + .getDistanceSq(entitylivingbase.posX, entitylivingbase.boundingBox.minY, entitylivingbase.posZ); double d1 = (double) (parentAI.mAttackingEntity.width * 2.0F * parentAI.mAttackingEntity.width * 2.0F + entitylivingbase.width); --this.field_75445_i; @@ -379,24 +370,19 @@ public class EntityAIBatKingAttack extends EntityAIBase { if ((this.longMemory || parentAI.mAttackingEntity.getEntitySenses().canSee(entitylivingbase)) && this.field_75445_i <= 0 && (this.field_151497_i == 0.0D && this.field_151495_j == 0.0D && this.field_151496_k == 0.0D - || entitylivingbase.getDistanceSq( - this.field_151497_i, this.field_151495_j, this.field_151496_k) + || entitylivingbase + .getDistanceSq(this.field_151497_i, this.field_151495_j, this.field_151496_k) >= 1.0D || parentAI.mAttackingEntity.getRNG().nextFloat() < 0.05F)) { this.field_151497_i = entitylivingbase.posX; this.field_151495_j = entitylivingbase.boundingBox.minY; this.field_151496_k = entitylivingbase.posZ; - this.field_75445_i = failedPathFindingPenalty - + 4 - + parentAI.mAttackingEntity.getRNG().nextInt(7); + this.field_75445_i = failedPathFindingPenalty + 4 + parentAI.mAttackingEntity.getRNG().nextInt(7); if (parentAI.mAttackingEntity.getNavigator().getPath() != null) { - PathPoint finalPathPoint = - parentAI.mAttackingEntity.getNavigator().getPath().getFinalPathPoint(); - if (finalPathPoint != null - && entitylivingbase.getDistanceSq( - finalPathPoint.xCoord, finalPathPoint.yCoord, finalPathPoint.zCoord) - < 1) { + PathPoint finalPathPoint = parentAI.mAttackingEntity.getNavigator().getPath().getFinalPathPoint(); + if (finalPathPoint != null && entitylivingbase + .getDistanceSq(finalPathPoint.xCoord, finalPathPoint.yCoord, finalPathPoint.zCoord) < 1) { failedPathFindingPenalty = 0; } else { failedPathFindingPenalty += 10; @@ -411,8 +397,7 @@ public class EntityAIBatKingAttack extends EntityAIBase { this.field_75445_i += 5; } - if (!parentAI.mAttackingEntity - .getNavigator() + if (!parentAI.mAttackingEntity.getNavigator() .tryMoveToEntityLiving(entitylivingbase, this.speedTowardsTarget)) { this.field_75445_i += 15; } diff --git a/src/main/java/gtPlusPlus/core/entity/item/ItemEntityGiantEgg.java b/src/main/java/gtPlusPlus/core/entity/item/ItemEntityGiantEgg.java index 95693d24c9..d100d3571b 100644 --- a/src/main/java/gtPlusPlus/core/entity/item/ItemEntityGiantEgg.java +++ b/src/main/java/gtPlusPlus/core/entity/item/ItemEntityGiantEgg.java @@ -1,20 +1,21 @@ package gtPlusPlus.core.entity.item; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.entity.monster.EntityGiantChickenBase; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.NBTUtils; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; public class ItemEntityGiantEgg extends EntityItem { /** - * The maximum age of this Chicken Egg. The item will try hatch once this is reached. + * The maximum age of this Chicken Egg. The item will try hatch once this is reached. */ public int mEggAge = 10000; @@ -98,14 +99,13 @@ public class ItemEntityGiantEgg extends EntityItem { if (this.age >= 1000) { // Cache the value for efficiency - if (mEggSize == -1) - mEggSize = (this.getEntityItem() != null - ? (this.getEntityItem().hasTagCompound() - ? (this.getEntityItem().getTagCompound().hasKey("size") - ? this.getEntityItem().getTagCompound().getInteger("size") - : 1) - : 1) - : 1); + if (mEggSize == -1) mEggSize = (this.getEntityItem() != null + ? (this.getEntityItem().hasTagCompound() + ? (this.getEntityItem().getTagCompound().hasKey("size") + ? this.getEntityItem().getTagCompound().getInteger("size") + : 1) + : 1) + : 1); if (MathUtils.randInt(100 * mEggSize, 1000) >= MathUtils.randInt(950, 1000)) { // Spawn Chicken if (spawnGiantChicken()) { diff --git a/src/main/java/gtPlusPlus/core/entity/monster/EntityBatKing.java b/src/main/java/gtPlusPlus/core/entity/monster/EntityBatKing.java index 0a35d550a4..049d47cc21 100644 --- a/src/main/java/gtPlusPlus/core/entity/monster/EntityBatKing.java +++ b/src/main/java/gtPlusPlus/core/entity/monster/EntityBatKing.java @@ -1,13 +1,7 @@ package gtPlusPlus.core.entity.monster; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.minecraft.BlockPos; -import gtPlusPlus.core.entity.ai.batking.EntityAIBatKingAttack; -import gtPlusPlus.core.entity.projectile.EntityThrowableBomb; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.EntityUtils; -import gtPlusPlus.core.util.reflect.ReflectionUtils; import java.lang.reflect.Field; + import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EnumCreatureAttribute; @@ -33,6 +27,14 @@ import net.minecraft.util.Vec3; import net.minecraft.world.EnumDifficulty; import net.minecraft.world.World; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.minecraft.BlockPos; +import gtPlusPlus.core.entity.ai.batking.EntityAIBatKingAttack; +import gtPlusPlus.core.entity.projectile.EntityThrowableBomb; +import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.core.util.minecraft.EntityUtils; +import gtPlusPlus.core.util.reflect.ReflectionUtils; + public class EntityBatKing extends EntityMob implements IRangedAttackMob { public int courseChangeCooldown; @@ -46,8 +48,11 @@ public class EntityBatKing extends EntityMob implements IRangedAttackMob { private int explosionStrength = 1; private EntityAIBatKingAttack aiAttack = new EntityAIBatKingAttack(this, null, 1.0D, 20, 60, 15.0F, true); - private EntityAIAttackOnCollide aiAttackOnCollide = - new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); + private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide( + this, + EntityPlayer.class, + 1.2D, + false); public EntityBatKing(World p_i1680_1_) { super(p_i1680_1_); @@ -118,8 +123,7 @@ public class EntityBatKing extends EntityMob implements IRangedAttackMob { } /** - * Returns true if this entity should push and be pushed by other entities when - * colliding. + * Returns true if this entity should push and be pushed by other entities when colliding. */ public boolean canBePushed() { return true; @@ -294,8 +298,8 @@ public class EntityBatKing extends EntityMob implements IRangedAttackMob { } /** - * returns if this entity triggers Block.onEntityWalking on the blocks they walk - * on. used for spiders and wolves to prevent them from trampling crops + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops */ protected boolean canTriggerWalking() { return false; @@ -359,8 +363,7 @@ public class EntityBatKing extends EntityMob implements IRangedAttackMob { if (this.targetedEntity != null && this.targetedEntity.getDistanceSqToEntity(this) < d4 * d4 * 8) { Logger.INFO("Trying to do ranged attack 2"); double d5 = this.targetedEntity.posX - this.posX; - double d6 = this.targetedEntity.boundingBox.minY - + (double) (this.targetedEntity.height / 2.0F) + double d6 = this.targetedEntity.boundingBox.minY + (double) (this.targetedEntity.height / 2.0F) - (this.posY + (double) (this.height / 2.0F)); double d7 = this.targetedEntity.posZ - this.posZ; this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(d5, d7)) * 180.0F / (float) Math.PI; @@ -374,11 +377,17 @@ public class EntityBatKing extends EntityMob implements IRangedAttackMob { Logger.INFO("Trying to do ranged attack 3a1"); this.worldObj.playAuxSFXAtEntity( - (EntityPlayer) null, 1008, (int) this.posX, (int) this.posY, (int) this.posZ, 0); + (EntityPlayer) null, + 1008, + (int) this.posX, + (int) this.posY, + (int) this.posZ, + 0); setIsBatHanging(true); - EntityThrowableBomb entitylargefireball = - new EntityThrowableBomb(this.worldObj, this /*d5, d6, d7*/); + EntityThrowableBomb entitylargefireball = new EntityThrowableBomb( + this.worldObj, + this /* d5, d6, d7 */); // entitylargefireball.field_92057_e = this.explosionStrength; // entitylargefireball.accelerationX *= 2; // entitylargefireball.accelerationY *= 2; @@ -395,14 +404,18 @@ public class EntityBatKing extends EntityMob implements IRangedAttackMob { Logger.INFO("Trying to do ranged attack 5a"); --this.attackCounter; EntityArrow entityarrow = new EntityArrow( - this.worldObj, this, p_82196_1_, MathUtils.randFloat(1f, 3f), (float) - (14 - this.worldObj.difficultySetting.getDifficultyId() * 4)); + this.worldObj, + this, + p_82196_1_, + MathUtils.randFloat(1f, 3f), + (float) (14 - this.worldObj.difficultySetting.getDifficultyId() * 4)); int i = MathUtils.randInt(0, 4); int j = MathUtils.randInt(0, 3); int k = MathUtils.randInt(0, 3); - entityarrow.setDamage((double) (p_82196_2_ * 2.0F) - + this.rand.nextGaussian() * 0.25D - + (double) ((float) this.worldObj.difficultySetting.getDifficultyId() * 0.11F)); + entityarrow.setDamage( + (double) (p_82196_2_ * 2.0F) + this.rand.nextGaussian() * 0.25D + + (double) ((float) this.worldObj.difficultySetting.getDifficultyId() + * 0.11F)); boolean boostAttack = MathUtils.randInt(0, 100) <= 21; if (boostAttack) { @@ -418,10 +431,7 @@ public class EntityBatKing extends EntityMob implements IRangedAttackMob { } } - this.playSound( - "mob.skeleton.say", - 1.0F, - 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F)); + this.playSound("mob.skeleton.say", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F)); this.worldObj.spawnEntityInWorld(entityarrow); Logger.INFO("Trying to do ranged attack 5a done"); } @@ -435,20 +445,24 @@ public class EntityBatKing extends EntityMob implements IRangedAttackMob { } } else { Logger.INFO("Trying to do ranged attack 4a"); - this.renderYawOffset = - this.rotationYaw = -((float) Math.atan2(this.motionX, this.motionZ)) * 180.0F / (float) Math.PI; + this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(this.motionX, this.motionZ)) * 180.0F + / (float) Math.PI; if (this.attackCounter > 0) { Logger.INFO("Trying to do ranged attack 5a"); --this.attackCounter; - EntityArrow entityarrow = new EntityArrow(this.worldObj, this, p_82196_1_, 1.6F, (float) - (14 - this.worldObj.difficultySetting.getDifficultyId() * 4)); + EntityArrow entityarrow = new EntityArrow( + this.worldObj, + this, + p_82196_1_, + 1.6F, + (float) (14 - this.worldObj.difficultySetting.getDifficultyId() * 4)); int i = MathUtils.randInt(0, 4); int j = MathUtils.randInt(0, 3); int k = MathUtils.randInt(0, 3); - entityarrow.setDamage((double) (p_82196_2_ * 2.0F) - + this.rand.nextGaussian() * 0.25D - + (double) ((float) this.worldObj.difficultySetting.getDifficultyId() * 0.11F)); + entityarrow.setDamage( + (double) (p_82196_2_ * 2.0F) + this.rand.nextGaussian() * 0.25D + + (double) ((float) this.worldObj.difficultySetting.getDifficultyId() * 0.11F)); boolean boostAttack = MathUtils.randInt(0, 100) <= 21; if (boostAttack) { @@ -479,8 +493,7 @@ public class EntityBatKing extends EntityMob implements IRangedAttackMob { } /** - * Checks if the entity's current position is a valid location to spawn this - * entity. + * Checks if the entity's current position is a valid location to spawn this entity. */ public boolean getCanSpawnHere() { return super.getCanSpawnHere() && this.worldObj.difficultySetting != EnumDifficulty.PEACEFUL; @@ -498,9 +511,8 @@ public class EntityBatKing extends EntityMob implements IRangedAttackMob { } /** - * Drop 0-2 items of this living's type. @param par1 - Whether this entity has - * recently been hit by a player. @param par2 - Level of Looting used to kill - * this mob. + * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param + * par2 - Level of Looting used to kill this mob. */ protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) { int j = this.rand.nextInt(2) + this.rand.nextInt(1 + p_70628_2_); @@ -567,8 +579,7 @@ public class EntityBatKing extends EntityMob implements IRangedAttackMob { if (this.targetedEntity != null && this.targetedEntity.getDistanceSqToEntity(this) < d4 * d4) { double d5 = this.targetedEntity.posX - this.posX; - double d6 = this.targetedEntity.boundingBox.minY - + (double) (this.targetedEntity.height / 2.0F) + double d6 = this.targetedEntity.boundingBox.minY + (double) (this.targetedEntity.height / 2.0F) - (this.posY + (double) (this.height / 2.0F)); double d7 = this.targetedEntity.posZ - this.posZ; this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(d5, d7)) * 180.0F / (float) Math.PI; @@ -576,14 +587,24 @@ public class EntityBatKing extends EntityMob implements IRangedAttackMob { if (this.canEntityBeSeen(this.targetedEntity)) { if (this.attackCounter == 10) { this.worldObj.playAuxSFXAtEntity( - (EntityPlayer) null, 1007, (int) this.posX, (int) this.posY, (int) this.posZ, 0); + (EntityPlayer) null, + 1007, + (int) this.posX, + (int) this.posY, + (int) this.posZ, + 0); } ++this.attackCounter; if (this.attackCounter == 20) { this.worldObj.playAuxSFXAtEntity( - (EntityPlayer) null, 1008, (int) this.posX, (int) this.posY, (int) this.posZ, 0); + (EntityPlayer) null, + 1008, + (int) this.posX, + (int) this.posY, + (int) this.posZ, + 0); EntityLargeFireball entitylargefireball = new EntityLargeFireball(this.worldObj, this, d5, d6, d7); entitylargefireball.field_92057_e = this.explosionStrength; double d8 = 4.0D; @@ -598,8 +619,8 @@ public class EntityBatKing extends EntityMob implements IRangedAttackMob { --this.attackCounter; } } else { - this.renderYawOffset = - this.rotationYaw = -((float) Math.atan2(this.motionX, this.motionZ)) * 180.0F / (float) Math.PI; + this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(this.motionX, this.motionZ)) * 180.0F + / (float) Math.PI; if (this.attackCounter > 0) { --this.attackCounter; @@ -629,8 +650,7 @@ public class EntityBatKing extends EntityMob implements IRangedAttackMob { axisalignedbb.offset(d4, d5, d6); /* - * if (!this.worldObj.getCollidingBoundingBoxes(this, axisalignedbb).isEmpty()) - * { return false; } + * if (!this.worldObj.getCollidingBoundingBoxes(this, axisalignedbb).isEmpty()) { return false; } */ } @@ -643,9 +663,8 @@ public class EntityBatKing extends EntityMob implements IRangedAttackMob { protected void fall(float p_70069_1_) {} /** - * Takes in the distance the entity has fallen this tick and whether its on the - * ground to update the fall distance and deal fall damage if landing on the - * ground. Args: distanceFallenThisTick, onGround + * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance + * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround */ protected void updateFallState(double p_70064_1_, boolean p_70064_3_) {} @@ -670,11 +689,9 @@ public class EntityBatKing extends EntityMob implements IRangedAttackMob { if (this.onGround) { f2 = this.worldObj.getBlock( - MathHelper.floor_double(this.posX), - MathHelper.floor_double(this.boundingBox.minY) - 1, - MathHelper.floor_double(this.posZ)) - .slipperiness - * 0.91F; + MathHelper.floor_double(this.posX), + MathHelper.floor_double(this.boundingBox.minY) - 1, + MathHelper.floor_double(this.posZ)).slipperiness * 0.91F; } float f3 = 0.16277136F / (f2 * f2 * f2); @@ -683,11 +700,9 @@ public class EntityBatKing extends EntityMob implements IRangedAttackMob { if (this.onGround) { f2 = this.worldObj.getBlock( - MathHelper.floor_double(this.posX), - MathHelper.floor_double(this.boundingBox.minY) - 1, - MathHelper.floor_double(this.posZ)) - .slipperiness - * 0.91F; + MathHelper.floor_double(this.posX), + MathHelper.floor_double(this.boundingBox.minY) - 1, + MathHelper.floor_double(this.posZ)).slipperiness * 0.91F; } this.moveEntity(this.motionX, this.motionY, this.motionZ); diff --git a/src/main/java/gtPlusPlus/core/entity/monster/EntityGiantChickenBase.java b/src/main/java/gtPlusPlus/core/entity/monster/EntityGiantChickenBase.java index e75a7664bc..e0c704b67b 100644 --- a/src/main/java/gtPlusPlus/core/entity/monster/EntityGiantChickenBase.java +++ b/src/main/java/gtPlusPlus/core/entity/monster/EntityGiantChickenBase.java @@ -1,8 +1,5 @@ package gtPlusPlus.core.entity.monster; -import gtPlusPlus.core.item.ModItems; -import gtPlusPlus.core.item.general.ItemGemShards; -import gtPlusPlus.core.util.math.MathUtils; import net.minecraft.entity.*; import net.minecraft.entity.ai.*; import net.minecraft.entity.effect.EntityLightningBolt; @@ -18,6 +15,10 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraftforge.common.ForgeHooks; +import gtPlusPlus.core.item.ModItems; +import gtPlusPlus.core.item.general.ItemGemShards; +import gtPlusPlus.core.util.math.MathUtils; + public class EntityGiantChickenBase extends EntityChicken { /** The time until the next egg is spawned. */ @@ -120,14 +121,13 @@ public class EntityGiantChickenBase extends EntityChicken { for (int k = 0; k < j * 2; ++k) { this.dropItem( ModItems.itemBigEgg, - MathUtils.getRandomFromArray(new int[] {1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2})); + MathUtils.getRandomFromArray(new int[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2 })); } // Chicken Corpses Dropped - int mBodies = MathUtils.getRandomFromArray(new int[] { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, - 6 - }); + int mBodies = MathUtils.getRandomFromArray( + new int[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, + 4, 4, 4, 5, 5, 6 }); if (this.isBurning()) { this.dropItem(Items.cooked_chicken, mBodies); } else { @@ -254,8 +254,7 @@ public class EntityGiantChickenBase extends EntityChicken { this.motionY = 0.68999998688697815D; this.motionY += 0.068999998688697815D; if (this.isPotionActive(Potion.jump)) { - this.motionY += - (double) ((float) (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.5F); + this.motionY += (double) ((float) (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.5F); } if (this.isSprinting()) { diff --git a/src/main/java/gtPlusPlus/core/entity/monster/EntitySickBlaze.java b/src/main/java/gtPlusPlus/core/entity/monster/EntitySickBlaze.java index 2abc2bd6a1..933109730c 100644 --- a/src/main/java/gtPlusPlus/core/entity/monster/EntitySickBlaze.java +++ b/src/main/java/gtPlusPlus/core/entity/monster/EntitySickBlaze.java @@ -1,8 +1,5 @@ package gtPlusPlus.core.entity.monster; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.core.entity.projectile.EntityToxinballSmall; import net.minecraft.entity.Entity; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.monster.EntityMob; @@ -13,7 +10,12 @@ import net.minecraft.util.DamageSource; import net.minecraft.util.MathHelper; import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.core.entity.projectile.EntityToxinballSmall; + public class EntitySickBlaze extends EntityMob { + /** Random offset used in floating behaviour */ private float heightOffset = 0.5F; /** ticks until heightOffset is randomized */ @@ -81,9 +83,8 @@ public class EntitySickBlaze extends EntityMob { } /** - * Called frequently so the entity can update its state every tick as - * required. For example, zombies and skeletons use this to react to - * sunlight and start to burn. + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. */ @Override public void onLivingUpdate() { @@ -107,8 +108,10 @@ public class EntitySickBlaze extends EntityMob { } if (this.rand.nextInt(24) == 0) { - /*this.worldObj.playSoundEffect(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "fire.fire", - 1.0F + this.rand.nextFloat(), this.rand.nextFloat() * 0.7F + 0.3F);*/ + /* + * this.worldObj.playSoundEffect(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "fire.fire", 1.0F + + * this.rand.nextFloat(), this.rand.nextFloat() * 0.7F + 0.3F); + */ } if (!this.onGround && this.motionY < 0.0D) { @@ -130,13 +133,11 @@ public class EntitySickBlaze extends EntityMob { } /** - * Basic mob attack. Default to touch of death in EntityCreature. Overridden - * by each mob to define their attack. + * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. */ @Override protected void attackEntity(Entity entity, float p_70785_2_) { - if (this.attackTime <= 0 - && p_70785_2_ < 2.0F + if (this.attackTime <= 0 && p_70785_2_ < 2.0F && entity.boundingBox.maxY > this.boundingBox.minY && entity.boundingBox.minY < this.boundingBox.maxY) { this.attackTime = 20; @@ -161,7 +162,12 @@ public class EntitySickBlaze extends EntityMob { if (this.field_70846_g > 1) { float f1 = MathHelper.sqrt_float(p_70785_2_) * 0.5F; this.worldObj.playAuxSFXAtEntity( - (EntityPlayer) null, 1009, (int) this.posX, (int) this.posY, (int) this.posZ, 0); + (EntityPlayer) null, + 1009, + (int) this.posX, + (int) this.posY, + (int) this.posZ, + 0); for (int i = 0; i < 1; ++i) { EntityToxinballSmall entitysmalltoxinball = new EntityToxinballSmall( @@ -193,8 +199,7 @@ public class EntitySickBlaze extends EntityMob { } /** - * Returns true if the entity is on fire. Used by render to add the fire - * effect on rendering. + * Returns true if the entity is on fire. Used by render to add the fire effect on rendering. */ @Override public boolean isBurning() { @@ -202,9 +207,8 @@ public class EntitySickBlaze extends EntityMob { } /** - * Drop 0-2 items of this living's type. @param par1 - Whether this entity - * has recently been hit by a player. @param par2 - Level of Looting used to - * kill this mob. + * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param + * par2 - Level of Looting used to kill this mob. */ @Override protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) { diff --git a/src/main/java/gtPlusPlus/core/entity/monster/EntityStaballoyConstruct.java b/src/main/java/gtPlusPlus/core/entity/monster/EntityStaballoyConstruct.java index b0cbbe2e8d..c5391468d6 100644 --- a/src/main/java/gtPlusPlus/core/entity/monster/EntityStaballoyConstruct.java +++ b/src/main/java/gtPlusPlus/core/entity/monster/EntityStaballoyConstruct.java @@ -1,12 +1,7 @@ package gtPlusPlus.core.entity.monster; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.util.reflect.ReflectionUtils; -import gtPlusPlus.core.world.explosions.ExplosionHandler; import java.lang.reflect.Field; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.*; @@ -21,6 +16,13 @@ import net.minecraft.util.MathHelper; import net.minecraft.village.Village; import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.reflect.ReflectionUtils; +import gtPlusPlus.core.world.explosions.ExplosionHandler; + public class EntityStaballoyConstruct extends EntityIronGolem { /* @@ -49,7 +51,8 @@ public class EntityStaballoyConstruct extends EntityIronGolem { this.tasks.addTask(6, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false)); this.targetTasks.addTask( - 2, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, false, true, IMob.mobSelector)); + 2, + new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, false, true, IMob.mobSelector)); } /** @@ -121,9 +124,8 @@ public class EntityStaballoyConstruct extends EntityIronGolem { } /** - * Called frequently so the entity can update its state every tick as - * required. For example, zombies and skeletons use this to react to - * sunlight and start to burn. + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. */ @Override public void onLivingUpdate() { @@ -219,9 +221,8 @@ public class EntityStaballoyConstruct extends EntityIronGolem { } /** - * Drop 0-2 items of this living's type. @param par1 - Whether this entity - * has recently been hit by a player. @param par2 - Level of Looting used to - * kill this mob. + * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param + * par2 - Level of Looting used to kill this mob. */ @Override protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) { @@ -402,8 +403,7 @@ public class EntityStaballoyConstruct extends EntityIronGolem { if (mFirstUpdateField != null && mReflectFirstUpdate == true) { try { this.mReflectFirstUpdate = (boolean) mFirstUpdateField.get(this); - } catch (IllegalArgumentException | IllegalAccessException e) { - } + } catch (IllegalArgumentException | IllegalAccessException e) {} } } super.onEntityUpdate(); @@ -471,8 +471,8 @@ public class EntityStaballoyConstruct extends EntityIronGolem { fluid, this)) { if (!this.inFluid && !this.mReflectFirstUpdate) { - float f = MathHelper.sqrt_double(this.motionX * this.motionX * 0.20000000298023224D - + this.motionY * this.motionY + float f = MathHelper.sqrt_double( + this.motionX * this.motionX * 0.20000000298023224D + this.motionY * this.motionY + this.motionZ * this.motionZ * 0.20000000298023224D) * 0.2F; @@ -533,8 +533,9 @@ public class EntityStaballoyConstruct extends EntityIronGolem { } private void explode() { - /* float f = 12.0F; - this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, f, true);*/ + /* + * float f = 12.0F; this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, f, true); + */ if (!this.worldObj.isRemote) { final float f = 6.5F; diff --git a/src/main/java/gtPlusPlus/core/entity/projectile/EntityHydrofluoricAcidPotion.java b/src/main/java/gtPlusPlus/core/entity/projectile/EntityHydrofluoricAcidPotion.java index 0e8174339e..da848575a3 100644 --- a/src/main/java/gtPlusPlus/core/entity/projectile/EntityHydrofluoricAcidPotion.java +++ b/src/main/java/gtPlusPlus/core/entity/projectile/EntityHydrofluoricAcidPotion.java @@ -1,9 +1,5 @@ package gtPlusPlus.core.entity.projectile; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.api.objects.minecraft.BlockPos; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.EntityUtils; import net.minecraft.block.Block; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -15,6 +11,11 @@ import net.minecraft.util.DamageSource; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.minecraft.BlockPos; +import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.core.util.minecraft.EntityUtils; + public class EntityHydrofluoricAcidPotion extends EntityThrowable { public EntityHydrofluoricAcidPotion(World world) { @@ -121,15 +122,15 @@ public class EntityHydrofluoricAcidPotion extends EntityThrowable { if (worldObj.getBlock(i, j - 1, h) == Blocks.grass) { worldObj.setBlock(i, j - 1, h, Blocks.dirt); } - } else if (mBlockhit == Blocks.carrots - || mBlockhit == Blocks.melon_block + } else if (mBlockhit == Blocks.carrots || mBlockhit == Blocks.melon_block || mBlockhit == Blocks.pumpkin || mBlockhit == Blocks.potatoes) { - worldObj.setBlock(i, j + 1, h, Blocks.fire); - worldObj.setBlock(i, j, h, Blocks.dirt); - } else if (mBlockhit == Blocks.air) { - worldObj.setBlock(i, j, h, Blocks.fire); - } + worldObj.setBlock(i, j + 1, h, Blocks.fire); + worldObj.setBlock(i, j, h, Blocks.dirt); + } else + if (mBlockhit == Blocks.air) { + worldObj.setBlock(i, j, h, Blocks.fire); + } } } } diff --git a/src/main/java/gtPlusPlus/core/entity/projectile/EntityLightningAttack.java b/src/main/java/gtPlusPlus/core/entity/projectile/EntityLightningAttack.java index c1778309e3..595eb53968 100644 --- a/src/main/java/gtPlusPlus/core/entity/projectile/EntityLightningAttack.java +++ b/src/main/java/gtPlusPlus/core/entity/projectile/EntityLightningAttack.java @@ -1,7 +1,5 @@ package gtPlusPlus.core.entity.projectile; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.projectile.EntityWitherSkull; import net.minecraft.potion.Potion; @@ -11,6 +9,9 @@ import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.EnumDifficulty; import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +imp