diff --git a/assets/hbm/lang/de_DE.lang b/assets/hbm/lang/de_DE.lang index 32f3e2275..c27e9ba55 100644 --- a/assets/hbm/lang/de_DE.lang +++ b/assets/hbm/lang/de_DE.lang @@ -373,6 +373,7 @@ item.schnitzel_vegan.name=Veganes Schnitzel item.apple_schrabidium.name=Schrabidiumapfel item.cotton_candy.name=Radioaktive Zuckerwatte item.tem_flakes.name=Tem Flakes +item.glowing_stew.name=Leuchtende Pilzsuppe tile.frozen_grass.name=Gefrorenes Gras tile.frozen_dirt.name=Gefrorene Erde @@ -394,12 +395,14 @@ item.gun_revolver.name=Verbesserter Revolver item.gun_revolver_gold.name=Goldener Revolver item.gun_revolver_schrabidium.name=Schrabidiumrevolver item.gun_revolver_cursed.name=Verfluchte Pistole +item.gun_fatman.name=M42 Nukleares Katapult "Fat Man" item.gun_revolver_iron_ammo.name=Patrone item.gun_revolver_ammo.name=Bleipatrone item.gun_revolver_gold_ammo.name=Goldene Kugel item.gun_revolver_schrabidium_ammo.name=Schrabidiumpatrone item.gun_revolver_cursed_ammo.name=Stahlpatrone +item.gun_fatman_ammo.name=Miniatombombe tile.block_schrabidium.name=Schrabidiumblock item.plate_gold.name=Goldplatte @@ -452,6 +455,8 @@ item.schrabidium_axe.name=Schrabidiumaxt item.schrabidium_shovel.name=Schrabidiumschaufel item.schrabidium_hoe.name=Schrabidiumfeldhacke +item.chainsaw.name=Kettensäge + item.mask_of_infamy.name=Maske der Schande tile.det_cord.name=Det Cord diff --git a/assets/hbm/lang/en_US.lang b/assets/hbm/lang/en_US.lang index ef7c61d0d..1b9dc5dfd 100644 --- a/assets/hbm/lang/en_US.lang +++ b/assets/hbm/lang/en_US.lang @@ -374,6 +374,7 @@ item.schnitzel_vegan.name=Vegan Schnitzel item.apple_schrabidium.name=Schrabidium Apple item.cotton_candy.name=Radioactive Cotton Candy item.tem_flakes.name=Tem Flakes +item.glowing_stew.name=Glowing Mushroom Stew tile.frozen_grass.name=Frozen Grass tile.frozen_dirt.name=Frozen Dirt @@ -395,12 +396,14 @@ item.gun_revolver.name=Enhanced Revolver item.gun_revolver_gold.name=Golden Revolver item.gun_revolver_schrabidium.name=Schrabidium Revolver item.gun_revolver_cursed.name=Cursed Revolver +item.gun_fatman.name=M42 Nuclear Catapult "Fat Man" item.gun_revolver_iron_ammo.name=Bullet item.gun_revolver_ammo.name=Lead Bullet item.gun_revolver_gold_ammo.name=Golden Bullet item.gun_revolver_schrabidium_ammo.name=Schrabidium Bullet item.gun_revolver_cursed_ammo.name=Steel Bullet +item.gun_fatman_ammo.name=Mini Nuke tile.block_schrabidium.name=Block of Schrabidium item.plate_gold.name=Gold Plate @@ -453,6 +456,8 @@ item.schrabidium_axe.name=Schrabidium Axe item.schrabidium_shovel.name=Schrabidium Shovel item.schrabidium_hoe.name=Schrabidium Hoe +item.chainsaw.name=Chainsaw + item.mask_of_infamy.name=Mask of Infamy tile.det_cord.name=Det Cord diff --git a/assets/hbm/textures/items/gun_fatman.png b/assets/hbm/textures/items/gun_fatman.png new file mode 100644 index 000000000..07bade5d1 Binary files /dev/null and b/assets/hbm/textures/items/gun_fatman.png differ diff --git a/assets/hbm/textures/items/gun_fatman_ammo.png b/assets/hbm/textures/items/gun_fatman_ammo.png new file mode 100644 index 000000000..d12fd606f Binary files /dev/null and b/assets/hbm/textures/items/gun_fatman_ammo.png differ diff --git a/assets/hbm/textures/models/FatmanLauncher.png b/assets/hbm/textures/models/FatmanLauncher.png new file mode 100644 index 000000000..6d8eed577 Binary files /dev/null and b/assets/hbm/textures/models/FatmanLauncher.png differ diff --git a/assets/hbm/textures/models/MiniNuke.png b/assets/hbm/textures/models/MiniNuke.png new file mode 100644 index 000000000..f42a819ff Binary files /dev/null and b/assets/hbm/textures/models/MiniNuke.png differ diff --git a/com/hbm/entity/EntityMiniNuke.java b/com/hbm/entity/EntityMiniNuke.java new file mode 100644 index 000000000..5e23da5dd --- /dev/null +++ b/com/hbm/entity/EntityMiniNuke.java @@ -0,0 +1,597 @@ +package com.hbm.entity; + +import java.util.List; + +import com.hbm.items.ModItems; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +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 EntityMiniNuke 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; + /** 1 if the player can pick up the arrow */ + public int canBePickedUp; + /** Seems to be some sort of timer for animating an arrow. */ + public int arrowShake; + /** The owner of this arrow. */ + public Entity shootingEntity; + private int ticksInGround; + private int ticksInAir; + private double damage = 2.0D; + /** The amount of knockback an arrow applies when it hits a mob. */ + private int knockbackStrength; + private static final String __OBFID = "CL_00001715"; + + + public EntityMiniNuke(World p_i1753_1_) + { + super(p_i1753_1_); + this.renderDistanceWeight = 10.0D; + this.setSize(0.5F, 0.5F); + } + + public EntityMiniNuke(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 EntityMiniNuke(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 EntityMiniNuke(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 EntityMiniNuke(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) + { + if (!this.worldObj.isRemote) + { + EntityNukeExplosionAdvanced entity0 = new EntityNukeExplosionAdvanced(this.worldObj); + entity0.posX = this.posX; + entity0.posY = this.posY; + entity0.posZ = this.posZ; + entity0.destructionRange = 35; + entity0.speed = 25; + entity0.coefficient = 10.0F; + + this.worldObj.spawnEntityInWorld(entity0); + } + 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.worldObj.isRemote) + { + entitylivingbase.setArrowCountInEntity(entitylivingbase.getArrowCountInEntity() + 1); + } + + 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) + { + EntityNukeExplosionAdvanced entity0 = new EntityNukeExplosionAdvanced(this.worldObj); + entity0.posX = this.posX; + entity0.posY = this.posY; + entity0.posZ = this.posZ; + entity0.destructionRange = 35; + entity0.speed = 25; + entity0.coefficient = 10.0F; + + this.worldObj.spawnEntityInWorld(entity0); + } + this.setDead(); + } + } + else + { + this.motionX *= -0.10000000149011612D; + this.motionY *= -0.10000000149011612D; + this.motionZ *= -0.10000000149011612D; + this.rotationYaw += 180.0F; + this.prevRotationYaw += 180.0F; + this.ticksInAir = 0; + } + } + 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); + } + } + } + + 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 -= 0.15D; + this.setPosition(this.posX, this.posY, this.posZ); + this.func_145775_I(); + } + } + + /** + * (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; + } + } + + /** + * 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; + } +} diff --git a/com/hbm/explosion/ExplosionNukeGeneric.java b/com/hbm/explosion/ExplosionNukeGeneric.java index 47d7a41d9..64edd436e 100644 --- a/com/hbm/explosion/ExplosionNukeGeneric.java +++ b/com/hbm/explosion/ExplosionNukeGeneric.java @@ -19,6 +19,7 @@ import net.minecraftforge.common.util.ForgeDirection; import com.hbm.blocks.DecoBlockAlt; import com.hbm.blocks.ModBlocks; +import com.hbm.entity.EntityMiniNuke; import com.hbm.entity.EntityMirv; import com.hbm.entity.EntityNukeCloudSmall; @@ -114,7 +115,7 @@ public class ExplosionNukeGeneric { d6 = entity.posY + entity.getEyeHeight() - y; d7 = entity.posZ - z; double d9 = MathHelper.sqrt_double(d5 * d5 + d6 * d6 + d7 * d7); - if (d9 < wat && !(entity instanceof EntityOcelot) && !(entity instanceof EntityNukeCloudSmall) && !(entity instanceof EntityMirv)) + if (d9 < wat && !(entity instanceof EntityOcelot) && !(entity instanceof EntityNukeCloudSmall) && !(entity instanceof EntityMirv) && !(entity instanceof EntityMiniNuke)) { d5 /= d9; d6 /= d9; diff --git a/com/hbm/items/GunFatman.java b/com/hbm/items/GunFatman.java new file mode 100644 index 000000000..8c481a25c --- /dev/null +++ b/com/hbm/items/GunFatman.java @@ -0,0 +1,149 @@ +package com.hbm.items; + +import com.google.common.collect.Multimap; +import com.hbm.entity.EntityMiniNuke; +import com.hbm.entity.EntityRocket; + +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 GunFatman 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 GunFatman() + { + this.maxStackSize = 1; + this.setMaxDamage(2500); + } + + /** + * 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; + + 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_fatman_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; + } + + EntityMiniNuke entityarrow = new EntityMiniNuke(p_77615_2_, p_77615_3_, 3.0F); + + entityarrow.setIsCritical(true); + entityarrow.gravity = 0.3; + entityarrow.setDamage(1000); + + p_77615_1_.damageItem(1, p_77615_3_); + p_77615_2_.playSoundAtEntity(p_77615_3_, "tile.piston.out", 1.0F, 0.5F); + + if(!flag) + { + p_77615_3_.inventory.consumeInventoryItem(ModItems.gun_fatman_ammo); + } + + if (!p_77615_2_.isRemote) + { + 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_; + } + + /** + * 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; + } + + /** + * 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_fatman_ammo)) + { + p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(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 0; + } + + public Multimap getItemAttributeModifiers() + { + Multimap multimap = super.getItemAttributeModifiers(); + multimap.put(SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Weapon modifier", (double)-0.3, 1)); + return multimap; + } +} diff --git a/com/hbm/items/GunRpg.java b/com/hbm/items/GunRpg.java index e29c00ea0..55c92d320 100644 --- a/com/hbm/items/GunRpg.java +++ b/com/hbm/items/GunRpg.java @@ -1,5 +1,6 @@ package com.hbm.items; +import com.hbm.entity.EntityMiniNuke; import com.hbm.entity.EntityRocket; import cpw.mods.fml.relauncher.Side; diff --git a/com/hbm/items/ModItems.java b/com/hbm/items/ModItems.java index eb09a9b94..ba351a697 100644 --- a/com/hbm/items/ModItems.java +++ b/com/hbm/items/ModItems.java @@ -289,6 +289,8 @@ public class ModItems { public static Item gun_revolver_schrabidium_ammo; public static Item gun_revolver_cursed; public static Item gun_revolver_cursed_ammo; + public static Item gun_fatman; + public static Item gun_fatman_ammo; public static Item gun_waluigi; public static Item grenade_generic; @@ -677,6 +679,8 @@ public class ModItems { gun_revolver_schrabidium = new GunRevolver(gun_revolver_schrabidium_ammo, 10000, 100000, true).setMaxDamage(100000).setUnlocalizedName("gun_revolver_schrabidium").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_revolver_schrabidium"); gun_revolver_cursed_ammo = new ItemCustomLore().setUnlocalizedName("gun_revolver_cursed_ammo").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_revolver_cursed_ammo"); gun_revolver_cursed = new GunRevolver(gun_revolver_cursed_ammo, 25, 40, false).setMaxDamage(5000).setUnlocalizedName("gun_revolver_cursed").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_revolver_cursed"); + gun_fatman_ammo = new Item().setUnlocalizedName("gun_fatman_ammo").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_fatman_ammo"); + gun_fatman = new GunFatman().setMaxDamage(5000).setUnlocalizedName("gun_fatman").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_fatman"); grenade_generic = new ItemGrenade().setUnlocalizedName("grenade_generic").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":grenade_generic"); grenade_strong = new ItemGrenade().setUnlocalizedName("grenade_strong").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":grenade_strong"); @@ -1103,6 +1107,8 @@ public class ModItems { GameRegistry.registerItem(gun_revolver_cursed_ammo, gun_revolver_cursed_ammo.getUnlocalizedName()); GameRegistry.registerItem(gun_rpg, gun_rpg.getUnlocalizedName()); GameRegistry.registerItem(gun_rpg_ammo, gun_rpg_ammo.getUnlocalizedName()); + GameRegistry.registerItem(gun_fatman, gun_fatman.getUnlocalizedName()); + GameRegistry.registerItem(gun_fatman_ammo, gun_fatman_ammo.getUnlocalizedName()); //Grenades GameRegistry.registerItem(grenade_generic, grenade_generic.getUnlocalizedName()); diff --git a/com/hbm/lib/HbmChestContents.java b/com/hbm/lib/HbmChestContents.java index a6c01db8e..35402f12e 100644 --- a/com/hbm/lib/HbmChestContents.java +++ b/com/hbm/lib/HbmChestContents.java @@ -53,6 +53,8 @@ public class HbmChestContents { new WeightedRandomChestContent(ModItems.gun_revolver_gold_ammo, 0, 1, 6, 2), new WeightedRandomChestContent(ModItems.gun_rpg, 0, 1, 1, 2), new WeightedRandomChestContent(ModItems.gun_rpg_ammo, 0, 1, 32, 3), + new WeightedRandomChestContent(ModItems.gun_fatman, 0, 1, 1, 1), + new WeightedRandomChestContent(ModItems.gun_fatman_ammo, 0, 1, 8, 2), new WeightedRandomChestContent(ModItems.battery_advanced, 200, 1, 1, 3), new WeightedRandomChestContent(ModItems.battery_schrabidium, 1000, 1, 1, 1), new WeightedRandomChestContent(ModItems.syringe_awesome, 0, 1, 1, 1), diff --git a/com/hbm/main/ClientProxy.java b/com/hbm/main/ClientProxy.java index 3be9fd7c6..eaf776f54 100644 --- a/com/hbm/main/ClientProxy.java +++ b/com/hbm/main/ClientProxy.java @@ -45,6 +45,7 @@ import com.hbm.entity.EntityGrenadeNuke; import com.hbm.entity.EntityGrenadePoison; import com.hbm.entity.EntityGrenadeSchrabidium; import com.hbm.entity.EntityGrenadeStrong; +import com.hbm.entity.EntityMiniNuke; import com.hbm.entity.EntityMirv; import com.hbm.entity.EntityMissileAntiBallistic; import com.hbm.entity.EntityMissileBunkerBuster; @@ -73,6 +74,8 @@ import com.hbm.render.ItemRenderRevolverCursed; import com.hbm.render.ItemRenderRevolverIron; import com.hbm.render.ItemRenderBigSword; import com.hbm.render.ItemRenderDecoBlock; +import com.hbm.render.ItemRenderFatMan; +import com.hbm.render.ItemRenderMiniNuke; import com.hbm.render.ItemRenderPoleTop; import com.hbm.render.ItemRenderRedstoneSword; import com.hbm.render.ItemRenderRevolver; @@ -91,6 +94,7 @@ import com.hbm.render.RenderDecoBlock; import com.hbm.render.RenderDecoBlockAlt; import com.hbm.render.RenderFlare; import com.hbm.render.RenderLaunchPadTier1; +import com.hbm.render.RenderMiniNuke; import com.hbm.render.RenderMirv; import com.hbm.render.RenderMissileGeneric; import com.hbm.render.RenderMissileHuge; @@ -199,8 +203,11 @@ public class ClientProxy extends ServerProxy MinecraftForgeClient.registerItemRenderer(ModItems.gun_revolver_gold, new ItemRenderRevolverGold()); MinecraftForgeClient.registerItemRenderer(ModItems.gun_revolver_schrabidium, new ItemRenderRevolverSchrabidium()); MinecraftForgeClient.registerItemRenderer(ModItems.gun_revolver_cursed, new ItemRenderRevolverCursed()); + MinecraftForgeClient.registerItemRenderer(ModItems.gun_fatman, new ItemRenderFatMan()); RenderingRegistry.registerEntityRenderingHandler(EntityBullet.class, new RenderRocket()); + RenderingRegistry.registerEntityRenderingHandler(EntityMiniNuke.class, new RenderMiniNuke()); + MinecraftForgeClient.registerItemRenderer(ModItems.gun_fatman_ammo, new ItemRenderMiniNuke()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityNukePrototype.class, new RenderNukePrototype()); diff --git a/com/hbm/main/MainRegistry.java b/com/hbm/main/MainRegistry.java index c638d21cd..20bb536a8 100644 --- a/com/hbm/main/MainRegistry.java +++ b/com/hbm/main/MainRegistry.java @@ -66,6 +66,7 @@ import com.hbm.entity.EntityGrenadeNuke; import com.hbm.entity.EntityGrenadePoison; import com.hbm.entity.EntityGrenadeSchrabidium; import com.hbm.entity.EntityGrenadeStrong; +import com.hbm.entity.EntityMiniNuke; import com.hbm.entity.EntityMirv; import com.hbm.entity.EntityMissileAntiBallistic; import com.hbm.entity.EntityMissileBunkerBuster; @@ -225,6 +226,7 @@ public class MainRegistry EntityRegistry.registerModEntity(EntityMissileExo.class, "entity_missile_exo", 33, this, 1000, 1, true); EntityRegistry.registerModEntity(EntityMissileMirv.class, "entity_missile_mirv", 34, this, 1000, 1, true); EntityRegistry.registerModEntity(EntityMirv.class, "entity_mirvlet", 35, this, 1000, 1, true); + EntityRegistry.registerModEntity(EntityMiniNuke.class, "entity_mini_nuke", 36, this, 1000, 1, true); EntityRegistry.registerGlobalEntityID(EntityNuclearCreeper.class, "entity_mob_nuclear_creeper", EntityRegistry.findGlobalUniqueEntityId(), 0x204131, 0x75CE00); } diff --git a/com/hbm/render/ItemRenderFatMan.java b/com/hbm/render/ItemRenderFatMan.java new file mode 100644 index 000000000..1eedc64da --- /dev/null +++ b/com/hbm/render/ItemRenderFatMan.java @@ -0,0 +1,70 @@ +package com.hbm.render; + +import org.lwjgl.opengl.GL11; + +import com.hbm.lib.RefStrings; + +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 ItemRenderFatMan implements IItemRenderer { + + protected ModelFatman swordModel; + + public ItemRenderFatMan() { + swordModel = new ModelFatman(); + } + + @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(); + GL11.glEnable(GL11.GL_CULL_FACE); + Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID +":textures/models/FatmanLauncher.png")); + GL11.glRotatef(-135.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(-0.5F, 0.0F, -0.2F); + //GL11.glScalef(2.0F, 2.0F, 2.0F); + GL11.glScalef(0.5F, 0.5F, 0.5F); + swordModel.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(); + GL11.glEnable(GL11.GL_CULL_FACE); + Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID +":textures/models/FatmanLauncher.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.5F, -0.2F, 0.0F); + GL11.glScalef(1.5F, 1.5F, 1.5F); + swordModel.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/ItemRenderMiniNuke.java b/com/hbm/render/ItemRenderMiniNuke.java new file mode 100644 index 000000000..924177de3 --- /dev/null +++ b/com/hbm/render/ItemRenderMiniNuke.java @@ -0,0 +1,68 @@ +package com.hbm.render; + +import org.lwjgl.opengl.GL11; + +import com.hbm.lib.RefStrings; + +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 ItemRenderMiniNuke implements IItemRenderer { + + protected ModelMiniNuke swordModel; + + public ItemRenderMiniNuke() { + swordModel = new ModelMiniNuke(); + } + + @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/MiniNuke.png")); + GL11.glRotatef(-135.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(-0.5F, 0.0F, -0.2F); + //GL11.glScalef(2.0F, 2.0F, 2.0F); + GL11.glScalef(0.5F, 0.5F, 0.5F); + GL11.glScalef(1.5F, 1.5F, 1.5F); + swordModel.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/MiniNuke.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.glScalef(2.0F, 2.0F, 2.0F); + GL11.glScalef(1.5F, 1.5F, 1.5F); + swordModel.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/ModelFatman.java b/com/hbm/render/ModelFatman.java new file mode 100644 index 000000000..3887c5331 --- /dev/null +++ b/com/hbm/render/ModelFatman.java @@ -0,0 +1,311 @@ +// Date: 26.01.2016 14:54:33 +// 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; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelFatman extends ModelBase +{ + //fields + ModelRenderer Shape1; + ModelRenderer Shape2; + ModelRenderer Shape3; + ModelRenderer Shape4; + ModelRenderer Shape5; + ModelRenderer Shape6; + ModelRenderer Shape7; + ModelRenderer Shape8; + ModelRenderer Shape9; + ModelRenderer Shape10; + ModelRenderer Shape11; + ModelRenderer Shape12; + ModelRenderer Shape13; + ModelRenderer Shape14; + ModelRenderer Shape15; + ModelRenderer Shape16; + ModelRenderer Shape17; + ModelRenderer Shape18; + ModelRenderer Shape19; + ModelRenderer Shape20; + ModelRenderer Shape21; + ModelRenderer Shape22; + ModelRenderer Shape23; + ModelRenderer Shape24; + ModelRenderer Shape25; + ModelRenderer Shape26; + ModelRenderer Shape27; + ModelRenderer Shape28; + ModelRenderer Shape29; + ModelRenderer Shape30; + ModelRenderer Shape31; + ModelRenderer Shape32; + ModelRenderer Shape33; + + public ModelFatman() + { + textureWidth = 128; + textureHeight = 64; + + Shape1 = new ModelRenderer(this, 0, 0); + Shape1.addBox(0F, 0F, 0F, 40, 2, 4); + Shape1.setRotationPoint(-20F, 0F, 0F); + Shape1.setTextureSize(128, 64); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0F, 0F); + Shape2 = new ModelRenderer(this, 0, 6); + Shape2.addBox(0F, 0F, 0F, 6, 2, 2); + Shape2.setRotationPoint(-19F, 2F, 1F); + Shape2.setTextureSize(128, 64); + Shape2.mirror = true; + setRotation(Shape2, 0F, 0F, 0F); + Shape3 = new ModelRenderer(this, 0, 10); + Shape3.addBox(0F, 0F, 0F, 1, 4, 1); + Shape3.setRotationPoint(-12F, 2F, 1.5F); + Shape3.setTextureSize(128, 64); + Shape3.mirror = true; + setRotation(Shape3, 0F, 0F, 0F); + Shape4 = new ModelRenderer(this, 16, 6); + Shape4.addBox(0F, 0F, 0F, 6, 1, 4); + Shape4.setRotationPoint(-10F, 2F, 0F); + Shape4.setTextureSize(128, 64); + Shape4.mirror = true; + setRotation(Shape4, 0F, 0F, 0F); + Shape5 = new ModelRenderer(this, 0, 15); + Shape5.addBox(0F, 0F, 0F, 2, 3, 1); + Shape5.setRotationPoint(-7F, 3F, 1.5F); + Shape5.setTextureSize(128, 64); + Shape5.mirror = true; + setRotation(Shape5, 0F, 0F, 0F); + Shape6 = new ModelRenderer(this, 4, 10); + Shape6.addBox(0F, 0F, 0F, 3, 3, 1); + Shape6.setRotationPoint(-10F, 3F, 1.5F); + Shape6.setTextureSize(128, 64); + Shape6.mirror = true; + setRotation(Shape6, 0F, 0F, 0F); + Shape7 = new ModelRenderer(this, 12, 10); + Shape7.addBox(-1F, 0F, 0F, 1, 2, 1); + Shape7.setRotationPoint(-7F, 3F, 1.5F); + Shape7.setTextureSize(128, 64); + Shape7.mirror = true; + setRotation(Shape7, 0F, 0F, 0.5235988F); + Shape8 = new ModelRenderer(this, 36, 6); + Shape8.addBox(0F, 0F, 0F, 10, 1, 4); + Shape8.setRotationPoint(-3F, 2F, 0F); + Shape8.setTextureSize(128, 64); + Shape8.mirror = true; + setRotation(Shape8, 0F, 0F, 0F); + Shape9 = new ModelRenderer(this, 64, 6); + Shape9.addBox(0F, 0F, 0F, 2, 3, 2); + Shape9.setRotationPoint(7F, 2F, 1F); + Shape9.setTextureSize(128, 64); + Shape9.mirror = true; + setRotation(Shape9, 0F, 0F, 0F); + Shape10 = new ModelRenderer(this, 88, 0); + Shape10.addBox(0F, 0F, 0F, 3, 4, 4); + Shape10.setRotationPoint(17F, -4F, 0F); + Shape10.setTextureSize(128, 64); + Shape10.mirror = true; + setRotation(Shape10, 0F, 0F, 0F); + Shape11 = new ModelRenderer(this, 72, 6); + Shape11.addBox(0F, 0F, 0F, 2, 3, 1); + Shape11.setRotationPoint(18F, -7F, 0F); + Shape11.setTextureSize(128, 64); + Shape11.mirror = true; + setRotation(Shape11, 0F, 0F, 0F); + Shape12 = new ModelRenderer(this, 78, 6); + Shape12.addBox(0F, 0F, 0F, 2, 3, 1); + Shape12.setRotationPoint(18F, -7F, 3F); + Shape12.setTextureSize(128, 64); + Shape12.mirror = true; + setRotation(Shape12, 0F, 0F, 0F); + Shape13 = new ModelRenderer(this, 0, 19); + Shape13.addBox(0F, -4F, 0F, 22, 4, 0); + Shape13.setRotationPoint(-17F, 0F, 1F); + Shape13.setTextureSize(128, 64); + Shape13.mirror = true; + setRotation(Shape13, 0.4363323F, 0F, 0F); + Shape14 = new ModelRenderer(this, 16, 11); + Shape14.addBox(0F, 0F, 0F, 33, 1, 1); + Shape14.setRotationPoint(-17F, -4F, -1F); + Shape14.setTextureSize(128, 64); + Shape14.mirror = true; + setRotation(Shape14, 0F, 0F, 0F); + Shape15 = new ModelRenderer(this, 0, 23); + Shape15.addBox(0F, -4F, 0F, 22, 4, 0); + Shape15.setRotationPoint(-17F, 0F, 3F); + Shape15.setTextureSize(128, 64); + Shape15.mirror = true; + setRotation(Shape15, -0.4363323F, 0F, 0F); + Shape16 = new ModelRenderer(this, 16, 13); + Shape16.addBox(0F, 0F, 0F, 33, 1, 1); + Shape16.setRotationPoint(-17F, -4F, 4F); + Shape16.setTextureSize(128, 64); + Shape16.mirror = true; + setRotation(Shape16, 0F, 0F, 0F); + Shape17 = new ModelRenderer(this, 44, 25); + Shape17.addBox(0F, -4F, 0F, 8, 4, 0); + Shape17.setRotationPoint(8F, 0F, 1F); + Shape17.setTextureSize(128, 64); + Shape17.mirror = true; + setRotation(Shape17, 0.4363323F, 0F, 0F); + Shape18 = new ModelRenderer(this, 44, 21); + Shape18.addBox(0F, -4F, 0F, 8, 4, 0); + Shape18.setRotationPoint(8F, 0F, 3F); + Shape18.setTextureSize(128, 64); + Shape18.mirror = true; + setRotation(Shape18, -0.4363323F, 0F, 0F); + Shape19 = new ModelRenderer(this, 0, 37); + Shape19.addBox(0F, 0F, 0F, 5, 4, 2); + Shape19.setRotationPoint(5F, -6F, 1F); + Shape19.setTextureSize(128, 64); + Shape19.mirror = true; + setRotation(Shape19, 0F, 0F, 0F); + Shape20 = new ModelRenderer(this, 0, 31); + Shape20.addBox(0F, 0F, 0F, 5, 2, 4); + Shape20.setRotationPoint(5F, -5F, 0F); + Shape20.setTextureSize(128, 64); + Shape20.mirror = true; + setRotation(Shape20, 0F, 0F, 0F); + Shape21 = new ModelRenderer(this, 0, 27); + Shape21.addBox(0F, 0F, 0F, 1, 2, 2); + Shape21.setRotationPoint(4F, -5F, 1F); + Shape21.setTextureSize(128, 64); + Shape21.mirror = true; + setRotation(Shape21, 0F, 0F, 0F); + Shape22 = new ModelRenderer(this, 6, 27); + Shape22.addBox(0F, 0F, 0F, 1, 2, 2); + Shape22.setRotationPoint(10F, -5F, 1F); + Shape22.setTextureSize(128, 64); + Shape22.mirror = true; + setRotation(Shape22, 0F, 0F, 0F); + Shape23 = new ModelRenderer(this, 8, 43); + Shape23.addBox(0F, 0F, 0F, 2, 2, 1); + Shape23.setRotationPoint(11F, -5F, 0F); + Shape23.setTextureSize(128, 64); + Shape23.mirror = true; + setRotation(Shape23, 0F, 0F, 0F); + Shape24 = new ModelRenderer(this, 8, 46); + Shape24.addBox(0F, 0F, 0F, 2, 2, 1); + Shape24.setRotationPoint(11F, -5F, 3F); + Shape24.setTextureSize(128, 64); + Shape24.mirror = true; + setRotation(Shape24, 0F, 0F, 0F); + Shape25 = new ModelRenderer(this, 0, 43); + Shape25.addBox(0F, 0F, 0F, 2, 1, 2); + Shape25.setRotationPoint(11F, -6F, 1F); + Shape25.setTextureSize(128, 64); + Shape25.mirror = true; + setRotation(Shape25, 0F, 0F, 0F); + Shape26 = new ModelRenderer(this, 0, 46); + Shape26.addBox(0F, 0F, 0F, 2, 1, 2); + Shape26.setRotationPoint(11F, -3F, 1F); + Shape26.setTextureSize(128, 64); + Shape26.mirror = true; + setRotation(Shape26, 0F, 0F, 0F); + Shape27 = new ModelRenderer(this, 18, 27); + Shape27.addBox(0F, 0F, 0F, 2, 5, 1); + Shape27.setRotationPoint(13F, -5F, 1.5F); + Shape27.setTextureSize(128, 64); + Shape27.mirror = true; + setRotation(Shape27, 0F, 0F, 0F); + Shape28 = new ModelRenderer(this, 84, 6); + Shape28.addBox(0F, 0F, 0F, 1, 3, 1); + Shape28.setRotationPoint(16F, -3F, 1.5F); + Shape28.setTextureSize(128, 64); + Shape28.mirror = true; + setRotation(Shape28, 0F, 0F, 0F); + Shape29 = new ModelRenderer(this, 6, 15); + Shape29.addBox(0F, 0F, 0F, 10, 2, 2); + Shape29.setRotationPoint(3F, -2F, 1F); + Shape29.setTextureSize(128, 64); + Shape29.mirror = true; + setRotation(Shape29, 0F, 0F, 0F); + Shape30 = new ModelRenderer(this, 30, 15); + Shape30.addBox(0F, 0F, 0F, 12, 2, 2); + Shape30.setRotationPoint(-7F, -1F, 4F); + Shape30.setTextureSize(128, 64); + Shape30.mirror = true; + setRotation(Shape30, 0F, 0F, 0F); + Shape31 = new ModelRenderer(this, 44, 19); + Shape31.addBox(0F, 0F, 0F, 14, 1, 1); + Shape31.setRotationPoint(5F, -0.5F, 4.5F); + Shape31.setTextureSize(128, 64); + Shape31.mirror = true; + setRotation(Shape31, 0F, 0F, 0F); + Shape32 = new ModelRenderer(this, 12, 27); + Shape32.addBox(0F, 0F, 0F, 1, 1, 1); + Shape32.setRotationPoint(18F, -0.5F, 3.5F); + Shape32.setTextureSize(128, 64); + Shape32.mirror = true; + setRotation(Shape32, 0F, 0F, 0F); + Shape33 = new ModelRenderer(this, 24, 29); + Shape33.addBox(0F, 0F, 0F, 21, 1, 2); + Shape33.setRotationPoint(-18F, -1F, 1F); + Shape33.setTextureSize(128, 64); + Shape33.mirror = true; + setRotation(Shape33, 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); + Shape7.render(f5); + Shape8.render(f5); + Shape9.render(f5); + Shape10.render(f5); + Shape11.render(f5); + Shape12.render(f5); + Shape13.render(f5); + Shape14.render(f5); + Shape15.render(f5); + Shape16.render(f5); + Shape17.render(f5); + Shape18.render(f5); + Shape19.render(f5); + Shape20.render(f5); + Shape21.render(f5); + Shape22.render(f5); + Shape23.render(f5); + Shape24.render(f5); + Shape25.render(f5); + Shape26.render(f5); + Shape27.render(f5); + Shape28.render(f5); + Shape29.render(f5); + Shape30.render(f5); + Shape31.render(f5); + Shape32.render(f5); + Shape33.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); + } + +} diff --git a/com/hbm/render/ModelMiniNuke.java b/com/hbm/render/ModelMiniNuke.java new file mode 100644 index 000000000..378a5c24b --- /dev/null +++ b/com/hbm/render/ModelMiniNuke.java @@ -0,0 +1,123 @@ +// Date: 26.01.2016 16:09: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; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelMiniNuke extends ModelBase +{ + //fields + ModelRenderer Shape1; + ModelRenderer Shape2; + ModelRenderer Shape3; + ModelRenderer Shape4; + ModelRenderer Shape5; + ModelRenderer Shape6; + ModelRenderer Shape7; + ModelRenderer Shape8; + + public ModelMiniNuke() + { + textureWidth = 64; + textureHeight = 32; + + Shape1 = new ModelRenderer(this, 0, 0); + Shape1.addBox(0F, 0F, 0F, 5, 4, 2); + Shape1.setRotationPoint(-2F, -2F, -1F); + Shape1.setTextureSize(64, 32); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0F, 0F); + Shape2 = new ModelRenderer(this, 0, 6); + Shape2.addBox(0F, 0F, 0F, 5, 2, 4); + Shape2.setRotationPoint(-2F, -1F, -2F); + Shape2.setTextureSize(64, 32); + Shape2.mirror = true; + setRotation(Shape2, 0F, 0F, 0F); + Shape3 = new ModelRenderer(this, 58, 0); + Shape3.addBox(0F, 0F, 0F, 1, 2, 2); + Shape3.setRotationPoint(-3F, -1F, -1F); + Shape3.setTextureSize(64, 32); + Shape3.mirror = true; + setRotation(Shape3, 0F, 0F, 0F); + Shape4 = new ModelRenderer(this, 52, 0); + Shape4.addBox(0F, 0F, 0F, 1, 2, 2); + Shape4.setRotationPoint(3F, -1F, -1F); + Shape4.setTextureSize(64, 32); + Shape4.mirror = true; + setRotation(Shape4, 0F, 0F, 0F); + Shape5 = new ModelRenderer(this, 46, 0); + Shape5.addBox(0F, 0F, 0F, 2, 2, 1); + Shape5.setRotationPoint(4F, -1F, -2F); + Shape5.setTextureSize(64, 32); + Shape5.mirror = true; + setRotation(Shape5, 0F, 0F, 0F); + Shape6 = new ModelRenderer(this, 40, 0); + Shape6.addBox(0F, 0F, 0F, 2, 2, 1); + Shape6.setRotationPoint(4F, -1F, 1F); + Shape6.setTextureSize(64, 32); + Shape6.mirror = true; + setRotation(Shape6, 0F, 0F, 0F); + Shape7 = new ModelRenderer(this, 24, 0); + Shape7.addBox(0F, 0F, 0F, 2, 1, 2); + Shape7.setRotationPoint(4F, -2F, -1F); + Shape7.setTextureSize(64, 32); + Shape7.mirror = true; + setRotation(Shape7, 0F, 0F, 0F); + Shape8 = new ModelRenderer(this, 32, 0); + Shape8.addBox(0F, 0F, 0F, 2, 1, 2); + Shape8.setRotationPoint(4F, 1F, -1F); + Shape8.setTextureSize(64, 32); + Shape8.mirror = true; + setRotation(Shape8, 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); + Shape7.render(f5); + Shape8.render(f5); + } + + public void renderAll(float f5) + { + Shape1.render(f5); + Shape2.render(f5); + Shape3.render(f5); + Shape4.render(f5); + Shape5.render(f5); + Shape6.render(f5); + Shape7.render(f5); + Shape8.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); + } + +} diff --git a/com/hbm/render/RenderMiniNuke.java b/com/hbm/render/RenderMiniNuke.java new file mode 100644 index 000000000..3e8c788dd --- /dev/null +++ b/com/hbm/render/RenderMiniNuke.java @@ -0,0 +1,39 @@ +package com.hbm.render; + +import org.lwjgl.opengl.GL11; + +import com.hbm.lib.RefStrings; + +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.model.AdvancedModelLoader; +import net.minecraftforge.client.model.IModelCustom; + +public class RenderMiniNuke extends Render { + + private ModelMiniNuke miniNuke; + + public RenderMiniNuke() { + miniNuke = new ModelMiniNuke(); + } + + @Override + public void doRender(Entity p_76986_1_, 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(p_76986_1_.prevRotationYaw + (p_76986_1_.rotationYaw - p_76986_1_.prevRotationYaw) * p_76986_9_ - 90.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(p_76986_1_.prevRotationPitch + (p_76986_1_.rotationPitch - p_76986_1_.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/MiniNuke.png")); + miniNuke.renderAll(0.0625F); + GL11.glPopMatrix(); + } + + @Override + protected ResourceLocation getEntityTexture(Entity p_110775_1_) { + return new ResourceLocation(RefStrings.MODID + ":textures/models/MiniNuke.png"); + } +}