diff --git a/src/main/java/assets/hbm/lang/de_DE.lang b/src/main/java/assets/hbm/lang/de_DE.lang index c1ce96298..3381e7725 100644 --- a/src/main/java/assets/hbm/lang/de_DE.lang +++ b/src/main/java/assets/hbm/lang/de_DE.lang @@ -64,11 +64,14 @@ achievement.tasteofblood=Der Geschmack von Blut armor.blastProtection=Explosionsmodifikator: %s armor.cap=Schadensobergrenze: %s armor.damageModifier=Modifikator: %s (%s) +armor.electricJetpack=Ionentriebwerke armor.fireproof=Feuerfest armor.fullSetBonus=Set-Bonus: armor.geigerHUD=Geigerzähler-HUD armor.geigerSound=Akustischer Geigerzähler +armor.glider=Schleichen um zu gleiten armor.gravity=Schwerkraftsmodifikator: %s +armor.hardLanding=Harte Landung armor.modifier=Genereller Schadensmodifikator: %s armor.nullDamage=Nichtet Schaden von %s armor.thermal=Wärmebildkamera @@ -610,6 +613,7 @@ item.bj_boots.name=Lunare Beschlagene Stiefel item.bj_helmet.name=Augenklappe mit Infrarot-Sensor item.bj_legs.name=Lunare Kybernetischer Beinersatz item.bj_plate.name=Lunare Kybernetische Panzerung +item.bj_plate_jetpack.name=Lunare Kybernetische Panzerung (Geflügelt) item.black_hole.name=Miniatur Schwarzes Loch item.blade_meteorite.name=Meteoritenklinge item.blade_titanium.name=Titanturbinenschaufel @@ -1253,7 +1257,7 @@ item.ingot_weidanium.name=Weidaniumbarren item.jackt.name=Verdammt stylische Kugeljacke item.jackt2.name=Verdammt stylische Kugeljacke 2: Tokyo Drift item.jetpack_boost.name=Boosterrucksack -item.jetpack_break.name=Bremsrucksack +item.jetpack_break.name=Bauarbeiter-Raketenrucksack item.jetpack_fly.name=Raketenrucksack item.jetpack_tank.name=Raketenrucksack-Reservetank item.jetpack_vector.name=Schubvektorgesteuerter Raketenrucksack diff --git a/src/main/java/assets/hbm/lang/en_US.lang b/src/main/java/assets/hbm/lang/en_US.lang index 3a377f671..fa8d33187 100644 --- a/src/main/java/assets/hbm/lang/en_US.lang +++ b/src/main/java/assets/hbm/lang/en_US.lang @@ -64,11 +64,14 @@ achievement.tasteofblood=The Taste of Blood armor.blastProtection=Damage modifier of %s against explosions armor.cap=Hard damage cap of %s armor.damageModifier=Damage modifier of %s against %s +armor.electricJetpack=Ion Jetpack armor.fireproof=Fireproof armor.fullSetBonus=Full Set Bonus: armor.geigerHUD=Built-In Geiger Counter HUD armor.geigerSound=Auditory Geiger Counter +armor.glider=Sneak to glide armor.gravity=Gravity modifier of %s +armor.hardLanding=Hard Landing armor.modifier=General damage modifier of %s armor.nullDamage=Nullifies all damage from %s armor.thermal=Thermal Sight @@ -610,6 +613,7 @@ item.bj_boots.name=Lunar Studded Boots item.bj_helmet.name=Eyepatch with Thermal Sensor item.bj_legs.name=Lunar Cybernetic Leg Replacements item.bj_plate.name=Lunar Cybernetic Plating +item.bj_plate_jetpack.name=Lunar Cybernetic Plating (Winged) item.black_hole.name=Miniature Black Hole item.blade_meteorite.name=Meteorite Blade item.blade_titanium.name=Titanium Blade @@ -1253,7 +1257,7 @@ item.ingot_weidanium.name=Weidanium Ingot item.jackt.name=Damn Stylish Ballistic Jacket item.jackt2.name=Damn Stylish Ballistic Jacket 2: Tokyo Drift item.jetpack_boost.name=Boostpack -item.jetpack_break.name=Breakpack +item.jetpack_break.name=Builder's Jetpack item.jetpack_fly.name=Jetpack item.jetpack_tank.name=Jetpack Reserve Fuel Tank item.jetpack_vector.name=Vectored Jetpack diff --git a/src/main/java/assets/hbm/textures/items/bj_plate_jetpack.png b/src/main/java/assets/hbm/textures/items/bj_plate_jetpack.png new file mode 100644 index 000000000..9499ffa6c Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/bj_plate_jetpack.png differ diff --git a/src/main/java/assets/hbm/textures/items/broodwich.png b/src/main/java/assets/hbm/textures/items/broodwich.png new file mode 100644 index 000000000..9a692d3c0 Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/broodwich.png differ diff --git a/src/main/java/assets/hbm/textures/particle/explosion_bf.png b/src/main/java/assets/hbm/textures/particle/explosion_bf.png new file mode 100644 index 000000000..ec6353b4c Binary files /dev/null and b/src/main/java/assets/hbm/textures/particle/explosion_bf.png differ diff --git a/src/main/java/com/hbm/crafting/ArmorRecipes.java b/src/main/java/com/hbm/crafting/ArmorRecipes.java index 633b83c4d..512e91396 100644 --- a/src/main/java/com/hbm/crafting/ArmorRecipes.java +++ b/src/main/java/com/hbm/crafting/ArmorRecipes.java @@ -2,6 +2,7 @@ package com.hbm.crafting; import com.hbm.blocks.ModBlocks; import com.hbm.config.GeneralConfig; +import com.hbm.handler.FluidTypeHandler.FluidType; import com.hbm.items.ModItems; import cpw.mods.fml.common.registry.GameRegistry; @@ -57,6 +58,7 @@ public class ArmorRecipes { GameRegistry.addRecipe(new ItemStack(ModItems.ajr_boots, 1), new Object[] { "P P", "PBP", 'P', ModItems.plate_armor_ajr, 'B', ModItems.alloy_boots }); GameRegistry.addRecipe(new ItemStack(ModItems.bj_helmet, 1), new Object[] { "SBS", " C ", " I ", 'S', Items.string, 'B', new ItemStack(Blocks.wool, 1, 15), 'C', ModItems.circuit_targeting_tier4, 'I', ModItems.ingot_starmetal }); GameRegistry.addRecipe(new ItemStack(ModItems.bj_plate, 1), new Object[] { "N N", "MSM", "NCN", 'N', ModItems.plate_armor_lunar, 'M', ModItems.motor_desh, 'S', ModItems.starmetal_plate, 'C', ModItems.circuit_targeting_tier5 }); + GameRegistry.addRecipe(new ItemStack(ModItems.bj_plate_jetpack, 1), new Object[] { "NFN", "TPT", "ICI", 'N', ModItems.plate_armor_lunar, 'F', ModItems.fins_quad_titanium, 'T', new ItemStack(ModItems.fluid_tank_full, 1, FluidType.XENON.ordinal()), 'P', ModItems.bj_plate, 'I', ModItems.mp_thruster_10_xenon, 'C', ModItems.crystal_phosphorus }); GameRegistry.addRecipe(new ItemStack(ModItems.bj_legs, 1), new Object[] { "MBM", "NSN", "N N", 'N', ModItems.plate_armor_lunar, 'M', ModItems.motor_desh, 'S', ModItems.starmetal_legs, 'B', ModBlocks.block_starmetal }); GameRegistry.addRecipe(new ItemStack(ModItems.bj_boots, 1), new Object[] { "N N", "BSB", 'N', ModItems.plate_armor_lunar, 'S', ModItems.starmetal_boots, 'B', ModBlocks.block_starmetal }); GameRegistry.addRecipe(new ItemStack(ModItems.hev_helmet, 1), new Object[] { "PPC", "PBP", "IFI", 'P', ModItems.plate_armor_hev, 'C', ModItems.circuit_targeting_tier4, 'B', ModItems.titanium_helmet, 'I', ModItems.plate_polymer, 'F', ModItems.gas_mask_filter }); @@ -71,10 +73,10 @@ public class ArmorRecipes { GameRegistry.addRecipe(new ItemStack(ModItems.euphemium_boots, 1), new Object[] { "E E", "E E", 'E', ModItems.plate_euphemium }); //Jetpacks - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.jetpack_boost, 1), new Object[] { "PTP", "SLS", "W W", 'P', "plateSteel", 'T', ModItems.tank_steel, 'S', ModItems.pipes_steel, 'L', Items.leather, 'W', ModItems.thruster_small })); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.jetpack_fly, 1), new Object[] { "PTP", "SLS", "W W", 'P', "plateSteel", 'T', ModItems.cap_aluminium, 'S', ModItems.pipes_steel, 'L', ModItems.jetpack_boost, 'W', ModItems.thruster_small })); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.jetpack_break, 1), new Object[] { "PTP", "SLS", "P P", 'P', "plateSteel", 'T', ModItems.cap_aluminium, 'S', ModItems.coil_tungsten, 'L', ModItems.jetpack_boost })); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.jetpack_vector, 1), new Object[] { "PTP", "SLS", "W W", 'P', "plateTitanium", 'T', ModItems.circuit_copper, 'S', ModItems.motor, 'L', ModItems.jetpack_fly, 'W', ModItems.thruster_small })); + GameRegistry.addRecipe(new ItemStack(ModItems.jetpack_fly, 1), new Object[] { "ACA", "TLT", "D D", 'A', ModItems.cap_aluminium, 'C', ModItems.circuit_targeting_tier1, 'T', ModItems.tank_steel, 'L', Items.leather, 'D', ModItems.thruster_small }); + GameRegistry.addRecipe(new ItemStack(ModItems.jetpack_break, 1), new Object[] { "ICI", "TJT", "I I", 'C', ModItems.circuit_targeting_tier2, 'T', ModItems.ingot_dura_steel, 'J', ModItems.jetpack_fly, 'I', ModItems.plate_polymer }); + GameRegistry.addRecipe(new ItemStack(ModItems.jetpack_vector, 1), new Object[] { "TCT", "MJM", "B B", 'C', ModItems.circuit_targeting_tier3, 'T', ModItems.tank_steel, 'J', ModItems.jetpack_break, 'M', ModItems.motor, 'B', ModItems.bolt_dura_steel }); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.jetpack_boost, 1), new Object[] { "PCP", "DJD", "PAP", 'C', ModItems.circuit_targeting_tier4, 'P', ModItems.plate_saturnite, 'D', "ingotDesh", 'J', ModItems.jetpack_vector, 'A', ModItems.board_copper })); //Hazmat GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.hazmat_helmet, 1), new Object[] { "EEE", "EIE", "FPF", 'E', ModItems.hazmat_cloth, 'I', "paneGlass", 'P', "plateSteel", 'F', ModItems.filter_coal })); diff --git a/src/main/java/com/hbm/entity/projectile/EntityShrapnel.java b/src/main/java/com/hbm/entity/projectile/EntityShrapnel.java index db855bfbe..b57b2cffa 100644 --- a/src/main/java/com/hbm/entity/projectile/EntityShrapnel.java +++ b/src/main/java/com/hbm/entity/projectile/EntityShrapnel.java @@ -11,6 +11,7 @@ public class EntityShrapnel extends EntityThrowable { public EntityShrapnel(World p_i1773_1_) { super(p_i1773_1_); + this.isImmuneToFire = true; } public EntityShrapnel(World p_i1774_1_, EntityLivingBase p_i1774_2_) diff --git a/src/main/java/com/hbm/explosion/ExplosionNT.java b/src/main/java/com/hbm/explosion/ExplosionNT.java index 8c3f41d92..9e3f60a97 100644 --- a/src/main/java/com/hbm/explosion/ExplosionNT.java +++ b/src/main/java/com/hbm/explosion/ExplosionNT.java @@ -155,9 +155,10 @@ public class ExplosionNT extends Explosion { } } - public void doExplosionB(boolean p_77279_1_) - { - this.worldObj.playSoundEffect(this.explosionX, this.explosionY, this.explosionZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F); + public void doExplosionB(boolean p_77279_1_) { + + if(!has(ExAttrib.NOSOUND)) + this.worldObj.playSoundEffect(this.explosionX, this.explosionY, this.explosionZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F); if (!has(ExAttrib.NOPARTICLE)) { if (this.explosionSize >= 2.0F && this.isSmoking) @@ -212,7 +213,7 @@ public class ExplosionNT extends Explosion { if (block.getMaterial() != Material.air) { - if (block.canDropFromExplosion(this)) + if (block.canDropFromExplosion(this) && !has(ExAttrib.NODROP)) { float chance = 1.0F; @@ -280,7 +281,9 @@ public class ExplosionNT extends Explosion { LAVA, //again the same thing but lava ALLMOD, //block placer attributes like fire are applied for all destroyed blocks ALLDROP, //miner TNT! + NODROP, //the opposite NOPARTICLE, + NOSOUND, NOHURT } diff --git a/src/main/java/com/hbm/handler/guncfg/GunFatmanFactory.java b/src/main/java/com/hbm/handler/guncfg/GunFatmanFactory.java index a513099b1..1d8c953ff 100644 --- a/src/main/java/com/hbm/handler/guncfg/GunFatmanFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/GunFatmanFactory.java @@ -5,6 +5,10 @@ import java.util.ArrayList; import com.hbm.config.BombConfig; import com.hbm.entity.logic.EntityBalefire; import com.hbm.entity.projectile.EntityBulletBase; +import com.hbm.explosion.ExplosionLarge; +import com.hbm.explosion.ExplosionNT; +import com.hbm.explosion.ExplosionNT.ExAttrib; +import com.hbm.explosion.ExplosionNukeGeneric; import com.hbm.explosion.ExplosionParticleB; import com.hbm.handler.BulletConfigSyncingUtil; import com.hbm.handler.BulletConfiguration; @@ -15,6 +19,7 @@ import com.hbm.items.ModItems; import com.hbm.packet.AuxParticlePacketNT; import com.hbm.packet.PacketDispatcher; import com.hbm.render.util.RenderScreenOverlay.Crosshair; +import com.hbm.saveddata.RadiationSavedData; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import net.minecraft.nbt.NBTTagCompound; @@ -118,11 +123,39 @@ public class GunFatmanFactory { public void behaveBlockHit(EntityBulletBase bullet, int x, int y, int z) { if(!bullet.worldObj.isRemote) { + + double posX = bullet.posX; + double posY = bullet.posY + 0.5; + double posZ = bullet.posZ; + + if(y >= 0) { + posX = x + 0.5; + posY = y + 1.5; + posZ = z + 0.5; + } NBTTagCompound data = new NBTTagCompound(); data.setString("type", "muke"); - PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, bullet.posX, bullet.posY + 0.5, bullet.posZ), new TargetPoint(bullet.dimension, bullet.posX, bullet.posY, bullet.posZ, 250)); + PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, posX, posY + 0.5, posZ), new TargetPoint(bullet.dimension, bullet.posX, bullet.posY, bullet.posZ, 250)); bullet.worldObj.playSoundEffect(x, y, z, "hbm:weapon.mukeExplosion", 15.0F, 1.0F); + + ExplosionLarge.spawnShrapnels(bullet.worldObj, posX, posY, posZ, 25); + + ExplosionNT exp = new ExplosionNT(bullet.worldObj, null, posX, posY, posZ, 15F) + .addAttrib(ExAttrib.FIRE) + .addAttrib(ExAttrib.NOPARTICLE) + .addAttrib(ExAttrib.NOSOUND) + .addAttrib(ExAttrib.NODROP) + .addAttrib(ExAttrib.NOHURT); + exp.doExplosionA(); + exp.doExplosionB(false); + + ExplosionNukeGeneric.dealDamage(bullet.worldObj, posX, posY, posZ, 45); + + for(int i = -2; i <= 2; i++) + for(int j = -2; j <= 2; j++) + if(i + j < 4) + RadiationSavedData.incrementRad(bullet.worldObj, (int)posX + i * 16, (int)posZ + j * 16, 50 / (Math.abs(i) + Math.abs(j) + 1), 1000); } } }; @@ -189,13 +222,41 @@ public class GunFatmanFactory { public void behaveBlockHit(EntityBulletBase bullet, int x, int y, int z) { if(!bullet.worldObj.isRemote) { - EntityBalefire bf = new EntityBalefire(bullet.worldObj); + + double posX = bullet.posX; + double posY = bullet.posY + 0.5; + double posZ = bullet.posZ; + + if(y >= 0) { + posX = x + 0.5; + posY = y + 1.5; + posZ = z + 0.5; + } + + /*EntityBalefire bf = new EntityBalefire(bullet.worldObj); bf.posX = x; bf.posY = y; bf.posZ = z; bf.destructionRange = (int) (BombConfig.fatmanRadius * 1.25); - bullet.worldObj.spawnEntityInWorld(bf); - ExplosionParticleB.spawnMush(bullet.worldObj, x, y, z); + bullet.worldObj.spawnEntityInWorld(bf);*/ + + bullet.worldObj.playSoundEffect(x, y, z, "hbm:weapon.mukeExplosion", 15.0F, 1.0F); + + ExplosionLarge.spawnShrapnels(bullet.worldObj, posX, posY, posZ, 25); + + ExplosionNT exp = new ExplosionNT(bullet.worldObj, null, posX, posY, posZ, 15F) + .addAttrib(ExAttrib.BALEFIRE) + .addAttrib(ExAttrib.NOPARTICLE) + .addAttrib(ExAttrib.NOSOUND) + .addAttrib(ExAttrib.NODROP) + .addAttrib(ExAttrib.NOHURT); + exp.doExplosionA(); + exp.doExplosionB(false); + + NBTTagCompound data = new NBTTagCompound(); + data.setString("type", "muke"); + data.setBoolean("balefire", true); + PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, x, y + 0.5, z), new TargetPoint(bullet.dimension, bullet.posX, bullet.posY, bullet.posZ, 250)); } } }; diff --git a/src/main/java/com/hbm/interfaces/IPartiallyFillable.java b/src/main/java/com/hbm/interfaces/IPartiallyFillable.java new file mode 100644 index 000000000..590302c5f --- /dev/null +++ b/src/main/java/com/hbm/interfaces/IPartiallyFillable.java @@ -0,0 +1,21 @@ +package com.hbm.interfaces; + +import com.hbm.handler.FluidTypeHandler.FluidType; + +import net.minecraft.item.ItemStack; + +public interface IPartiallyFillable { + + public FluidType getType(ItemStack stack); + + public int getFill(ItemStack stack); + + public void setFill(ItemStack stack, int fill); + + public int getMaxFill(ItemStack stack); + + public int getLoadSpeed(ItemStack stack); + + public int getUnloadSpeed(ItemStack stack); + +} diff --git a/src/main/java/com/hbm/inventory/FluidTank.java b/src/main/java/com/hbm/inventory/FluidTank.java index 5e3521527..561a2f4db 100644 --- a/src/main/java/com/hbm/inventory/FluidTank.java +++ b/src/main/java/com/hbm/inventory/FluidTank.java @@ -1,6 +1,7 @@ package com.hbm.inventory; import com.hbm.handler.FluidTypeHandler.FluidType; +import com.hbm.interfaces.IPartiallyFillable; import com.hbm.inventory.gui.GuiInfoContainer; import com.hbm.items.ModItems; import com.hbm.items.armor.JetpackBase; @@ -81,6 +82,9 @@ public class FluidTank { FluidType inType = FluidType.NONE; if(slots[in] != null) { + + //TODO: add IPartiallyFillable case for unloading + inType = FluidContainerRegistry.getFluidType(slots[in]); if(slots[in].getItem() == ModItems.fluid_barrel_infinite && type != FluidType.NONE) { @@ -123,19 +127,24 @@ public class FluidTank { ItemStack full = null; if(slots[in] != null) { - - //TODO: make an interface to handle cases like these - for(int i = 0; i < 25; i++) { - if(slots[in].getItem() instanceof JetpackBase && ((JetpackBase)slots[in].getItem()).fuel == this.type) { - if(this.fluid > 0 && JetpackBase.getFuel(slots[in]) < ((JetpackBase)slots[in].getItem()).maxFuel) { - this.fluid--; - JetpackBase.setFuel(slots[in], JetpackBase.getFuel(slots[in]) + 1); - } else { - return; + + if(slots[in].getItem() instanceof IPartiallyFillable) { + IPartiallyFillable fillable = (IPartiallyFillable)slots[in].getItem(); + int speed = fillable.getLoadSpeed(slots[in]); + + if(fillable.getType(slots[in]) == this.type && speed > 0) { + + int toLoad = Math.min(this.fluid, speed); + int fill = fillable.getFill(slots[in]); + toLoad = Math.min(toLoad, fillable.getMaxFill(slots[in]) - fill); + + if(toLoad > 0) { + this.fluid -= toLoad; + fillable.setFill(slots[in], fill + toLoad); } - } else { - break; } + + return; } if(slots[in].getItem() == ModItems.fluid_barrel_infinite) { diff --git a/src/main/java/com/hbm/items/ModItems.java b/src/main/java/com/hbm/items/ModItems.java index 27bc10173..c1765d35d 100644 --- a/src/main/java/com/hbm/items/ModItems.java +++ b/src/main/java/com/hbm/items/ModItems.java @@ -1641,6 +1641,7 @@ public class ModItems { public static Item ajr_boots; public static Item bj_helmet; public static Item bj_plate; + public static Item bj_plate_jetpack; public static Item bj_legs; public static Item bj_boots; public static Item hev_helmet; @@ -3738,6 +3739,7 @@ public class ModItems { .setFireproof(true) .enableVATS(true) .setHasGeigerSound(true) + .setHasHardLanding(true) .addEffect(new PotionEffect(Potion.damageBoost.id, 20, 0)) .setBlastProtection(0.5F) .addResistance("fall", 0) @@ -3752,6 +3754,7 @@ public class ModItems { .setFireproof(true) .enableVATS(true) .setHasGeigerSound(true) + .setHasHardLanding(true) .addEffect(new PotionEffect(Potion.jump.id, 20, 0)) .addEffect(new PotionEffect(Potion.damageBoost.id, 20, 0)) .setBlastProtection(0.25F) @@ -3770,6 +3773,7 @@ public class ModItems { .enableVATS(true) .enableThermalSight(true) .setHasGeigerSound(true) + .setHasHardLanding(true) .addEffect(new PotionEffect(Potion.moveSpeed.id, 20, 1)) .addEffect(new PotionEffect(Potion.jump.id, 20, 0)) .addEffect(new PotionEffect(Potion.field_76443_y.id, 20, 0)) @@ -3781,6 +3785,7 @@ public class ModItems { .setFall("hbm:step.iron_land") .addResistance("fall", 0).setUnlocalizedName("bj_helmet").setTextureName(RefStrings.MODID + ":bj_helmet"); bj_plate = new ArmorBJ(aMatBJ, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 10000000, 10000, 1000, 100).cloneStats((ArmorFSB) bj_helmet).setUnlocalizedName("bj_plate").setTextureName(RefStrings.MODID + ":bj_plate"); + bj_plate_jetpack = new ArmorBJJetpack(aMatBJ, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 10000000, 10000, 1000, 100).cloneStats((ArmorFSB) bj_helmet).setUnlocalizedName("bj_plate_jetpack").setTextureName(RefStrings.MODID + ":bj_plate_jetpack"); bj_legs = new ArmorBJ(aMatBJ, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 10000000, 10000, 1000, 100).cloneStats((ArmorFSB) bj_helmet).setUnlocalizedName("bj_legs").setTextureName(RefStrings.MODID + ":bj_legs"); bj_boots = new ArmorBJ(aMatBJ, 7, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png", 10000000, 10000, 1000, 100).cloneStats((ArmorFSB) bj_helmet).setUnlocalizedName("bj_boots").setTextureName(RefStrings.MODID + ":bj_boots"); @@ -4059,8 +4064,8 @@ public class ModItems { australium_iii = new ArmorAustralium(MainRegistry.aMatAus3, 9, 1).setUnlocalizedName("australium_iii").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":australium_iii"); - jetpack_boost = new JetpackBooster(MainRegistry.aMatSteel, 9, 1).setUnlocalizedName("jetpack_boost").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":jetpack_boost"); - jetpack_break = new JetpackBreak(MainRegistry.aMatSteel, 9, 1, FluidType.KEROSENE, 8000).setUnlocalizedName("jetpack_break").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":jetpack_break"); + jetpack_boost = new JetpackBooster(MainRegistry.aMatSteel, 9, 1, FluidType.BALEFIRE, 32000).setUnlocalizedName("jetpack_boost").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":jetpack_boost"); + jetpack_break = new JetpackBreak(MainRegistry.aMatSteel, 9, 1, FluidType.KEROSENE, 12000).setUnlocalizedName("jetpack_break").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":jetpack_break"); jetpack_fly = new JetpackRegular(MainRegistry.aMatSteel, 9, 1, FluidType.KEROSENE, 12000).setUnlocalizedName("jetpack_fly").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":jetpack_fly"); jetpack_vector = new JetpackVectorized(MainRegistry.aMatSteel, 9, 1, FluidType.KEROSENE, 16000).setUnlocalizedName("jetpack_vector").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":jetpack_vector"); @@ -6079,6 +6084,7 @@ public class ModItems { GameRegistry.registerItem(ajr_boots, ajr_boots.getUnlocalizedName()); GameRegistry.registerItem(bj_helmet, bj_helmet.getUnlocalizedName()); GameRegistry.registerItem(bj_plate, bj_plate.getUnlocalizedName()); + GameRegistry.registerItem(bj_plate_jetpack, bj_plate_jetpack.getUnlocalizedName()); GameRegistry.registerItem(bj_legs, bj_legs.getUnlocalizedName()); GameRegistry.registerItem(bj_boots, bj_boots.getUnlocalizedName()); GameRegistry.registerItem(hev_helmet, hev_helmet.getUnlocalizedName()); @@ -6151,10 +6157,10 @@ public class ModItems { GameRegistry.registerItem(australium_iii, australium_iii.getUnlocalizedName()); GameRegistry.registerItem(jackt, jackt.getUnlocalizedName()); GameRegistry.registerItem(jackt2, jackt2.getUnlocalizedName()); - GameRegistry.registerItem(jetpack_boost, jetpack_boost.getUnlocalizedName()); - GameRegistry.registerItem(jetpack_break, jetpack_break.getUnlocalizedName()); GameRegistry.registerItem(jetpack_fly, jetpack_fly.getUnlocalizedName()); + GameRegistry.registerItem(jetpack_break, jetpack_break.getUnlocalizedName()); GameRegistry.registerItem(jetpack_vector, jetpack_vector.getUnlocalizedName()); + GameRegistry.registerItem(jetpack_boost, jetpack_boost.getUnlocalizedName()); //GameRegistry.registerItem(australium_iv, australium_iv.getUnlocalizedName()); //GameRegistry.registerItem(australium_v, australium_v.getUnlocalizedName()); diff --git a/src/main/java/com/hbm/items/armor/ArmorBJJetpack.java b/src/main/java/com/hbm/items/armor/ArmorBJJetpack.java new file mode 100644 index 000000000..fe2c112d3 --- /dev/null +++ b/src/main/java/com/hbm/items/armor/ArmorBJJetpack.java @@ -0,0 +1,114 @@ +package com.hbm.items.armor; + +import java.util.List; + +import com.hbm.extprop.HbmExtendedProperties; +import com.hbm.handler.HbmKeybinds.EnumKeybind; +import com.hbm.main.MainRegistry; +import com.hbm.packet.AuxParticlePacketNT; +import com.hbm.packet.KeybindPacket; +import com.hbm.packet.PacketDispatcher; +import com.hbm.render.model.ModelArmorBJ; +import com.hbm.util.I18nUtil; + +import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class ArmorBJJetpack extends ArmorBJ { + + public ArmorBJJetpack(ArmorMaterial material, int layer, int slot, String texture, long maxPower, long chargeRate, long consumption, long drain) { + super(material, layer, slot, texture, maxPower, chargeRate, consumption, drain); + } + + @SideOnly(Side.CLIENT) + ModelArmorBJ model; + + @Override + @SideOnly(Side.CLIENT) + public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) { + + if(model == null) { + model = new ModelArmorBJ(5); + } + + return model; + } + + public void onArmorTick(World world, EntityPlayer player, ItemStack stack) { + + super.onArmorTick(world, player, stack); + + HbmExtendedProperties props = HbmExtendedProperties.getData(player); + + if(world.isRemote) { + + if(player == MainRegistry.proxy.me()) { + + boolean last = props.getKeyPressed(EnumKeybind.JETPACK); + boolean current = MainRegistry.proxy.getIsKeyPressed(EnumKeybind.JETPACK); + + if(last != current) { + PacketDispatcher.wrapper.sendToServer(new KeybindPacket(EnumKeybind.JETPACK, current)); + props.setKeyPressed(EnumKeybind.JETPACK, current); + } + } + + } else { + + if(this.hasFSBArmor(player) && props.getKeyPressed(EnumKeybind.JETPACK)) { + + NBTTagCompound data = new NBTTagCompound(); + data.setString("type", "jetpack_bj"); + data.setInteger("player", player.getEntityId()); + PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, player.posX, player.posY, player.posZ), new TargetPoint(world.provider.dimensionId, player.posX, player.posY, player.posZ, 100)); + } + } + + if(this.hasFSBArmor(player)) { + + if(props.getKeyPressed(EnumKeybind.JETPACK)) { + + if(player.motionY < 0.4D) + player.motionY += 0.1D; + + player.fallDistance = 0; + + world.playSoundEffect(player.posX, player.posY, player.posZ, "hbm:weapon.immolatorShoot", 0.125F, 1.5F); + + } else if(player.isSneaking()) { + + if(player.motionY < -0.08) { + + double mo = player.motionY * -0.4; + player.motionY += mo; + + Vec3 vec = player.getLookVec(); + vec.xCoord *= mo; + vec.yCoord *= mo; + vec.zCoord *= mo; + + player.motionX += vec.xCoord; + player.motionY += vec.yCoord; + player.motionZ += vec.zCoord; + } + } + } + } + + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) { + super.addInformation(stack, player, list, ext); + + list.add(EnumChatFormatting.RED + " + " + I18nUtil.resolveKey("armor.electricJetpack")); + list.add(EnumChatFormatting.GRAY + " + " + I18nUtil.resolveKey("armor.glider")); + } +} diff --git a/src/main/java/com/hbm/items/armor/ArmorFSB.java b/src/main/java/com/hbm/items/armor/ArmorFSB.java index f3b197dfc..daad39cc0 100644 --- a/src/main/java/com/hbm/items/armor/ArmorFSB.java +++ b/src/main/java/com/hbm/items/armor/ArmorFSB.java @@ -25,13 +25,16 @@ import net.minecraft.client.resources.I18n; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; +import net.minecraft.util.DamageSource; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraftforge.client.event.RenderGameOverlayEvent; @@ -55,6 +58,7 @@ public class ArmorFSB extends ItemArmor { public boolean thermal = false; public boolean geigerSound = false; public boolean customGeiger = false; + public boolean hardLanding = false; public double gravity = 0; public String step; public String jump; @@ -125,6 +129,11 @@ public class ArmorFSB extends ItemArmor { return this; } + public ArmorFSB setHasHardLanding(boolean hardLanding) { + this.hardLanding = hardLanding; + return this; + } + public ArmorFSB setGravity(double gravity) { this.gravity = gravity; return this; @@ -165,6 +174,7 @@ public class ArmorFSB extends ItemArmor { this.thermal = original.thermal; this.geigerSound = original.geigerSound; this.customGeiger = original.customGeiger; + this.hardLanding = original.hardLanding; this.gravity = original.gravity; this.step = original.step; this.jump = original.jump; @@ -238,6 +248,10 @@ public class ArmorFSB extends ItemArmor { list.add(EnumChatFormatting.RED + " " + I18nUtil.resolveKey("armor.thermal")); } + if(hardLanding) { + list.add(EnumChatFormatting.RED + " " + I18nUtil.resolveKey("armor.hardLanding")); + } + if(gravity != 0) { list.add(EnumChatFormatting.BLUE + " " + I18nUtil.resolveKey("armor.gravity", gravity)); } @@ -425,6 +439,29 @@ public class ArmorFSB extends ItemArmor { if(ArmorFSB.hasFSBArmor(player)) { ArmorFSB chestplate = (ArmorFSB) player.inventory.armorInventory[2].getItem(); + + if(chestplate.hardLanding && player.fallDistance > 10) { + + //player.playSound(Block.soundTypeAnvil.func_150496_b(), 2.0F, 0.5F); + + List entities = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, player.boundingBox.expand(3, 0, 3)); + + for(Entity e : entities) { + + Vec3 vec = Vec3.createVectorHelper(player.posX - e.posX, 0, player.posZ - e.posZ); + + if(vec.lengthVector() < 3) { + + double intensity = 3 - vec.lengthVector(); + e.motionX += vec.xCoord * intensity * -2; + e.motionY += 0.1D * intensity; + e.motionZ += vec.zCoord * intensity * -2; + + e.attackEntityFrom(DamageSource.causePlayerDamage(player).setDamageBypassesArmor(), (float) (intensity * 10)); + } + } + //return; + } if(chestplate.fall != null) player.playSound(chestplate.fall, 1.0F, 1.0F); diff --git a/src/main/java/com/hbm/items/armor/ArmorFSBPowered.java b/src/main/java/com/hbm/items/armor/ArmorFSBPowered.java index 94c4150e6..c23e22600 100644 --- a/src/main/java/com/hbm/items/armor/ArmorFSBPowered.java +++ b/src/main/java/com/hbm/items/armor/ArmorFSBPowered.java @@ -130,7 +130,7 @@ public class ArmorFSBPowered extends ArmorFSB implements IBatteryItem { public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { - if(this.drain > 0 && ArmorFSB.hasFSBArmor(player)) { + if(this.drain > 0 && ArmorFSB.hasFSBArmor(player) && !player.capabilities.isCreativeMode) { this.dischargeBattery(itemStack, drain); } } diff --git a/src/main/java/com/hbm/items/armor/JetpackBase.java b/src/main/java/com/hbm/items/armor/JetpackBase.java index 4e1be46fa..5a03fdbec 100644 --- a/src/main/java/com/hbm/items/armor/JetpackBase.java +++ b/src/main/java/com/hbm/items/armor/JetpackBase.java @@ -3,6 +3,7 @@ package com.hbm.items.armor; import java.util.List; import com.hbm.handler.FluidTypeHandler.FluidType; +import com.hbm.interfaces.IPartiallyFillable; import com.hbm.render.model.ModelJetPack; import com.hbm.util.I18nUtil; @@ -16,7 +17,7 @@ import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -public abstract class JetpackBase extends ItemArmor { +public abstract class JetpackBase extends ItemArmor implements IPartiallyFillable { private ModelJetPack model; public FluidType fuel; @@ -75,4 +76,34 @@ public abstract class JetpackBase extends ItemArmor { stack.stackTagCompound.setInteger("fuel", i); } + + @Override + public FluidType getType(ItemStack stack) { + return fuel; + } + + @Override + public int getFill(ItemStack stack) { + return this.getFuel(stack); + } + + @Override + public void setFill(ItemStack stack, int fill) { + this.setFuel(stack, fill); + } + + @Override + public int getMaxFill(ItemStack stack) { + return this.maxFuel; + } + + @Override + public int getLoadSpeed(ItemStack stack) { + return 10; + } + + @Override + public int getUnloadSpeed(ItemStack stack) { + return 0; + } } diff --git a/src/main/java/com/hbm/items/armor/JetpackBooster.java b/src/main/java/com/hbm/items/armor/JetpackBooster.java index da9fbdb4d..7e1053ba6 100644 --- a/src/main/java/com/hbm/items/armor/JetpackBooster.java +++ b/src/main/java/com/hbm/items/armor/JetpackBooster.java @@ -2,52 +2,28 @@ package com.hbm.items.armor; import java.util.List; -import com.hbm.entity.particle.EntityGasFlameFX; -import com.hbm.render.model.ModelJetPack; +import com.hbm.extprop.HbmExtendedProperties; +import com.hbm.handler.FluidTypeHandler.FluidType; +import com.hbm.handler.HbmKeybinds.EnumKeybind; +import com.hbm.main.MainRegistry; +import com.hbm.packet.AuxParticlePacketNT; +import com.hbm.packet.KeybindPacket; +import com.hbm.packet.PacketDispatcher; + +import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.Vec3; import net.minecraft.world.World; -public class JetpackBooster extends ItemArmor { +public class JetpackBooster extends JetpackBase { - private ModelJetPack model; - public static int maxFuel = 750; - - public JetpackBooster(ArmorMaterial p_i45325_1_, int p_i45325_2_, int p_i45325_3_) { - super(p_i45325_1_, p_i45325_2_, p_i45325_3_); - } - - @Override - public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) - { - list.add("Kerosene: " + this.getFuel(itemstack) + "mB / " + this.maxFuel + "mB"); - } - - - @Override - public boolean isValidArmor(ItemStack stack, int armorType, Entity entity) { - return armorType == 1; - } - - @Override - @SideOnly(Side.CLIENT) - public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) { - if (armorSlot == 1) { - if (model == null) { - this.model = new ModelJetPack(); - } - return this.model; - } - - return null; + public JetpackBooster(ArmorMaterial mat, int i, int j, FluidType fuel, int maxFuel) { + super(mat, i, j, fuel, maxFuel); } @Override @@ -56,87 +32,62 @@ public class JetpackBooster extends ItemArmor { } public void onArmorTick(World world, EntityPlayer player, ItemStack stack) { - - if(player.isSneaking() && this.getBoost(stack) == 0 && this.getCooldown(stack) == 0 && this.getFuel(stack) > 0) { - this.setBoost(stack, 15); - this.setCooldown(stack, 40); - } - - if(this.getBoost(stack) > 0) { - - Vec3 vec = Vec3.createVectorHelper(player.getLookVec().xCoord, 0, player.getLookVec().zCoord); - vec.normalize(); - player.motionY += 0.15; - - this.setBoost(stack, this.getBoost(stack) - 1); - - if(!world.isRemote) { - EntityGasFlameFX fx = new EntityGasFlameFX(world); - fx.posX = player.posX - vec.xCoord; - fx.posY = player.posY - 1; - fx.posZ = player.posZ - vec.zCoord; - fx.motionY = -0.1; - world.spawnEntityInWorld(fx); - } - - this.setFuel(stack, this.getFuel(stack) - 1); - - if(player.motionY > 0) - player.fallDistance = 0; - } - - if(this.getCooldown(stack) > 0) - this.setCooldown(stack, this.getCooldown(stack) - 1); - - if(this.getFuel(stack) == 0) - this.setBoost(stack, 0); - } - - public void setBoost(ItemStack stack, int i) { - if(!stack.hasTagCompound()) - stack.stackTagCompound = new NBTTagCompound(); - - stack.stackTagCompound.setInteger("boost", i); - } - - public int getBoost(ItemStack stack) { - if(!stack.hasTagCompound()) - return 0; - - return stack.stackTagCompound.getInteger("boost"); - } - - public void setCooldown(ItemStack stack, int i) { - if(!stack.hasTagCompound()) - stack.stackTagCompound = new NBTTagCompound(); - - stack.stackTagCompound.setInteger("cool", i); - } - - public int getCooldown(ItemStack stack) { - if(!stack.hasTagCompound()) - return 0; - - return stack.stackTagCompound.getInteger("cool"); - } - - public static int getFuel(ItemStack stack) { - if(stack.stackTagCompound == null) { - stack.stackTagCompound = new NBTTagCompound(); - return 0; - } - return stack.stackTagCompound.getInteger("fuel"); + HbmExtendedProperties props = HbmExtendedProperties.getData(player); - } - - public static void setFuel(ItemStack stack, int i) { - if(stack.stackTagCompound == null) { - stack.stackTagCompound = new NBTTagCompound(); - } - - stack.stackTagCompound.setInteger("fuel", i); - - } + if(world.isRemote) { + + if(player == MainRegistry.proxy.me()) { + + boolean last = props.getKeyPressed(EnumKeybind.JETPACK); + boolean current = MainRegistry.proxy.getIsKeyPressed(EnumKeybind.JETPACK); + + if(last != current) { + PacketDispatcher.wrapper.sendToServer(new KeybindPacket(EnumKeybind.JETPACK, current)); + props.setKeyPressed(EnumKeybind.JETPACK, current); + } + } + + } else { + + if(getFuel(stack) > 0 && props.getKeyPressed(EnumKeybind.JETPACK)) { + NBTTagCompound data = new NBTTagCompound(); + data.setString("type", "jetpack"); + data.setInteger("player", player.getEntityId()); + data.setInteger("mode", 1); + PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, player.posX, player.posY, player.posZ), new TargetPoint(world.provider.dimensionId, player.posX, player.posY, player.posZ, 100)); + } + } + + if(getFuel(stack) > 0 && props.getKeyPressed(EnumKeybind.JETPACK)) { + + if(player.motionY < 0.6D) + player.motionY += 0.1D; + + Vec3 look = player.getLookVec(); + + if(Vec3.createVectorHelper(player.motionX, player.motionY, player.motionZ).lengthVector() < 5) { + player.motionX += look.xCoord * 0.25; + player.motionY += look.yCoord * 0.25; + player.motionZ += look.zCoord * 0.25; + + if(look.yCoord > 0) + player.fallDistance = 0; + } + + world.playSoundEffect(player.posX, player.posY, player.posZ, "hbm:weapon.flamethrowerShoot", 0.25F, 1.0F); + this.useUpFuel(player, stack, 1); + } + } + + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) { + + list.add("High-powered vectorized jetpack."); + list.add("Highly increased fuel consumption."); + list.add(""); + + super.addInformation(stack, player, list, ext); + } } diff --git a/src/main/java/com/hbm/items/armor/JetpackBreak.java b/src/main/java/com/hbm/items/armor/JetpackBreak.java index f2e69b8c3..2e64c078e 100644 --- a/src/main/java/com/hbm/items/armor/JetpackBreak.java +++ b/src/main/java/com/hbm/items/armor/JetpackBreak.java @@ -1,5 +1,7 @@ package com.hbm.items.armor; +import java.util.List; + import com.hbm.extprop.HbmExtendedProperties; import com.hbm.handler.FluidTypeHandler.FluidType; import com.hbm.handler.HbmKeybinds.EnumKeybind; @@ -9,6 +11,8 @@ import com.hbm.packet.KeybindPacket; import com.hbm.packet.PacketDispatcher; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -76,10 +80,24 @@ public class JetpackBreak extends JetpackBase { player.motionY += 0.1D; else if(player.motionY < 0) player.motionY = 0; + + player.motionX *= 1.025D; + player.motionZ *= 1.025D; world.playSoundEffect(player.posX, player.posY, player.posZ, "hbm:weapon.flamethrowerShoot", 0.25F, 1.5F); this.useUpFuel(player, stack, 10); } } } + + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) { + + list.add("Regular jetpack that will automatically hover mid-air."); + list.add("Sneaking will stop hover mode."); + list.add("Hover mode will consume less fuel and increase air-mobility."); + list.add(""); + + super.addInformation(stack, player, list, ext); + } } diff --git a/src/main/java/com/hbm/items/armor/JetpackRegular.java b/src/main/java/com/hbm/items/armor/JetpackRegular.java index dcb31dc25..0af44f498 100644 --- a/src/main/java/com/hbm/items/armor/JetpackRegular.java +++ b/src/main/java/com/hbm/items/armor/JetpackRegular.java @@ -2,7 +2,6 @@ package com.hbm.items.armor; import java.util.List; -import com.hbm.entity.particle.EntityGasFlameFX; import com.hbm.extprop.HbmExtendedProperties; import com.hbm.handler.FluidTypeHandler.FluidType; import com.hbm.handler.HbmKeybinds.EnumKeybind; @@ -10,20 +9,14 @@ import com.hbm.main.MainRegistry; import com.hbm.packet.AuxParticlePacketNT; import com.hbm.packet.KeybindPacket; import com.hbm.packet.PacketDispatcher; -import com.hbm.render.model.ModelJetPack; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; -import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.Vec3; import net.minecraft.world.World; public class JetpackRegular extends JetpackBase { @@ -75,4 +68,13 @@ public class JetpackRegular extends JetpackBase { this.useUpFuel(player, stack, 5); } } + + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) { + + list.add("Regular jetpack for simple upwards momentum."); + list.add(""); + + super.addInformation(stack, player, list, ext); + } } diff --git a/src/main/java/com/hbm/items/armor/JetpackVectorized.java b/src/main/java/com/hbm/items/armor/JetpackVectorized.java index 567ae54d0..d44352430 100644 --- a/src/main/java/com/hbm/items/armor/JetpackVectorized.java +++ b/src/main/java/com/hbm/items/armor/JetpackVectorized.java @@ -2,7 +2,6 @@ package com.hbm.items.armor; import java.util.List; -import com.hbm.entity.particle.EntityGasFlameFX; import com.hbm.extprop.HbmExtendedProperties; import com.hbm.handler.FluidTypeHandler.FluidType; import com.hbm.handler.HbmKeybinds.EnumKeybind; @@ -10,18 +9,13 @@ import com.hbm.main.MainRegistry; import com.hbm.packet.AuxParticlePacketNT; import com.hbm.packet.KeybindPacket; import com.hbm.packet.PacketDispatcher; -import com.hbm.render.model.ModelJetPack; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; -import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.Vec3; import net.minecraft.world.World; @@ -86,4 +80,14 @@ public class JetpackVectorized extends JetpackBase { this.useUpFuel(player, stack, 3); } } + + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) { + + list.add("High-mobility jetpack."); + list.add("Higher fuel consumption."); + list.add(""); + + super.addInformation(stack, player, list, ext); + } } diff --git a/src/main/java/com/hbm/main/ClientProxy.java b/src/main/java/com/hbm/main/ClientProxy.java index 392ec52c8..8a20ce6cf 100644 --- a/src/main/java/com/hbm/main/ClientProxy.java +++ b/src/main/java/com/hbm/main/ClientProxy.java @@ -8,6 +8,7 @@ import net.minecraft.client.particle.EntityCloudFX; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.particle.EntityFireworkSparkFX; import net.minecraft.client.particle.EntityFlameFX; +import net.minecraft.client.particle.EntityReddustFX; import net.minecraft.client.renderer.entity.RenderSnowball; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.client.settings.GameSettings; @@ -946,10 +947,59 @@ public class ClientProxy extends ServerProxy { } } + if("jetpack_bj".equals(type)) { + + Entity ent = world.getEntityByID(data.getInteger("player")); + + if(ent instanceof EntityPlayer) { + + EntityPlayer p = (EntityPlayer)ent; + + Vec3 vec = Vec3.createVectorHelper(0, 0, -0.3125); + Vec3 offset = Vec3.createVectorHelper(0.125, 0, 0); + float angle = (float) -Math.toRadians(p.rotationYawHead - (p.rotationYawHead - p.renderYawOffset)); + + vec.rotateAroundY(angle); + offset.rotateAroundY(angle); + + double ix = p.posX + vec.xCoord; + double iy = p.posY + p.eyeHeight - 0.9375; + double iz = p.posZ + vec.zCoord; + double ox = offset.xCoord; + double oz = offset.zCoord; + + Vec3 pos = Vec3.createVectorHelper(ix, iy, iz); + Vec3 thrust = Vec3.createVectorHelper(0, -1, 0); + Vec3 target = pos.addVector(thrust.xCoord * 10, thrust.yCoord * 10, thrust.zCoord * 10); + MovingObjectPosition mop = player.worldObj.func_147447_a(pos, target, false, false, true); + + if(mop != null && mop.typeOfHit == MovingObjectType.BLOCK && mop.sideHit == 1) { + + Block b = world.getBlock(mop.blockX, mop.blockY, mop.blockZ); + int meta = world.getBlockMetadata(mop.blockX, mop.blockY, mop.blockZ); + + Vec3 delta = Vec3.createVectorHelper(ix - mop.hitVec.xCoord, iy - mop.hitVec.yCoord, iz - mop.hitVec.zCoord); + Vec3 vel = Vec3.createVectorHelper(0.75 - delta.lengthVector() * 0.075, 0, 0); + + for(int i = 0; i < (10 - delta.lengthVector()); i++) { + vel.rotateAroundY(world.rand.nextFloat() * (float)Math.PI * 2F); + Minecraft.getMinecraft().effectRenderer.addEffect(new EntityBlockDustFX(world, mop.hitVec.xCoord, mop.hitVec.yCoord + 0.1, mop.hitVec.zCoord, vel.xCoord, 0.1, vel.zCoord, b, meta)); + } + } + + EntityReddustFX dust1 = new EntityReddustFX(world, ix + ox, iy, iz + oz, 0.0F, 0.0F, 0.0F); + EntityReddustFX dust2 = new EntityReddustFX(world, ix - ox, iy, iz - oz, 0.0F, 0.0F, 0.0F); + dust1.setVelocity(p.motionX, p.motionY, p.motionZ); + dust2.setVelocity(p.motionX, p.motionY, p.motionZ); + Minecraft.getMinecraft().effectRenderer.addEffect(dust1); + Minecraft.getMinecraft().effectRenderer.addEffect(dust2); + } + } + if("muke".equals(type)) { ParticleMukeWave wave = new ParticleMukeWave(man, world, x, y, z); - ParticleMukeFlash flash = new ParticleMukeFlash(man, world, x, y, z); + ParticleMukeFlash flash = new ParticleMukeFlash(man, world, x, y, z, data.getBoolean("balefire")); Minecraft.getMinecraft().effectRenderer.addEffect(wave); Minecraft.getMinecraft().effectRenderer.addEffect(flash); diff --git a/src/main/java/com/hbm/main/MainRegistry.java b/src/main/java/com/hbm/main/MainRegistry.java index 4ef606d24..83fabb428 100644 --- a/src/main/java/com/hbm/main/MainRegistry.java +++ b/src/main/java/com/hbm/main/MainRegistry.java @@ -1048,6 +1048,7 @@ public class MainRegistry { HazmatRegistry.registerHazmat(ModItems.bj_helmet, 0.4F); HazmatRegistry.registerHazmat(ModItems.bj_plate, 0.8F); + HazmatRegistry.registerHazmat(ModItems.bj_plate_jetpack, 0.8F); HazmatRegistry.registerHazmat(ModItems.bj_legs, 0.6F); HazmatRegistry.registerHazmat(ModItems.bj_boots, 0.2F); diff --git a/src/main/java/com/hbm/main/ModEventHandlerClient.java b/src/main/java/com/hbm/main/ModEventHandlerClient.java index 1739ea50f..f173b147d 100644 --- a/src/main/java/com/hbm/main/ModEventHandlerClient.java +++ b/src/main/java/com/hbm/main/ModEventHandlerClient.java @@ -15,6 +15,8 @@ import com.hbm.interfaces.Spaghetti; import com.hbm.inventory.RecipesCommon.ComparableStack; import com.hbm.items.ModItems; import com.hbm.items.armor.ArmorFSB; +import com.hbm.items.armor.ArmorFSBPowered; +import com.hbm.items.armor.JetpackBase; import com.hbm.items.weapon.ItemGunBase; import com.hbm.lib.Library; import com.hbm.lib.RefStrings; @@ -57,6 +59,7 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; import net.minecraft.util.Vec3; +import net.minecraftforge.client.GuiIngameForge; import net.minecraftforge.client.event.MouseEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; @@ -117,11 +120,84 @@ public class ModEventHandlerClient { PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(0, 0, 0, 999, 0)); } + /// HANDLE FSB HUD /// ItemStack helmet = player.inventory.armorInventory[3]; if(helmet != null && helmet.getItem() instanceof ArmorFSB) { ((ArmorFSB)helmet.getItem()).handleOverlay(event, player); } + + /// HANDLE ELECTRIC FSB HUD /// + + if(!event.isCanceled() && event.type == event.type.ARMOR) { + + int width = event.resolution.getScaledWidth(); + int height = event.resolution.getScaledHeight(); + int left = width / 2 - 91; + int top = height - GuiIngameForge.left_height - 3; + + Tessellator tess = Tessellator.instance; + + if(ArmorFSB.hasFSBArmorIgnoreCharge(player)) { + ArmorFSB chestplate = (ArmorFSB)player.inventory.armorInventory[2].getItem(); + boolean noHelmet = chestplate.noHelmet; + + GL11.glDisable(GL11.GL_TEXTURE_2D); + tess.startDrawingQuads(); + + for(int i = 0; i < (noHelmet ? 3 : 4); i++) { + + ItemStack stack = player.inventory.armorInventory[i]; + + if(!(stack != null && stack.getItem() instanceof ArmorFSBPowered)) + break; + + float tot = 1F - (float) ((ArmorFSBPowered)stack.getItem()).getDurabilityForDisplay(stack); + + tess.setColorOpaque_F(0.25F, 0.25F, 0.25F); + tess.addVertex(left - 0.5, top - 0.5, 0); + tess.addVertex(left - 0.5, top + 1.5, 0); + tess.addVertex(left + 81.5, top + 1.5, 0); + tess.addVertex(left + 81.5, top - 0.5, 0); + + tess.setColorOpaque_F(1F - tot, tot, 0F); + tess.addVertex(left, top, 0); + tess.addVertex(left, top + 1, 0); + tess.addVertex(left + 81 * tot, top + 1, 0); + tess.addVertex(left + 81 * tot, top, 0); + + top -= 2.5; + } + + tess.draw(); + + GL11.glEnable(GL11.GL_TEXTURE_2D); + + } else if(player.inventory.armorInventory[2] != null && player.inventory.armorInventory[2].getItem() instanceof JetpackBase) { + + ItemStack stack = player.inventory.armorInventory[2]; + + float tot = (float) ((JetpackBase)stack.getItem()).getFuel(stack) / (float) ((JetpackBase)stack.getItem()).getMaxFill(stack); + top -= 3; + + GL11.glDisable(GL11.GL_TEXTURE_2D); + tess.startDrawingQuads(); + tess.setColorOpaque_F(0.25F, 0.25F, 0.25F); + tess.addVertex(left - 0.5, top - 0.5, 0); + tess.addVertex(left - 0.5, top + 4.5, 0); + tess.addVertex(left + 81.5, top + 4.5, 0); + tess.addVertex(left + 81.5, top - 0.5, 0); + + tess.setColorOpaque_F(1F - tot, tot, 0F); + tess.addVertex(left, top, 0); + tess.addVertex(left, top + 4, 0); + tess.addVertex(left + 81 * tot, top + 4, 0); + tess.addVertex(left + 81 * tot, top, 0); + tess.draw(); + + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + } } public static boolean ducked = false; diff --git a/src/main/java/com/hbm/particle/ParticleMukeCloud.java b/src/main/java/com/hbm/particle/ParticleMukeCloud.java index 4f20c0781..b1072b57d 100644 --- a/src/main/java/com/hbm/particle/ParticleMukeCloud.java +++ b/src/main/java/com/hbm/particle/ParticleMukeCloud.java @@ -1,10 +1,15 @@ package com.hbm.particle; +import org.lwjgl.opengl.GL11; + import com.hbm.lib.RefStrings; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; @@ -13,12 +18,114 @@ import net.minecraft.world.World; public class ParticleMukeCloud extends EntityFX { private static final ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/particle/explosion.png"); + private TextureManager theRenderEngine; + + private float friction; public ParticleMukeCloud(TextureManager texman, World world, double x, double y, double z, double mx, double my, double mz) { - super(world, x, y, z, mx, my, mz); + super(world, x, y, z); + this.theRenderEngine = texman; + this.motionX = mx; + this.motionY = my; + this.motionZ = mz; + + if(motionY > 0) { + this.friction = 0.9F; + + if(motionY > 0.1) + this.particleMaxAge = 92 + rand.nextInt(11) + (int)(motionY * 20); + else + this.particleMaxAge = 72 + rand.nextInt(11); + + } else if (motionY == 0) { + + this.friction = 0.95F; + this.particleMaxAge = 52 + rand.nextInt(11); + + } else { + + this.friction = 0.85F; + this.particleMaxAge = 122 + rand.nextInt(31); + this.particleAge = 80; + } } public int getFXLayer() { return 3; } + + public void onUpdate() { + + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge - 2) { + this.setDead(); + } + + this.motionY -= 0.04D * (double)this.particleGravity; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= friction; + this.motionY *= friction; + this.motionZ *= friction; + + if (this.onGround) { + this.motionX *= 0.7D; + this.motionZ *= 0.7D; + } + } + + public void renderParticle(Tessellator tess, float interp, float x, float y, float z, float tx, float tz) { + + this.theRenderEngine.bindTexture(getTexture()); + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_BLEND); + GL11.glAlphaFunc(GL11.GL_GREATER, 0); + GL11.glDepthMask(false); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + RenderHelper.disableStandardItemLighting(); + + if(this.particleAge > this.particleMaxAge) + this.particleAge = this.particleMaxAge; + + int texIndex = this.particleAge * 25 / this.particleMaxAge; + float f0 = 1F / 5F; + + float uMin = texIndex % 5 * f0; + float uMax = uMin + f0; + float vMin = texIndex / 5 * f0; + float vMax = vMin + f0; + + tess.startDrawingQuads(); + + tess.setNormal(0.0F, 1.0F, 0.0F); + tess.setBrightness(240); + + this.particleAlpha = 1F; + this.particleScale = 3; + + tess.setColorRGBA_F(1.0F, 1.0F, 1.0F, this.particleAlpha); + + float pX = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) interp - interpPosX); + float pY = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) interp - interpPosY); + float pZ = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) interp - interpPosZ); + + tess.addVertexWithUV((double) (pX - x * this.particleScale - tx * this.particleScale), (double) (pY - y * this.particleScale), (double) (pZ - z * this.particleScale - tz * this.particleScale), uMax, vMax); + tess.addVertexWithUV((double) (pX - x * this.particleScale + tx * this.particleScale), (double) (pY + y * this.particleScale), (double) (pZ - z * this.particleScale + tz * this.particleScale), uMax, vMin); + tess.addVertexWithUV((double) (pX + x * this.particleScale + tx * this.particleScale), (double) (pY + y * this.particleScale), (double) (pZ + z * this.particleScale + tz * this.particleScale), uMin, vMin); + tess.addVertexWithUV((double) (pX + x * this.particleScale - tx * this.particleScale), (double) (pY - y * this.particleScale), (double) (pZ + z * this.particleScale - tz * this.particleScale), uMin, vMax); + + tess.draw(); + + GL11.glPolygonOffset(0.0F, 0.0F); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + GL11.glEnable(GL11.GL_LIGHTING); + } + + protected ResourceLocation getTexture() { + return texture; + } } diff --git a/src/main/java/com/hbm/particle/ParticleMukeCloudBF.java b/src/main/java/com/hbm/particle/ParticleMukeCloudBF.java new file mode 100644 index 000000000..ba52d85eb --- /dev/null +++ b/src/main/java/com/hbm/particle/ParticleMukeCloudBF.java @@ -0,0 +1,23 @@ +package com.hbm.particle; + +import com.hbm.lib.RefStrings; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class ParticleMukeCloudBF extends ParticleMukeCloud { + + private static final ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/particle/explosion_bf.png"); + + public ParticleMukeCloudBF(TextureManager texman, World world, double x, double y, double z, double mx, double my, double mz) { + super(texman, world, x, y, z, mx, my, mz); + } + + protected ResourceLocation getTexture() { + return texture; + } +} diff --git a/src/main/java/com/hbm/particle/ParticleMukeFlash.java b/src/main/java/com/hbm/particle/ParticleMukeFlash.java index 5c33b7683..6d118232f 100644 --- a/src/main/java/com/hbm/particle/ParticleMukeFlash.java +++ b/src/main/java/com/hbm/particle/ParticleMukeFlash.java @@ -8,12 +8,12 @@ import com.hbm.lib.RefStrings; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.Vec3; import net.minecraft.world.World; @SideOnly(Side.CLIENT) @@ -22,15 +22,62 @@ public class ParticleMukeFlash extends EntityFX { private static final ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/particle/flare.png"); private TextureManager theRenderEngine; - public ParticleMukeFlash(TextureManager texman, World world, double x, double y, double z) { + boolean bf; + + public ParticleMukeFlash(TextureManager texman, World world, double x, double y, double z, boolean bf) { super(world, x, y, z); this.theRenderEngine = texman; this.particleMaxAge = 20; + this.bf = bf; } public int getFXLayer() { return 3; } + + public void onUpdate() { + super.onUpdate(); + + if(this.particleAge == 15) { + + //Stem + for(double d = 0.0D; d <= 1.8D; d += 0.1) { + ParticleMukeCloud cloud = getCloud(theRenderEngine, worldObj, posX, posY, posZ + 0.5, rand.nextGaussian() * 0.05, d + rand.nextGaussian() * 0.02, rand.nextGaussian() * 0.05); + Minecraft.getMinecraft().effectRenderer.addEffect(cloud); + } + + //Ground + for(int i = 0; i < 100; i++) { + ParticleMukeCloud cloud = getCloud(theRenderEngine, worldObj, posX, posY + 0.5, posZ, rand.nextGaussian() * 0.5, rand.nextInt(5) == 0 ? 0.02 : 0, rand.nextGaussian() * 0.5); + Minecraft.getMinecraft().effectRenderer.addEffect(cloud); + } + + //Mush + for(int i = 0; i < 75; i++) { + double x = rand.nextGaussian() * 0.5; + double z = rand.nextGaussian() * 0.5; + + if(x * x + z * z > 1.5) { + x *= 0.5; + z *= 0.5; + } + + double y = 1.8 + (rand.nextDouble() * 3 - 1.5) * (0.75 - (x * x + z * z)) * 0.5; + + ParticleMukeCloud cloud = getCloud(theRenderEngine, worldObj, posX, posY, posZ, x, y + rand.nextGaussian() * 0.02, z); + Minecraft.getMinecraft().effectRenderer.addEffect(cloud); + } + } + } + + private ParticleMukeCloud getCloud(TextureManager texman, World world, double x, double y, double z, double mx, double my, double mz) { + + if(this.bf) { + return new ParticleMukeCloudBF(theRenderEngine, world, x, y, z, mx, my, mz); + } else { + return new ParticleMukeCloud(theRenderEngine, world, x, y, z, mx, my, mz); + } + } public void renderParticle(Tessellator tess, float interp, float x, float y, float z, float tx, float tz) { @@ -39,8 +86,8 @@ public class ParticleMukeFlash extends EntityFX { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_BLEND); - GL11.glAlphaFunc(GL11.GL_GREATER, 0); GL11.glDepthMask(false); + GL11.glAlphaFunc(GL11.GL_GREATER, 0); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); RenderHelper.disableStandardItemLighting(); @@ -50,7 +97,7 @@ public class ParticleMukeFlash extends EntityFX { tess.setBrightness(240); this.particleAlpha = 1 - (((float)this.particleAge + interp) / (float)this.particleMaxAge); - float scale = (this.particleAge + interp) * 0.75F + 5; + float scale = (this.particleAge + interp) * 3F + 1F; tess.setColorRGBA_F(1.0F, 0.9F, 0.75F, this.particleAlpha * 0.5F); @@ -64,9 +111,9 @@ public class ParticleMukeFlash extends EntityFX { rand.setSeed(i * 31 + 1); - float pX = (float) (dX + rand.nextDouble() * 10 - 5); - float pY = (float) (dY + rand.nextDouble() * 5 - 2.5); - float pZ = (float) (dZ + rand.nextDouble() * 10 - 5); + float pX = (float) (dX + rand.nextDouble() * 15 - 7.5); + float pY = (float) (dY + rand.nextDouble() * 7.5 - 3.75); + float pZ = (float) (dZ + rand.nextDouble() * 15 - 7.5); tess.addVertexWithUV((double) (pX - x * scale - tx * scale), (double) (pY - y * scale), (double) (pZ - z * scale - tz * scale), 1, 1); tess.addVertexWithUV((double) (pX - x * scale + tx * scale), (double) (pY + y * scale), (double) (pZ - z * scale + tz * scale), 1, 0); diff --git a/src/main/java/com/hbm/particle/ParticleMukeWave.java b/src/main/java/com/hbm/particle/ParticleMukeWave.java index 209c59bfd..54267a38e 100644 --- a/src/main/java/com/hbm/particle/ParticleMukeWave.java +++ b/src/main/java/com/hbm/particle/ParticleMukeWave.java @@ -56,10 +56,10 @@ public class ParticleMukeWave extends EntityFX { float pY = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double)interp - interpPosY); float pZ = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double)interp - interpPosZ); - tess.addVertexWithUV((double)(pX - 1 * scale), (double)(pY), (double)(pZ - 1 * scale), 1, 1); - tess.addVertexWithUV((double)(pX - 1 * scale), (double)(pY), (double)(pZ + 1 * scale), 1, 0); - tess.addVertexWithUV((double)(pX + 1 * scale), (double)(pY), (double)(pZ + 1 * scale), 0, 0); - tess.addVertexWithUV((double)(pX + 1 * scale), (double)(pY), (double)(pZ - 1 * scale), 0, 1); + tess.addVertexWithUV((double)(pX - 1 * scale), (double)(pY - 0.25), (double)(pZ - 1 * scale), 1, 1); + tess.addVertexWithUV((double)(pX - 1 * scale), (double)(pY - 0.25), (double)(pZ + 1 * scale), 1, 0); + tess.addVertexWithUV((double)(pX + 1 * scale), (double)(pY - 0.25), (double)(pZ + 1 * scale), 0, 0); + tess.addVertexWithUV((double)(pX + 1 * scale), (double)(pY - 0.25), (double)(pZ - 1 * scale), 0, 1); tess.draw(); GL11.glPolygonOffset(0.0F, 0.0F); diff --git a/src/main/java/com/hbm/render/item/weapon/ItemRenderBFLauncher.java b/src/main/java/com/hbm/render/item/weapon/ItemRenderBFLauncher.java index d147ba15a..5893a0c46 100644 --- a/src/main/java/com/hbm/render/item/weapon/ItemRenderBFLauncher.java +++ b/src/main/java/com/hbm/render/item/weapon/ItemRenderBFLauncher.java @@ -42,9 +42,7 @@ public class ItemRenderBFLauncher implements IItemRenderer { GL11.glEnable(GL11.GL_CULL_FACE); Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID +":textures/models/BFLauncher.png")); GL11.glRotatef(-150.0F, 0.0F, 0.0F, 1.0F); - GL11.glTranslatef(-0.6F, -0.1F, -0.2F); - //GL11.glScalef(2.0F, 2.0F, 2.0F); - GL11.glScalef(0.5F, 0.5F, 0.5F); + GL11.glTranslatef(-0.8F, -0.1F, -0.2F); swordModel.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, item); GL11.glPopMatrix(); break; diff --git a/src/main/java/com/hbm/render/item/weapon/ItemRenderFatMan.java b/src/main/java/com/hbm/render/item/weapon/ItemRenderFatMan.java index 46d15b308..e669de40f 100644 --- a/src/main/java/com/hbm/render/item/weapon/ItemRenderFatMan.java +++ b/src/main/java/com/hbm/render/item/weapon/ItemRenderFatMan.java @@ -43,9 +43,7 @@ public class ItemRenderFatMan implements IItemRenderer { GL11.glEnable(GL11.GL_CULL_FACE); Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID +":textures/models/FatmanLauncher.png")); GL11.glRotatef(-150.0F, 0.0F, 0.0F, 1.0F); - GL11.glTranslatef(-0.6F, -0.1F, -0.2F); - //GL11.glScalef(2.0F, 2.0F, 2.0F); - GL11.glScalef(0.5F, 0.5F, 0.5F); + GL11.glTranslatef(-0.8F, -0.1F, -0.2F); swordModel.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, item); GL11.glPopMatrix(); break; diff --git a/src/main/java/com/hbm/render/item/weapon/ItemRenderMIRVLauncher.java b/src/main/java/com/hbm/render/item/weapon/ItemRenderMIRVLauncher.java index 94b31385c..f7d174b2b 100644 --- a/src/main/java/com/hbm/render/item/weapon/ItemRenderMIRVLauncher.java +++ b/src/main/java/com/hbm/render/item/weapon/ItemRenderMIRVLauncher.java @@ -43,9 +43,7 @@ public class ItemRenderMIRVLauncher implements IItemRenderer { GL11.glEnable(GL11.GL_CULL_FACE); Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID +":textures/models/MIRVLauncher.png")); GL11.glRotatef(-150.0F, 0.0F, 0.0F, 1.0F); - GL11.glTranslatef(-0.6F, -0.1F, -0.2F); - //GL11.glScalef(2.0F, 2.0F, 2.0F); - GL11.glScalef(0.5F, 0.5F, 0.5F); + GL11.glTranslatef(-0.8F, -0.1F, -0.2F); swordModel.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, item); GL11.glPopMatrix(); break; diff --git a/src/main/java/com/hbm/render/model/ModelArmorBJ.java b/src/main/java/com/hbm/render/model/ModelArmorBJ.java index 1084a6e37..4325e3ba0 100644 --- a/src/main/java/com/hbm/render/model/ModelArmorBJ.java +++ b/src/main/java/com/hbm/render/model/ModelArmorBJ.java @@ -38,11 +38,15 @@ public class ModelArmorBJ extends ModelArmorBase { Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.bj_eyepatch); head.render(par7); } - if(type == 1) { + if(type == 1 || type == 5) { Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.bj_chest); body.render(par7); - //Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.bj_jetpack); - //jetpack.render(par7); + + if(type == 5) { + Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.bj_jetpack); + jetpack.render(par7); + } + Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.bj_arm); leftArm.render(par7); rightArm.render(par7); diff --git a/src/main/java/com/hbm/util/ArmorUtil.java b/src/main/java/com/hbm/util/ArmorUtil.java index 1aa90fb58..d6214450a 100644 --- a/src/main/java/com/hbm/util/ArmorUtil.java +++ b/src/main/java/com/hbm/util/ArmorUtil.java @@ -139,6 +139,8 @@ public class ArmorUtil { "starmetal", "hazmat", //also count because rubber is insulating "rubber", + "hev", + "ajr", "spacesuit" }; @@ -188,6 +190,14 @@ public class ArmorUtil { { return true; } + if(checkArmorPiece(player, ModItems.ajr_helmet, 3)) + { + return true; + } + if(checkArmorPiece(player, ModItems.hev_helmet, 3)) + { + return true; + } if(checkArmorPiece(player, ModItems.schrabidium_helmet, 3)) { return true; @@ -209,6 +219,14 @@ public class ArmorUtil { { return true; } + if(checkArmorPiece(player, ModItems.hazmat_helmet_red, 3)) + { + return true; + } + if(checkArmorPiece(player, ModItems.hazmat_helmet_grey, 3)) + { + return true; + } if(checkArmorPiece(player, ModItems.gas_mask, 3)) { return true;