new rad method, vault sounds, loot changes, model fix, succ gm1 fix, bup

This commit is contained in:
HbmMods 2018-08-12 00:26:27 +02:00
parent 5ac33e52a1
commit ee43614e01
26 changed files with 740 additions and 661 deletions

View File

@ -19,6 +19,8 @@
"block.sonarPing": {"category": "block", "sounds": [{"name": "block/sonarPing", "stream": false}]}, "block.sonarPing": {"category": "block", "sounds": [{"name": "block/sonarPing", "stream": false}]},
"block.reactorStart": {"category": "block", "sounds": [{"name": "block/reactorStart", "stream": false}]}, "block.reactorStart": {"category": "block", "sounds": [{"name": "block/reactorStart", "stream": false}]},
"block.reactorStop": {"category": "block", "sounds": [{"name": "block/reactorStop", "stream": false}]}, "block.reactorStop": {"category": "block", "sounds": [{"name": "block/reactorStop", "stream": false}]},
"block.vaultScrape": {"category": "block", "sounds": [{"name": "block/vaultScrape", "stream": false}]},
"block.vaultThud": {"category": "block", "sounds": [{"name": "block/vaultThud", "stream": false}]},
"item.techBleep": {"category": "player", "sounds": [{"name": "tool/techBleep", "stream": false}]}, "item.techBleep": {"category": "player", "sounds": [{"name": "tool/techBleep", "stream": false}]},
"item.techBoop": {"category": "player", "sounds": [{"name": "tool/techBoop", "stream": false}]}, "item.techBoop": {"category": "player", "sounds": [{"name": "tool/techBoop", "stream": false}]},

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -218,24 +218,15 @@ public class BlockOre extends Block {
} }
if (entity instanceof EntityLivingBase && this == ModBlocks.block_trinitite) if (entity instanceof EntityLivingBase && this == ModBlocks.block_trinitite)
{ {
if(entity instanceof EntityPlayer && Library.checkForHazmat((EntityPlayer)entity)) Library.applyRadiation((EntityLivingBase)entity, 45, 19, 30, 14);
{ } else {
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 45 * 20, 20));
}
} }
if (entity instanceof EntityLivingBase && this == ModBlocks.block_waste) if (entity instanceof EntityLivingBase && this == ModBlocks.block_waste)
{ {
if(entity instanceof EntityPlayer && Library.checkForHazmat((EntityPlayer)entity)) Library.applyRadiation((EntityLivingBase)entity, 60, 19, 40, 14);
{ } else {
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 60 * 20, 20));
}
} }
if (entity instanceof EntityLivingBase && (this == ModBlocks.waste_trinitite || this == ModBlocks.waste_trinitite_red)) if (entity instanceof EntityLivingBase && (this == ModBlocks.waste_trinitite || this == ModBlocks.waste_trinitite_red))
{ {
if(entity instanceof EntityPlayer && Library.checkForHazmat((EntityPlayer)entity)) Library.applyRadiation((EntityLivingBase)entity, 30, 9, 15, 4);
{ } else {
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 30 * 20, 10));
}
} }
if(this == ModBlocks.block_meteor_molten) if(this == ModBlocks.block_meteor_molten)

View File

@ -223,14 +223,8 @@ public class ExplosionNukeGeneric {
d5 /= d9; d5 /= d9;
d6 /= d9; d6 /= d9;
d7 /= d9; d7 /= d9;
// double d10 = (double)world.getBlockDensity(vec3,
// entity.boundingBox); if (!(entity instanceof EntityPlayer && ((EntityPlayer) entity).capabilities.isCreativeMode)) {
// if(d10 > 0) isOccupied = true;
double d11 = (1.0D - d4);// * d10;
if (!(entity instanceof EntityPlayerMP && ((EntityPlayerMP) entity).theItemInWorldManager.getGameType() == GameType.CREATIVE)) {
// entity.attackEntityFrom(DamageSource.generic,
// ((int)((d11 * d11 + d11) / 2.0D * 8.0D *
// bombStartStrength + 1.0D)));
double d8 = 0.125 + (random.nextDouble() * 0.25); double d8 = 0.125 + (random.nextDouble() * 0.25);
entity.motionX -= d5 * d8; entity.motionX -= d5 * d8;
entity.motionY -= d6 * d8; entity.motionY -= d6 * d8;

View File

@ -1894,7 +1894,7 @@ public class ModItems {
sat_interface = new ItemSatInterface().setUnlocalizedName("sat_interface").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":sat_interface"); sat_interface = new ItemSatInterface().setUnlocalizedName("sat_interface").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":sat_interface");
gun_rpg = new GunRpg().setUnlocalizedName("gun_rpg").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_rpg_new"); gun_rpg = new GunRpg().setUnlocalizedName("gun_rpg").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_rpg_new");
gun_rpg_ammo = new Item().setUnlocalizedName("gun_rpg_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_rpg_ammo_new"); gun_rpg_ammo = new Item().setUnlocalizedName("gun_rpg_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_rpg_ammo_alt");
gun_stinger = new GunStinger().setUnlocalizedName("gun_stinger").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_stinger"); gun_stinger = new GunStinger().setUnlocalizedName("gun_stinger").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_stinger");
gun_skystinger = new GunStinger().setUnlocalizedName("gun_skystinger").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_skystinger"); gun_skystinger = new GunStinger().setUnlocalizedName("gun_skystinger").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_skystinger");
gun_stinger_ammo = new Item().setUnlocalizedName("gun_stinger_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_stinger_ammo"); gun_stinger_ammo = new Item().setUnlocalizedName("gun_stinger_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_stinger_ammo");

View File

@ -44,7 +44,7 @@ public class ItemRadioactive extends Item {
this == ModItems.pellet_mes || this == ModItems.pellet_mes ||
this == ModItems.pellet_neptunium || this == ModItems.pellet_neptunium ||
this == ModItems.pellet_schrabidium) { this == ModItems.pellet_schrabidium) {
living.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 80 * 20, 25)); Library.applyRadiation(living, 80, 24, 60, 19);
} }
//Strong //Strong
@ -78,7 +78,7 @@ public class ItemRadioactive extends Item {
this == ModItems.gadget_core || this == ModItems.gadget_core ||
this == ModItems.man_core || this == ModItems.man_core ||
this == ModItems.nuclear_waste) { this == ModItems.nuclear_waste) {
living.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 60 * 20, 20)); Library.applyRadiation(living, 60, 19, 40, 14);
} }
//Strong Nuggets //Strong Nuggets
@ -98,7 +98,7 @@ public class ItemRadioactive extends Item {
this == ModItems.rod_uranium_fuel_depleted || this == ModItems.rod_uranium_fuel_depleted ||
this == ModItems.rod_plutonium_fuel_depleted || this == ModItems.rod_plutonium_fuel_depleted ||
this == ModItems.rod_mox_fuel_depleted) { this == ModItems.rod_mox_fuel_depleted) {
living.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 45 * 20, 20)); Library.applyRadiation(living, 45, 19, 30, 14);
} }
//Medium //Medium
@ -116,7 +116,7 @@ public class ItemRadioactive extends Item {
this == ModItems.mike_core || this == ModItems.mike_core ||
this == ModItems.tsar_core || this == ModItems.tsar_core ||
this == ModItems.trinitite) { this == ModItems.trinitite) {
living.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 30 * 20, 15)); Library.applyRadiation(living, 30, 14, 15, 9);
} }
//Medium Nuggets //Medium Nuggets
@ -128,7 +128,7 @@ public class ItemRadioactive extends Item {
this == ModItems.rod_pu238 || this == ModItems.rod_pu238 ||
this == ModItems.rod_plutonium || this == ModItems.rod_plutonium ||
this == ModItems.pellet_rtg_weak) { this == ModItems.pellet_rtg_weak) {
living.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 20 * 20, 15)); Library.applyRadiation(living, 20, 14, 5, 9);
} }
//Weak //Weak
@ -141,7 +141,7 @@ public class ItemRadioactive extends Item {
this == ModItems.rod_dual_u238 || this == ModItems.rod_dual_u238 ||
this == ModItems.rod_quad_pu238 || this == ModItems.rod_quad_pu238 ||
this == ModItems.rod_dual_pu238) { this == ModItems.rod_dual_pu238) {
living.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 20 * 20, 5)); Library.applyRadiation(living, 20, 4, 5, 0);
} }
//Weak Nuggets //Weak Nuggets
@ -150,24 +150,29 @@ public class ItemRadioactive extends Item {
this == ModItems.nugget_u238 || this == ModItems.nugget_u238 ||
this == ModItems.rod_uranium || this == ModItems.rod_uranium ||
this == ModItems.rod_u238 || this == ModItems.rod_u238 ||
this == ModItems.cell_tritium || this == ModItems.powder_yellowcake) {
Library.applyRadiation(living, 10, 4, 0, 0);
}
//Tritium
if (this == ModItems.cell_tritium ||
this == ModItems.rod_tritium || this == ModItems.rod_tritium ||
this == ModItems.rod_dual_tritium || this == ModItems.rod_dual_tritium ||
this == ModItems.rod_quad_tritium || this == ModItems.rod_quad_tritium) {
this == ModItems.powder_yellowcake) { Library.applyRadiation(living, 10, 4, 0, 0);
living.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 10 * 20, 5));
} }
//Powder //Powder
if (this == ModItems.powder_neptunium || if (this == ModItems.powder_neptunium ||
this == ModItems.powder_plutonium) { this == ModItems.powder_plutonium) {
living.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 60 * 20, 20)); Library.applyRadiation(living, 60, 19, 45, 14);
living.setFire(5); living.setFire(5);
} }
if (this == ModItems.powder_uranium) { if (this == ModItems.powder_uranium) {
living.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 20 * 20, 5)); Library.applyRadiation(living, 20, 4, 0, 0);
living.setFire(5); living.setFire(5);
} }
@ -191,7 +196,7 @@ public class ItemRadioactive extends Item {
this == ModItems.rod_dual_schrabidium_fuel || this == ModItems.rod_dual_schrabidium_fuel ||
this == ModItems.rod_quad_schrabidium_fuel) { this == ModItems.rod_quad_schrabidium_fuel) {
living.addPotionEffect(new PotionEffect(Potion.blindness.id, 60 * 20, 0)); living.addPotionEffect(new PotionEffect(Potion.blindness.id, 60 * 20, 0));
living.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 100 * 20, 30)); Library.applyRadiation(living, 100, 29, 75, 24);
} }
if (this == ModItems.nugget_schrabidium || if (this == ModItems.nugget_schrabidium ||
@ -200,18 +205,18 @@ public class ItemRadioactive extends Item {
this == ModItems.nugget_hes || this == ModItems.nugget_hes ||
this == ModItems.nugget_les) { this == ModItems.nugget_les) {
living.addPotionEffect(new PotionEffect(Potion.blindness.id, 60 * 20, 0)); living.addPotionEffect(new PotionEffect(Potion.blindness.id, 60 * 20, 0));
living.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 75 * 20, 30)); Library.applyRadiation(living, 75, 29, 60, 24);
} }
if (this == ModItems.plate_schrabidium || if (this == ModItems.plate_schrabidium ||
this == ModItems.wire_schrabidium) { this == ModItems.wire_schrabidium) {
living.addPotionEffect(new PotionEffect(Potion.blindness.id, 60 * 20, 0)); living.addPotionEffect(new PotionEffect(Potion.blindness.id, 60 * 20, 0));
living.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 80 * 20, 30)); Library.applyRadiation(living, 80, 29, 60, 24);
} }
if (this == ModItems.powder_schrabidium) { if (this == ModItems.powder_schrabidium) {
living.addPotionEffect(new PotionEffect(Potion.blindness.id, 60 * 20, 0)); living.addPotionEffect(new PotionEffect(Potion.blindness.id, 60 * 20, 0));
living.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 100 * 20, 30)); Library.applyRadiation(living, 100, 29, 75, 24);
living.setFire(5); living.setFire(5);
} }
} }

View File

@ -5,6 +5,7 @@ import java.util.Random;
import com.hbm.blocks.ModBlocks; import com.hbm.blocks.ModBlocks;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import net.minecraft.init.Items;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.util.WeightedRandomChestContent; import net.minecraft.util.WeightedRandomChestContent;
@ -13,60 +14,83 @@ public class HbmChestContents {
static Random rand = new Random(); static Random rand = new Random();
private static WeightedRandomChestContent[] modGeneric = new WeightedRandomChestContent[] { private static WeightedRandomChestContent[] modGeneric = new WeightedRandomChestContent[] {
new WeightedRandomChestContent(ModItems.ingot_steel, 0, 10, 15, 5), new WeightedRandomChestContent(Items.bread, 0, 1, 5, 8),
new WeightedRandomChestContent(ModItems.ingot_red_copper, 0, 5, 10, 3), new WeightedRandomChestContent(Items.iron_ingot, 0, 2, 6, 10),
new WeightedRandomChestContent(ModItems.ingot_tungsten, 0, 5, 15, 3), new WeightedRandomChestContent(ModItems.ingot_steel, 0, 2, 5, 7),
new WeightedRandomChestContent(ModItems.ingot_beryllium, 0, 1, 5, 2), new WeightedRandomChestContent(ModItems.ingot_beryllium, 0, 1, 2, 4),
new WeightedRandomChestContent(ModItems.ingot_titanium, 0, 7, 10, 4), new WeightedRandomChestContent(ModItems.ingot_titanium, 0, 1, 1, 3),
new WeightedRandomChestContent(ModItems.gun_revolver, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.circuit_aluminium, 0, 1, 2, 7),
new WeightedRandomChestContent(ModItems.gun_revolver_ammo, 0, 2, 6, 2), new WeightedRandomChestContent(ModItems.circuit_targeting_tier1, 0, 1, 1, 5),
new WeightedRandomChestContent(ModItems.gun_revolver, 0, 1, 1, 3),
new WeightedRandomChestContent(ModItems.gun_revolver_ammo, 0, 2, 6, 4),
new WeightedRandomChestContent(ModItems.gun_lever_action, 0, 1, 1, 1),
new WeightedRandomChestContent(ModItems.gun_lever_action_ammo, 0, 2, 6, 3),
new WeightedRandomChestContent(ModItems.battery_generic, 0, 1, 1, 4), new WeightedRandomChestContent(ModItems.battery_generic, 0, 1, 1, 4),
new WeightedRandomChestContent(ModItems.battery_advanced, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.battery_advanced, 0, 1, 1, 2),
new WeightedRandomChestContent(Item.getItemFromBlock(ModBlocks.block_titanium), 0, 0, 3, 1) }; new WeightedRandomChestContent(ModItems.scrap, 0, 1, 3, 10),
new WeightedRandomChestContent(ModItems.dust, 0, 2, 4, 9),
new WeightedRandomChestContent(ModItems.bottle_opener, 0, 1, 1, 2),
new WeightedRandomChestContent(ModItems.bottle_nuka, 0, 1, 3, 4),
new WeightedRandomChestContent(ModItems.bottle_cherry, 0, 1, 1, 2),
new WeightedRandomChestContent(ModItems.stealth_boy, 0, 1, 1, 1),
new WeightedRandomChestContent(ModItems.cap_nuka, 0, 1, 15, 7),
new WeightedRandomChestContent(ModItems.canister_fuel, 0, 1, 2, 2),
new WeightedRandomChestContent(ModItems.canister_biofuel, 0, 1, 2, 3),
new WeightedRandomChestContent(ModItems.gas_mask_m65, 60, 1, 1, 2) };
private static WeightedRandomChestContent[] antenna = new WeightedRandomChestContent[] { private static WeightedRandomChestContent[] antenna = new WeightedRandomChestContent[] {
new WeightedRandomChestContent(ModItems.ingot_steel, 0, 3, 7, 5), new WeightedRandomChestContent(ModItems.ingot_steel, 0, 1, 2, 7),
new WeightedRandomChestContent(ModItems.ingot_red_copper, 0, 3, 10, 3), new WeightedRandomChestContent(ModItems.ingot_red_copper, 0, 1, 1, 4),
new WeightedRandomChestContent(ModItems.ingot_titanium, 0, 3, 5, 4), new WeightedRandomChestContent(ModItems.ingot_titanium, 0, 1, 3, 5),
new WeightedRandomChestContent(ModItems.wire_red_copper, 0, 3, 7, 4), new WeightedRandomChestContent(ModItems.wire_red_copper, 0, 2, 3, 7),
new WeightedRandomChestContent(ModItems.circuit_aluminium, 0, 1, 5, 3), new WeightedRandomChestContent(ModItems.circuit_aluminium, 0, 1, 3, 6),
new WeightedRandomChestContent(ModItems.circuit_copper, 0, 1, 3, 2), new WeightedRandomChestContent(ModItems.circuit_targeting_tier1, 0, 1, 1, 4),
new WeightedRandomChestContent(ModItems.circuit_red_copper, 0, 1, 2, 1), new WeightedRandomChestContent(ModItems.circuit_copper, 0, 1, 1, 4),
new WeightedRandomChestContent(ModItems.battery_generic, 0, 1, 1, 5), new WeightedRandomChestContent(ModItems.battery_generic, 0, 1, 1, 4),
new WeightedRandomChestContent(ModItems.battery_advanced, 0, 1, 1, 3), new WeightedRandomChestContent(ModItems.battery_advanced, 0, 1, 1, 3),
new WeightedRandomChestContent(ModItems.powder_iodine, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.powder_iodine, 0, 1, 1, 1),
new WeightedRandomChestContent(ModItems.powder_bromine, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.powder_bromine, 0, 1, 1, 1),
new WeightedRandomChestContent(Item.getItemFromBlock(ModBlocks.block_titanium), 0, 1, 2, 2), new WeightedRandomChestContent(Item.getItemFromBlock(ModBlocks.steel_poles), 0, 1, 4, 8),
new WeightedRandomChestContent(Item.getItemFromBlock(ModBlocks.steel_poles), 0, 4, 9, 5), new WeightedRandomChestContent(Item.getItemFromBlock(ModBlocks.steel_scaffold), 0, 1, 3, 8),
new WeightedRandomChestContent(Item.getItemFromBlock(ModBlocks.steel_scaffold), 0, 4, 6, 3), new WeightedRandomChestContent(Item.getItemFromBlock(ModBlocks.pole_top), 0, 1, 1, 4),
new WeightedRandomChestContent(Item.getItemFromBlock(ModBlocks.pole_top), 0, 2, 4, 4), new WeightedRandomChestContent(Item.getItemFromBlock(ModBlocks.pole_satellite_receiver), 0, 1, 1, 7),
new WeightedRandomChestContent(Item.getItemFromBlock(ModBlocks.pole_satellite_receiver), 0, 3, 5, 3) }; new WeightedRandomChestContent(ModItems.scrap, 0, 1, 3, 10),
new WeightedRandomChestContent(ModItems.dust, 0, 2, 4, 9),
new WeightedRandomChestContent(ModItems.bottle_opener, 0, 1, 1, 2),
new WeightedRandomChestContent(ModItems.bottle_nuka, 0, 1, 3, 4),
new WeightedRandomChestContent(ModItems.bottle_cherry, 0, 1, 1, 2),
new WeightedRandomChestContent(ModItems.stealth_boy, 0, 1, 1, 1),
new WeightedRandomChestContent(ModItems.cap_nuka, 0, 1, 15, 7) };
private static WeightedRandomChestContent[] expensive = new WeightedRandomChestContent[] { private static WeightedRandomChestContent[] expensive = new WeightedRandomChestContent[] {
new WeightedRandomChestContent(ModItems.nugget_schrabidium, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.nugget_schrabidium, 0, 1, 1, 1),
new WeightedRandomChestContent(ModItems.circuit_targeting_tier3, 0, 1, 1, 4),
new WeightedRandomChestContent(ModItems.circuit_gold, 0, 1, 2, 3), new WeightedRandomChestContent(ModItems.circuit_gold, 0, 1, 2, 3),
new WeightedRandomChestContent(ModItems.circuit_schrabidium, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.circuit_targeting_tier4, 0, 1, 1, 2),
new WeightedRandomChestContent(ModItems.nuke_starter_kit, 0, 1, 1, 2), new WeightedRandomChestContent(ModItems.gun_lever_action, 0, 1, 1, 5),
new WeightedRandomChestContent(ModItems.nuke_commercially_kit, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.gun_lever_action_ammo, 0, 2, 6, 6),
new WeightedRandomChestContent(ModItems.nuke_electric_kit, 0, 1, 1, 1),
new WeightedRandomChestContent(ModItems.gun_revolver_gold, 0, 1, 1, 4), new WeightedRandomChestContent(ModItems.gun_revolver_gold, 0, 1, 1, 4),
new WeightedRandomChestContent(ModItems.gun_revolver_gold_ammo, 0, 1, 6, 5), new WeightedRandomChestContent(ModItems.gun_revolver_gold_ammo, 0, 1, 6, 5),
new WeightedRandomChestContent(ModItems.gun_revolver_lead, 0, 1, 1, 4), new WeightedRandomChestContent(ModItems.gun_revolver_lead, 0, 1, 1, 4),
new WeightedRandomChestContent(ModItems.gun_revolver_lead_ammo, 0, 1, 6, 5), new WeightedRandomChestContent(ModItems.gun_revolver_lead_ammo, 0, 1, 6, 5),
new WeightedRandomChestContent(ModItems.gun_rpg, 0, 1, 1, 4), new WeightedRandomChestContent(ModItems.gun_rpg, 0, 1, 1, 4),
new WeightedRandomChestContent(ModItems.gun_rpg_ammo, 0, 1, 32, 5), new WeightedRandomChestContent(ModItems.gun_rpg_ammo, 0, 1, 4, 5),
new WeightedRandomChestContent(ModItems.gun_fatman, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.gun_fatman, 0, 1, 1, 1),
new WeightedRandomChestContent(ModItems.gun_fatman_ammo, 0, 1, 8, 2), new WeightedRandomChestContent(ModItems.gun_fatman_ammo, 0, 1, 2, 2),
new WeightedRandomChestContent(ModItems.gun_xvl1456, 0, 1, 1, 1),
new WeightedRandomChestContent(ModItems.gun_xvl1456_ammo, 0, 16, 64, 2),
new WeightedRandomChestContent(ModItems.grenade_nuclear, 0, 1, 1, 2), new WeightedRandomChestContent(ModItems.grenade_nuclear, 0, 1, 1, 2),
new WeightedRandomChestContent(ModItems.stealth_boy, 0, 1, 1, 2), new WeightedRandomChestContent(ModItems.stealth_boy, 0, 1, 1, 2),
new WeightedRandomChestContent(ModItems.battery_advanced, 0, 1, 1, 3), new WeightedRandomChestContent(ModItems.battery_advanced, 0, 1, 1, 3),
new WeightedRandomChestContent(ModItems.battery_advanced_cell, 0, 1, 1, 2),
new WeightedRandomChestContent(ModItems.battery_schrabidium, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.battery_schrabidium, 0, 1, 1, 1),
new WeightedRandomChestContent(ModItems.syringe_awesome, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.syringe_awesome, 0, 1, 1, 1),
new WeightedRandomChestContent(ModItems.crate_caller, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.crate_caller, 0, 1, 1, 3),
new WeightedRandomChestContent(ModItems.fusion_core, 0, 1, 1, 4), new WeightedRandomChestContent(ModItems.fusion_core, 0, 1, 1, 4),
new WeightedRandomChestContent(Item.getItemFromBlock(ModBlocks.red_barrel), 0, 1, 3, 1) }; new WeightedRandomChestContent(ModItems.bottle_nuka, 0, 1, 3, 6),
new WeightedRandomChestContent(ModItems.bottle_quantum, 0, 1, 1, 3),
new WeightedRandomChestContent(Item.getItemFromBlock(ModBlocks.red_barrel), 0, 1, 1, 6),
new WeightedRandomChestContent(ModItems.canister_fuel, 0, 1, 2, 2),
new WeightedRandomChestContent(ModItems.canister_biofuel, 0, 1, 2, 3),
new WeightedRandomChestContent(ModItems.gas_mask_m65, 60, 1, 1, 5) };
private static WeightedRandomChestContent[] nukeTrash = new WeightedRandomChestContent[] { private static WeightedRandomChestContent[] nukeTrash = new WeightedRandomChestContent[] {
new WeightedRandomChestContent(ModItems.nugget_u238, 0, 3, 12, 5), new WeightedRandomChestContent(ModItems.nugget_u238, 0, 3, 12, 5),
@ -79,6 +103,8 @@ public class HbmChestContents {
new WeightedRandomChestContent(ModItems.rod_dual_pu240, 0, 1, 1, 3), new WeightedRandomChestContent(ModItems.rod_dual_pu240, 0, 1, 1, 3),
new WeightedRandomChestContent(ModItems.rod_quad_u238, 0, 1, 1, 3), new WeightedRandomChestContent(ModItems.rod_quad_u238, 0, 1, 1, 3),
new WeightedRandomChestContent(ModItems.rod_quad_pu240, 0, 1, 1, 3), new WeightedRandomChestContent(ModItems.rod_quad_pu240, 0, 1, 1, 3),
new WeightedRandomChestContent(ModItems.bottle_quantum, 0, 1, 1, 1),
new WeightedRandomChestContent(ModItems.gas_mask_m65, 60, 1, 1, 5),
new WeightedRandomChestContent(Item.getItemFromBlock(ModBlocks.yellow_barrel), 0, 1, 1, 2) }; new WeightedRandomChestContent(Item.getItemFromBlock(ModBlocks.yellow_barrel), 0, 1, 1, 2) };
private static WeightedRandomChestContent[] nuclear = new WeightedRandomChestContent[] { private static WeightedRandomChestContent[] nuclear = new WeightedRandomChestContent[] {
@ -105,6 +131,8 @@ public class HbmChestContents {
new WeightedRandomChestContent(ModItems.powder_neptunium, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.powder_neptunium, 0, 1, 1, 1),
new WeightedRandomChestContent(ModItems.powder_strontium, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.powder_strontium, 0, 1, 1, 1),
new WeightedRandomChestContent(ModItems.powder_cobalt, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.powder_cobalt, 0, 1, 1, 1),
new WeightedRandomChestContent(ModItems.bottle_quantum, 0, 1, 1, 1),
new WeightedRandomChestContent(ModItems.gas_mask_m65, 60, 1, 1, 5),
new WeightedRandomChestContent(Item.getItemFromBlock(ModBlocks.yellow_barrel), 0, 1, 3, 3) }; new WeightedRandomChestContent(Item.getItemFromBlock(ModBlocks.yellow_barrel), 0, 1, 3, 3) };
private static WeightedRandomChestContent[] vertibird = new WeightedRandomChestContent[] { private static WeightedRandomChestContent[] vertibird = new WeightedRandomChestContent[] {
@ -112,9 +140,8 @@ public class HbmChestContents {
new WeightedRandomChestContent(ModItems.t45_plate, 0, 1, 1, 15), new WeightedRandomChestContent(ModItems.t45_plate, 0, 1, 1, 15),
new WeightedRandomChestContent(ModItems.t45_legs, 0, 1, 1, 15), new WeightedRandomChestContent(ModItems.t45_legs, 0, 1, 1, 15),
new WeightedRandomChestContent(ModItems.t45_boots, 0, 1, 1, 15), new WeightedRandomChestContent(ModItems.t45_boots, 0, 1, 1, 15),
new WeightedRandomChestContent(ModItems.t45_kit, 0, 1, 1, 3),
new WeightedRandomChestContent(ModItems.fusion_core, 0, 1, 1, 10), new WeightedRandomChestContent(ModItems.fusion_core, 0, 1, 1, 10),
new WeightedRandomChestContent(ModItems.circuit_red_copper, 0, 1, 3, 3),
new WeightedRandomChestContent(ModItems.circuit_gold, 0, 1, 3, 3),
new WeightedRandomChestContent(ModItems.gun_revolver, 0, 1, 1, 4), new WeightedRandomChestContent(ModItems.gun_revolver, 0, 1, 1, 4),
new WeightedRandomChestContent(ModItems.gun_revolver_ammo, 0, 1, 24, 4), new WeightedRandomChestContent(ModItems.gun_revolver_ammo, 0, 1, 24, 4),
new WeightedRandomChestContent(ModItems.gun_rpg, 0, 1, 1, 3), new WeightedRandomChestContent(ModItems.gun_rpg, 0, 1, 1, 3),
@ -122,9 +149,13 @@ public class HbmChestContents {
new WeightedRandomChestContent(ModItems.rod_uranium_fuel, 0, 1, 1, 2), new WeightedRandomChestContent(ModItems.rod_uranium_fuel, 0, 1, 1, 2),
new WeightedRandomChestContent(ModItems.rod_dual_uranium_fuel, 0, 1, 1, 2), new WeightedRandomChestContent(ModItems.rod_dual_uranium_fuel, 0, 1, 1, 2),
new WeightedRandomChestContent(ModItems.rod_quad_uranium_fuel, 0, 1, 1, 2), new WeightedRandomChestContent(ModItems.rod_quad_uranium_fuel, 0, 1, 1, 2),
new WeightedRandomChestContent(ModItems.gun_fatman_ammo, 0, 1, 2, 2), new WeightedRandomChestContent(ModItems.gun_fatman_ammo, 0, 1, 2, 1),
new WeightedRandomChestContent(ModItems.gun_fatman, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.gun_fatman, 0, 1, 1, 1),
new WeightedRandomChestContent(ModItems.crate_caller, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.bottle_nuka, 0, 1, 3, 6),
new WeightedRandomChestContent(ModItems.bottle_quantum, 0, 1, 1, 3),
new WeightedRandomChestContent(ModItems.stealth_boy, 0, 1, 1, 7),
new WeightedRandomChestContent(ModItems.crate_caller, 0, 1, 1, 3),
new WeightedRandomChestContent(ModItems.gas_mask_m65, 0, 1, 1, 5),
new WeightedRandomChestContent(ModItems.grenade_nuclear, 0, 1, 2, 2) }; new WeightedRandomChestContent(ModItems.grenade_nuclear, 0, 1, 2, 2) };
private static WeightedRandomChestContent[] missile = new WeightedRandomChestContent[] { private static WeightedRandomChestContent[] missile = new WeightedRandomChestContent[] {
@ -134,17 +165,8 @@ public class HbmChestContents {
new WeightedRandomChestContent(ModItems.missile_buster, 0, 1, 1, 4), new WeightedRandomChestContent(ModItems.missile_buster, 0, 1, 1, 4),
new WeightedRandomChestContent(ModItems.missile_strong, 0, 1, 1, 3), new WeightedRandomChestContent(ModItems.missile_strong, 0, 1, 1, 3),
new WeightedRandomChestContent(ModItems.missile_incendiary_strong, 0, 1, 1, 3), new WeightedRandomChestContent(ModItems.missile_incendiary_strong, 0, 1, 1, 3),
new WeightedRandomChestContent(ModItems.missile_cluster_strong, 0, 1, 1, 3),
new WeightedRandomChestContent(ModItems.missile_buster_strong, 0, 1, 1, 3),
new WeightedRandomChestContent(ModItems.missile_burst, 0, 1, 1, 2),
new WeightedRandomChestContent(ModItems.missile_inferno, 0, 1, 1, 2),
new WeightedRandomChestContent(ModItems.missile_rain, 0, 1, 1, 2),
new WeightedRandomChestContent(ModItems.missile_drill, 0, 1, 1, 2),
new WeightedRandomChestContent(ModItems.missile_nuclear, 0, 1, 1, 1),
new WeightedRandomChestContent(ModItems.missile_nuclear_cluster, 0, 1, 1, 1),
new WeightedRandomChestContent(ModItems.missile_endo, 0, 1, 1, 1),
new WeightedRandomChestContent(ModItems.missile_exo, 0, 1, 1, 1),
new WeightedRandomChestContent(Item.getItemFromBlock(ModBlocks.launch_pad), 0, 1, 1, 5), new WeightedRandomChestContent(Item.getItemFromBlock(ModBlocks.launch_pad), 0, 1, 1, 5),
new WeightedRandomChestContent(ModItems.gas_mask_m65, 0, 1, 1, 5),
new WeightedRandomChestContent(ModItems.battery_advanced, 0, 1, 1, 5), new WeightedRandomChestContent(ModItems.battery_advanced, 0, 1, 1, 5),
new WeightedRandomChestContent(ModItems.designator, 0, 1, 1, 5), new WeightedRandomChestContent(ModItems.designator, 0, 1, 1, 5),
new WeightedRandomChestContent(ModItems.crate_caller, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.crate_caller, 0, 1, 1, 1),
@ -153,7 +175,9 @@ public class HbmChestContents {
new WeightedRandomChestContent(ModItems.thruster_large, 0, 1, 1, 5), new WeightedRandomChestContent(ModItems.thruster_large, 0, 1, 1, 5),
new WeightedRandomChestContent(ModItems.fuel_tank_small, 0, 1, 1, 5), new WeightedRandomChestContent(ModItems.fuel_tank_small, 0, 1, 1, 5),
new WeightedRandomChestContent(ModItems.fuel_tank_medium, 0, 1, 1, 5), new WeightedRandomChestContent(ModItems.fuel_tank_medium, 0, 1, 1, 5),
new WeightedRandomChestContent(ModItems.fuel_tank_small, 0, 1, 1, 5) }; new WeightedRandomChestContent(ModItems.fuel_tank_small, 0, 1, 1, 5),
new WeightedRandomChestContent(ModItems.warhead_mirvlet, 0, 1, 1, 1),
new WeightedRandomChestContent(ModItems.warhead_nuclear, 0, 1, 1, 1) };
private static WeightedRandomChestContent[] spaceship = new WeightedRandomChestContent[] { private static WeightedRandomChestContent[] spaceship = new WeightedRandomChestContent[] {
new WeightedRandomChestContent(ModItems.battery_advanced, 0, 1, 1, 5), new WeightedRandomChestContent(ModItems.battery_advanced, 0, 1, 1, 5),

View File

@ -25,6 +25,7 @@ import com.hbm.interfaces.ISource;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import com.hbm.items.special.ItemBattery; import com.hbm.items.special.ItemBattery;
import com.hbm.main.MainRegistry; import com.hbm.main.MainRegistry;
import com.hbm.potion.HbmPotion;
import com.hbm.tileentity.conductor.TileEntityCable; import com.hbm.tileentity.conductor.TileEntityCable;
import com.hbm.tileentity.conductor.TileEntityFluidDuct; import com.hbm.tileentity.conductor.TileEntityFluidDuct;
import com.hbm.tileentity.conductor.TileEntityGasDuct; import com.hbm.tileentity.conductor.TileEntityGasDuct;
@ -44,6 +45,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3; import net.minecraft.util.Vec3;
@ -215,13 +217,38 @@ public class Library {
} }
} }
//radDura: Radiation duration in seconds
//radLevel: Radiation level (0 = I)
//maskDura: Radiation duration when wearing gasmask
//maskLevel: Radiation level when wearing gasmask
public static void applyRadiation(Entity e, int radDura, int radLevel, int maskDura, int maskLevel) {
if(!(e instanceof EntityLivingBase))
return;
EntityLivingBase entity = (EntityLivingBase)e;
if(entity instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer)entity;
if(checkForHazmat(player))
return;
if(checkForGasMask(player)) {
entity.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, maskDura * 60, maskLevel));
return;
}
}
entity.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, radDura * 60, radLevel));
}
public static boolean checkForHazmat(EntityPlayer player) { public static boolean checkForHazmat(EntityPlayer player) {
if(checkArmor(player, ModItems.hazmat_helmet, ModItems.hazmat_plate, ModItems.hazmat_legs, ModItems.hazmat_boots) || if(checkArmor(player, ModItems.hazmat_helmet, ModItems.hazmat_plate, ModItems.hazmat_legs, ModItems.hazmat_boots) ||
checkArmor(player, ModItems.t45_helmet, ModItems.t45_plate, ModItems.t45_legs, ModItems.t45_boots) || checkArmor(player, ModItems.t45_helmet, ModItems.t45_plate, ModItems.t45_legs, ModItems.t45_boots) ||
checkArmor(player, ModItems.euphemium_helmet, ModItems.euphemium_plate, ModItems.euphemium_legs, ModItems.euphemium_boots) ||
checkArmor(player, ModItems.schrabidium_helmet, ModItems.schrabidium_plate, ModItems.schrabidium_legs, ModItems.schrabidium_boots) || checkArmor(player, ModItems.schrabidium_helmet, ModItems.schrabidium_plate, ModItems.schrabidium_legs, ModItems.schrabidium_boots) ||
checkArmor(player, ModItems.hazmat_paa_helmet, ModItems.hazmat_paa_plate, ModItems.hazmat_paa_legs, ModItems.hazmat_paa_boots)) checkForHaz2(player))
{ {
return true; return true;
} }
@ -231,7 +258,8 @@ public class Library {
public static boolean checkForHaz2(EntityPlayer player) { public static boolean checkForHaz2(EntityPlayer player) {
if(checkArmor(player, ModItems.hazmat_paa_helmet, ModItems.hazmat_paa_plate, ModItems.hazmat_paa_legs, ModItems.hazmat_paa_boots)) if(checkArmor(player, ModItems.hazmat_paa_helmet, ModItems.hazmat_paa_plate, ModItems.hazmat_paa_legs, ModItems.hazmat_paa_boots) ||
checkArmor(player, ModItems.euphemium_helmet, ModItems.euphemium_plate, ModItems.euphemium_legs, ModItems.euphemium_boots))
{ {
return true; return true;
} }
@ -263,6 +291,10 @@ public class Library {
{ {
return true; return true;
} }
if(checkArmorPiece(player, ModItems.gas_mask_m65, 3))
{
return true;
}
if(checkArmorPiece(player, ModItems.t45_helmet, 3)) if(checkArmorPiece(player, ModItems.t45_helmet, 3))
{ {
return true; return true;

View File

@ -1040,6 +1040,7 @@ public class CraftingManager {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.goggles, 1), new Object[] { "P P", "GPG", 'G', "paneGlass", 'P', "plateSteel" })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.goggles, 1), new Object[] { "P P", "GPG", 'G', "paneGlass", 'P', "plateSteel" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gas_mask, 1), new Object[] { "PPP", "GPG", "FPF", 'G', "paneGlass", 'P', "plateSteel", 'F', ModItems.filter_coal })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gas_mask, 1), new Object[] { "PPP", "GPG", "FPF", 'G', "paneGlass", 'P', "plateSteel", 'F', ModItems.filter_coal }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gas_mask_m65, 1), new Object[] { "PPP", "GPG", "FIF", 'G', "paneGlass", 'P', ModItems.plate_polymer, 'F', ModItems.filter_coal, 'I', "plateIron" }));
GameRegistry.addRecipe(new ItemStack(ModItems.cape_radiation, 1), new Object[] { "W W", "WIW", "WDW", 'W', new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 11), 'D', new ItemStack(Items.dye, 1, 11), 'I', ModItems.nuclear_waste }); GameRegistry.addRecipe(new ItemStack(ModItems.cape_radiation, 1), new Object[] { "W W", "WIW", "WDW", 'W', new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 11), 'D', new ItemStack(Items.dye, 1, 11), 'I', ModItems.nuclear_waste });
GameRegistry.addRecipe(new ItemStack(ModItems.cape_gasmask, 1), new Object[] { "W W", "WIW", "WDW", 'W', new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 4), 'D', new ItemStack(Items.dye, 1, 0), 'I', ModItems.gas_mask }); GameRegistry.addRecipe(new ItemStack(ModItems.cape_gasmask, 1), new Object[] { "W W", "WIW", "WDW", 'W', new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 4), 'D', new ItemStack(Items.dye, 1, 0), 'I', ModItems.gas_mask });

View File

@ -1,5 +1,7 @@
package com.hbm.main; package com.hbm.main;
import java.util.Random;
import com.hbm.entity.missile.EntityMissileBaseAdvanced; import com.hbm.entity.missile.EntityMissileBaseAdvanced;
import com.hbm.entity.mob.EntityNuclearCreeper; import com.hbm.entity.mob.EntityNuclearCreeper;
import com.hbm.entity.projectile.EntityMeteor; import com.hbm.entity.projectile.EntityMeteor;
@ -15,21 +17,26 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.monster.EntityZombie; import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.passive.EntityCow; import net.minecraft.entity.passive.EntityCow;
import net.minecraft.entity.passive.EntityMooshroom; import net.minecraft.entity.passive.EntityMooshroom;
import net.minecraft.entity.passive.EntityVillager; import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect; import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatComponentText;
import net.minecraft.world.World;
import net.minecraftforge.event.entity.EntityEvent.EnteringChunk; import net.minecraftforge.event.entity.EntityEvent.EnteringChunk;
import net.minecraftforge.event.entity.living.LivingSpawnEvent;
public class ModEventHandler public class ModEventHandler
{ {
public static boolean showMessage = true; public static boolean showMessage = true;
public static int meteorShower = 0; public static int meteorShower = 0;
static Random rand = new Random();
@SubscribeEvent @SubscribeEvent
public void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent event) { public void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent event) {
@ -41,6 +48,44 @@ public class ModEventHandler
showMessage = !showMessage; showMessage = !showMessage;
} }
@SubscribeEvent
public void spawnMob(LivingSpawnEvent event) {
EntityLivingBase entity = event.entityLiving;
World world = event.world;
if(entity instanceof EntityZombie) {
if(rand.nextInt(64) == 0)
entity.setCurrentItemOrArmor(4, new ItemStack(ModItems.gas_mask_m65, 1, world.rand.nextInt(100)));
if(rand.nextInt(128) == 0)
entity.setCurrentItemOrArmor(4, new ItemStack(ModItems.gas_mask, 1, world.rand.nextInt(100)));
if(rand.nextInt(256) == 0)
entity.setCurrentItemOrArmor(4, new ItemStack(ModItems.mask_of_infamy, 1, world.rand.nextInt(100)));
if(rand.nextInt(128) == 0)
entity.setCurrentItemOrArmor(0, new ItemStack(ModItems.pipe_lead, 1, world.rand.nextInt(100)));
if(rand.nextInt(128) == 0)
entity.setCurrentItemOrArmor(0, new ItemStack(ModItems.reer_graar, 1, world.rand.nextInt(100)));
if(rand.nextInt(128) == 0)
entity.setCurrentItemOrArmor(0, new ItemStack(ModItems.pipe_rusty, 1, world.rand.nextInt(100)));
if(rand.nextInt(128) == 0)
entity.setCurrentItemOrArmor(0, new ItemStack(ModItems.crowbar, 1, world.rand.nextInt(100)));
if(rand.nextInt(128) == 0)
entity.setCurrentItemOrArmor(0, new ItemStack(ModItems.big_sword, 1, world.rand.nextInt(100)));
if(rand.nextInt(256) == 0)
entity.setCurrentItemOrArmor(0, new ItemStack(ModItems.steel_pickaxe, 1, world.rand.nextInt(300)));
}
if(entity instanceof EntitySkeleton) {
if(rand.nextInt(16) == 0) {
entity.setCurrentItemOrArmor(4, new ItemStack(ModItems.gas_mask_m65, 1, world.rand.nextInt(100)));
if(rand.nextInt(32) == 0) {
entity.setCurrentItemOrArmor(0, new ItemStack(ModItems.syringe_poison));
}
}
}
}
@SubscribeEvent @SubscribeEvent
public void worldTick(WorldTickEvent event) { public void worldTick(WorldTickEvent event) {
@ -125,7 +170,7 @@ public class ModEventHandler
int level = effect.getAmplifier(); int level = effect.getAmplifier();
if(level > 15) { if(level > 14) {
if(event.world.rand.nextInt(100) == 0) if(event.world.rand.nextInt(100) == 0)
entity.addPotionEffect(new PotionEffect(Potion.confusion.id, 5 * 20, 0)); entity.addPotionEffect(new PotionEffect(Potion.confusion.id, 5 * 20, 0));
if(event.world.rand.nextInt(300) == 0) if(event.world.rand.nextInt(300) == 0)
@ -136,7 +181,7 @@ public class ModEventHandler
entity.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 5 * 20, 2)); entity.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 5 * 20, 2));
if(event.world.rand.nextInt(500) == 0) if(event.world.rand.nextInt(500) == 0)
entity.addPotionEffect(new PotionEffect(Potion.wither.id, 3 * 20, 4)); entity.addPotionEffect(new PotionEffect(Potion.wither.id, 3 * 20, 4));
} else if(level > 10) { } else if(level > 9) {
if(event.world.rand.nextInt(150) == 0) if(event.world.rand.nextInt(150) == 0)
entity.addPotionEffect(new PotionEffect(Potion.confusion.id, 5 * 20, 0)); entity.addPotionEffect(new PotionEffect(Potion.confusion.id, 5 * 20, 0));
if(event.world.rand.nextInt(400) == 0) if(event.world.rand.nextInt(400) == 0)

View File

@ -80,12 +80,16 @@ public class ModelGasMask extends ModelBiped {
@Override @Override
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) {
EntityPlayer player = (EntityPlayer) entity;
if (player.isSneaking()) { if (entity instanceof EntityPlayer) {
this.isSneak = true; EntityPlayer player = (EntityPlayer) entity;
} else { if (player.isSneaking()) {
this.isSneak = false; this.isSneak = true;
} else {
this.isSneak = false;
}
} }
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
this.mask.rotationPointX = this.bipedHead.rotationPointX; this.mask.rotationPointX = this.bipedHead.rotationPointX;
this.mask.rotationPointY = this.bipedHead.rotationPointY; this.mask.rotationPointY = this.bipedHead.rotationPointY;

View File

@ -4,11 +4,6 @@
// Keep in mind that you still need to fill in some blanks // Keep in mind that you still need to fill in some blanks
// - ZeuX // - ZeuX
package com.hbm.render.model; package com.hbm.render.model;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
@ -18,114 +13,109 @@ import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
public class ModelGoggles extends ModelBiped public class ModelGoggles extends ModelBiped {
{ // fields
//fields ModelRenderer Shape1;
ModelRenderer Shape1; ModelRenderer Shape2;
ModelRenderer Shape2; ModelRenderer Shape5;
ModelRenderer Shape5; ModelRenderer Shape6;
ModelRenderer Shape6; ModelRenderer Shape7;
ModelRenderer Shape7; ModelRenderer google;
ModelRenderer google;
public ModelGoggles()
{
textureWidth = 64;
textureHeight = 32;
google = new ModelRenderer(this, 0, 0);
Shape1 = new ModelRenderer(this, 0, 0);
Shape1.addBox(0F, 0F, 0F, 9, 3, 1);
Shape1.setRotationPoint(-4.5F, -3F - 2, -4.5F);
Shape1.setTextureSize(64, 32);
Shape1.mirror = true;
setRotation(Shape1, 0F, 0F, 0F);
convertToChild(google, Shape1);
Shape2 = new ModelRenderer(this, 0, 4);
Shape2.addBox(0F, 0F, 0F, 9, 2, 5);
Shape2.setRotationPoint(-4.5F, -3F - 2, -3.5F);
Shape2.setTextureSize(64, 32);
Shape2.mirror = true;
setRotation(Shape2, 0F, 0F, 0F);
convertToChild(google, Shape2);
Shape5 = new ModelRenderer(this, 26, 0);
Shape5.addBox(0F, 0F, 0F, 2, 2, 1);
Shape5.setRotationPoint(1F, -2.5F - 2, -5F);
Shape5.setTextureSize(64, 32);
Shape5.mirror = true;
setRotation(Shape5, 0F, 0F, 0F);
convertToChild(google, Shape5);
Shape6 = new ModelRenderer(this, 20, 0);
Shape6.addBox(0F, 0F, 0F, 2, 2, 1);
Shape6.setRotationPoint(-3F, -2.5F - 2, -5F);
Shape6.setTextureSize(64, 32);
Shape6.mirror = true;
setRotation(Shape6, 0F, 0F, 0F);
convertToChild(google, Shape6);
Shape7 = new ModelRenderer(this, 0, 11);
Shape7.addBox(0F, 0F, 0F, 9, 1, 4);
Shape7.setRotationPoint(-4.5F, -3F - 2, 0.5F);
Shape7.setTextureSize(64, 32);
Shape7.mirror = true;
setRotation(Shape7, 0F, 0F, 0F);
convertToChild(google, Shape7);
}
/*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);
Shape5.render(f5);
Shape6.render(f5);
Shape7.render(f5);
}*/
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
@Override
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
{
EntityPlayer player = (EntityPlayer)entity;
if(player.isSneaking())
{
this.isSneak = true;
} else {
this.isSneak = false;
}
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
this.google.rotationPointX = this.bipedHead.rotationPointX;
this.google.rotationPointY = this.bipedHead.rotationPointY;
this.google.rotateAngleY = this.bipedHead.rotateAngleY;
this.google.rotateAngleX = this.bipedHead.rotateAngleX;
}
@Override
public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7)
{
setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);
GL11.glPushMatrix();
this.google.render(par7);
GL11.glPopMatrix();
}
protected void convertToChild(ModelRenderer parParent, ModelRenderer parChild) public ModelGoggles() {
{ textureWidth = 64;
// move child rotation point to be relative to parent textureHeight = 32;
parChild.rotationPointX -= parParent.rotationPointX;
parChild.rotationPointY -= parParent.rotationPointY; google = new ModelRenderer(this, 0, 0);
parChild.rotationPointZ -= parParent.rotationPointZ; Shape1 = new ModelRenderer(this, 0, 0);
// make rotations relative to parent Shape1.addBox(0F, 0F, 0F, 9, 3, 1);
parChild.rotateAngleX -= parParent.rotateAngleX; Shape1.setRotationPoint(-4.5F, -3F - 2, -4.5F);
parChild.rotateAngleY -= parParent.rotateAngleY; Shape1.setTextureSize(64, 32);
parChild.rotateAngleZ -= parParent.rotateAngleZ; Shape1.mirror = true;
// create relationship setRotation(Shape1, 0F, 0F, 0F);
parParent.addChild(parChild); convertToChild(google, Shape1);
} Shape2 = new ModelRenderer(this, 0, 4);
Shape2.addBox(0F, 0F, 0F, 9, 2, 5);
Shape2.setRotationPoint(-4.5F, -3F - 2, -3.5F);
Shape2.setTextureSize(64, 32);
Shape2.mirror = true;
setRotation(Shape2, 0F, 0F, 0F);
convertToChild(google, Shape2);
Shape5 = new ModelRenderer(this, 26, 0);
Shape5.addBox(0F, 0F, 0F, 2, 2, 1);
Shape5.setRotationPoint(1F, -2.5F - 2, -5F);
Shape5.setTextureSize(64, 32);
Shape5.mirror = true;
setRotation(Shape5, 0F, 0F, 0F);
convertToChild(google, Shape5);
Shape6 = new ModelRenderer(this, 20, 0);
Shape6.addBox(0F, 0F, 0F, 2, 2, 1);
Shape6.setRotationPoint(-3F, -2.5F - 2, -5F);
Shape6.setTextureSize(64, 32);
Shape6.mirror = true;
setRotation(Shape6, 0F, 0F, 0F);
convertToChild(google, Shape6);
Shape7 = new ModelRenderer(this, 0, 11);
Shape7.addBox(0F, 0F, 0F, 9, 1, 4);
Shape7.setRotationPoint(-4.5F, -3F - 2, 0.5F);
Shape7.setTextureSize(64, 32);
Shape7.mirror = true;
setRotation(Shape7, 0F, 0F, 0F);
convertToChild(google, Shape7);
}
/*
* 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); Shape5.render(f5); Shape6.render(f5);
* Shape7.render(f5); }
*/
private void setRotation(ModelRenderer model, float x, float y, float z) {
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
@Override
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) {
if (entity instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) entity;
if (player.isSneaking()) {
this.isSneak = true;
} else {
this.isSneak = false;
}
}
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
this.google.rotationPointX = this.bipedHead.rotationPointX;
this.google.rotationPointY = this.bipedHead.rotationPointY;
this.google.rotateAngleY = this.bipedHead.rotateAngleY;
this.google.rotateAngleX = this.bipedHead.rotateAngleX;
}
@Override
public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) {
setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);
GL11.glPushMatrix();
this.google.render(par7);
GL11.glPopMatrix();
}
protected void convertToChild(ModelRenderer parParent, ModelRenderer parChild) {
// move child rotation point to be relative to parent
parChild.rotationPointX -= parParent.rotationPointX;
parChild.rotationPointY -= parParent.rotationPointY;
parChild.rotationPointZ -= parParent.rotationPointZ;
// make rotations relative to parent
parChild.rotateAngleX -= parParent.rotateAngleX;
parChild.rotateAngleY -= parParent.rotateAngleY;
parChild.rotateAngleZ -= parParent.rotateAngleZ;
// create relationship
parParent.addChild(parChild);
}
} }

View File

@ -107,11 +107,14 @@ public class ModelM65 extends ModelBiped {
@Override @Override
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) {
EntityPlayer player = (EntityPlayer) entity;
if (player.isSneaking()) { if(entity instanceof EntityPlayer) {
this.isSneak = true; EntityPlayer player = (EntityPlayer) entity;
} else { if (player.isSneaking()) {
this.isSneak = false; this.isSneak = true;
} else {
this.isSneak = false;
}
} }
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
this.mask.rotationPointX = this.bipedHead.rotationPointX; this.mask.rotationPointX = this.bipedHead.rotationPointX;

View File

@ -4,11 +4,6 @@
// Keep in mind that you still need to fill in some blanks // Keep in mind that you still need to fill in some blanks
// - ZeuX // - ZeuX
package com.hbm.render.model; package com.hbm.render.model;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
@ -18,131 +13,124 @@ import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
public class ModelT45Boots extends ModelBiped public class ModelT45Boots extends ModelBiped {
{ // fields
//fields ModelRenderer leftleg;
ModelRenderer leftleg; ModelRenderer rightleg;
ModelRenderer rightleg; ModelRenderer Shape1;
ModelRenderer Shape1; ModelRenderer Shape2;
ModelRenderer Shape2; ModelRenderer Shape3;
ModelRenderer Shape3; ModelRenderer Shape4;
ModelRenderer Shape4;
public ModelT45Boots()
{
textureWidth = 64;
textureHeight = 32;
leftleg = new ModelRenderer(this, 0, 0); public ModelT45Boots() {
rightleg = new ModelRenderer(this, 0, 0); textureWidth = 64;
Shape1 = new ModelRenderer(this, 0, 0); textureHeight = 32;
Shape1.addBox(0F, 0F, 0F, 4, 2, 6);
Shape1.setRotationPoint(-4F + 2, 0F + 9.5F, -4F); leftleg = new ModelRenderer(this, 0, 0);
Shape1.setTextureSize(64, 32); rightleg = new ModelRenderer(this, 0, 0);
Shape1.mirror = true; Shape1 = new ModelRenderer(this, 0, 0);
setRotation(Shape1, 0F, 0F, 0F); Shape1.addBox(0F, 0F, 0F, 4, 2, 6);
convertToChild(leftleg, Shape1); Shape1.setRotationPoint(-4F + 2, 0F + 9.5F, -4F);
Shape2 = new ModelRenderer(this, 0, 8); Shape1.setTextureSize(64, 32);
Shape2.addBox(0F, 0F, 0F, 4, 2, 6); Shape1.mirror = true;
Shape2.setRotationPoint(0F - 2, 0F + 9.5F, -4F); setRotation(Shape1, 0F, 0F, 0F);
Shape2.setTextureSize(64, 32); convertToChild(leftleg, Shape1);
Shape2.mirror = true; Shape2 = new ModelRenderer(this, 0, 8);
setRotation(Shape2, 0F, 0F, 0F); Shape2.addBox(0F, 0F, 0F, 4, 2, 6);
convertToChild(rightleg, Shape2); Shape2.setRotationPoint(0F - 2, 0F + 9.5F, -4F);
Shape3 = new ModelRenderer(this, 0, 16); Shape2.setTextureSize(64, 32);
Shape3.addBox(0F, -1F, 0F, 4, 2, 4); Shape2.mirror = true;
Shape3.setRotationPoint(-4F + 2, 0F + 9.5F, -4F); setRotation(Shape2, 0F, 0F, 0F);
Shape3.setTextureSize(64, 32); convertToChild(rightleg, Shape2);
Shape3.mirror = true; Shape3 = new ModelRenderer(this, 0, 16);
setRotation(Shape3, 0.2617994F, 0F, 0F); Shape3.addBox(0F, -1F, 0F, 4, 2, 4);
convertToChild(leftleg, Shape3); Shape3.setRotationPoint(-4F + 2, 0F + 9.5F, -4F);
Shape4 = new ModelRenderer(this, 0, 22); Shape3.setTextureSize(64, 32);
Shape4.addBox(0F, -1F, 0F, 4, 2, 4); Shape3.mirror = true;
Shape4.setRotationPoint(0F - 2, 0F + 9.5F, -4F); setRotation(Shape3, 0.2617994F, 0F, 0F);
Shape4.setTextureSize(64, 32); convertToChild(leftleg, Shape3);
Shape4.mirror = true; Shape4 = new ModelRenderer(this, 0, 22);
setRotation(Shape4, 0.2617994F, 0F, 0F); Shape4.addBox(0F, -1F, 0F, 4, 2, 4);
convertToChild(rightleg, Shape4); Shape4.setRotationPoint(0F - 2, 0F + 9.5F, -4F);
} Shape4.setTextureSize(64, 32);
Shape4.mirror = true;
/*public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) setRotation(Shape4, 0.2617994F, 0F, 0F);
{ convertToChild(rightleg, Shape4);
super.render(entity, f, f1, f2, f3, f4, f5); }
setRotationAngles(f, f1, f2, f3, f4, f5);
Shape1.render(f5); /*
Shape2.render(f5); * public void render(Entity entity, float f, float f1, float f2, float f3,
Shape3.render(f5); * float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5);
Shape4.render(f5); * setRotationAngles(f, f1, f2, f3, f4, f5); Shape1.render(f5);
}*/ * Shape2.render(f5); Shape3.render(f5); Shape4.render(f5); }
*/
private void setRotation(ModelRenderer model, float x, float y, float z)
{ private void setRotation(ModelRenderer model, float x, float y, float z) {
model.rotateAngleX = x; model.rotateAngleX = x;
model.rotateAngleY = y; model.rotateAngleY = y;
model.rotateAngleZ = z; model.rotateAngleZ = z;
} }
@Override @Override
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) {
{
EntityPlayer player = (EntityPlayer)entity; if (entity instanceof EntityPlayer) {
if(player.isSneaking()) EntityPlayer player = (EntityPlayer) entity;
{ if (player.isSneaking()) {
this.isSneak = true; this.isSneak = true;
} else { } else {
this.isSneak = false; this.isSneak = false;
} }
}
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
this.leftleg.rotationPointX = this.bipedLeftLeg.rotationPointX; super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
this.leftleg.rotationPointY = this.bipedLeftLeg.rotationPointY - 1.5F; this.leftleg.rotationPointX = this.bipedLeftLeg.rotationPointX;
this.leftleg.rotationPointZ = this.bipedLeftLeg.rotationPointZ; this.leftleg.rotationPointY = this.bipedLeftLeg.rotationPointY - 1.5F;
this.leftleg.rotateAngleX = this.bipedLeftLeg.rotateAngleX; this.leftleg.rotationPointZ = this.bipedLeftLeg.rotationPointZ;
this.leftleg.rotateAngleY = this.bipedLeftLeg.rotateAngleY; this.leftleg.rotateAngleX = this.bipedLeftLeg.rotateAngleX;
this.leftleg.rotateAngleZ = this.bipedLeftLeg.rotateAngleZ; this.leftleg.rotateAngleY = this.bipedLeftLeg.rotateAngleY;
this.rightleg.rotationPointX = this.bipedRightLeg.rotationPointX; this.leftleg.rotateAngleZ = this.bipedLeftLeg.rotateAngleZ;
this.rightleg.rotationPointY = this.bipedRightLeg.rotationPointY - 1.5F; this.rightleg.rotationPointX = this.bipedRightLeg.rotationPointX;
this.rightleg.rotationPointZ = this.bipedRightLeg.rotationPointZ; this.rightleg.rotationPointY = this.bipedRightLeg.rotationPointY - 1.5F;
this.rightleg.rotateAngleX = this.bipedRightLeg.rotateAngleX; this.rightleg.rotationPointZ = this.bipedRightLeg.rotationPointZ;
this.rightleg.rotateAngleY = this.bipedRightLeg.rotateAngleY; this.rightleg.rotateAngleX = this.bipedRightLeg.rotateAngleX;
this.rightleg.rotateAngleZ = this.bipedRightLeg.rotateAngleZ; this.rightleg.rotateAngleY = this.bipedRightLeg.rotateAngleY;
this.rightleg.rotateAngleZ = this.bipedRightLeg.rotateAngleZ;
if(this.isSneak)
{ if (this.isSneak) {
this.leftleg.rotationPointZ -= 0.5F; this.leftleg.rotationPointZ -= 0.5F;
this.rightleg.rotationPointZ -= 0.5F; this.rightleg.rotationPointZ -= 0.5F;
this.leftleg.rotationPointY += 0.5F; this.leftleg.rotationPointY += 0.5F;
this.rightleg.rotationPointY += 0.5F; this.rightleg.rotationPointY += 0.5F;
} }
} }
@Override
public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) @Override
{ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) {
setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glScalef(1.125F, 1.125F, 1.125F); GL11.glScalef(1.125F, 1.125F, 1.125F);
//this.leftleg.addChild(Shape1); // this.leftleg.addChild(Shape1);
//this.leftleg.addChild(Shape3); // this.leftleg.addChild(Shape3);
this.leftleg.render(par7); this.leftleg.render(par7);
//this.rightleg.addChild(Shape2); // this.rightleg.addChild(Shape2);
//this.rightleg.addChild(Shape4); // this.rightleg.addChild(Shape4);
this.rightleg.render(par7); this.rightleg.render(par7);
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
protected void convertToChild(ModelRenderer parParent, ModelRenderer parChild) protected void convertToChild(ModelRenderer parParent, ModelRenderer parChild) {
{ // move child rotation point to be relative to parent
// move child rotation point to be relative to parent parChild.rotationPointX -= parParent.rotationPointX;
parChild.rotationPointX -= parParent.rotationPointX; parChild.rotationPointY -= parParent.rotationPointY;
parChild.rotationPointY -= parParent.rotationPointY; parChild.rotationPointZ -= parParent.rotationPointZ;
parChild.rotationPointZ -= parParent.rotationPointZ; // make rotations relative to parent
// make rotations relative to parent parChild.rotateAngleX -= parParent.rotateAngleX;
parChild.rotateAngleX -= parParent.rotateAngleX; parChild.rotateAngleY -= parParent.rotateAngleY;
parChild.rotateAngleY -= parParent.rotateAngleY; parChild.rotateAngleZ -= parParent.rotateAngleZ;
parChild.rotateAngleZ -= parParent.rotateAngleZ; // create relationship
// create relationship parParent.addChild(parChild);
parParent.addChild(parChild); }
}
} }

View File

@ -11,6 +11,9 @@ import org.lwjgl.opengl.GL11;
import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.monster.EntityPigZombie;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction; import net.minecraft.item.EnumAction;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -243,6 +246,11 @@ public class ModelT45Chest extends ModelBiped {
this.rightarm.rotateAngleX = this.bipedRightArm.rotateAngleX; this.rightarm.rotateAngleX = this.bipedRightArm.rotateAngleX;
this.rightarm.rotateAngleY = this.bipedRightArm.rotateAngleY; this.rightarm.rotateAngleY = this.bipedRightArm.rotateAngleY;
this.rightarm.rotateAngleZ = this.bipedRightArm.rotateAngleZ; this.rightarm.rotateAngleZ = this.bipedRightArm.rotateAngleZ;
if(entity instanceof EntityZombie || entity instanceof EntityPigZombie || entity instanceof EntitySkeleton) {
this.leftarm.rotateAngleX -= (90 * Math.PI / 180D);
this.rightarm.rotateAngleX -= (90 * Math.PI / 180D);
}
} }
@Override @Override

View File

@ -4,11 +4,6 @@
// Keep in mind that you still need to fill in some blanks // Keep in mind that you still need to fill in some blanks
// - ZeuX // - ZeuX
package com.hbm.render.model; package com.hbm.render.model;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
@ -18,145 +13,136 @@ import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
public class ModelT45Helmet extends ModelBiped public class ModelT45Helmet extends ModelBiped {
{ // fields
//fields ModelRenderer helmet;
ModelRenderer helmet; ModelRenderer Shape1;
ModelRenderer Shape1; ModelRenderer Shape2;
ModelRenderer Shape2; ModelRenderer Shape3;
ModelRenderer Shape3; ModelRenderer Shape4;
ModelRenderer Shape4; ModelRenderer Shape5;
ModelRenderer Shape5; ModelRenderer Shape6;
ModelRenderer Shape6; ModelRenderer Shape7;
ModelRenderer Shape7; ModelRenderer Shape8;
ModelRenderer Shape8;
public ModelT45Helmet()
{
textureWidth = 64;
textureHeight = 32;
helmet = new ModelRenderer(this, 0, 0); public ModelT45Helmet() {
Shape1 = new ModelRenderer(this, 0, 0); textureWidth = 64;
Shape1.addBox(0F, 0F, 0F, 8, 8, 8); textureHeight = 32;
Shape1.setRotationPoint(-4F, 0F - 8 + 0.0625F / 2, -4F);
Shape1.setTextureSize(64, 32);
Shape1.mirror = true;
setRotation(Shape1, 0F, 0F, 0F);
convertToChild(helmet, Shape1);
Shape2 = new ModelRenderer(this, 32, 0);
Shape2.addBox(0F, 0F, 0F, 2, 2, 1);
Shape2.setRotationPoint(1F, 1F - 8 + 0.0625F / 2 + 1, -5F);
Shape2.setTextureSize(64, 32);
Shape2.mirror = true;
setRotation(Shape2, 0F, 0F, 0F);
convertToChild(helmet, Shape2);
Shape3 = new ModelRenderer(this, 40, 6);
Shape3.addBox(0F, 0F, 0F, 1, 1, 4);
Shape3.setRotationPoint(-5F, 1F - 8 + 0.0625F / 2, -5.466667F);
Shape3.setTextureSize(64, 32);
Shape3.mirror = true;
setRotation(Shape3, 0F, 0F, 0F);
convertToChild(helmet, Shape3);
Shape4 = new ModelRenderer(this, 40, 0);
Shape4.addBox(0F, 0F, 0F, 4, 2, 2);
Shape4.setRotationPoint(-2F, 5F - 8 + 0.0625F / 2, -4F);
Shape4.setTextureSize(64, 32);
Shape4.mirror = true;
setRotation(Shape4, -0.7853982F, 0F, 0F);
convertToChild(helmet, Shape4);
Shape5 = new ModelRenderer(this, 54, 0);
Shape5.addBox(0F, 2F, 0F, 2, 1, 2);
Shape5.setRotationPoint(-1F, 5F - 8 + 0.0625F / 2, -4F);
Shape5.setTextureSize(64, 32);
Shape5.mirror = true;
setRotation(Shape5, -0.7853982F, 0F, 0F);
convertToChild(helmet, Shape5);
Shape6 = new ModelRenderer(this, 0, 16);
Shape6.addBox(0F, 0F, 0F, 10, 1, 9);
Shape6.setRotationPoint(-5F, 6F - 8 + 0.0625F / 2, -4.5F);
Shape6.setTextureSize(64, 32);
Shape6.mirror = true;
setRotation(Shape6, 0F, 0F, 0F);
convertToChild(helmet, Shape6);
Shape7 = new ModelRenderer(this, 32, 7);
Shape7.addBox(0F, 0F, 0F, 1, 1, 1);
Shape7.setRotationPoint(-1.5F, 5F - 8 + 0.0625F / 2, -4.5F);
Shape7.setTextureSize(64, 32);
Shape7.mirror = true;
setRotation(Shape7, -0.7853982F, 0F, 0F);
convertToChild(helmet, Shape7);
Shape8 = new ModelRenderer(this, 32, 5);
Shape8.addBox(0F, 0F, 0F, 1, 1, 1);
Shape8.setRotationPoint(0.5F, 5F - 8 + 0.0625F / 2, -4.5F);
Shape8.setTextureSize(64, 32);
Shape8.mirror = true;
setRotation(Shape8, -0.7853982F, 0F, 0F);
convertToChild(helmet, Shape8);
}
/*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);
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;
}
@Override
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
{
EntityPlayer player = (EntityPlayer)entity;
if(player.isSneaking())
{
this.isSneak = true;
} else {
this.isSneak = false;
}
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
this.helmet.rotationPointX = this.bipedHead.rotationPointX;
this.helmet.rotationPointY = this.bipedHead.rotationPointY;
this.helmet.rotateAngleY = this.bipedHead.rotateAngleY;
this.helmet.rotateAngleX = this.bipedHead.rotateAngleX;
}
@Override
public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7)
{
setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);
GL11.glPushMatrix();
GL11.glScalef(1.125F, 1.125F, 1.125F);
GL11.glScalef(1.0625F, 1.0625F, 1.0625F);
this.helmet.render(par7);
GL11.glPopMatrix();
}
protected void convertToChild(ModelRenderer parParent, ModelRenderer parChild) helmet = new ModelRenderer(this, 0, 0);
{ Shape1 = new ModelRenderer(this, 0, 0);
// move child rotation point to be relative to parent Shape1.addBox(0F, 0F, 0F, 8, 8, 8);
parChild.rotationPointX -= parParent.rotationPointX; Shape1.setRotationPoint(-4F, 0F - 8 + 0.0625F / 2, -4F);
parChild.rotationPointY -= parParent.rotationPointY; Shape1.setTextureSize(64, 32);
parChild.rotationPointZ -= parParent.rotationPointZ; Shape1.mirror = true;
// make rotations relative to parent setRotation(Shape1, 0F, 0F, 0F);
parChild.rotateAngleX -= parParent.rotateAngleX; convertToChild(helmet, Shape1);
parChild.rotateAngleY -= parParent.rotateAngleY; Shape2 = new ModelRenderer(this, 32, 0);
parChild.rotateAngleZ -= parParent.rotateAngleZ; Shape2.addBox(0F, 0F, 0F, 2, 2, 1);
// create relationship Shape2.setRotationPoint(1F, 1F - 8 + 0.0625F / 2 + 1, -5F);
parParent.addChild(parChild); Shape2.setTextureSize(64, 32);
} Shape2.mirror = true;
setRotation(Shape2, 0F, 0F, 0F);
convertToChild(helmet, Shape2);
Shape3 = new ModelRenderer(this, 40, 6);
Shape3.addBox(0F, 0F, 0F, 1, 1, 4);
Shape3.setRotationPoint(-5F, 1F - 8 + 0.0625F / 2, -5.466667F);
Shape3.setTextureSize(64, 32);
Shape3.mirror = true;
setRotation(Shape3, 0F, 0F, 0F);
convertToChild(helmet, Shape3);
Shape4 = new ModelRenderer(this, 40, 0);
Shape4.addBox(0F, 0F, 0F, 4, 2, 2);
Shape4.setRotationPoint(-2F, 5F - 8 + 0.0625F / 2, -4F);
Shape4.setTextureSize(64, 32);
Shape4.mirror = true;
setRotation(Shape4, -0.7853982F, 0F, 0F);
convertToChild(helmet, Shape4);
Shape5 = new ModelRenderer(this, 54, 0);
Shape5.addBox(0F, 2F, 0F, 2, 1, 2);
Shape5.setRotationPoint(-1F, 5F - 8 + 0.0625F / 2, -4F);
Shape5.setTextureSize(64, 32);
Shape5.mirror = true;
setRotation(Shape5, -0.7853982F, 0F, 0F);
convertToChild(helmet, Shape5);
Shape6 = new ModelRenderer(this, 0, 16);
Shape6.addBox(0F, 0F, 0F, 10, 1, 9);
Shape6.setRotationPoint(-5F, 6F - 8 + 0.0625F / 2, -4.5F);
Shape6.setTextureSize(64, 32);
Shape6.mirror = true;
setRotation(Shape6, 0F, 0F, 0F);
convertToChild(helmet, Shape6);
Shape7 = new ModelRenderer(this, 32, 7);
Shape7.addBox(0F, 0F, 0F, 1, 1, 1);
Shape7.setRotationPoint(-1.5F, 5F - 8 + 0.0625F / 2, -4.5F);
Shape7.setTextureSize(64, 32);
Shape7.mirror = true;
setRotation(Shape7, -0.7853982F, 0F, 0F);
convertToChild(helmet, Shape7);
Shape8 = new ModelRenderer(this, 32, 5);
Shape8.addBox(0F, 0F, 0F, 1, 1, 1);
Shape8.setRotationPoint(0.5F, 5F - 8 + 0.0625F / 2, -4.5F);
Shape8.setTextureSize(64, 32);
Shape8.mirror = true;
setRotation(Shape8, -0.7853982F, 0F, 0F);
convertToChild(helmet, Shape8);
}
/*
* 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); 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;
}
@Override
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) {
if (entity instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) entity;
if (player.isSneaking()) {
this.isSneak = true;
} else {
this.isSneak = false;
}
}
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
this.helmet.rotationPointX = this.bipedHead.rotationPointX;
this.helmet.rotationPointY = this.bipedHead.rotationPointY;
this.helmet.rotateAngleY = this.bipedHead.rotateAngleY;
this.helmet.rotateAngleX = this.bipedHead.rotateAngleX;
}
@Override
public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) {
setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);
GL11.glPushMatrix();
GL11.glScalef(1.125F, 1.125F, 1.125F);
GL11.glScalef(1.0625F, 1.0625F, 1.0625F);
this.helmet.render(par7);
GL11.glPopMatrix();
}
protected void convertToChild(ModelRenderer parParent, ModelRenderer parChild) {
// move child rotation point to be relative to parent
parChild.rotationPointX -= parParent.rotationPointX;
parChild.rotationPointY -= parParent.rotationPointY;
parChild.rotationPointZ -= parParent.rotationPointZ;
// make rotations relative to parent
parChild.rotateAngleX -= parParent.rotateAngleX;
parChild.rotateAngleY -= parParent.rotateAngleY;
parChild.rotateAngleZ -= parParent.rotateAngleZ;
// create relationship
parParent.addChild(parChild);
}
} }

View File

@ -4,11 +4,6 @@
// Keep in mind that you still need to fill in some blanks // Keep in mind that you still need to fill in some blanks
// - ZeuX // - ZeuX
package com.hbm.render.model; package com.hbm.render.model;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
@ -18,146 +13,137 @@ import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
public class ModelT45Legs extends ModelBiped public class ModelT45Legs extends ModelBiped {
{ // fields
//fields ModelRenderer leftleg;
ModelRenderer leftleg; ModelRenderer rightleg;
ModelRenderer rightleg; ModelRenderer Shape1;
ModelRenderer Shape1; ModelRenderer Shape2;
ModelRenderer Shape2; ModelRenderer Shape3;
ModelRenderer Shape3; ModelRenderer Shape4;
ModelRenderer Shape4; ModelRenderer Shape5;
ModelRenderer Shape5; ModelRenderer Shape6;
ModelRenderer Shape6;
public ModelT45Legs()
{
textureWidth = 64;
textureHeight = 32;
leftleg = new ModelRenderer(this, 0, 0); public ModelT45Legs() {
rightleg = new ModelRenderer(this, 0, 0); textureWidth = 64;
Shape1 = new ModelRenderer(this, 0, 0); textureHeight = 32;
Shape1.addBox(0F, 0F, 0F, 4, 12, 4);
Shape1.setRotationPoint(-4F + 2, 0F - 0.5F, -2F);
Shape1.setTextureSize(64, 32);
Shape1.mirror = true;
setRotation(Shape1, 0F, 0F, 0F);
convertToChild(rightleg, Shape1);
Shape2 = new ModelRenderer(this, 16, 0);
Shape2.addBox(0F, 0F, 0F, 4, 12, 4);
Shape2.setRotationPoint(0F - 2, 0F - 0.5F, -2F);
Shape2.setTextureSize(64, 32);
Shape2.mirror = true;
setRotation(Shape2, 0F, 0F, 0F);
convertToChild(leftleg, Shape2);
Shape3 = new ModelRenderer(this, 0, 16);
Shape3.addBox(0F, -6F, 0F, 5, 6, 4);
Shape3.setRotationPoint(-5F + 2, 10F - 0.5F, -2F);
Shape3.setTextureSize(64, 32);
Shape3.mirror = true;
setRotation(Shape3, 0.1745329F, 0F, 0F);
convertToChild(rightleg, Shape3);
Shape4 = new ModelRenderer(this, 18, 16);
Shape4.addBox(0F, -6F, 0F, 5, 6, 4);
Shape4.setRotationPoint(0F - 2, 10F - 0.5F, -2F);
Shape4.setTextureSize(64, 32);
Shape4.mirror = true;
setRotation(Shape4, 0.1745329F, 0F, 0F);
convertToChild(leftleg, Shape4);
Shape5 = new ModelRenderer(this, 34, 0);
Shape5.addBox(0F, 0F, 0F, 5, 2, 4);
Shape5.setRotationPoint(-5F + 2, 1F - 0.5F, -3F);
Shape5.setTextureSize(64, 32);
Shape5.mirror = true;
setRotation(Shape5, 0F, 0F, 0F);
convertToChild(rightleg, Shape5);
Shape6 = new ModelRenderer(this, 34, 8);
Shape6.addBox(0F, 0F, 0F, 5, 2, 4);
Shape6.setRotationPoint(0F - 2, 1F - 0.5F, -3F);
Shape6.setTextureSize(64, 32);
Shape6.mirror = true;
setRotation(Shape6, 0F, 0F, 0F);
convertToChild(leftleg, Shape6);
}
/*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);
Shape1.render(f5);
Shape2.render(f5);
Shape3.render(f5);
Shape4.render(f5);
Shape5.render(f5);
Shape6.render(f5);
}*/
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
@Override
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
{
EntityPlayer player = (EntityPlayer)entity; leftleg = new ModelRenderer(this, 0, 0);
if(player.isSneaking()) rightleg = new ModelRenderer(this, 0, 0);
{ Shape1 = new ModelRenderer(this, 0, 0);
this.isSneak = true; Shape1.addBox(0F, 0F, 0F, 4, 12, 4);
} else { Shape1.setRotationPoint(-4F + 2, 0F - 0.5F, -2F);
this.isSneak = false; Shape1.setTextureSize(64, 32);
} Shape1.mirror = true;
setRotation(Shape1, 0F, 0F, 0F);
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); convertToChild(rightleg, Shape1);
this.leftleg.rotationPointX = this.bipedLeftLeg.rotationPointX; Shape2 = new ModelRenderer(this, 16, 0);
this.leftleg.rotationPointY = this.bipedLeftLeg.rotationPointY - 1.5F; Shape2.addBox(0F, 0F, 0F, 4, 12, 4);
this.leftleg.rotationPointZ = this.bipedLeftLeg.rotationPointZ; Shape2.setRotationPoint(0F - 2, 0F - 0.5F, -2F);
this.leftleg.rotateAngleX = this.bipedLeftLeg.rotateAngleX; Shape2.setTextureSize(64, 32);
this.leftleg.rotateAngleY = this.bipedLeftLeg.rotateAngleY; Shape2.mirror = true;
this.leftleg.rotateAngleZ = this.bipedLeftLeg.rotateAngleZ; setRotation(Shape2, 0F, 0F, 0F);
this.rightleg.rotationPointX = this.bipedRightLeg.rotationPointX; convertToChild(leftleg, Shape2);
this.rightleg.rotationPointY = this.bipedRightLeg.rotationPointY - 1.5F; Shape3 = new ModelRenderer(this, 0, 16);
this.rightleg.rotationPointZ = this.bipedRightLeg.rotationPointZ; Shape3.addBox(0F, -6F, 0F, 5, 6, 4);
this.rightleg.rotateAngleX = this.bipedRightLeg.rotateAngleX; Shape3.setRotationPoint(-5F + 2, 10F - 0.5F, -2F);
this.rightleg.rotateAngleY = this.bipedRightLeg.rotateAngleY; Shape3.setTextureSize(64, 32);
this.rightleg.rotateAngleZ = this.bipedRightLeg.rotateAngleZ; Shape3.mirror = true;
setRotation(Shape3, 0.1745329F, 0F, 0F);
if(this.isSneak) convertToChild(rightleg, Shape3);
{ Shape4 = new ModelRenderer(this, 18, 16);
this.leftleg.rotationPointZ -= 0.5F; Shape4.addBox(0F, -6F, 0F, 5, 6, 4);
this.rightleg.rotationPointZ -= 0.5F; Shape4.setRotationPoint(0F - 2, 10F - 0.5F, -2F);
this.leftleg.rotationPointY += 0.5F; Shape4.setTextureSize(64, 32);
this.rightleg.rotationPointY += 0.5F; Shape4.mirror = true;
} setRotation(Shape4, 0.1745329F, 0F, 0F);
} convertToChild(leftleg, Shape4);
@Override Shape5 = new ModelRenderer(this, 34, 0);
public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) Shape5.addBox(0F, 0F, 0F, 5, 2, 4);
{ Shape5.setRotationPoint(-5F + 2, 1F - 0.5F, -3F);
setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); Shape5.setTextureSize(64, 32);
GL11.glPushMatrix(); Shape5.mirror = true;
GL11.glScalef(1.125F, 1.125F, 1.125F); setRotation(Shape5, 0F, 0F, 0F);
this.leftleg.render(par7); convertToChild(rightleg, Shape5);
Shape6 = new ModelRenderer(this, 34, 8);
this.rightleg.render(par7); Shape6.addBox(0F, 0F, 0F, 5, 2, 4);
GL11.glPopMatrix(); Shape6.setRotationPoint(0F - 2, 1F - 0.5F, -3F);
} Shape6.setTextureSize(64, 32);
Shape6.mirror = true;
protected void convertToChild(ModelRenderer parParent, ModelRenderer parChild) setRotation(Shape6, 0F, 0F, 0F);
{ convertToChild(leftleg, Shape6);
// move child rotation point to be relative to parent }
parChild.rotationPointX -= parParent.rotationPointX;
parChild.rotationPointY -= parParent.rotationPointY; /*
parChild.rotationPointZ -= parParent.rotationPointZ; * public void render(Entity entity, float f, float f1, float f2, float f3,
// make rotations relative to parent * float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5);
parChild.rotateAngleX -= parParent.rotateAngleX; * setRotationAngles(f, f1, f2, f3, f4, f5); Shape1.render(f5);
parChild.rotateAngleY -= parParent.rotateAngleY; * Shape2.render(f5); Shape3.render(f5); Shape4.render(f5);
parChild.rotateAngleZ -= parParent.rotateAngleZ; * Shape5.render(f5); Shape6.render(f5); }
// create relationship */
parParent.addChild(parChild);
} private void setRotation(ModelRenderer model, float x, float y, float z) {
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
@Override
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) {
if (entity instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) entity;
if (player.isSneaking()) {
this.isSneak = true;
} else {
this.isSneak = false;
}
}
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
this.leftleg.rotationPointX = this.bipedLeftLeg.rotationPointX;
this.leftleg.rotationPointY = this.bipedLeftLeg.rotationPointY - 1.5F;
this.leftleg.rotationPointZ = this.bipedLeftLeg.rotationPointZ;
this.leftleg.rotateAngleX = this.bipedLeftLeg.rotateAngleX;
this.leftleg.rotateAngleY = this.bipedLeftLeg.rotateAngleY;
this.leftleg.rotateAngleZ = this.bipedLeftLeg.rotateAngleZ;
this.rightleg.rotationPointX = this.bipedRightLeg.rotationPointX;
this.rightleg.rotationPointY = this.bipedRightLeg.rotationPointY - 1.5F;
this.rightleg.rotationPointZ = this.bipedRightLeg.rotationPointZ;
this.rightleg.rotateAngleX = this.bipedRightLeg.rotateAngleX;
this.rightleg.rotateAngleY = this.bipedRightLeg.rotateAngleY;
this.rightleg.rotateAngleZ = this.bipedRightLeg.rotateAngleZ;
if (this.isSneak) {
this.leftleg.rotationPointZ -= 0.5F;
this.rightleg.rotationPointZ -= 0.5F;
this.leftleg.rotationPointY += 0.5F;
this.rightleg.rotationPointY += 0.5F;
}
}
@Override
public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) {
setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);
GL11.glPushMatrix();
GL11.glScalef(1.125F, 1.125F, 1.125F);
this.leftleg.render(par7);
this.rightleg.render(par7);
GL11.glPopMatrix();
}
protected void convertToChild(ModelRenderer parParent, ModelRenderer parChild) {
// move child rotation point to be relative to parent
parChild.rotationPointX -= parParent.rotationPointX;
parChild.rotationPointY -= parParent.rotationPointY;
parChild.rotationPointZ -= parParent.rotationPointZ;
// make rotations relative to parent
parChild.rotateAngleX -= parParent.rotateAngleX;
parChild.rotateAngleY -= parParent.rotateAngleY;
parChild.rotateAngleZ -= parParent.rotateAngleZ;
// create relationship
parParent.addChild(parChild);
}
} }

View File

@ -64,17 +64,8 @@ public class TileEntityYellowBarrel extends TileEntity {
double d9 = MathHelper.sqrt_double(d5 * d5 + d6 * d6 + d7 * d7); double d9 = MathHelper.sqrt_double(d5 * d5 + d6 * d6 + d7 * d7);
if (d9 < wat) if (d9 < wat)
{ {
if(entity instanceof EntityPlayer && Library.checkForHazmat((EntityPlayer)entity)) if(entity instanceof EntityLivingBase)
{ Library.applyRadiation((EntityLivingBase)entity, 80, 24, 60, 19);
/*Library.damageSuit(((EntityPlayer)entity), 0);
Library.damageSuit(((EntityPlayer)entity), 1);
Library.damageSuit(((EntityPlayer)entity), 2);
Library.damageSuit(((EntityPlayer)entity), 3);*/
} else if(entity instanceof EntityLivingBase && !(entity instanceof EntityNuclearCreeper) && !(entity instanceof EntityMooshroom) && !(entity instanceof EntityZombie))
{
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 30 * 20, 14));
}
} }
} }
} }

View File

@ -435,13 +435,8 @@ public class TileEntityMachineReactorSmall extends TileEntity
xCoord + 0.5 + 5, yCoord + 1.5 + 5, zCoord + 0.5 + 5)); xCoord + 0.5 + 5, yCoord + 1.5 + 5, zCoord + 0.5 + 5));
for (Entity e : list) { for (Entity e : list) {
if (e instanceof EntityPlayer && Library.checkForHazmat((EntityPlayer) e)) { if (e instanceof EntityLivingBase)
Library.applyRadiation((EntityLivingBase)e, 80, 24, 60, 19);
} else {
if (e instanceof EntityLivingBase)
((EntityLivingBase) e)
.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 80 * 20, 25));
}
} }
} }

View File

@ -7,7 +7,6 @@ import java.util.Random;
import com.hbm.blocks.ModBlocks; import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.machine.MachineGenerator; import com.hbm.blocks.machine.MachineGenerator;
import com.hbm.entity.logic.EntityNukeExplosionMK3;
import com.hbm.entity.logic.EntityNukeExplosionMK4; import com.hbm.entity.logic.EntityNukeExplosionMK4;
import com.hbm.entity.mob.EntityNuclearCreeper; import com.hbm.entity.mob.EntityNuclearCreeper;
import com.hbm.explosion.ExplosionParticle; import com.hbm.explosion.ExplosionParticle;
@ -499,17 +498,8 @@ public class TileEntityReactorMultiblock extends TileEntity implements ISidedInv
double d9 = MathHelper.sqrt_double(d5 * d5 + d6 * d6 + d7 * d7); double d9 = MathHelper.sqrt_double(d5 * d5 + d6 * d6 + d7 * d7);
if (d9 < wat) if (d9 < wat)
{ {
if(entity instanceof EntityPlayer && Library.checkForHazmat((EntityPlayer)entity)) if (entity instanceof EntityLivingBase)
{ Library.applyRadiation((EntityLivingBase)entity, 80, 24, 60, 19);
/*Library.damageSuit(((EntityPlayer)entity), 0);
Library.damageSuit(((EntityPlayer)entity), 1);
Library.damageSuit(((EntityPlayer)entity), 2);
Library.damageSuit(((EntityPlayer)entity), 3);*/
} else {
if(entity instanceof EntityLivingBase)
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 80 * 20, 25));
}
} }
} }
} }

View File

@ -39,6 +39,50 @@ public class TileEntityVaultDoor extends TileEntity {
public void updateEntity() { public void updateEntity() {
if(!worldObj.isRemote) { if(!worldObj.isRemote) {
if(isOpening && state == 1) {
if(timer == 0)
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultScrape", 1.0F, 1.0F);
if(timer == 110)
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThud", 1.0F, 1.0F);
if(timer == 130)
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThud", 1.0F, 1.0F);
if(timer == 150)
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThud", 1.0F, 1.0F);
if(timer == 170)
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThud", 1.0F, 1.0F);
if(timer == 190)
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThud", 1.0F, 1.0F);
if(timer == 210)
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThud", 1.0F, 1.0F);
if(timer == 230)
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThud", 1.0F, 1.0F);
if(timer == 249)
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThud", 1.0F, 1.0F);
}
if(!isOpening && state == 1) {
if(timer == 0)
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThud", 1.0F, 1.0F);
if(timer == 20)
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThud", 1.0F, 1.0F);
if(timer == 40)
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThud", 1.0F, 1.0F);
if(timer == 60)
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThud", 1.0F, 1.0F);
if(timer == 80)
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThud", 1.0F, 1.0F);
if(timer == 100)
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThud", 1.0F, 1.0F);
if(timer == 120)
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThud", 1.0F, 1.0F);
if(timer == 140)
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultThud", 1.0F, 1.0F);
if(timer == 150)
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.vaultScrape", 1.0F, 1.0F);
}
if(state != 1) { if(state != 1) {
timer = 0; timer = 0;
} else { } else {

View File

@ -13,9 +13,9 @@ import net.minecraft.world.World;
public class Spaceship2 public class Spaceship2
{ {
Block Block1 = ModBlocks.block_tungsten; Block Block1 = ModBlocks.deco_tungsten;
Block Block2 = ModBlocks.fusion_conductor; Block Block2 = ModBlocks.fusion_conductor;
Block Block3 = ModBlocks.block_steel; Block Block3 = ModBlocks.deco_steel;
Block Block4 = ModBlocks.fusion_heater; Block Block4 = ModBlocks.fusion_heater;
Block Block5 = ModBlocks.block_meteor; Block Block5 = ModBlocks.block_meteor;
Block Block6 = ModBlocks.reactor_element; Block Block6 = ModBlocks.reactor_element;