diff --git a/assets/hbm/lang/de_DE.lang b/assets/hbm/lang/de_DE.lang index 114e7dbb5..d8534a518 100644 --- a/assets/hbm/lang/de_DE.lang +++ b/assets/hbm/lang/de_DE.lang @@ -838,6 +838,8 @@ item.rod_quad_waste.name=Vierfacher Atommüllstab item.gun_rpg.name=Raketenwerfer item.gun_rpg_ammo.name=Rakete +item.gun_stinger.name=FIM-92 Stinger +item.gun_stinger_ammo.name=Stinger-Rakete item.flame_pony.name=Bild eines Cartoon Ponys item.flame_conspiracy.name=Verschwörungstheorie diff --git a/assets/hbm/lang/en_US.lang b/assets/hbm/lang/en_US.lang index b45207b3e..85ae65283 100644 --- a/assets/hbm/lang/en_US.lang +++ b/assets/hbm/lang/en_US.lang @@ -841,6 +841,8 @@ item.rod_quad_waste.name=Nuclear Waste Quad Rod item.gun_rpg.name=Rocket Launcher item.gun_rpg_ammo.name=Rocket +item.gun_stinger.name=FIM-92 Stinger +item.gun_stinger_ammo.name=Stinger Rocket item.flame_pony.name=Painting of a Cartoon Pony item.flame_conspiracy.name=Conspiracy Theory diff --git a/assets/hbm/textures/items/gun_stinger.png b/assets/hbm/textures/items/gun_stinger.png new file mode 100644 index 000000000..efa3f726e Binary files /dev/null and b/assets/hbm/textures/items/gun_stinger.png differ diff --git a/assets/hbm/textures/items/gun_stinger_ammo.png b/assets/hbm/textures/items/gun_stinger_ammo.png new file mode 100644 index 000000000..132e23ffe Binary files /dev/null and b/assets/hbm/textures/items/gun_stinger_ammo.png differ diff --git a/assets/hbm/textures/models/ModelSRocket.png b/assets/hbm/textures/models/ModelSRocket.png new file mode 100644 index 000000000..2cd7d1ddf Binary files /dev/null and b/assets/hbm/textures/models/ModelSRocket.png differ diff --git a/assets/hbm/textures/models/ModelStinger.png b/assets/hbm/textures/models/ModelStinger.png new file mode 100644 index 000000000..c296d5f79 Binary files /dev/null and b/assets/hbm/textures/models/ModelStinger.png differ diff --git a/com/hbm/entity/projectile/EntityRocketHoming.java b/com/hbm/entity/projectile/EntityRocketHoming.java new file mode 100644 index 000000000..f4bdb787f --- /dev/null +++ b/com/hbm/entity/projectile/EntityRocketHoming.java @@ -0,0 +1,722 @@ +package com.hbm.entity.projectile; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.hbm.entity.particle.EntityDSmokeFX; +import com.hbm.entity.particle.EntityGasFX; +import com.hbm.entity.particle.EntityOilSpillFX; +import com.hbm.entity.particle.EntitySSmokeFX; +import com.hbm.entity.particle.EntityTSmokeFX; +import com.hbm.explosion.ExplosionLarge; +import com.hbm.items.ModItems; +import com.hbm.lib.Library; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IProjectile; +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +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; + +public class EntityRocketHoming extends Entity implements IProjectile +{ + private int field_145791_d = -1; + private int field_145792_e = -1; + private int field_145789_f = -1; + public double gravity = 0.0D; + private Block field_145790_g; + private int inData; + private boolean inGround; + public int canBePickedUp; + public int arrowShake; + public Entity shootingEntity; + private int ticksInGround; + private int ticksInAir; + private double damage = 2.0D; + private int knockbackStrength; + private static final String __OBFID = "CL_00001715"; + + + public EntityRocketHoming(World p_i1753_1_) + { + super(p_i1753_1_); + this.renderDistanceWeight = 10.0D; + this.setSize(0.5F, 0.5F); + } + + public EntityRocketHoming(World p_i1754_1_, double p_i1754_2_, double p_i1754_4_, double p_i1754_6_) + { + super(p_i1754_1_); + this.renderDistanceWeight = 10.0D; + this.setSize(0.5F, 0.5F); + this.setPosition(p_i1754_2_, p_i1754_4_, p_i1754_6_); + this.yOffset = 0.0F; + } + + public EntityRocketHoming(World p_i1755_1_, EntityLivingBase p_i1755_2_, EntityLivingBase p_i1755_3_, float p_i1755_4_, float p_i1755_5_) + { + super(p_i1755_1_); + this.renderDistanceWeight = 10.0D; + this.shootingEntity = p_i1755_2_; + + if (p_i1755_2_ instanceof EntityPlayer) + { + this.canBePickedUp = 1; + } + + this.posY = p_i1755_2_.posY + p_i1755_2_.getEyeHeight() - 0.10000000149011612D; + double d0 = p_i1755_3_.posX - p_i1755_2_.posX; + double d1 = p_i1755_3_.boundingBox.minY + p_i1755_3_.height / 3.0F - this.posY; + double d2 = p_i1755_3_.posZ - p_i1755_2_.posZ; + double d3 = MathHelper.sqrt_double(d0 * d0 + d2 * d2); + + if (d3 >= 1.0E-7D) + { + float f2 = (float)(Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F; + float f3 = (float)(-(Math.atan2(d1, d3) * 180.0D / Math.PI)); + double d4 = d0 / d3; + double d5 = d2 / d3; + this.setLocationAndAngles(p_i1755_2_.posX + d4, this.posY, p_i1755_2_.posZ + d5, f2, f3); + this.yOffset = 0.0F; + float f4 = (float)d3 * 0.2F; + this.setThrowableHeading(d0, d1 + f4, d2, p_i1755_4_, p_i1755_5_); + } + } + + public EntityRocketHoming(World p_i1756_1_, EntityLivingBase p_i1756_2_, float p_i1756_3_) + { + super(p_i1756_1_); + this.renderDistanceWeight = 10.0D; + this.shootingEntity = p_i1756_2_; + + if (p_i1756_2_ instanceof EntityPlayer) + { + this.canBePickedUp = 1; + } + + this.setSize(0.5F, 0.5F); + this.setLocationAndAngles(p_i1756_2_.posX, p_i1756_2_.posY + p_i1756_2_.getEyeHeight(), p_i1756_2_.posZ, p_i1756_2_.rotationYaw, p_i1756_2_.rotationPitch); + this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F; + this.posY -= 0.10000000149011612D; + this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F; + this.setPosition(this.posX, this.posY, this.posZ); + this.yOffset = 0.0F; + this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI); + this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI); + this.motionY = (-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI)); + this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, p_i1756_3_ * 1.5F, 1.0F); + } + + public EntityRocketHoming(World world, int x, int y, int z, double mx, double my, double mz, double grav) { + super(world); + this.posX = x + 0.5F; + this.posY = y + 0.5F; + this.posZ = z + 0.5F; + + this.motionX = mx; + this.motionY = my; + this.motionZ = mz; + + this.gravity = grav; + } + + @Override + protected void entityInit() + { + this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); + } + + /** + * Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction. + */ + @Override + public void setThrowableHeading(double p_70186_1_, double p_70186_3_, double p_70186_5_, float p_70186_7_, float p_70186_8_) + { + float f2 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_3_ * p_70186_3_ + p_70186_5_ * p_70186_5_); + p_70186_1_ /= f2; + p_70186_3_ /= f2; + p_70186_5_ /= f2; + p_70186_1_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * p_70186_8_; + p_70186_3_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * p_70186_8_; + p_70186_5_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * p_70186_8_; + p_70186_1_ *= p_70186_7_; + p_70186_3_ *= p_70186_7_; + p_70186_5_ *= p_70186_7_; + this.motionX = p_70186_1_; + this.motionY = p_70186_3_; + this.motionZ = p_70186_5_; + float f3 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_5_ * p_70186_5_); + this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70186_1_, p_70186_5_) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70186_3_, f3) * 180.0D / Math.PI); + this.ticksInGround = 0; + } + + /** + * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, + * posY, posZ, yaw, pitch + */ + @Override + @SideOnly(Side.CLIENT) + public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, float p_70056_8_, int p_70056_9_) + { + this.setPosition(p_70056_1_, p_70056_3_, p_70056_5_); + this.setRotation(p_70056_7_, p_70056_8_); + } + + /** + * Sets the velocity to the args. Args: x, y, z + */ + @Override + @SideOnly(Side.CLIENT) + public void setVelocity(double p_70016_1_, double p_70016_3_, 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) + { + 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); + this.prevRotationPitch = this.rotationPitch; + this.prevRotationYaw = this.rotationYaw; + this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + this.ticksInGround = 0; + } + } + + /** + * Called to update the entity's position/logic. + */ + //@Override + @Override + public void onUpdate() + { + super.onUpdate(); + + 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, (double)f) * 180.0D / Math.PI); + } + + Block block = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f); + + if (block.getMaterial() != Material.air) + { + block.setBlockBoundsBasedOnState(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f); + AxisAlignedBB axisalignedbb = block.getCollisionBoundingBoxFromPool(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f); + + if (axisalignedbb != null && axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ))) + { + this.inGround = true; + } + } + + if (this.arrowShake > 0) + { + --this.arrowShake; + } + + if (this.inGround) + { + /*int j = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f); + + if (block == this.field_145790_g && j == this.inData) + { + ++this.ticksInGround; + + if (this.ticksInGround == 1200) + { + this.setDead(); + } + } + else + { + this.inGround = false; + this.motionX *= (double)(this.rand.nextFloat() * 0.2F); + this.motionY *= (double)(this.rand.nextFloat() * 0.2F); + this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); + this.ticksInGround = 0; + this.ticksInAir = 0; + }*/ + + + if (!this.worldObj.isRemote) + { + //this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 2.5F, true); + ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, false, true); + /*EntityNukeExplosionAdvanced explosion = new EntityNukeExplosionAdvanced(this.worldObj); + explosion.speed = 25; + explosion.coefficient = 5.0F; + explosion.destructionRange = 20; + explosion.posX = this.posX; + explosion.posY = this.posY; + explosion.posZ = this.posZ; + this.worldObj.spawnEntityInWorld(explosion);*/ + } + if (!this.worldObj.isRemote) + { + //this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 2.5F, true); + ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, false, true); + } + this.setDead(); + } + else + { + ++this.ticksInAir; + 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 movingobjectposition = 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 (movingobjectposition != null) + { + vec3 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); + } + + Entity entity = null; + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double d0 = 0.0D; + int i; + float f1; + + for (i = 0; i < list.size(); ++i) + { + Entity entity1 = (Entity)list.get(i); + + if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) + { + f1 = 0.3F; + AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand(f1, f1, f1); + MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec31, vec3); + + if (movingobjectposition1 != null) + { + double d1 = vec31.distanceTo(movingobjectposition1.hitVec); + + if (d1 < d0 || d0 == 0.0D) + { + entity = entity1; + d0 = d1; + } + } + } + } + + if (entity != null) + { + movingobjectposition = new MovingObjectPosition(entity); + } + + if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer) + { + EntityPlayer entityplayer = (EntityPlayer)movingobjectposition.entityHit; + + if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).canAttackPlayer(entityplayer)) + { + movingobjectposition = null; + } + } + + float f2; + float f4; + + if (movingobjectposition != null) + { + if (movingobjectposition.entityHit != null) + { + f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + int k = MathHelper.ceiling_double_int(f2 * this.damage); + + if (this.getIsCritical()) + { + k += this.rand.nextInt(k / 2 + 2); + } + + DamageSource damagesource = null; + + if (this.shootingEntity == null) + { + damagesource = DamageSource.causeIndirectMagicDamage(this, this); + } + else + { + damagesource = DamageSource.causeIndirectMagicDamage(this, this); + } + + if (this.isBurning() && !(movingobjectposition.entityHit instanceof EntityEnderman)) + { + movingobjectposition.entityHit.setFire(5); + } + + if (movingobjectposition.entityHit.attackEntityFrom(damagesource, k)) + { + if (movingobjectposition.entityHit instanceof EntityLivingBase) + { + EntityLivingBase entitylivingbase = (EntityLivingBase)movingobjectposition.entityHit; + + if (this.knockbackStrength > 0) + { + f4 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + + if (f4 > 0.0F) + { + movingobjectposition.entityHit.addVelocity(this.motionX * this.knockbackStrength * 0.6000000238418579D / f4, 0.1D, this.motionZ * this.knockbackStrength * 0.6000000238418579D / f4); + } + } + + if (this.shootingEntity != null && this.shootingEntity instanceof EntityLivingBase) + { + EnchantmentHelper.func_151384_a(entitylivingbase, this.shootingEntity); + EnchantmentHelper.func_151385_b((EntityLivingBase)this.shootingEntity, entitylivingbase); + } + + if (this.shootingEntity != null && movingobjectposition.entityHit != this.shootingEntity && movingobjectposition.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP) + { + ((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(6, 0.0F)); + } + } + + if (!(movingobjectposition.entityHit instanceof EntityEnderman)) + { + if (!this.worldObj.isRemote) + { + //this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 2.5F, true); + ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, false, true); + } + this.setDead(); + } + } + else + { + if (!this.worldObj.isRemote) + { + //this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 2.5F, true); + ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, false, true); + } + this.setDead(); + } + } + else + { + this.field_145791_d = movingobjectposition.blockX; + this.field_145792_e = movingobjectposition.blockY; + this.field_145789_f = movingobjectposition.blockZ; + this.field_145790_g = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f); + this.inData = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f); + this.motionX = ((float)(movingobjectposition.hitVec.xCoord - this.posX)); + this.motionY = ((float)(movingobjectposition.hitVec.yCoord - this.posY)); + this.motionZ = ((float)(movingobjectposition.hitVec.zCoord - this.posZ)); + f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + this.posX -= this.motionX / f2 * 0.05000000074505806D; + this.posY -= this.motionY / f2 * 0.05000000074505806D; + this.posZ -= this.motionZ / f2 * 0.05000000074505806D; + this.inGround = true; + this.arrowShake = 7; + this.setIsCritical(false); + + if (this.field_145790_g.getMaterial() != Material.air) + { + this.field_145790_g.onEntityCollidedWithBlock(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f, this); + } + } + } + + if (true) + { + //for (i = 0; i < 4; ++i) + { + //this.worldObj.spawnParticle("cloud", this.posX, this.posY, this.posZ, /*0, 0, 0 this.posX + this.motionX * (double)i / 4.0D, this.posY + this.motionY * (double)i / 4.0D, this.posZ + this.motionZ * (double)i / 4.0D,*/ -this.motionX/4, -this.motionY/4, -this.motionZ/4); + if(!worldObj.isRemote && this.ticksExisted > 1) + this.worldObj.spawnEntityInWorld(new EntityTSmokeFX(worldObj, this.posX, this.posY, this.posZ, 0, 0, 0)); + } + } + + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + f2 = 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, (double)f2) * 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; + float f3 = 0.99F; + f1 = 0.05F; + + if (this.isInWater()) + { + for (int l = 0; l < 4; ++l) + { + f4 = 0.25F; + this.worldObj.spawnParticle("bubble", this.posX - this.motionX * f4, this.posY - this.motionY * f4, this.posZ - this.motionZ * f4, this.motionX, this.motionY, this.motionZ); + } + + f3 = 0.8F; + } + + if (this.isWet()) + { + this.extinguish(); + } + + /*this.motionX *= f3; + this.motionY *= f3; + this.motionZ *= f3;*/ + //this.motionY -= gravity; + this.setPosition(this.posX, this.posY, this.posZ); + this.func_145775_I(); + } + + steer(); + + if (this.ticksExisted > 250) + this.setDead(); + } + + int homingRadius = 35; + int homingMod = 15; + float acceptance = 120; + + private void steer() { + List all = worldObj.getEntitiesWithinAABBExcludingEntity(this, AxisAlignedBB.getBoundingBox(posX - homingRadius, posY - homingRadius, posZ - homingRadius, posX + homingRadius, posY + homingRadius, posZ + homingRadius)); + HashMap targetable = new HashMap(); + Vec3 path = Vec3.createVectorHelper(motionX, motionY, motionZ); + double startSpeed = path.lengthVector(); + path.normalize(); + + if(all.isEmpty()) + return; + + //Iterate through all entities and only allocate ones that can be targeted + for(Entity e : all) { + Vec3 rel = Vec3.createVectorHelper(e.posX - posX, e.posY + e.getEyeHeight() - posY, e.posZ - posZ); + double vecProd = rel.xCoord * path.xCoord + rel.yCoord * path.yCoord + rel.zCoord * path.zCoord; + double bot = rel.lengthVector() * path.lengthVector(); + double angle = Math.acos(vecProd / bot) * 180 / Math.PI; + + if(angle <= acceptance); + if(e.height * e.width * e.width >= 0.5D) + if(!Library.isObstructed(worldObj, e.posX, e.posY, e.posZ, posX, posY, posZ)) + targetable.put(e, angle); + } + + if(targetable.isEmpty()) + return; + + double smallest = Double.POSITIVE_INFINITY; + Entity nearestE = null; + + //Iterate through all entities and choose the one that has the smallest angle + for(Map.Entry entry : targetable.entrySet()) { + if(entry.getValue() < smallest) { + smallest = entry.getValue(); + nearestE = entry.getKey(); + } + } + + if(nearestE == null) + return; + + Vec3 winVec = Vec3.createVectorHelper(nearestE.posX - posX, nearestE.posY - posY, nearestE.posZ - posZ); + + winVec.normalize(); + + double newX = ((path.xCoord * (smallest * homingMod - 1)) + winVec.xCoord) / (smallest * homingMod); + double newY = ((path.yCoord * (smallest * homingMod - 1)) + winVec.yCoord) / (smallest * homingMod); + double newZ = ((path.zCoord * (smallest * homingMod - 1)) + winVec.zCoord) / (smallest * homingMod); + + Vec3 newPath = Vec3.createVectorHelper(newX, newY, newZ); + newPath.normalize(); + newPath.xCoord *= startSpeed; + newPath.yCoord *= startSpeed; + newPath.zCoord *= startSpeed; + + motionX = newPath.xCoord; + motionY = newPath.yCoord; + motionZ = newPath.zCoord; + this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, (float)startSpeed, 0.0F); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + @Override + public void writeEntityToNBT(NBTTagCompound p_70014_1_) + { + p_70014_1_.setShort("xTile", (short)this.field_145791_d); + p_70014_1_.setShort("yTile", (short)this.field_145792_e); + p_70014_1_.setShort("zTile", (short)this.field_145789_f); + p_70014_1_.setShort("life", (short)this.ticksInGround); + p_70014_1_.setByte("inTile", (byte)Block.getIdFromBlock(this.field_145790_g)); + p_70014_1_.setByte("inData", (byte)this.inData); + p_70014_1_.setByte("shake", (byte)this.arrowShake); + p_70014_1_.setByte("inGround", (byte)(this.inGround ? 1 : 0)); + p_70014_1_.setByte("pickup", (byte)this.canBePickedUp); + p_70014_1_.setDouble("damage", this.damage); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + @Override + public void readEntityFromNBT(NBTTagCompound p_70037_1_) + { + this.field_145791_d = p_70037_1_.getShort("xTile"); + this.field_145792_e = p_70037_1_.getShort("yTile"); + this.field_145789_f = p_70037_1_.getShort("zTile"); + this.ticksInGround = p_70037_1_.getShort("life"); + this.field_145790_g = Block.getBlockById(p_70037_1_.getByte("inTile") & 255); + this.inData = p_70037_1_.getByte("inData") & 255; + this.arrowShake = p_70037_1_.getByte("shake") & 255; + this.inGround = p_70037_1_.getByte("inGround") == 1; + + if (p_70037_1_.hasKey("damage", 99)) + { + this.damage = p_70037_1_.getDouble("damage"); + } + + if (p_70037_1_.hasKey("pickup", 99)) + { + this.canBePickedUp = p_70037_1_.getByte("pickup"); + } + else if (p_70037_1_.hasKey("player", 99)) + { + this.canBePickedUp = p_70037_1_.getBoolean("player") ? 1 : 0; + } + } + + /** + * Called by a player entity when they collide with an entity + */ + @Override + public void onCollideWithPlayer(EntityPlayer p_70100_1_) + { + if (!this.worldObj.isRemote && this.inGround && this.arrowShake <= 0) + { + boolean flag = this.canBePickedUp == 1 || this.canBePickedUp == 2 && p_70100_1_.capabilities.isCreativeMode; + + if (this.canBePickedUp == 1 && !p_70100_1_.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_rpg_ammo, 1))) + { + flag = false; + } + + if (flag) + { + p_70100_1_.onItemPickup(this, 1); + this.setDead(); + } + } + } + + /** + * 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; + } + + @Override + @SideOnly(Side.CLIENT) + public float getShadowSize() + { + return 0.0F; + } + + public void setDamage(double p_70239_1_) + { + this.damage = p_70239_1_; + } + + public double getDamage() + { + return this.damage; + } + + /** + * Sets the amount of knockback the arrow applies when it hits a mob. + */ + public void setKnockbackStrength(int p_70240_1_) + { + this.knockbackStrength = p_70240_1_; + } + + /** + * If returns false, the item will not inflict any damage against entities. + */ + @Override + public boolean canAttackWithItem() + { + return false; + } + + /** + * Whether the arrow has a stream of critical hit particles flying behind it. + */ + public void setIsCritical(boolean p_70243_1_) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (p_70243_1_) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 1))); + } + else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -2))); + } + } + + /** + * Whether the arrow has a stream of critical hit particles flying behind it. + */ + public boolean getIsCritical() + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + return (b0 & 1) != 0; + } +} \ No newline at end of file diff --git a/com/hbm/inventory/MachineRecipes.java b/com/hbm/inventory/MachineRecipes.java index ea78113a8..201910c38 100644 --- a/com/hbm/inventory/MachineRecipes.java +++ b/com/hbm/inventory/MachineRecipes.java @@ -3859,6 +3859,22 @@ public class MachineRecipes { case OIL_SAND: list.add(new ItemStack(ModBlocks.ore_oil_sand, 16)); break; + case DYN_SCHRAB: + list.add(new ItemStack(ModItems.dynosphere_desh_charged, 3)); + list.add(new ItemStack(ModItems.ingot_uranium, 1)); + list.add(new ItemStack(ModItems.catalyst_clay, 8)); + break; + case DYN_EUPH: + list.add(new ItemStack(ModItems.dynosphere_schrabidium_charged, 1)); + list.add(new ItemStack(ModItems.ingot_plutonium, 1)); + list.add(new ItemStack(ModItems.catalyst_clay, 16)); + break; + case DYN_DNT: + list.add(new ItemStack(ModItems.dynosphere_euphemium_charged, 2)); + list.add(new ItemStack(ModItems.powder_spark_mix, 1)); + list.add(new ItemStack(ModItems.ingot_starmetal, 1)); + list.add(new ItemStack(ModItems.catalyst_clay, 32)); + break; default: break; } @@ -4127,6 +4143,15 @@ public class MachineRecipes { case YELLOWCAKE: output[0] = new ItemStack(ModItems.powder_yellowcake, 1); break; + case DYN_SCHRAB: + output[0] = new ItemStack(ModItems.ingot_schrabidium, 1); + break; + case DYN_EUPH: + output[0] = new ItemStack(ModItems.ingot_euphemium, 1); + break; + case DYN_DNT: + output[0] = new ItemStack(ModItems.ingot_dineutronium, 1); + break; default: break; } @@ -4228,6 +4253,15 @@ public class MachineRecipes { case OIL_SAND: input[0] = new FluidStack(1000, FluidType.BITUMEN); break; + case DYN_SCHRAB: + input[0] = new FluidStack(50, FluidType.WATZ); + break; + case DYN_EUPH: + input[0] = new FluidStack(100, FluidType.WATZ); + break; + case DYN_DNT: + input[0] = new FluidStack(150, FluidType.WATZ); + break; default: break; } diff --git a/com/hbm/items/ModItems.java b/com/hbm/items/ModItems.java index 8d623fe84..2fc2af3e0 100644 --- a/com/hbm/items/ModItems.java +++ b/com/hbm/items/ModItems.java @@ -656,9 +656,11 @@ public class ModItems { public static Item missile_exo; public static Item missile_doomsday; public static Item missile_taint; - + public static Item gun_rpg; public static Item gun_rpg_ammo; + public static Item gun_stinger; + public static Item gun_stinger_ammo; public static Item gun_revolver; public static Item gun_revolver_ammo; public static Item gun_revolver_iron; @@ -1753,6 +1755,8 @@ public class ModItems { gun_rpg = new GunRpg().setUnlocalizedName("gun_rpg").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_rpg_new"); gun_rpg_ammo = new Item().setUnlocalizedName("gun_rpg_ammo").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_rpg_ammo_new"); + gun_stinger = new GunStinger().setUnlocalizedName("gun_stinger").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_stinger"); + gun_stinger_ammo = new Item().setUnlocalizedName("gun_stinger_ammo").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_stinger_ammo"); gun_revolver_ammo = new Item().setUnlocalizedName("gun_revolver_ammo").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_revolver_ammo"); gun_revolver = new GunRevolver(gun_revolver_ammo, 10, 25, false, false).setMaxDamage(500).setUnlocalizedName("gun_revolver").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_revolver"); gun_revolver_iron_ammo = new Item().setUnlocalizedName("gun_revolver_iron_ammo").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_revolver_iron_ammo"); @@ -1927,13 +1931,13 @@ public class ModItems { dynosphere_base = new Item().setUnlocalizedName("dynosphere_base").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":dynosphere_base"); dynosphere_desh = new ItemBattery(10000L).setUnlocalizedName("dynosphere_desh").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":dynosphere_desh"); - dynosphere_desh_charged = new Item().setUnlocalizedName("dynosphere_desh_charged").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":dynosphere_desh_charged"); + dynosphere_desh_charged = new Item().setUnlocalizedName("dynosphere_desh_charged").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":dynosphere_desh_charged"); dynosphere_schrabidium = new ItemBattery(1000000L).setUnlocalizedName("dynosphere_schrabidium").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":dynosphere_schrabidium"); - dynosphere_schrabidium_charged = new Item().setUnlocalizedName("dynosphere_schrabidium_charged").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":dynosphere_schrabidium_charged"); + dynosphere_schrabidium_charged = new Item().setUnlocalizedName("dynosphere_schrabidium_charged").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":dynosphere_schrabidium_charged"); dynosphere_euphemium = new ItemBattery(100000000L).setUnlocalizedName("dynosphere_euphemium").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":dynosphere_euphemium"); - dynosphere_euphemium_charged = new Item().setUnlocalizedName("dynosphere_euphemium_charged").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":dynosphere_euphemium_charged"); + dynosphere_euphemium_charged = new Item().setUnlocalizedName("dynosphere_euphemium_charged").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":dynosphere_euphemium_charged"); dynosphere_dineutronium = new ItemBattery(10000000000L).setUnlocalizedName("dynosphere_dineutronium").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":dynosphere_dineutronium"); - dynosphere_dineutronium_charged = new Item().setUnlocalizedName("dynosphere_dineutronium_charged").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":dynosphere_dineutronium_charged"); + dynosphere_dineutronium_charged = new Item().setUnlocalizedName("dynosphere_dineutronium_charged").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":dynosphere_dineutronium_charged"); factory_core_titanium = new ItemBattery(70400).setUnlocalizedName("factory_core_titanium").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":factory_core_titanium"); factory_core_advanced = new ItemBattery(41600).setUnlocalizedName("factory_core_advanced").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":factory_core_advanced"); @@ -3019,6 +3023,7 @@ public class ModItems { GameRegistry.registerItem(gun_revolver_pip, gun_revolver_pip.getUnlocalizedName()); GameRegistry.registerItem(gun_b92, gun_b92.getUnlocalizedName()); GameRegistry.registerItem(gun_rpg, gun_rpg.getUnlocalizedName()); + GameRegistry.registerItem(gun_stinger, gun_stinger.getUnlocalizedName()); GameRegistry.registerItem(gun_fatman, gun_fatman.getUnlocalizedName()); GameRegistry.registerItem(gun_mirv, gun_mirv.getUnlocalizedName()); GameRegistry.registerItem(gun_bf, gun_bf.getUnlocalizedName()); @@ -3060,6 +3065,7 @@ public class ModItems { GameRegistry.registerItem(gun_revolver_pip_ammo, gun_revolver_pip_ammo.getUnlocalizedName()); GameRegistry.registerItem(gun_b92_ammo, gun_b92_ammo.getUnlocalizedName()); GameRegistry.registerItem(gun_rpg_ammo, gun_rpg_ammo.getUnlocalizedName()); + GameRegistry.registerItem(gun_stinger_ammo, gun_stinger_ammo.getUnlocalizedName()); GameRegistry.registerItem(gun_fatman_ammo, gun_fatman_ammo.getUnlocalizedName()); GameRegistry.registerItem(gun_mirv_ammo, gun_mirv_ammo.getUnlocalizedName()); GameRegistry.registerItem(gun_bf_ammo, gun_bf_ammo.getUnlocalizedName()); diff --git a/com/hbm/items/tool/ItemChemistryTemplate.java b/com/hbm/items/tool/ItemChemistryTemplate.java index a288d54f8..83e17e072 100644 --- a/com/hbm/items/tool/ItemChemistryTemplate.java +++ b/com/hbm/items/tool/ItemChemistryTemplate.java @@ -72,7 +72,10 @@ public class ItemChemistryTemplate extends Item { YELLOWCAKE, UF6, PUF6, - SAS3; + SAS3, + DYN_SCHRAB, + DYN_EUPH, + DYN_DNT; public static EnumChemistryTemplate getEnum(int i) { if(i < EnumChemistryTemplate.values().length) @@ -220,6 +223,12 @@ public class ItemChemistryTemplate extends Item { return 150; case SAS3: return 200; + case DYN_SCHRAB: + return 1*60*20; + case DYN_EUPH: + return 3*60*20; + case DYN_DNT: + return 5*60*20; default: return 100; } diff --git a/com/hbm/items/weapon/GunRpg.java b/com/hbm/items/weapon/GunRpg.java index 18a8af87a..da5243c14 100644 --- a/com/hbm/items/weapon/GunRpg.java +++ b/com/hbm/items/weapon/GunRpg.java @@ -22,132 +22,118 @@ import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.ArrowLooseEvent; import net.minecraftforge.event.entity.player.ArrowNockEvent; -public class GunRpg extends Item -{ - public static final String[] bowPullIconNameArray = new String[] {"pulling_0", "pulling_1", "pulling_2"}; - @SideOnly(Side.CLIENT) - private IIcon[] iconArray; - private static final String __OBFID = "CL_00001777"; +public class GunRpg extends Item { + public static final String[] bowPullIconNameArray = new String[] { "pulling_0", "pulling_1", "pulling_2" }; + @SideOnly(Side.CLIENT) + private IIcon[] iconArray; + private static final String __OBFID = "CL_00001777"; - public GunRpg() - { - this.maxStackSize = 1; - this.setMaxDamage(500); - } + public GunRpg() { + this.maxStackSize = 1; + this.setMaxDamage(500); + } - /** - * called when the player releases the use item button. Args: itemstack, world, entityplayer, itemInUseCount - */ - @Override - public void onPlayerStoppedUsing(ItemStack p_77615_1_, World p_77615_2_, EntityPlayer p_77615_3_, int p_77615_4_) - { - int j = this.getMaxItemUseDuration(p_77615_1_) - p_77615_4_; + /** + * called when the player releases the use item button. Args: itemstack, + * world, entityplayer, itemInUseCount + */ + @Override + public void onPlayerStoppedUsing(ItemStack p_77615_1_, World p_77615_2_, EntityPlayer p_77615_3_, int p_77615_4_) { + int j = this.getMaxItemUseDuration(p_77615_1_) - p_77615_4_; - ArrowLooseEvent event = new ArrowLooseEvent(p_77615_3_, p_77615_1_, j); - MinecraftForge.EVENT_BUS.post(event); - if (event.isCanceled()) - { - return; - } - j = event.charge; + ArrowLooseEvent event = new ArrowLooseEvent(p_77615_3_, p_77615_1_, j); + MinecraftForge.EVENT_BUS.post(event); + if (event.isCanceled()) { + return; + } + j = event.charge; - boolean flag = p_77615_3_.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, p_77615_1_) > 0; + boolean flag = p_77615_3_.capabilities.isCreativeMode + || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, p_77615_1_) > 0; - if (flag || p_77615_3_.inventory.hasItem(ModItems.gun_rpg_ammo)) - { - float f = j / 20.0F; - f = (f * f + f * 2.0F) / 3.0F; + if (flag || p_77615_3_.inventory.hasItem(ModItems.gun_rpg_ammo)) { + float f = j / 20.0F; + f = (f * f + f * 2.0F) / 3.0F; - if (j < 25.0D) - { - return; - } + if (j < 25.0D) { + return; + } - if (j > 25.0F) - { - f = 25.0F; - } + if (j > 25.0F) { + f = 25.0F; + } - EntityRocket entityarrow = new EntityRocket(p_77615_2_, p_77615_3_, 3.0F); + EntityRocket entityarrow = new EntityRocket(p_77615_2_, p_77615_3_, 3.0F); - if (f == 1.0F) - { - entityarrow.setIsCritical(true); - } + if (f == 1.0F) { + entityarrow.setIsCritical(true); + } - p_77615_1_.damageItem(1, p_77615_3_); - p_77615_2_.playSoundAtEntity(p_77615_3_, "hbm:weapon.rpgShoot", 1.0F, 0.25F); + p_77615_1_.damageItem(1, p_77615_3_); + p_77615_2_.playSoundAtEntity(p_77615_3_, "hbm:weapon.rpgShoot", 1.0F, 0.25F); - if (flag) - { - entityarrow.canBePickedUp = 2; - } - else - { - p_77615_3_.inventory.consumeInventoryItem(ModItems.gun_rpg_ammo); - } + if (flag) { + entityarrow.canBePickedUp = 2; + } else { + p_77615_3_.inventory.consumeInventoryItem(ModItems.gun_rpg_ammo); + } - if (!p_77615_2_.isRemote) - { - entityarrow.canBePickedUp = 2; - p_77615_2_.spawnEntityInWorld(entityarrow); - } - } - } + if (!p_77615_2_.isRemote) { + entityarrow.canBePickedUp = 2; + p_77615_2_.spawnEntityInWorld(entityarrow); + } + } + } - @Override - public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_) - { - return p_77654_1_; - } + @Override + public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_) { + return p_77654_1_; + } - /** - * How long it takes to use or consume an item - */ - @Override - public int getMaxItemUseDuration(ItemStack p_77626_1_) - { - return 72000; - } + /** + * How long it takes to use or consume an item + */ + @Override + public int getMaxItemUseDuration(ItemStack p_77626_1_) { + return 72000; + } - /** - * returns the action that specifies what animation to play when the items is being used - */ - @Override - public EnumAction getItemUseAction(ItemStack p_77661_1_) - { - return EnumAction.bow; - } + /** + * returns the action that specifies what animation to play when the items + * is being used + */ + @Override + public EnumAction getItemUseAction(ItemStack p_77661_1_) { + return EnumAction.bow; + } - /** - * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer - */ - @Override - public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) - { - ArrowNockEvent event = new ArrowNockEvent(p_77659_3_, p_77659_1_); - MinecraftForge.EVENT_BUS.post(event); - if (event.isCanceled()) - { - return event.result; - } + /** + * Called whenever this item is equipped and the right mouse button is + * pressed. Args: itemStack, world, entityPlayer + */ + @Override + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { + ArrowNockEvent event = new ArrowNockEvent(p_77659_3_, p_77659_1_); + MinecraftForge.EVENT_BUS.post(event); + if (event.isCanceled()) { + return event.result; + } - if (p_77659_3_.capabilities.isCreativeMode || p_77659_3_.inventory.hasItem(ModItems.gun_rpg_ammo)) - { - p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_)); - } + if (p_77659_3_.capabilities.isCreativeMode || p_77659_3_.inventory.hasItem(ModItems.gun_rpg_ammo)) { + p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_)); + } - return p_77659_1_; - } + return p_77659_1_; + } - /** - * Return the enchantability factor of the item, most of the time is based on material. - */ - @Override - public int getItemEnchantability() - { - return 1; - } + /** + * Return the enchantability factor of the item, most of the time is based + * on material. + */ + @Override + public int getItemEnchantability() { + return 1; + } @Override public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) { diff --git a/com/hbm/items/weapon/GunStinger.java b/com/hbm/items/weapon/GunStinger.java new file mode 100644 index 000000000..1d5d40e2f --- /dev/null +++ b/com/hbm/items/weapon/GunStinger.java @@ -0,0 +1,133 @@ +package com.hbm.items.weapon; + +import java.util.List; + +import com.google.common.collect.Multimap; +import com.hbm.entity.projectile.EntityRocket; +import com.hbm.entity.projectile.EntityRocketHoming; +import com.hbm.items.ModItems; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumAction; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.player.ArrowLooseEvent; +import net.minecraftforge.event.entity.player.ArrowNockEvent; + +public class GunStinger extends Item { + + public GunStinger() + { + this.maxStackSize = 1; + this.setMaxDamage(500); + } + + @Override + public void onPlayerStoppedUsing(ItemStack p_77615_1_, World p_77615_2_, EntityPlayer p_77615_3_, int p_77615_4_) { + int j = this.getMaxItemUseDuration(p_77615_1_) - p_77615_4_; + + ArrowLooseEvent event = new ArrowLooseEvent(p_77615_3_, p_77615_1_, j); + MinecraftForge.EVENT_BUS.post(event); + if (event.isCanceled()) { + return; + } + j = event.charge; + + boolean flag = p_77615_3_.capabilities.isCreativeMode + || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, p_77615_1_) > 0; + + if (flag || p_77615_3_.inventory.hasItem(ModItems.gun_stinger_ammo)) { + float f = j / 20.0F; + f = (f * f + f * 2.0F) / 3.0F; + + if (j < 25.0D) { + return; + } + + if (j > 25.0F) { + f = 25.0F; + } + + EntityRocketHoming entityarrow = new EntityRocketHoming(p_77615_2_, p_77615_3_, 1.0F); + + if (f == 1.0F) { + entityarrow.setIsCritical(true); + } + + p_77615_1_.damageItem(1, p_77615_3_); + p_77615_2_.playSoundAtEntity(p_77615_3_, "hbm:weapon.rpgShoot", 1.0F, 0.25F); + + if (flag) { + entityarrow.canBePickedUp = 2; + } else { + p_77615_3_.inventory.consumeInventoryItem(ModItems.gun_stinger_ammo); + } + + if (!p_77615_2_.isRemote) { + entityarrow.canBePickedUp = 2; + p_77615_2_.spawnEntityInWorld(entityarrow); + } + } + } + + @Override + public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_) { + return p_77654_1_; + } + + @Override + public int getMaxItemUseDuration(ItemStack p_77626_1_) { + return 72000; + } + + @Override + public EnumAction getItemUseAction(ItemStack p_77661_1_) { + return EnumAction.bow; + } + + @Override + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { + ArrowNockEvent event = new ArrowNockEvent(p_77659_3_, p_77659_1_); + MinecraftForge.EVENT_BUS.post(event); + if (event.isCanceled()) { + return event.result; + } + + if (p_77659_3_.capabilities.isCreativeMode || p_77659_3_.inventory.hasItem(ModItems.gun_stinger_ammo)) { + p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_)); + } + + return p_77659_1_; + } + + @Override + public int getItemEnchantability() { + return 1; + } + + @Override + public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) { + + list.add("Kaboom!"); + list.add(""); + list.add("Ammo: Rockets"); + list.add("Projectiles explode on impact."); + } + + @Override + public Multimap getItemAttributeModifiers() { + Multimap multimap = super.getItemAttributeModifiers(); + multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), + new AttributeModifier(field_111210_e, "Weapon modifier", 4, 0)); + return multimap; + } +} diff --git a/com/hbm/main/ClientProxy.java b/com/hbm/main/ClientProxy.java index 6aa9ac549..afd16eaef 100644 --- a/com/hbm/main/ClientProxy.java +++ b/com/hbm/main/ClientProxy.java @@ -84,6 +84,7 @@ public class ClientProxy extends ServerProxy RenderingRegistry.registerEntityRenderingHandler(EntityRocket.class, new RenderSnowball(ModItems.man_core)); MinecraftForgeClient.registerItemRenderer(ModItems.gun_rpg, new ItemRenderRpg()); + MinecraftForgeClient.registerItemRenderer(ModItems.gun_stinger, new ItemRenderStinger()); //MinecraftForgeClient.registerItemRenderer(ModItems.gun_rpg_ammo, new ItemRenderRocket()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBombMulti.class, new RenderBombMulti()); @@ -262,6 +263,7 @@ public class ClientProxy extends ServerProxy RenderingRegistry.registerEntityRenderingHandler(EntityMissileTaint.class, new RenderMissileTaint()); RenderingRegistry.registerEntityRenderingHandler(EntityAAShell.class, new RenderMirv()); + RenderingRegistry.registerEntityRenderingHandler(EntityRocketHoming.class, new RenderSRocket()); RenderingRegistry.registerEntityRenderingHandler(EntityMissileEndo.class, new RenderMissileThermo()); RenderingRegistry.registerEntityRenderingHandler(EntityMissileExo.class, new RenderMissileThermo()); diff --git a/com/hbm/main/CraftingManager.java b/com/hbm/main/CraftingManager.java index 685585a98..5ca790db0 100644 --- a/com/hbm/main/CraftingManager.java +++ b/com/hbm/main/CraftingManager.java @@ -641,6 +641,8 @@ public class CraftingManager { GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_rpg, 1), new Object[] { "SSW", " SW", 'S', "plateSteel", 'W', "plateIron" })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_rpg_ammo, 8), new Object[] { "SI ", "ITI", " I ", 'S', "plateSteel", 'T', Item.getItemFromBlock(Blocks.tnt), 'I', "plateIron" })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_stinger, 1), new Object[] { "SSW", "CSW", 'S', "plateSteel", 'W', "plateTitanium", 'C', ModItems.circuit_red_copper })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_stinger_ammo, 4), new Object[] { "SS ", "STI", " IR", 'S', "plateSteel", 'T', Item.getItemFromBlock(Blocks.tnt), 'I', "plateAluminum", 'R', "dustRedstone" })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_revolver, 1), new Object[] { "SSS", " RW", 'S', "plateSteel", 'W', Item.getItemFromBlock(Blocks.planks), 'R', ModItems.wire_aluminium })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_revolver_ammo, 16), new Object[] { "L", "S", "G", 'L', "plateLead", 'S', "plateSteel", 'G', Items.gunpowder })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_revolver_iron, 1), new Object[] { "SSS", " RW", 'S', "plateIron", 'W', Item.getItemFromBlock(Blocks.planks), 'R', ModItems.wire_aluminium })); @@ -1096,16 +1098,18 @@ public class CraftingManager { GameRegistry.addRecipe(new ShapedOreRecipe(ItemBattery.getEmptyBattery(ModItems.dynosphere_schrabidium), new Object[] { "RPR", "PBP", "RPR", 'R', ModItems.powder_power, 'P', "ingotSchrabidium", 'B', ModItems.dynosphere_desh_charged })); GameRegistry.addRecipe(new ShapedOreRecipe(ItemBattery.getEmptyBattery(ModItems.dynosphere_euphemium), new Object[] { "RPR", "PBP", "RPR", 'R', ModItems.powder_nitan_mix, 'P', "ingotEuphemium", 'B', ModItems.dynosphere_schrabidium_charged })); GameRegistry.addRecipe(new ShapedOreRecipe(ItemBattery.getEmptyBattery(ModItems.dynosphere_dineutronium), new Object[] { "RPR", "PBP", "RPR", 'R', ModItems.powder_spark_mix, 'P', "ingotDineutronium", 'B', ModItems.dynosphere_euphemium_charged })); + //Temporary Crappy Recipes GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_revolver_pip, 1), new Object[] { " G ", "SSP", " TI", 'G', Blocks.glass_pane, 'S', "plateSteel", 'P', ModItems.powder_power, 'T', ModItems.wire_tungsten, 'I', "ingotPolymer" })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_revolver_pip_ammo, 1), new Object[] { "S", "G", "C", 'S', "plateSteel", 'G', Items.gunpowder, 'C', "plateCopper" })); - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.ingot_dineutronium, 1), new Object[] { ModItems.powder_spark_mix, "nuggetSchrabidium" })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.plate_dineutronium, 4), new Object[] { "PIP", "IDI", "PIP", 'P', ModItems.powder_spark_mix, 'I', "ingotDineutronium", 'D', "ingotDesh" })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.plate_desh, 4), new Object[] { "PIP", "IDI", "PIP", 'P', ModItems.powder_polymer, 'I', "ingotDesh", 'D', "ingotDuraSteel" })); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.taint), new Object[] { "nuggetEuphemium", ModItems.nuclear_waste })); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.taint), new Object[] { "nuggetEuphemium", ModItems.trinitite })); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.meteor_remote), new Object[] { "nuggetSchrabidium", ModItems.fragment_meteorite, ModItems.crate_caller })); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.crate_caller), new Object[] { "nuggetSchrabidium", ModItems.crowbar, ModItems.detonator })); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.catalyst_clay), new Object[] { "dustIron", Items.clay_ball })); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.catalyst_clay, 4), new Object[] { "dustAluminum", "dustRedstone", Items.clay_ball })); } diff --git a/com/hbm/main/MainRegistry.java b/com/hbm/main/MainRegistry.java index 89dd4edb6..90fb77f8e 100644 --- a/com/hbm/main/MainRegistry.java +++ b/com/hbm/main/MainRegistry.java @@ -141,6 +141,7 @@ import com.hbm.entity.projectile.EntityOilSpill; import com.hbm.entity.projectile.EntityPlasmaBeam; import com.hbm.entity.projectile.EntityRainbow; import com.hbm.entity.projectile.EntityRocket; +import com.hbm.entity.projectile.EntityRocketHoming; import com.hbm.entity.projectile.EntityRubble; import com.hbm.entity.projectile.EntitySchrab; import com.hbm.entity.projectile.EntityShrapnel; @@ -667,6 +668,7 @@ public class MainRegistry EntityRegistry.registerModEntity(EntityCloudFleijaRainbow.class, "entity_cloud_rainbow", 90, this, 1000, 1, true); EntityRegistry.registerModEntity(EntityExplosiveBeam.class, "entity_beam_bomb", 91, this, 1000, 1, true); EntityRegistry.registerModEntity(EntityAAShell.class, "entity_aa_shell", 92, this, 1000, 1, true); + EntityRegistry.registerModEntity(EntityRocketHoming.class, "entity_stinger", 93, this, 1000, 1, true); EntityRegistry.registerGlobalEntityID(EntityNuclearCreeper.class, "entity_mob_nuclear_creeper", EntityRegistry.findGlobalUniqueEntityId(), 0x204131, 0x75CE00); EntityRegistry.registerGlobalEntityID(EntityHunterChopper.class, "entity_mob_hunter_chopper", EntityRegistry.findGlobalUniqueEntityId(), 0x000020, 0x2D2D72); diff --git a/com/hbm/render/entity/RenderSRocket.java b/com/hbm/render/entity/RenderSRocket.java new file mode 100644 index 000000000..46e8f2fde --- /dev/null +++ b/com/hbm/render/entity/RenderSRocket.java @@ -0,0 +1,43 @@ +package com.hbm.render.entity; + +import org.lwjgl.opengl.GL11; + +import com.hbm.entity.projectile.EntityBullet; +import com.hbm.lib.RefStrings; +import com.hbm.render.model.ModelBullet; +import com.hbm.render.model.ModelSRocket; + +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; + +public class RenderSRocket extends Render { + + private ModelSRocket missile; + + public RenderSRocket() { + missile = new ModelSRocket(); + } + + @Override + public void doRender(Entity rocket, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, + float p_76986_9_) { + GL11.glPushMatrix(); + GL11.glTranslatef((float) p_76986_2_, (float) p_76986_4_, (float) p_76986_6_); + GL11.glRotatef(rocket.prevRotationYaw + (rocket.rotationYaw - rocket.prevRotationYaw) * p_76986_9_ - 90.0F, + 0.0F, 1.0F, 0.0F); + GL11.glRotatef(rocket.prevRotationPitch + (rocket.rotationPitch - rocket.prevRotationPitch) * p_76986_9_ + 180, + 0.0F, 0.0F, 1.0F); + GL11.glScalef(1.5F, 1.5F, 1.5F); + + + bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/models/ModelSRocket.png")); + missile.renderAll(0.0625F); + GL11.glPopMatrix(); + } + + @Override + protected ResourceLocation getEntityTexture(Entity p_110775_1_) { + return new ResourceLocation(RefStrings.MODID + ":textures/models/ModelSRocket.png"); + } +} diff --git a/com/hbm/render/item/ItemRenderRpg.java b/com/hbm/render/item/ItemRenderRpg.java index 33f506be5..322a05664 100644 --- a/com/hbm/render/item/ItemRenderRpg.java +++ b/com/hbm/render/item/ItemRenderRpg.java @@ -4,6 +4,7 @@ import org.lwjgl.opengl.GL11; import com.hbm.lib.RefStrings; import com.hbm.render.model.ModelAt4; +import com.hbm.render.model.ModelStinger; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; diff --git a/com/hbm/render/item/ItemRenderStinger.java b/com/hbm/render/item/ItemRenderStinger.java new file mode 100644 index 000000000..a2b2ee71f --- /dev/null +++ b/com/hbm/render/item/ItemRenderStinger.java @@ -0,0 +1,72 @@ +package com.hbm.render.item; + +import org.lwjgl.opengl.GL11; + +import com.hbm.lib.RefStrings; +import com.hbm.render.model.ModelAt4; +import com.hbm.render.model.ModelStinger; + +import net.minecraft.client.Minecraft; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.IItemRenderer.ItemRenderType; +import net.minecraftforge.client.IItemRenderer.ItemRendererHelper; + +public class ItemRenderStinger implements IItemRenderer { + + protected ModelStinger stinger; + + public ItemRenderStinger() { + stinger = new ModelStinger(); + } + + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) { + switch(type) { + case EQUIPPED: + case EQUIPPED_FIRST_PERSON: + case ENTITY: + return true; + default: return false; + } + } + + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { + return false; + } + + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) { + switch(type) { + case EQUIPPED_FIRST_PERSON: + GL11.glPushMatrix(); + Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID +":textures/models/ModelStinger.png")); + GL11.glRotatef(-135.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(-0.3F, 0.0F, -0.1F); + GL11.glScalef(2.0F, 2.0F, 2.0F); + GL11.glScalef(0.5F, 0.5F, 0.5F); + GL11.glScalef(0.5F, 0.5F, 0.5F); + stinger.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); + GL11.glPopMatrix(); + break; + case EQUIPPED: + case ENTITY: + GL11.glPushMatrix(); + Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID +":textures/models/ModelStinger.png")); + GL11.glRotatef(-200.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(75.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F); + GL11.glTranslatef(0.0F, -0.2F, -0.5F); + GL11.glRotatef(-5.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(0.2F, -0.2F, 0.1F); + GL11.glScalef(1.5F, 1.5F, 1.5F); + GL11.glScalef(0.5F, 0.5F, 0.5F); + stinger.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); + GL11.glPopMatrix(); + default: break; + } + } +} diff --git a/com/hbm/render/model/ModelSRocket.java b/com/hbm/render/model/ModelSRocket.java new file mode 100644 index 000000000..6185db735 --- /dev/null +++ b/com/hbm/render/model/ModelSRocket.java @@ -0,0 +1,94 @@ +// Date: 23.02.2018 15:06:23 +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + +package com.hbm.render.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelSRocket extends ModelBase { + // fields + ModelRenderer Shape1; + ModelRenderer Shape2; + ModelRenderer Shape3; + ModelRenderer Shape4; + ModelRenderer Shape5; + ModelRenderer Shape6; + + public ModelSRocket() { + textureWidth = 64; + textureHeight = 16; + + Shape1 = new ModelRenderer(this, 0, 0); + Shape1.addBox(0F, 0F, 0F, 24, 2, 2); + Shape1.setRotationPoint(-12F, -1F, -1F); + Shape1.setTextureSize(64, 16); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0F, 0F); + Shape2 = new ModelRenderer(this, 0, 4); + Shape2.addBox(0F, 0F, 0F, 1, 6, 0); + Shape2.setRotationPoint(7F, -3F, 0F); + Shape2.setTextureSize(64, 16); + Shape2.mirror = true; + setRotation(Shape2, 0F, 0F, 0F); + Shape3 = new ModelRenderer(this, 2, 4); + Shape3.addBox(0F, 0F, 0F, 1, 0, 6); + Shape3.setRotationPoint(7F, 0F, -3F); + Shape3.setTextureSize(64, 16); + Shape3.mirror = true; + setRotation(Shape3, 0F, 0F, 0F); + Shape4 = new ModelRenderer(this, 16, 4); + Shape4.addBox(0F, 0F, 0F, 1, 4, 0); + Shape4.setRotationPoint(-10F, -2F, 0F); + Shape4.setTextureSize(64, 16); + Shape4.mirror = true; + setRotation(Shape4, 0F, 0F, 0F); + Shape5 = new ModelRenderer(this, 0, 10); + Shape5.addBox(0F, 0F, 0F, 1, 0, 4); + Shape5.setRotationPoint(-10F, 0F, -2F); + Shape5.setTextureSize(64, 16); + Shape5.mirror = true; + setRotation(Shape5, 0F, 0F, 0F); + Shape6 = new ModelRenderer(this, 18, 4); + Shape6.addBox(0F, 0F, 0F, 2, 3, 3); + Shape6.setRotationPoint(9F, -1.5F, -1.5F); + Shape6.setTextureSize(64, 16); + Shape6.mirror = true; + setRotation(Shape6, 0F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + Shape1.render(f5); + Shape2.render(f5); + Shape3.render(f5); + Shape4.render(f5); + Shape5.render(f5); + Shape6.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } + + public void renderAll(float f5) { + Shape1.render(f5); + Shape2.render(f5); + Shape3.render(f5); + Shape4.render(f5); + Shape5.render(f5); + Shape6.render(f5); + } + +} diff --git a/com/hbm/render/model/ModelStinger.java b/com/hbm/render/model/ModelStinger.java new file mode 100644 index 000000000..a56c12805 --- /dev/null +++ b/com/hbm/render/model/ModelStinger.java @@ -0,0 +1,178 @@ +// Date: 22.02.2018 20:57:37 +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + +package com.hbm.render.model; + +import org.lwjgl.opengl.GL11; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelStinger extends ModelBase { + // fields + ModelRenderer B1; + ModelRenderer B2; + ModelRenderer B3; + ModelRenderer E1; + ModelRenderer E2; + ModelRenderer E3; + ModelRenderer F1; + ModelRenderer F2; + ModelRenderer F3; + ModelRenderer D1; + ModelRenderer D2; + ModelRenderer D3; + ModelRenderer F; + ModelRenderer H1; + ModelRenderer H2; + ModelRenderer H3; + ModelRenderer E4; + + public ModelStinger() { + textureWidth = 128; + textureHeight = 64; + + B1 = new ModelRenderer(this, 0, 0); + B1.addBox(0F, 0F, 0F, 52, 4, 2); + B1.setRotationPoint(-26F, 0F, -1F); + B1.setTextureSize(128, 64); + B1.mirror = true; + setRotation(B1, 0F, 0F, 0F); + B2 = new ModelRenderer(this, 0, 6); + B2.addBox(0F, 0F, 0F, 52, 2, 4); + B2.setRotationPoint(-26F, 1F, -2F); + B2.setTextureSize(128, 64); + B2.mirror = true; + setRotation(B2, 0F, 0F, 0F); + B3 = new ModelRenderer(this, 0, 12); + B3.addBox(0F, 0F, 0F, 52, 3, 3); + B3.setRotationPoint(-26F, 0.5F, -1.5F); + B3.setTextureSize(128, 64); + B3.mirror = true; + setRotation(B3, 0F, 0F, 0F); + E1 = new ModelRenderer(this, 0, 18); + E1.addBox(0F, 0F, 0F, 2, 6, 3); + E1.setRotationPoint(26F, -1F, -1.5F); + E1.setTextureSize(128, 64); + E1.mirror = true; + setRotation(E1, 0F, 0F, 0F); + E2 = new ModelRenderer(this, 10, 18); + E2.addBox(0F, 0F, 0F, 2, 3, 6); + E2.setRotationPoint(26F, 0.5F, -3F); + E2.setTextureSize(128, 64); + E2.mirror = true; + setRotation(E2, 0F, 0F, 0F); + E3 = new ModelRenderer(this, 26, 18); + E3.addBox(0F, 0F, 0F, 2, 5, 5); + E3.setRotationPoint(26F, -0.5F, -2.5F); + E3.setTextureSize(128, 64); + E3.mirror = true; + setRotation(E3, 0F, 0F, 0F); + F1 = new ModelRenderer(this, 0, 27); + F1.addBox(0F, 0F, 0F, 4, 5, 5); + F1.setRotationPoint(-30F, -0.5F, -2.5F); + F1.setTextureSize(128, 64); + F1.mirror = true; + setRotation(F1, 0F, 0F, 0F); + F2 = new ModelRenderer(this, 0, 37); + F2.addBox(0F, 0F, 0F, 4, 6, 3); + F2.setRotationPoint(-30F, -1F, -1.5F); + F2.setTextureSize(128, 64); + F2.mirror = true; + setRotation(F2, 0F, 0F, 0F); + F3 = new ModelRenderer(this, 14, 37); + F3.addBox(0F, 0F, 0F, 4, 3, 6); + F3.setRotationPoint(-30F, 0.5F, -3F); + F3.setTextureSize(128, 64); + F3.mirror = true; + setRotation(F3, 0F, 0F, 0F); + D1 = new ModelRenderer(this, 0, 46); + D1.addBox(0F, 0F, 0F, 16, 8, 3); + D1.setRotationPoint(-25F, 4F, -1F); + D1.setTextureSize(128, 64); + D1.mirror = true; + setRotation(D1, 0F, 0F, 0F); + D2 = new ModelRenderer(this, 38, 46); + D2.addBox(0F, 0F, 0F, 12, 8, 1); + D2.setRotationPoint(-21F, 4F, -2F); + D2.setTextureSize(128, 64); + D2.mirror = true; + setRotation(D2, 0F, 0F, 0F); + D3 = new ModelRenderer(this, 34, 38); + D3.addBox(0F, 0F, 0F, 16, 6, 2); + D3.setRotationPoint(-21F, 0.5F, -4F); + D3.setTextureSize(128, 64); + D3.mirror = true; + setRotation(D3, 0F, 0F, 0F); + F = new ModelRenderer(this, 40, 18); + F.addBox(0F, 0F, 0F, 12, 8, 5); + F.setRotationPoint(-25F, -8F, -2.5F); + F.setTextureSize(128, 64); + F.mirror = true; + setRotation(F, 0F, 0F, 0F); + H1 = new ModelRenderer(this, 18, 27); + H1.addBox(0F, 0F, 0F, 2, 7, 1); + H1.setRotationPoint(-4F, 4F, -0.5F); + H1.setTextureSize(128, 64); + H1.mirror = true; + //setRotation(H1, 0F, 0F, -0.2617994F); + setRotation(H1, 0F, 0F, 0F); + H2 = new ModelRenderer(this, 24, 31); + H2.addBox(0F, 0F, 0F, 8, 1, 2); + H2.setRotationPoint(-9F, 4F, -1F); + H2.setTextureSize(128, 64); + H2.mirror = true; + setRotation(H2, 0F, 0F, 0F); + H3 = new ModelRenderer(this, 44, 31); + H3.addBox(0F, 0F, 0F, 2, 3, 2); + H3.setRotationPoint(-12F, 12F, -1F); + H3.setTextureSize(128, 64); + H3.mirror = true; + setRotation(H3, 0F, 0F, 0F); + E4 = new ModelRenderer(this, 38, 55); + E4.addBox(0F, 0F, 0F, 8, 6, 2); + E4.setRotationPoint(16F, -1F, -4F); + E4.setTextureSize(128, 64); + E4.mirror = true; + setRotation(E4, 0F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + B1.render(f5); + B2.render(f5); + B3.render(f5); + E1.render(f5); + E2.render(f5); + E3.render(f5); + F1.render(f5); + F2.render(f5); + F3.render(f5); + D1.render(f5); + D2.render(f5); + D3.render(f5); + GL11.glDisable(GL11.GL_CULL_FACE); + F.render(f5); + GL11.glEnable(GL11.GL_CULL_FACE); + H1.render(f5); + H2.render(f5); + H3.render(f5); + E4.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } + +}