diff --git a/assets/hbm/lang/de_DE.lang b/assets/hbm/lang/de_DE.lang index b31eb701b..859e5495e 100644 --- a/assets/hbm/lang/de_DE.lang +++ b/assets/hbm/lang/de_DE.lang @@ -1637,6 +1637,7 @@ item.cap_sparkle.name=S~Cola Kronkorken item.cap_korl.name=Korl Kronkorken item.cap_fritz.name=Fritz-Kola Kronkorken item.cap_sunset.name=Sunset Sarsaparilla Kronkorken +item.cap_star.name=Sunset Sarsaparilla Sternkronkorken item.ring_pull.name=Dosenring item.canteen_13.name=Vault 13 Kantine diff --git a/assets/hbm/lang/en_US.lang b/assets/hbm/lang/en_US.lang index c4c87c5b6..f5f5738c7 100644 --- a/assets/hbm/lang/en_US.lang +++ b/assets/hbm/lang/en_US.lang @@ -1637,6 +1637,7 @@ item.cap_sparkle.name=S~Cola Bottle Cap item.cap_korl.name=Korl Bottle Cap item.cap_fritz.name=Fritz Cola Bottle Cap item.cap_sunset.name=Sunset Sarsaparilla Bottle Cap +item.cap_star.name=Sunset Sarsaparilla Star Cap item.ring_pull.name=Ring Pull item.canteen_13.name=Vault 13 Canteen diff --git a/assets/hbm/sounds.json b/assets/hbm/sounds.json index 4de202cc8..64369c6f7 100644 --- a/assets/hbm/sounds.json +++ b/assets/hbm/sounds.json @@ -119,5 +119,6 @@ "alarm.regularSiren": {"category": "record", "sounds": [{"name": "alarm/regularSiren", "stream": false}]}, "alarm.foKlaxonA": {"category": "record", "sounds": [{"name": "alarm/foKlaxonA", "stream": false}]}, "alarm.foKlaxonB": {"category": "record", "sounds": [{"name": "alarm/foKlaxonB", "stream": false}]}, - "alarm.nostromoSiren": {"category": "record", "sounds": [{"name": "alarm/nostromoSiren", "stream": false}]} + "alarm.nostromoSiren": {"category": "record", "sounds": [{"name": "alarm/nostromoSiren", "stream": false}]}, + "alarm.easAlarm": {"category": "record", "sounds": [{"name": "alarm/easAlarm", "stream": false}]} } diff --git a/assets/hbm/sounds/alarm/classicSiren.ogg b/assets/hbm/sounds/alarm/classicSiren.ogg new file mode 100644 index 000000000..5a390ad36 Binary files /dev/null and b/assets/hbm/sounds/alarm/classicSiren.ogg differ diff --git a/assets/hbm/sounds/alarm/easAlarm.ogg b/assets/hbm/sounds/alarm/easAlarm.ogg new file mode 100644 index 000000000..c4229523c Binary files /dev/null and b/assets/hbm/sounds/alarm/easAlarm.ogg differ diff --git a/assets/hbm/sounds/alarm/estarreich.ogg b/assets/hbm/sounds/alarm/estarreich.ogg new file mode 100644 index 000000000..cb3a2fb1b Binary files /dev/null and b/assets/hbm/sounds/alarm/estarreich.ogg differ diff --git a/assets/hbm/sounds/tool/nitro.ogg b/assets/hbm/sounds/tool/nitro.ogg new file mode 100644 index 000000000..368fbe69c Binary files /dev/null and b/assets/hbm/sounds/tool/nitro.ogg differ diff --git a/assets/hbm/textures/items/bottle2_sunset.png b/assets/hbm/textures/items/bottle2_sunset.png index f07cbdee8..394269ce9 100644 Binary files a/assets/hbm/textures/items/bottle2_sunset.png and b/assets/hbm/textures/items/bottle2_sunset.png differ diff --git a/assets/hbm/textures/items/bottle2_sunset_alt.png b/assets/hbm/textures/items/bottle2_sunset_alt.png new file mode 100644 index 000000000..f07cbdee8 Binary files /dev/null and b/assets/hbm/textures/items/bottle2_sunset_alt.png differ diff --git a/assets/hbm/textures/items/cap_star.png b/assets/hbm/textures/items/cap_star.png new file mode 100644 index 000000000..608b6a0f6 Binary files /dev/null and b/assets/hbm/textures/items/cap_star.png differ diff --git a/assets/hbm/textures/items/cap_sunset.png b/assets/hbm/textures/items/cap_sunset.png index e7f07f5ff..c535266b7 100644 Binary files a/assets/hbm/textures/items/cap_sunset.png and b/assets/hbm/textures/items/cap_sunset.png differ diff --git a/assets/hbm/textures/items/cap_sunset_alt.png b/assets/hbm/textures/items/cap_sunset_alt.png new file mode 100644 index 000000000..e7f07f5ff Binary files /dev/null and b/assets/hbm/textures/items/cap_sunset_alt.png differ diff --git a/com/hbm/items/ModItems.java b/com/hbm/items/ModItems.java index 48db00e56..df3ef61d2 100644 --- a/com/hbm/items/ModItems.java +++ b/com/hbm/items/ModItems.java @@ -553,6 +553,7 @@ public class ModItems { public static Item cap_korl; public static Item cap_fritz; public static Item cap_sunset; + public static Item cap_star; public static Item ring_pull; public static Item rod_empty; @@ -1837,6 +1838,7 @@ public class ModItems { cap_korl = new Item().setUnlocalizedName("cap_korl").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":cap_korl"); cap_fritz = new Item().setUnlocalizedName("cap_fritz").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":cap_fritz"); cap_sunset = new Item().setUnlocalizedName("cap_sunset").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":cap_sunset"); + cap_star = new Item().setUnlocalizedName("cap_star").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":cap_star"); ring_pull = new Item().setUnlocalizedName("ring_pull").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":ring_pull"); rod_empty = new Item().setUnlocalizedName("rod_empty").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":rod_empty"); @@ -3737,6 +3739,7 @@ public class ModItems { GameRegistry.registerItem(cap_korl, cap_korl.getUnlocalizedName()); GameRegistry.registerItem(cap_fritz, cap_fritz.getUnlocalizedName()); GameRegistry.registerItem(cap_sunset, cap_sunset.getUnlocalizedName()); + GameRegistry.registerItem(cap_star, cap_star.getUnlocalizedName()); GameRegistry.registerItem(ring_pull, ring_pull.getUnlocalizedName()); //Chaos diff --git a/com/hbm/items/food/ItemEnergy.java b/com/hbm/items/food/ItemEnergy.java index 555d8ade0..d60d1baa1 100644 --- a/com/hbm/items/food/ItemEnergy.java +++ b/com/hbm/items/food/ItemEnergy.java @@ -19,197 +19,202 @@ import net.minecraft.world.World; public class ItemEnergy extends Item { @Override - public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_) + public ItemStack onEaten(ItemStack stack, World world, EntityPlayer player) { - if (!p_77654_3_.capabilities.isCreativeMode) + if (!player.capabilities.isCreativeMode) { - --p_77654_1_.stackSize; + --stack.stackSize; } - if (!p_77654_2_.isRemote) + if (!world.isRemote) { if(this == ModItems.can_smart) { - p_77654_3_.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 1)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.resistance.id, 30 * 20, 2)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 30 * 20, 0)); + player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 1)); + player.addPotionEffect(new PotionEffect(Potion.resistance.id, 30 * 20, 2)); + player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 30 * 20, 0)); } if(this == ModItems.can_creature) { - p_77654_3_.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 0)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.resistance.id, 30 * 20, 2)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.regeneration.id, 30 * 20, 1)); + player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 0)); + player.addPotionEffect(new PotionEffect(Potion.resistance.id, 30 * 20, 2)); + player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 30 * 20, 1)); } if(this == ModItems.can_redbomb) { - p_77654_3_.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 0)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 30 * 20, 2)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.jump.id, 30 * 20, 1)); + player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 0)); + player.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 30 * 20, 2)); + player.addPotionEffect(new PotionEffect(Potion.jump.id, 30 * 20, 1)); } if(this == ModItems.can_mrsugar) { - p_77654_3_.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 0)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 30 * 20, 1)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.jump.id, 30 * 20, 2)); + player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 0)); + player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 30 * 20, 1)); + player.addPotionEffect(new PotionEffect(Potion.jump.id, 30 * 20, 2)); } if(this == ModItems.can_overcharge) { - p_77654_3_.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 1)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.resistance.id, 30 * 20, 2)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 30 * 20, 0)); + player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 1)); + player.addPotionEffect(new PotionEffect(Potion.resistance.id, 30 * 20, 2)); + player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 30 * 20, 0)); } if(this == ModItems.can_luna) { - p_77654_3_.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 1)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.resistance.id, 30 * 20, 2)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 30 * 20, 1)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.regeneration.id, 30 * 20, 2)); + player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 1)); + player.addPotionEffect(new PotionEffect(Potion.resistance.id, 30 * 20, 2)); + player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 30 * 20, 1)); + player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 30 * 20, 2)); } if(this == ModItems.chocolate_milk) { - ExplosionLarge.explode(p_77654_2_, p_77654_3_.posX, p_77654_3_.posY, p_77654_3_.posZ, 50, true, false, false); + ExplosionLarge.explode(world, player.posX, player.posY, player.posZ, 50, true, false, false); } if(this == ModItems.bottle_nuka) { - p_77654_3_.heal(4F); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 1)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 30 * 20, 1)); + player.heal(4F); + player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 1)); + player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 30 * 20, 1)); } if(this == ModItems.bottle_cherry) { - p_77654_3_.heal(6F); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 0)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.jump.id, 30 * 20, 2)); + player.heal(6F); + player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 0)); + player.addPotionEffect(new PotionEffect(Potion.jump.id, 30 * 20, 2)); } if(this == ModItems.bottle_quantum) { - p_77654_3_.heal(10F); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 1)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.resistance.id, 30 * 20, 2)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 30 * 20, 1)); + player.heal(10F); + player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 1)); + player.addPotionEffect(new PotionEffect(Potion.resistance.id, 30 * 20, 2)); + player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 30 * 20, 1)); } if(this == ModItems.bottle2_korl) { - p_77654_3_.heal(6); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 1)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 30 * 20, 2)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 30 * 20, 2)); + player.heal(6); + player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 1)); + player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 30 * 20, 2)); + player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 30 * 20, 2)); } if(this == ModItems.bottle2_fritz) { - p_77654_3_.heal(6); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 1)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.resistance.id, 30 * 20, 2)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.jump.id, 30 * 20, 2)); + player.heal(6); + player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 1)); + player.addPotionEffect(new PotionEffect(Potion.resistance.id, 30 * 20, 2)); + player.addPotionEffect(new PotionEffect(Potion.jump.id, 30 * 20, 2)); } if(this == ModItems.bottle2_korl_special) { - p_77654_3_.heal(16); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 120 * 20, 1)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 120 * 20, 2)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 120 * 20, 2)); + player.heal(16); + player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 120 * 20, 1)); + player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 120 * 20, 2)); + player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 120 * 20, 2)); } if(this == ModItems.bottle2_fritz_special) { - p_77654_3_.heal(16); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 120 * 20, 1)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.resistance.id, 120 * 20, 2)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.jump.id, 120 * 20, 2)); + player.heal(16); + player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 120 * 20, 1)); + player.addPotionEffect(new PotionEffect(Potion.resistance.id, 120 * 20, 2)); + player.addPotionEffect(new PotionEffect(Potion.jump.id, 120 * 20, 2)); } if(this == ModItems.bottle_sparkle) { - p_77654_3_.heal(10F); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 120 * 20, 1)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.resistance.id, 120 * 20, 2)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 120 * 20, 2)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 120 * 20, 1)); + player.heal(10F); + player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 120 * 20, 1)); + player.addPotionEffect(new PotionEffect(Potion.resistance.id, 120 * 20, 2)); + player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 120 * 20, 2)); + player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 120 * 20, 1)); } if(this == ModItems.bottle2_sunset) { - p_77654_3_.heal(6); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 60 * 20, 1)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.resistance.id, 60 * 20, 2)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 60 * 20, 2)); - p_77654_3_.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 60 * 20, 2)); + player.heal(6); + player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 60 * 20, 1)); + player.addPotionEffect(new PotionEffect(Potion.resistance.id, 60 * 20, 2)); + player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 60 * 20, 2)); + player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 60 * 20, 2)); } } - if (!p_77654_3_.capabilities.isCreativeMode && this != ModItems.chocolate_milk) + if (!player.capabilities.isCreativeMode && this != ModItems.chocolate_milk) { if(this == ModItems.can_creature || this == ModItems.can_mrsugar || this == ModItems.can_overcharge || this == ModItems.can_redbomb || this == ModItems.can_smart || this == ModItems.can_luna) { - p_77654_3_.inventory.addItemStackToInventory(new ItemStack(ModItems.ring_pull)); - if (p_77654_1_.stackSize <= 0) + player.inventory.addItemStackToInventory(new ItemStack(ModItems.ring_pull)); + if (stack.stackSize <= 0) { return new ItemStack(ModItems.can_empty); } - p_77654_3_.inventory.addItemStackToInventory(new ItemStack(ModItems.can_empty)); + player.inventory.addItemStackToInventory(new ItemStack(ModItems.can_empty)); } if(this == ModItems.bottle_cherry || this == ModItems.bottle_nuka) { - p_77654_3_.inventory.addItemStackToInventory(new ItemStack(ModItems.cap_nuka)); - if (p_77654_1_.stackSize <= 0) + player.inventory.addItemStackToInventory(new ItemStack(ModItems.cap_nuka)); + if (stack.stackSize <= 0) { return new ItemStack(ModItems.bottle_empty); } - p_77654_3_.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle_empty)); + player.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle_empty)); } if(this == ModItems.bottle_quantum) { - p_77654_3_.inventory.addItemStackToInventory(new ItemStack(ModItems.cap_quantum)); - if (p_77654_1_.stackSize <= 0) + player.inventory.addItemStackToInventory(new ItemStack(ModItems.cap_quantum)); + if (stack.stackSize <= 0) { return new ItemStack(ModItems.bottle_empty); } - p_77654_3_.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle_empty)); + player.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle_empty)); } if(this == ModItems.bottle2_korl || this == ModItems.bottle2_korl_special) { - p_77654_3_.inventory.addItemStackToInventory(new ItemStack(ModItems.cap_korl)); - if (p_77654_1_.stackSize <= 0) + player.inventory.addItemStackToInventory(new ItemStack(ModItems.cap_korl)); + if (stack.stackSize <= 0) { return new ItemStack(ModItems.bottle2_empty); } - p_77654_3_.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle2_empty)); + player.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle2_empty)); } if(this == ModItems.bottle2_fritz || this == ModItems.bottle2_fritz_special) { - p_77654_3_.inventory.addItemStackToInventory(new ItemStack(ModItems.cap_fritz)); - if (p_77654_1_.stackSize <= 0) + player.inventory.addItemStackToInventory(new ItemStack(ModItems.cap_fritz)); + if (stack.stackSize <= 0) { return new ItemStack(ModItems.bottle2_empty); } - p_77654_3_.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle2_empty)); + player.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle2_empty)); } if(this == ModItems.bottle_sparkle) { - p_77654_3_.inventory.addItemStackToInventory(new ItemStack(ModItems.cap_sparkle)); - if (p_77654_1_.stackSize <= 0) + player.inventory.addItemStackToInventory(new ItemStack(ModItems.cap_sparkle)); + if (stack.stackSize <= 0) { return new ItemStack(ModItems.bottle_empty); } - p_77654_3_.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle_empty)); + player.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle_empty)); } if(this == ModItems.bottle2_sunset) { - p_77654_3_.inventory.addItemStackToInventory(new ItemStack(ModItems.cap_sunset)); - if (p_77654_1_.stackSize <= 0) + + if(world.rand.nextInt(10) == 0) + player.inventory.addItemStackToInventory(new ItemStack(ModItems.cap_star)); + else + player.inventory.addItemStackToInventory(new ItemStack(ModItems.cap_sunset)); + + if (stack.stackSize <= 0) { return new ItemStack(ModItems.bottle2_empty); } - p_77654_3_.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle2_empty)); + player.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle2_empty)); } } - return p_77654_1_; + return stack; } @Override diff --git a/com/hbm/items/tool/ItemCassette.java b/com/hbm/items/tool/ItemCassette.java index bb53beb79..fd9202c62 100644 --- a/com/hbm/items/tool/ItemCassette.java +++ b/com/hbm/items/tool/ItemCassette.java @@ -40,6 +40,7 @@ public class ItemCassette extends Item { SWEEP_SIREN( "Sweep Siren", new ResourceLocation("hbm:alarm.sweepSiren"), SoundType.LOOP, 15592026, 500), STRIDER_SIREN( "Missile Silo Siren", new ResourceLocation("hbm:alarm.striderSiren"), SoundType.LOOP, 11250586, 500), NOSTROMO_SIREN( "Nostromo Self Destruct", new ResourceLocation("hbm:alarm.nostromoSiren"), SoundType.LOOP, 0x5dd800, 100), + EAS_ALARM( "EAS Alarm Screech", new ResourceLocation("hbm:alarm.easAlarm"), SoundType.LOOP, 0xb3a8c1, 50), APC_PASS( "APC Pass", new ResourceLocation("hbm:alarm.apcPass"), SoundType.PASS, 3422163, 50), RAZORTRAIN( "Razortrain Horn", new ResourceLocation("hbm:alarm.razortrainHorn"), SoundType.SOUND, 7819501, 250); diff --git a/com/hbm/world/Meteorite.java b/com/hbm/world/Meteorite.java index 30e8e06eb..5ea38c720 100644 --- a/com/hbm/world/Meteorite.java +++ b/com/hbm/world/Meteorite.java @@ -710,54 +710,61 @@ public class Meteorite { public List getRandomOre(Random rand) { List ores = new ArrayList(); - String[] names = OreDictionary.getOreNames(); - - for(int i = 0; i < names.length; i++) { - if(names[i].length() > 3 && names[i].substring(0, 3).equals("ore")) { - - List ota = OreDictionary.getOres(names[i]); - for(int j = 0; j < ota.size(); j++) { - ItemStack stack = ota.get(j); - if(Block.getBlockFromItem(stack.getItem()) != null) - ores.add(stack.copy()); + try { + String[] names = OreDictionary.getOreNames(); + + for(int i = 0; i < names.length; i++) { + if(names[i] != null && names[i].length() > 3 && names[i].substring(0, 3).equals("ore")) { + + List ota = OreDictionary.getOres(names[i]); + for(int j = 0; j < ota.size(); j++) { + ItemStack stack = ota.get(j); + if(Block.getBlockFromItem(stack.getItem()) != null) + ores.add(stack.copy()); + } } } - } - - switch(rand.nextInt(15)) { - case 0: - List list1 = new ArrayList(); - list1.add(new ItemStack(ModBlocks.ore_rare, 1).copy()); - return list1; - case 1: - List list2 = new ArrayList(); - list2.add(new ItemStack(ModBlocks.ore_uranium, 1).copy()); - return list2; - case 2: - List list3 = new ArrayList(); - list3.add(new ItemStack(ModBlocks.ore_reiium, 1).copy()); - list3.add(new ItemStack(ModBlocks.ore_weidanium, 1).copy()); - list3.add(new ItemStack(ModBlocks.ore_australium, 1).copy()); - list3.add(new ItemStack(ModBlocks.ore_unobtainium, 1).copy()); - list3.add(new ItemStack(ModBlocks.ore_daffergon, 1).copy()); - list3.add(new ItemStack(ModBlocks.ore_verticium, 1).copy()); - return list3; - case 3: - List list4 = new ArrayList(); - list4.add(new ItemStack(ModBlocks.ore_nether_fire, 1).copy()); - list4.add(new ItemStack(ModBlocks.ore_nether_plutonium, 1).copy()); - list4.add(new ItemStack(ModBlocks.ore_nether_schrabidium, 1).copy()); - list4.add(new ItemStack(ModBlocks.ore_nether_sulfur, 1).copy()); - list4.add(new ItemStack(ModBlocks.ore_nether_tungsten, 1).copy()); - list4.add(new ItemStack(ModBlocks.ore_nether_uranium, 1).copy()); - return list4; - } - - if(ores.isEmpty()) { - List list = new ArrayList(); - list.add(new ItemStack(Blocks.iron_ore, 1).copy()); - return list; - } else { + + switch(rand.nextInt(15)) { + case 0: + List list1 = new ArrayList(); + list1.add(new ItemStack(ModBlocks.ore_rare, 1).copy()); + return list1; + case 1: + List list2 = new ArrayList(); + list2.add(new ItemStack(ModBlocks.ore_uranium, 1).copy()); + return list2; + case 2: + List list3 = new ArrayList(); + list3.add(new ItemStack(ModBlocks.ore_reiium, 1).copy()); + list3.add(new ItemStack(ModBlocks.ore_weidanium, 1).copy()); + list3.add(new ItemStack(ModBlocks.ore_australium, 1).copy()); + list3.add(new ItemStack(ModBlocks.ore_unobtainium, 1).copy()); + list3.add(new ItemStack(ModBlocks.ore_daffergon, 1).copy()); + list3.add(new ItemStack(ModBlocks.ore_verticium, 1).copy()); + return list3; + case 3: + List list4 = new ArrayList(); + list4.add(new ItemStack(ModBlocks.ore_nether_fire, 1).copy()); + list4.add(new ItemStack(ModBlocks.ore_nether_plutonium, 1).copy()); + list4.add(new ItemStack(ModBlocks.ore_nether_schrabidium, 1).copy()); + list4.add(new ItemStack(ModBlocks.ore_nether_sulfur, 1).copy()); + list4.add(new ItemStack(ModBlocks.ore_nether_tungsten, 1).copy()); + list4.add(new ItemStack(ModBlocks.ore_nether_uranium, 1).copy()); + return list4; + } + + if(ores.isEmpty()) { + List list = new ArrayList(); + list.add(new ItemStack(Blocks.iron_ore, 1).copy()); + return list; + } else { + return ores; + } + } catch(Exception ex) { + MainRegistry.logger.error("Critical error in meteor creation, falling back to iron ore..."); + ores.clear(); + ores.add(new ItemStack(Blocks.iron_ore, 1).copy()); return ores; } }