aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/core/entity
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gtPlusPlus/core/entity')
-rw-r--r--src/main/java/gtPlusPlus/core/entity/EntityPrimedMiningExplosive.java216
-rw-r--r--src/main/java/gtPlusPlus/core/entity/EntityTeleportFX.java247
-rw-r--r--src/main/java/gtPlusPlus/core/entity/EntityTeslaTowerLightning.java168
-rw-r--r--src/main/java/gtPlusPlus/core/entity/InternalEntityRegistry.java96
-rw-r--r--src/main/java/gtPlusPlus/core/entity/ai/batking/EntityAIBatKingAttack.java406
-rw-r--r--src/main/java/gtPlusPlus/core/entity/item/ItemEntityGiantEgg.java117
-rw-r--r--src/main/java/gtPlusPlus/core/entity/monster/EntityBatKing.java712
-rw-r--r--src/main/java/gtPlusPlus/core/entity/monster/EntityGiantChickenBase.java311
-rw-r--r--src/main/java/gtPlusPlus/core/entity/monster/EntitySickBlaze.java225
-rw-r--r--src/main/java/gtPlusPlus/core/entity/monster/EntityStaballoyConstruct.java553
-rw-r--r--src/main/java/gtPlusPlus/core/entity/projectile/EntityHydrofluoricAcidPotion.java127
-rw-r--r--src/main/java/gtPlusPlus/core/entity/projectile/EntityLightningAttack.java76
-rw-r--r--src/main/java/gtPlusPlus/core/entity/projectile/EntitySulfuricAcidPotion.java115
-rw-r--r--src/main/java/gtPlusPlus/core/entity/projectile/EntityThrowableBomb.java145
-rw-r--r--src/main/java/gtPlusPlus/core/entity/projectile/EntityToxinball.java327
-rw-r--r--src/main/java/gtPlusPlus/core/entity/projectile/EntityToxinballSmall.java88
16 files changed, 3929 insertions, 0 deletions
diff --git a/src/main/java/gtPlusPlus/core/entity/EntityPrimedMiningExplosive.java b/src/main/java/gtPlusPlus/core/entity/EntityPrimedMiningExplosive.java
new file mode 100644
index 0000000000..9abd07392d
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/entity/EntityPrimedMiningExplosive.java
@@ -0,0 +1,216 @@
+package gtPlusPlus.core.entity;
+
+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;
+
+ public EntityPrimedMiningExplosive(final World world){
+ super(world);
+ this.fuse = 160;
+ this.preventEntitySpawning = true;
+ this.setSize(0.98F, 0.98F);
+ this.yOffset = this.height / 2.0F;
+ }
+
+ 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);
+ this.motionX = -((float)Math.sin(f)) * 0.02F;
+ this.motionY = 0.20000000298023224D;
+ this.motionZ = -((float)Math.cos(f)) * 0.02F;
+ this.fuse = 160;
+ this.prevPosX = x;
+ this.prevPosY = y;
+ this.prevPosZ = z;
+ this.tntPlacedBy = placingEntity;
+ }
+
+ @Override
+ protected void entityInit() {}
+
+ /**
+ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to
+ * prevent them from trampling crops
+ */
+ @Override
+ protected boolean canTriggerWalking()
+ {
+ return false;
+ }
+
+ /**
+ * Returns true if other Entities should be prevented from moving through this Entity.
+ */
+ @Override
+ public boolean canBeCollidedWith()
+ {
+ return !this.isDead;
+ }
+
+ /**
+ * Called to update the entity's position/logic.
+ */
+ @Override
+ public void onUpdate()
+ {
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+ this.motionY -= 0.03999999910593033D;
+ this.moveEntity(this.motionX, this.motionY, this.motionZ);
+ this.motionX *= 0.9800000190734863D;
+ this.motionY *= 0.9800000190734863D;
+ this.motionZ *= 0.9800000190734863D;
+
+ if (this.onGround)
+ {
+ this.motionX *= 0.699999988079071D;
+ this.motionZ *= 0.699999988079071D;
+ this.motionY *= -0.5D;
+ }
+
+ if (this.fuse-- <= 0)
+ {
+ this.setDead();
+
+ if (!this.worldObj.isRemote)
+ {
+ this.explode();
+ }
+ }
+ else
+ {
+
+ int t = MathUtils.randInt(0, 15);
+
+ if (t <= 2){
+ int e = MathUtils.randInt(0, 3);
+ if (e <= 1){
+ this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("cloud", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ }
+ else if (e == 2){
+ this.worldObj.spawnParticle("explode", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("largeexplode", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("hugeexplosion", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+
+ }
+ }
+ else if (t <= 4){
+ int e = MathUtils.randInt(0, 5);
+ if (e <= 1){
+ this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("cloud", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ }
+ else if (e == 2){
+ this.worldObj.spawnParticle("explode", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("largeexplode", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("hugeexplosion", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+
+ }
+ }
+ else if (t <= 6){
+ int e = MathUtils.randInt(0, 4);
+ if (e <= 1){
+ this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("cloud", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ }
+ else if (e == 2){
+ this.worldObj.spawnParticle("explode", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("largeexplode", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("hugeexplosion", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+
+ }
+ }
+ else if (t <= 8){
+ int e = MathUtils.randInt(0, 1);
+ if (e <= 1){
+ this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("cloud", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ }
+ else if (e == 2){
+ this.worldObj.spawnParticle("explode", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("largeexplode", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("hugeexplosion", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+
+ }
+ }
+ else if (t <= 10){
+ int e = MathUtils.randInt(0, 6);
+ if (e <= 1){
+ this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("cloud", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ }
+ else if (e >= 2){
+ this.worldObj.spawnParticle("explode", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("largeexplode", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("hugeexplosion", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+
+ }
+ }
+
+ }
+ }
+
+ private void explode()
+ {
+ final float f = 100.0F;
+
+ 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);*/
+ }
+
+ /**
+ * (abstract) Protected helper method to write subclass entity data to NBT.
+ */
+ @Override
+ protected void writeEntityToNBT(final NBTTagCompound tag)
+ {
+ tag.setByte("Fuse", (byte)this.fuse);
+ }
+
+ /**
+ * (abstract) Protected helper method to read subclass entity data from NBT.
+ */
+ @Override
+ protected void readEntityFromNBT(final NBTTagCompound tag)
+ {
+ this.fuse = tag.getByte("Fuse");
+ }
+
+ /**
+ * returns null or the entityliving it was placed or ignited by
+ */
+ @Override
+ public EntityLivingBase getTntPlacedBy()
+ {
+ return this.tntPlacedBy;
+ }
+} \ No newline at end of file
diff --git a/src/main/java/gtPlusPlus/core/entity/EntityTeleportFX.java b/src/main/java/gtPlusPlus/core/entity/EntityTeleportFX.java
new file mode 100644
index 0000000000..ea667b8667
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/entity/EntityTeleportFX.java
@@ -0,0 +1,247 @@
+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;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.MathHelper;
+import net.minecraft.world.World;
+
+public class EntityTeleportFX extends Entity
+{
+ /** 'x' location the eye should float towards. */
+ private double targetX;
+ /** 'y' location the eye should float towards. */
+ private double targetY;
+ /** 'z' location the eye should float towards. */
+ private double targetZ;
+ private int despawnTimer;
+ private boolean shatterOrDrop;
+ private static final String __OBFID = "CL_00001716";
+
+ public EntityTeleportFX(final World p_i1757_1_)
+ {
+ super(p_i1757_1_);
+ this.setSize(0.25F, 0.25F);
+ }
+
+ @Override
+ protected void entityInit() {}
+
+ /**
+ * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge
+ * length * 64 * renderDistanceWeight Args: distance
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean isInRangeToRenderDist(final double p_70112_1_)
+ {
+ double d1 = this.boundingBox.getAverageEdgeLength() * 4.0D;
+ d1 *= 64.0D;
+ 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_)
+ {
+ super(p_i1758_1_);
+ this.despawnTimer = 0;
+ this.setSize(0.25F, 0.25F);
+ this.setPosition(p_i1758_2_, p_i1758_4_, p_i1758_6_);
+ this.yOffset = 0.0F;
+ }
+
+ /**
+ * The location the eye should float/move towards. Currently used for moving towards the nearest stronghold. Args:
+ * strongholdX, strongholdY, strongholdZ
+ */
+ public void moveTowards(final double p_70220_1_, final int p_70220_3_, final double p_70220_4_)
+ {
+ final double d2 = p_70220_1_ - this.posX;
+ final double d3 = p_70220_4_ - this.posZ;
+ final float f = MathHelper.sqrt_double((d2 * d2) + (d3 * d3));
+
+ if (f > 12.0F)
+ {
+ this.targetX = this.posX + ((d2 / f) * 12.0D);
+ this.targetZ = this.posZ + ((d3 / f) * 12.0D);
+ this.targetY = this.posY + 8.0D;
+ }
+ else
+ {
+ this.targetX = p_70220_1_;
+ this.targetY = p_70220_3_;
+ this.targetZ = p_70220_4_;
+ }
+
+ this.despawnTimer = 0;
+ this.shatterOrDrop = this.rand.nextInt(5) > 0;
+ }
+
+ /**
+ * Sets the velocity to the args. Args: x, y, z
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void setVelocity(final double p_70016_1_, final double p_70016_3_, final double p_70016_5_)
+ {
+ this.motionX = p_70016_1_;
+ this.motionY = p_70016_3_;
+ this.motionZ = p_70016_5_;
+
+ if ((this.prevRotationPitch == 0.0F) && (this.prevRotationYaw == 0.0F))
+ {
+ final float f = MathHelper.sqrt_double((p_70016_1_ * p_70016_1_) + (p_70016_5_ * p_70016_5_));
+ this.prevRotationYaw = this.rotationYaw = (float)((Math.atan2(p_70016_1_, p_70016_5_) * 180.0D) / Math.PI);
+ this.prevRotationPitch = this.rotationPitch = (float)((Math.atan2(p_70016_3_, f) * 180.0D) / Math.PI);
+ }
+ }
+
+ /**
+ * Called to update the entity's position/logic.
+ */
+ @Override
+ public void onUpdate()
+ {
+ this.lastTickPosX = this.posX;
+ this.lastTickPosY = this.posY;
+ this.lastTickPosZ = this.posZ;
+ super.onUpdate();
+ this.posX += this.motionX;
+ this.posY += this.motionY;
+ this.posZ += this.motionZ;
+ 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)
+ {
+ ;
+ }
+
+ while ((this.rotationPitch - this.prevRotationPitch) >= 180.0F)
+ {
+ this.prevRotationPitch += 360.0F;
+ }
+
+ while ((this.rotationYaw - this.prevRotationYaw) < -180.0F)
+ {
+ this.prevRotationYaw -= 360.0F;
+ }
+
+ while ((this.rotationYaw - this.prevRotationYaw) >= 180.0F)
+ {
+ this.prevRotationYaw += 360.0F;
+ }
+
+ this.rotationPitch = this.prevRotationPitch + ((this.rotationPitch - this.prevRotationPitch) * 0.2F);
+ this.rotationYaw = this.prevRotationYaw + ((this.rotationYaw - this.prevRotationYaw) * 0.2F);
+
+ if (!this.worldObj.isRemote)
+ {
+ final double d0 = this.targetX - this.posX;
+ final double d1 = this.targetZ - this.posZ;
+ final float f1 = (float)Math.sqrt((d0 * d0) + (d1 * d1));
+ final float f2 = (float)Math.atan2(d1, d0);
+ double d2 = f + ((f1 - f) * 0.0025D);
+
+ if (f1 < 1.0F)
+ {
+ d2 *= 0.8D;
+ this.motionY *= 0.8D;
+ }
+
+ this.motionX = Math.cos(f2) * d2;
+ this.motionZ = Math.sin(f2) * d2;
+
+ if (this.posY < this.targetY)
+ {
+ this.motionY += (1.0D - this.motionY) * 0.014999999664723873D;
+ }
+ else
+ {
+ this.motionY += (-1.0D - this.motionY) * 0.014999999664723873D;
+ }
+ }
+
+ final float f3 = 0.25F;
+
+ if (this.isInWater())
+ {
+ for (int i = 0; i < 4; ++i)
+ {
+ this.worldObj.spawnParticle("bubble", this.posX - (this.motionX * f3), this.posY - (this.motionY * f3), this.posZ - (this.motionZ * f3), this.motionX, this.motionY, this.motionZ);
+ }
+ }
+ else
+ {
+ this.worldObj.spawnParticle("portal", ((this.posX - (this.motionX * f3)) + (this.rand.nextDouble() * 0.6D)) - 0.3D, this.posY - (this.motionY * f3) - 0.5D, ((this.posZ - (this.motionZ * f3)) + (this.rand.nextDouble() * 0.6D)) - 0.3D, this.motionX, this.motionY, this.motionZ);
+ }
+
+ if (!this.worldObj.isRemote)
+ {
+ this.setPosition(this.posX, this.posY, this.posZ);
+ ++this.despawnTimer;
+
+ if ((this.despawnTimer > 80) && !this.worldObj.isRemote)
+ {
+ this.setDead();
+
+ if (this.shatterOrDrop)
+ {
+ this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, new ItemStack(Items.ender_eye)));
+ }
+ else
+ {
+ this.worldObj.playAuxSFX(2003, (int)Math.round(this.posX), (int)Math.round(this.posY), (int)Math.round(this.posZ), 0);
+ }
+ }
+ }
+ }
+
+ /**
+ * (abstract) Protected helper method to write subclass entity data to NBT.
+ */
+ @Override
+ public void writeEntityToNBT(final NBTTagCompound p_70014_1_) {}
+
+ /**
+ * (abstract) Protected helper method to read subclass entity data from NBT.
+ */
+ @Override
+ public void readEntityFromNBT(final NBTTagCompound p_70037_1_) {}
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public float getShadowSize()
+ {
+ return 0.0F;
+ }
+
+ /**
+ * Gets how bright this entity is.
+ */
+ @Override
+ public float getBrightness(final float p_70013_1_)
+ {
+ return 1.0F;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getBrightnessForRender(final float p_70070_1_)
+ {
+ return 15728880;
+ }
+
+ /**
+ * If returns false, the item will not inflict any damage against entities.
+ */
+ @Override
+ public boolean canAttackWithItem()
+ {
+ return false;
+ }
+} \ No newline at end of file
diff --git a/src/main/java/gtPlusPlus/core/entity/EntityTeslaTowerLightning.java b/src/main/java/gtPlusPlus/core/entity/EntityTeslaTowerLightning.java
new file mode 100644
index 0000000000..bf629bd147
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/entity/EntityTeslaTowerLightning.java
@@ -0,0 +1,168 @@
+package gtPlusPlus.core.entity;
+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;
+import net.minecraft.init.Blocks;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.AxisAlignedBB;
+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. */
+ private int boltLivingTime;
+
+ private final UUID boltID;
+ private final UUID boltOwnerID;
+
+ 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)
+ {
+ super(p_i1703_1_);
+ Logger.INFO("Plasma Bolt - Created.");
+ Random rand = new XSTR(p_i1703_1_.getSeed());
+ this.setLocationAndAngles(p_i1703_2_, p_i1703_4_, p_i1703_6_, 0.0F, 0.0F);
+ this.lightningState = 2;
+ this.boltVertex = rand.nextLong();
+ this.boltLivingTime = (1) + rand.nextInt(3) + 1;
+ this.boltValidDamageTarget = valid;
+ this.boltID = UUID.randomUUID();
+ this.boltOwnerID = owner;
+
+ //Puts fires out
+ 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(MathHelper.floor_double(p_i1703_2_), MathHelper.floor_double(p_i1703_4_), MathHelper.floor_double(p_i1703_6_), 10))
+ {
+ Logger.INFO("Plasma Bolt - Putting out fires?.");
+ int i = MathHelper.floor_double(p_i1703_2_);
+ int j = MathHelper.floor_double(p_i1703_4_);
+ int k = MathHelper.floor_double(p_i1703_6_);
+
+ if (p_i1703_1_.getBlock(i, j, k).getMaterial() == Material.fire)
+ {
+ p_i1703_1_.setBlock(i, j, k, Blocks.air);
+ }
+
+ for (i = 0; i < 4; ++i)
+ {
+ j = MathHelper.floor_double(p_i1703_2_) + rand.nextInt(3) - 1;
+ k = MathHelper.floor_double(p_i1703_4_) + rand.nextInt(3) - 1;
+ int l = MathHelper.floor_double(p_i1703_6_) + rand.nextInt(3) - 1;
+
+ if (p_i1703_1_.getBlock(j, k, l).getMaterial() == Material.fire)
+ {
+ p_i1703_1_.setBlock(j, k, l, Blocks.air);
+ }
+ }
+ }
+ }
+
+ /**
+ * Called to update the entity's position/logic.
+ */
+ public void onUpdate()
+ {
+ //Logger.INFO("Zap");
+ super.onUpdate();
+ Logger.INFO("Plasma Bolt - Tick.");
+ Random rand = new XSTR(this.worldObj.getSeed());
+
+ if (this.lightningState == 2)
+ {
+ Logger.INFO("Plasma Bolt - Playing Sound.");
+ this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "ambient.weather.thunder", 10000.0F, 0.8F + rand.nextFloat() * 0.2F);
+ }
+ --this.lightningState;
+
+
+ if (this.lightningState >= 0)
+ {
+ Logger.INFO("Plasma Bolt - state >= 0.");
+ if (this.worldObj.isRemote)
+ {
+ Logger.INFO("Plasma Bolt - World is remote, resetting state to 2.");
+ this.worldObj.lastLightningBolt = 2;
+ }
+ else
+ {
+ Logger.INFO("Plasma Bolt - World is server side.");
+ double d0 = 3.0D;
+ List<Entity> list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, AxisAlignedBB.getBoundingBox(this.posX - d0, this.posY - d0, this.posZ - d0, this.posX + d0, this.posY + 6.0D + d0, this.posZ + d0));
+
+ for (int l = 0; l < list.size(); ++l)
+ {
+ Entity entity = list.get(l);
+ if (this.boltValidDamageTarget.getUniqueID().equals(entity.getUniqueID())){
+ if (!entity.getUniqueID().equals(boltOwnerID)){
+ Logger.INFO("Plasma Bolt - Hurting Entity.");
+ Logger.INFO("Plasma Bolt - "+entity.getCommandSenderName()+".");
+ //if (!net.minecraftforge.event.ForgeEventFactory.onEntityStruckByLightning(entity, this))
+ EntityUtils.doFireDamage(entity, 5);
+ EntityUtils.doDamage(entity, new DamageTeslaTower(entity), 20);
+ }
+ }
+ }
+
+ }
+ }
+
+ if (this.lightningState < 0)
+ {
+ Logger.INFO("Plasma Bolt - state < 0.");
+ if (this.boltLivingTime == 0)
+ {
+ Logger.INFO("Plasma Bolt - setting dead.");
+ this.setDead();
+ }
+ else if (this.lightningState < -rand.nextInt(10))
+ {
+ Logger.INFO("Plasma Bolt - dunno.");
+ --this.boltLivingTime;
+ this.lightningState = 1;
+ this.boltVertex = rand.nextLong();
+ //Puts fires out.
+ if (!this.worldObj.isRemote && this.worldObj.getGameRules().getGameRuleBooleanValue("doFireTick") && this.worldObj.doChunksNearChunkExist(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ), 10))
+ {
+ Logger.INFO("Plasma Bolt - Putting fires out [2].");
+ int i = MathHelper.floor_double(this.posX);
+ int j = MathHelper.floor_double(this.posY);
+ int k = MathHelper.floor_double(this.posZ);
+
+ if (this.worldObj.getBlock(i, j, k).getMaterial() == Material.fire)
+ {
+ this.worldObj.setBlock(i, j, k, Blocks.air);
+ }
+ }
+
+ }
+ }
+ }
+
+ protected void entityInit() {}
+
+ /**
+ * (abstract) Protected helper method to read subclass entity data from NBT.
+ */
+ protected void readEntityFromNBT(NBTTagCompound p_70037_1_) {}
+
+ /**
+ * (abstract) Protected helper method to write subclass entity data to NBT.
+ */
+ protected void writeEntityToNBT(NBTTagCompound p_70014_1_) {}
+} \ No newline at end of file
diff --git a/src/main/java/gtPlusPlus/core/entity/InternalEntityRegistry.java b/src/main/java/gtPlusPlus/core/entity/InternalEntityRegistry.java
new file mode 100644
index 0000000000..6b88d5775c
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/entity/InternalEntityRegistry.java
@@ -0,0 +1,96 @@
+package gtPlusPlus.core.entity;
+
+import cpw.mods.fml.common.registry.EntityRegistry;
+
+import gtPlusPlus.GTplusplus;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.australia.entity.type.EntityAustralianSpiderBase;
+import gtPlusPlus.australia.entity.type.EntityBoar;
+import gtPlusPlus.australia.entity.type.EntityDingo;
+import gtPlusPlus.australia.entity.type.EntityOctopus;
+import gtPlusPlus.core.entity.monster.EntityBatKing;
+import gtPlusPlus.core.entity.monster.EntityGiantChickenBase;
+import gtPlusPlus.core.entity.monster.EntitySickBlaze;
+import gtPlusPlus.core.entity.monster.EntityStaballoyConstruct;
+import gtPlusPlus.core.entity.projectile.EntityHydrofluoricAcidPotion;
+import gtPlusPlus.core.entity.projectile.EntityLightningAttack;
+import gtPlusPlus.core.entity.projectile.EntitySulfuricAcidPotion;
+import gtPlusPlus.core.entity.projectile.EntityThrowableBomb;
+import gtPlusPlus.core.entity.projectile.EntityToxinballSmall;
+import gtPlusPlus.core.item.general.spawn.ItemCustomSpawnEgg;
+import gtPlusPlus.core.util.Utils;
+
+public class InternalEntityRegistry {
+
+ static int mEntityID = 0;
+
+ public static void registerEntities(){
+ Logger.INFO("Registering GT++ Entities.");
+
+ //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);
+
+ //EntityRegistry.registerGlobalEntityID(EntitySulfuricAcidPotion.class, "throwablePotionSulfuric", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(200, 0, 200), Utils.rgbtoHexValue(125, 125, 125));
+ EntityRegistry.registerModEntity(EntitySulfuricAcidPotion.class, "throwablePotionSulfuric", mEntityID++, GTplusplus.instance, 64, 20, true);
+
+
+ //EntityRegistry.registerGlobalEntityID(EntityHydrofluoricAcidPotion.class, "throwablePotionHydrofluoric", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(0, 0, 0), Utils.rgbtoHexValue(255, 255, 255));
+ EntityRegistry.registerModEntity(EntityHydrofluoricAcidPotion.class, "throwablePotionHydrofluoric", mEntityID++, GTplusplus.instance, 64, 20, true);
+
+
+ //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);
+
+
+ //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);
+ ItemCustomSpawnEgg.registerEntityForSpawnEgg(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);
+ ItemCustomSpawnEgg.registerEntityForSpawnEgg(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);
+
+ EntityRegistry.registerModEntity(EntityThrowableBomb.class, "EntityThrowableBomb", mEntityID++, GTplusplus.instance, 64, 10, true);
+
+ EntityRegistry.registerModEntity(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);
+ 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);
+ ItemCustomSpawnEgg.registerEntityForSpawnEgg(3, "batKing", Utils.rgbtoHexValue(175, 175, 0), Utils.rgbtoHexValue(0, 175, 175));
+ //EntityRegistry.registerModEntity(EntityGiantChickenBase.class, "bigChickenFriendly", mEntityID++, GTplusplus.instance, 64, 20, true);
+
+
+
+
+
+ //Australia
+ EntityRegistry.registerModEntity(EntityAustralianSpiderBase.class, "AusSpider", mEntityID++, GTplusplus.instance, 64, 20, true);
+ ItemCustomSpawnEgg.registerEntityForSpawnEgg(30, "AusSpider", Utils.rgbtoHexValue(125, 0, 125), Utils.rgbtoHexValue(175, 175, 175));
+ EntityRegistry.registerModEntity(EntityBoar.class, "AusBoar", mEntityID++, GTplusplus.instance, 64, 20, true);
+ ItemCustomSpawnEgg.registerEntityForSpawnEgg(31, "AusBoar", Utils.rgbtoHexValue(75, 75, 0), Utils.rgbtoHexValue(175, 175, 75));
+ EntityRegistry.registerModEntity(EntityDingo.class, "AusDingo", mEntityID++, GTplusplus.instance, 64, 20, true);
+ ItemCustomSpawnEgg.registerEntityForSpawnEgg(32, "AusDingo", Utils.rgbtoHexValue(175, 125, 0), Utils.rgbtoHexValue(175, 75, 175));
+ EntityRegistry.registerModEntity(EntityOctopus.class, "AusOctopus", mEntityID++, GTplusplus.instance, 32, 20, true);
+ ItemCustomSpawnEgg.registerEntityForSpawnEgg(33, "AusOctopus", Utils.rgbtoHexValue(150, 50, 150), Utils.rgbtoHexValue(75, 175, 175));
+ //EntityRegistry.registerGlobalEntityID(EntityAustralianSpiderBase.class, "AusSpider", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(255, 0, 0), Utils.rgbtoHexValue(175, 175, 175));
+ //EntityRegistry.registerGlobalEntityID(EntityBoar.class, "AusBoar", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(255, 0, 0), Utils.rgbtoHexValue(175, 175, 175));
+ //EntityRegistry.registerGlobalEntityID(EntityDingo.class, "AusDingo", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(255, 0, 0), Utils.rgbtoHexValue(175, 175, 175));
+ //EntityRegistry.registerGlobalEntityID(EntityOctopus.class, "AusOctopus", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(255, 0, 0), Utils.rgbtoHexValue(175, 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
new file mode 100644
index 0000000000..52d1d6100c
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/entity/ai/batking/EntityAIBatKingAttack.java
@@ -0,0 +1,406 @@
+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;
+import net.minecraft.pathfinding.PathEntity;
+import net.minecraft.pathfinding.PathPoint;
+import net.minecraft.util.MathHelper;
+
+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. */
+ private final EntityBatKing mAttackingEntity;
+
+ /** The PathEntity of our entity. */
+ private PathEntity mEntityPathEntity;
+
+ /** 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) {
+ mRangedAI = new Ranged(this, aMovementSpeed, someInt, 5, someFloat);
+ mMeleeAI = new Melee(this, aClassTarget, aMovementSpeed, aLongMemory);
+ mAttackingEntity = aAttacker;
+ mClassTarget = aClassTarget;
+ }