diff --git a/src/main/java/assets/hbm/lang/de_DE.lang b/src/main/java/assets/hbm/lang/de_DE.lang index 213359c64..d0fecd49f 100644 --- a/src/main/java/assets/hbm/lang/de_DE.lang +++ b/src/main/java/assets/hbm/lang/de_DE.lang @@ -1351,6 +1351,7 @@ item.ingot_uranium.name=Uranbarren item.ingot_uranium_fuel.name=Urankernbrennstoffbarren item.ingot_verticium.name=Verticiumbarren item.ingot_weidanium.name=Weidaniumbarren +item.ingot_zirconium.name=Zirkoniumwürfel item.ink.name=林-Tinte item.insert_doxium.name=Astolfium-dottierte Doxiumeinlage item.insert_du.name=DU-Einlage @@ -1834,6 +1835,7 @@ item.powder_uranium.name=Uranstaub item.powder_verticium.name=Verticiumstaub item.powder_weidanium.name=Weidaniumstaub item.powder_yellowcake.name=Yellowcake +item.powder_zirconium.name=Zirkoniumstaub item.primer_357.name=.357 Magnum-Zündhütchen (x24) item.primer_44.name=.44 Magnum-Zündhütchen (x24) item.primer_50.name=Großkaliber-Zündhütchen (x12) @@ -2255,6 +2257,7 @@ itemGroup.tabWeapon=NTM Waffen und Geschütze potion.hbm_bang=! ! ! potion.hbm_lead=Bleivergiftung potion.hbm_mutation=Verdorbenes Herz +potion.hbm_potionsickness=Trankkrankheit potion.hbm_phosphorus=Phosphorverbrennung potion.hbm_radaway=Radaway potion.hbm_radiation=Kontaminiert diff --git a/src/main/java/assets/hbm/lang/en_US.lang b/src/main/java/assets/hbm/lang/en_US.lang index c2560a134..0d12572d4 100644 --- a/src/main/java/assets/hbm/lang/en_US.lang +++ b/src/main/java/assets/hbm/lang/en_US.lang @@ -1351,6 +1351,7 @@ item.ingot_uranium.name=Uranium Ingot item.ingot_uranium_fuel.name=Ingot of Uranium Fuel item.ingot_verticium.name=Verticium Ingot item.ingot_weidanium.name=Weidanium Ingot +item.ingot_zirconium.name=Zirconium Cube item.ink.name=林 Ink item.insert_doxium.name=Astolfium-Doped Doxium Insert item.insert_du.name=DU Insert @@ -1834,6 +1835,7 @@ item.powder_uranium.name=Uranium Powder item.powder_verticium.name=Verticium Powder item.powder_weidanium.name=Weidanium Powder item.powder_yellowcake.name=Yellowcake +item.powder_zirconium.name=Zirconium Powder item.primer_357.name=.357 Magnum Primer (x24) item.primer_44.name=.44 Magnum Primer (x24) item.primer_50.name=Large Caliber Primer (x12) @@ -2256,6 +2258,7 @@ potion.hbm_bang=! ! ! potion.hbm_lead=Lead Poisoning potion.hbm_mutation=Tainted Heart potion.hbm_phosphorus=Phosphorus Burns +potion.hbm_potionsickness=Potion Sickness potion.hbm_radaway=Radaway potion.hbm_radiation=Contaminated potion.hbm_radx=Rad-X diff --git a/src/main/java/assets/hbm/textures/blocks/hadron_coil_chlorophyte.png b/src/main/java/assets/hbm/textures/blocks/hadron_coil_chlorophyte.png new file mode 100644 index 000000000..d0a31a89f Binary files /dev/null and b/src/main/java/assets/hbm/textures/blocks/hadron_coil_chlorophyte.png differ diff --git a/src/main/java/assets/hbm/textures/gui/potions.png b/src/main/java/assets/hbm/textures/gui/potions.png index b82b2e1d4..4a7dc7434 100644 Binary files a/src/main/java/assets/hbm/textures/gui/potions.png and b/src/main/java/assets/hbm/textures/gui/potions.png differ diff --git a/src/main/java/assets/hbm/textures/items/ingot_zirconium.png b/src/main/java/assets/hbm/textures/items/ingot_zirconium.png new file mode 100644 index 000000000..4d3d0c6b4 Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/ingot_zirconium.png differ diff --git a/src/main/java/assets/hbm/textures/items/powder_zirconium.png b/src/main/java/assets/hbm/textures/items/powder_zirconium.png new file mode 100644 index 000000000..7a88b3ad3 Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/powder_zirconium.png differ diff --git a/src/main/java/assets/hbm/textures/particle/fart.png b/src/main/java/assets/hbm/textures/particle/fart.png new file mode 100644 index 000000000..0dac14938 Binary files /dev/null and b/src/main/java/assets/hbm/textures/particle/fart.png differ diff --git a/src/main/java/com/hbm/config/CommonConfig.java b/src/main/java/com/hbm/config/CommonConfig.java index c79bb74d3..59cc4f297 100644 --- a/src/main/java/com/hbm/config/CommonConfig.java +++ b/src/main/java/com/hbm/config/CommonConfig.java @@ -43,6 +43,13 @@ public class CommonConfig { return prop.getBoolean(); } + public static String createConfigString(Configuration config, String category, String name, String comment, String def) { + + Property prop = config.get(category, name, def); + prop.comment = comment; + return prop.getString(); + } + public static String[] createConfigStringList(Configuration config, String category, String name, String comment) { Property prop = config.get(category, name, new String[] { "PLACEHOLDER" }); diff --git a/src/main/java/com/hbm/config/PotionConfig.java b/src/main/java/com/hbm/config/PotionConfig.java index 66020734f..415c77e3f 100644 --- a/src/main/java/com/hbm/config/PotionConfig.java +++ b/src/main/java/com/hbm/config/PotionConfig.java @@ -14,6 +14,9 @@ public class PotionConfig { public static int telekinesisID = 69; public static int phosphorusID = 70; public static int stabilityID = 71; + public static int potionsicknessID = 72; + + public static int potionSickness = 0; public static void loadFromConfig(Configuration config) { @@ -28,5 +31,14 @@ public class PotionConfig { telekinesisID = CommonConfig.createConfigInt(config, CATEGORY_POTION, "8.07_telekinesisPotionID", "What potion ID the telekinesis effect will have", 69); phosphorusID = CommonConfig.createConfigInt(config, CATEGORY_POTION, "8.08_phosphorusPotionID", "What potion ID the phosphorus effect will have", 70); stabilityID = CommonConfig.createConfigInt(config, CATEGORY_POTION, "8.09_stabilityPotionID", "What potion ID the stability effect will have", 71); + potionsicknessID = CommonConfig.createConfigInt(config, CATEGORY_POTION, "8.10_potionsicknessID", "What potion ID the potion sickness effect will have", 72); + + String s = CommonConfig.createConfigString(config, CATEGORY_POTION, "8.S0_potionSickness", "Valid configs include \"NORMAL\" and \"TERRARIA\", otherwise potion sickness is turned off", "OFF"); + + if("normal".equals(s.toLowerCase())) + potionSickness = 1; + if("terraria".equals(s.toLowerCase())) + potionSickness = 2; + } } diff --git a/src/main/java/com/hbm/config/VersatileConfig.java b/src/main/java/com/hbm/config/VersatileConfig.java index c7be4d3cf..ba8d1d340 100644 --- a/src/main/java/com/hbm/config/VersatileConfig.java +++ b/src/main/java/com/hbm/config/VersatileConfig.java @@ -1,8 +1,11 @@ package com.hbm.config; import com.hbm.items.ModItems; +import com.hbm.potion.HbmPotion; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.Item; +import net.minecraft.potion.PotionEffect; public class VersatileConfig { @@ -22,4 +25,18 @@ public class VersatileConfig { return 100; } + public static void applyPotionSickness(EntityLivingBase entity, int duration) { + + if(PotionConfig.potionSickness == 0) + return; + + if(PotionConfig.potionSickness == 2) + duration *= 12; + + entity.addPotionEffect(new PotionEffect(HbmPotion.potionsickness.id, duration * 20)); + } + + public static boolean hasPotionSickness(EntityLivingBase entity) { + return entity.isPotionActive(HbmPotion.potionsickness); + } } diff --git a/src/main/java/com/hbm/items/ModItems.java b/src/main/java/com/hbm/items/ModItems.java index 97b2391d0..aee2d64bd 100644 --- a/src/main/java/com/hbm/items/ModItems.java +++ b/src/main/java/com/hbm/items/ModItems.java @@ -96,6 +96,7 @@ public class ModItems { public static Item nugget_schrabidium_fuel; public static Item ingot_advanced_alloy; public static Item lithium; + public static Item ingot_zirconium; public static Item ingot_hes; public static Item ingot_les; public static Item nugget_hes; @@ -302,6 +303,7 @@ public class ModItems { public static Item powder_red_copper; public static Item powder_steel; public static Item powder_lithium; + public static Item powder_zirconium; public static Item redstone_depleted; public static Item powder_australium; @@ -2250,6 +2252,7 @@ public class ModItems { plate_gold = new Item().setUnlocalizedName("plate_gold").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":plate_gold"); plate_advanced_alloy = new Item().setUnlocalizedName("plate_advanced_alloy").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":plate_advanced_alloy"); lithium = new Item().setUnlocalizedName("lithium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":lithium"); + ingot_zirconium = new Item().setUnlocalizedName("ingot_zirconium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_zirconium"); ingot_semtex = new ItemLemon(4, 5, true).setUnlocalizedName("ingot_semtex").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_semtex"); ingot_phosphorus = new ItemRadioactive(0F, true).setUnlocalizedName("ingot_phosphorus").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_phosphorus"); wire_advanced_alloy = new Item().setUnlocalizedName("wire_advanced_alloy").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":wire_advanced_alloy"); @@ -2433,6 +2436,7 @@ public class ModItems { powder_red_copper = new Item().setUnlocalizedName("powder_red_copper").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_red_copper"); powder_steel = new Item().setUnlocalizedName("powder_steel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_steel"); powder_lithium = new Item().setUnlocalizedName("powder_lithium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_lithium"); + powder_zirconium = new Item().setUnlocalizedName("powder_zirconium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_zirconium"); redstone_depleted = new Item().setUnlocalizedName("redstone_depleted").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":redstone_depleted"); powder_power = new ItemCustomLore().setUnlocalizedName("powder_power").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_energy_alt"); powder_iodine = new ItemCustomLore().setUnlocalizedName("powder_iodine").setCreativeTab(null).setTextureName(RefStrings.MODID + ":powder_iodine"); @@ -4694,6 +4698,7 @@ public class ModItems { //Misc Ingots GameRegistry.registerItem(ingot_phosphorus, ingot_phosphorus.getUnlocalizedName()); GameRegistry.registerItem(lithium, lithium.getUnlocalizedName()); + GameRegistry.registerItem(ingot_zirconium, ingot_zirconium.getUnlocalizedName()); GameRegistry.registerItem(ingot_semtex, ingot_semtex.getUnlocalizedName()); GameRegistry.registerItem(solid_fuel, solid_fuel.getUnlocalizedName()); GameRegistry.registerItem(rocket_fuel, rocket_fuel.getUnlocalizedName()); @@ -4760,6 +4765,7 @@ public class ModItems { GameRegistry.registerItem(powder_chlorophyte, powder_chlorophyte.getUnlocalizedName()); GameRegistry.registerItem(powder_combine_steel, powder_combine_steel.getUnlocalizedName()); GameRegistry.registerItem(powder_lithium, powder_lithium.getUnlocalizedName()); + GameRegistry.registerItem(powder_zirconium, powder_zirconium.getUnlocalizedName()); GameRegistry.registerItem(powder_lignite, powder_lignite.getUnlocalizedName()); GameRegistry.registerItem(powder_iodine, powder_iodine.getUnlocalizedName()); GameRegistry.registerItem(powder_thorium, powder_thorium.getUnlocalizedName()); diff --git a/src/main/java/com/hbm/items/food/ItemCanteen.java b/src/main/java/com/hbm/items/food/ItemCanteen.java index faa32064f..0808c47fb 100644 --- a/src/main/java/com/hbm/items/food/ItemCanteen.java +++ b/src/main/java/com/hbm/items/food/ItemCanteen.java @@ -2,6 +2,7 @@ package com.hbm.items.food; import java.util.List; +import com.hbm.config.VersatileConfig; import com.hbm.items.ModItems; import com.hbm.main.MainRegistry; @@ -48,6 +49,8 @@ public class ItemCanteen extends Item { player.addPotionEffect(new PotionEffect(Potion.resistance.id, 60 * 20, 2)); player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 60 * 20, 1)); } + + VersatileConfig.applyPotionSickness(player, 5); return stack; } @@ -64,7 +67,7 @@ public class ItemCanteen extends Item { @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { - if (stack.getItemDamage() == 0) + if (stack.getItemDamage() == 0 && !VersatileConfig.hasPotionSickness(player)) player.setItemInUse(stack, this.getMaxItemUseDuration(stack)); return stack; diff --git a/src/main/java/com/hbm/items/food/ItemEnergy.java b/src/main/java/com/hbm/items/food/ItemEnergy.java index f8bfae04d..fd7883fcf 100644 --- a/src/main/java/com/hbm/items/food/ItemEnergy.java +++ b/src/main/java/com/hbm/items/food/ItemEnergy.java @@ -2,6 +2,7 @@ package com.hbm.items.food; import java.util.List; +import com.hbm.config.VersatileConfig; import com.hbm.explosion.ExplosionLarge; import com.hbm.items.ModItems; import com.hbm.main.MainRegistry; @@ -20,387 +21,333 @@ import net.minecraftforge.common.util.FakePlayer; public class ItemEnergy extends Item { - @Override + @Override public ItemStack onEaten(ItemStack stack, World world, EntityPlayer player) { - - if (!player.capabilities.isCreativeMode) - { - --stack.stackSize; - } - if (!world.isRemote) - { - - if(player instanceof FakePlayer) { - world.newExplosion(player, player.posX, player.posY, player.posZ, 5F, true, true); - return super.onEaten(stack, world, player); - } - - if(this == ModItems.can_smart) - { - 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) - { - 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) - { - 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) - { - 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) - { - 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) - { - 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.can_bepis) - { - player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 3)); - player.addPotionEffect(new PotionEffect(Potion.resistance.id, 30 * 20, 3)); - } - if(this == ModItems.can_breen) - { - player.addPotionEffect(new PotionEffect(Potion.confusion.id, 30 * 20, 0)); - } - if(this == ModItems.chocolate_milk) - { - ExplosionLarge.explode(world, player.posX, player.posY, player.posZ, 50, true, false, false); - } - if(this == ModItems.bottle_nuka) - { - player.heal(4F); - player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 1)); - player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 30 * 20, 1)); - ContaminationUtil.applyRadDirect(player, 5.0F); - } - if(this == ModItems.bottle_cherry) - { - player.heal(6F); - player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 0)); - player.addPotionEffect(new PotionEffect(Potion.jump.id, 30 * 20, 2)); - ContaminationUtil.applyRadDirect(player, 5.0F); - } - if(this == ModItems.bottle_quantum) - { - 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)); - ContaminationUtil.applyRadDirect(player, 15.0F); - } - if(this == ModItems.bottle2_korl) - { - 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) - { - 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) - { - 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) - { - 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) - { - 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)); - ContaminationUtil.applyRadDirect(player, 5.0F); - } - if(this == ModItems.bottle_rad) - { - 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.fireResistance.id, 120 * 20, 0)); - player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 120 * 20, 4)); - player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 120 * 20, 1)); - ContaminationUtil.applyRadDirect(player, 15.0F); - } - if(this == ModItems.bottle2_sunset) - { - 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(!player.capabilities.isCreativeMode) { + --stack.stackSize; + } - 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 || - this == ModItems.can_bepis || this == ModItems.can_breen) { - player.inventory.addItemStackToInventory(new ItemStack(ModItems.ring_pull)); - if (stack.stackSize <= 0) - { - return new ItemStack(ModItems.can_empty); - } + if(!world.isRemote) { - player.inventory.addItemStackToInventory(new ItemStack(ModItems.can_empty)); - } - - if(this == ModItems.bottle_cherry || this == ModItems.bottle_nuka) { - player.inventory.addItemStackToInventory(new ItemStack(ModItems.cap_nuka)); - if (stack.stackSize <= 0) - { - return new ItemStack(ModItems.bottle_empty); - } + if(player instanceof FakePlayer) { + world.newExplosion(player, player.posX, player.posY, player.posZ, 5F, true, true); + return super.onEaten(stack, world, player); + } + + VersatileConfig.applyPotionSickness(player, 5); - player.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle_empty)); - } - - if(this == ModItems.bottle_quantum) { - player.inventory.addItemStackToInventory(new ItemStack(ModItems.cap_quantum)); - if (stack.stackSize <= 0) - { - return new ItemStack(ModItems.bottle_empty); - } + if(this == ModItems.can_smart) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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.can_bepis) { + player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 3)); + player.addPotionEffect(new PotionEffect(Potion.resistance.id, 30 * 20, 3)); + } + if(this == ModItems.can_breen) { + player.addPotionEffect(new PotionEffect(Potion.confusion.id, 30 * 20, 0)); + } + if(this == ModItems.chocolate_milk) { + ExplosionLarge.explode(world, player.posX, player.posY, player.posZ, 50, true, false, false); + } + if(this == ModItems.bottle_nuka) { + player.heal(4F); + player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 1)); + player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 30 * 20, 1)); + ContaminationUtil.applyRadDirect(player, 5.0F); + } + if(this == ModItems.bottle_cherry) { + player.heal(6F); + player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 30 * 20, 0)); + player.addPotionEffect(new PotionEffect(Potion.jump.id, 30 * 20, 2)); + ContaminationUtil.applyRadDirect(player, 5.0F); + } + if(this == ModItems.bottle_quantum) { + 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)); + ContaminationUtil.applyRadDirect(player, 15.0F); + } + if(this == ModItems.bottle2_korl) { + 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) { + 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) { + 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) { + 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) { + 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)); + ContaminationUtil.applyRadDirect(player, 5.0F); + } + if(this == ModItems.bottle_rad) { + 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.fireResistance.id, 120 * 20, 0)); + player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 120 * 20, 4)); + player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 120 * 20, 1)); + ContaminationUtil.applyRadDirect(player, 15.0F); + } + if(this == ModItems.bottle2_sunset) { + 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)); + } + } - player.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle_empty)); - } - - if(this == ModItems.bottle2_korl || this == ModItems.bottle2_korl_special) { - player.inventory.addItemStackToInventory(new ItemStack(ModItems.cap_korl)); - if (stack.stackSize <= 0) - { - return new ItemStack(ModItems.bottle2_empty); - } + 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 || this == ModItems.can_bepis || this == ModItems.can_breen) { + player.inventory.addItemStackToInventory(new ItemStack(ModItems.ring_pull)); + if(stack.stackSize <= 0) { + return new ItemStack(ModItems.can_empty); + } - player.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle2_empty)); - } - - if(this == ModItems.bottle2_fritz || this == ModItems.bottle2_fritz_special) { - player.inventory.addItemStackToInventory(new ItemStack(ModItems.cap_fritz)); - if (stack.stackSize <= 0) - { - return new ItemStack(ModItems.bottle2_empty); - } + player.inventory.addItemStackToInventory(new ItemStack(ModItems.can_empty)); + } - player.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle2_empty)); - } - - if(this == ModItems.bottle_sparkle) { - player.inventory.addItemStackToInventory(new ItemStack(ModItems.cap_sparkle)); - if (stack.stackSize <= 0) - { - return new ItemStack(ModItems.bottle_empty); - } + if(this == ModItems.bottle_cherry || this == ModItems.bottle_nuka) { + player.inventory.addItemStackToInventory(new ItemStack(ModItems.cap_nuka)); + if(stack.stackSize <= 0) { + return new ItemStack(ModItems.bottle_empty); + } - player.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle_empty)); - } - - if(this == ModItems.bottle_rad) { - player.inventory.addItemStackToInventory(new ItemStack(ModItems.cap_rad)); - if (stack.stackSize <= 0) - { - return new ItemStack(ModItems.bottle_empty); - } + player.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle_empty)); + } - player.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle_empty)); - } - - if(this == ModItems.bottle2_sunset) { - - 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); - } + if(this == ModItems.bottle_quantum) { + player.inventory.addItemStackToInventory(new ItemStack(ModItems.cap_quantum)); + if(stack.stackSize <= 0) { + return new ItemStack(ModItems.bottle_empty); + } - player.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle2_empty)); - } - } + player.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle_empty)); + } - return stack; - } - - @Override - public int getMaxItemUseDuration(ItemStack p_77626_1_) - { - return 32; - } + if(this == ModItems.bottle2_korl || this == ModItems.bottle2_korl_special) { + player.inventory.addItemStackToInventory(new ItemStack(ModItems.cap_korl)); + if(stack.stackSize <= 0) { + return new ItemStack(ModItems.bottle2_empty); + } - @Override - public EnumAction getItemUseAction(ItemStack p_77661_1_) - { - return EnumAction.drink; - } + player.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle2_empty)); + } - @Override - public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) - { - if(!(this == ModItems.can_creature || this == ModItems.can_mrsugar || - this == ModItems.can_overcharge || this == ModItems.can_redbomb || - this == ModItems.can_smart || this == ModItems.chocolate_milk || - this == ModItems.can_luna || this == ModItems.can_bepis || - this == ModItems.can_breen)) - if(!p_77659_3_.inventory.hasItem(ModItems.bottle_opener)) - return p_77659_1_; - - p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_)); - - return p_77659_1_; - } - - @Override + if(this == ModItems.bottle2_fritz || this == ModItems.bottle2_fritz_special) { + player.inventory.addItemStackToInventory(new ItemStack(ModItems.cap_fritz)); + if(stack.stackSize <= 0) { + return new ItemStack(ModItems.bottle2_empty); + } + + player.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle2_empty)); + } + + if(this == ModItems.bottle_sparkle) { + player.inventory.addItemStackToInventory(new ItemStack(ModItems.cap_sparkle)); + if(stack.stackSize <= 0) { + return new ItemStack(ModItems.bottle_empty); + } + + player.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle_empty)); + } + + if(this == ModItems.bottle_rad) { + player.inventory.addItemStackToInventory(new ItemStack(ModItems.cap_rad)); + if(stack.stackSize <= 0) { + return new ItemStack(ModItems.bottle_empty); + } + + player.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle_empty)); + } + + if(this == ModItems.bottle2_sunset) { + + 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); + } + + player.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle2_empty)); + } + } + + return stack; + } + + @Override + public int getMaxItemUseDuration(ItemStack p_77626_1_) { + return 32; + } + + @Override + public EnumAction getItemUseAction(ItemStack p_77661_1_) { + return EnumAction.drink; + } + + @Override + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { + + if(VersatileConfig.hasPotionSickness(p_77659_3_)) + return p_77659_1_; + + if(!(this == ModItems.can_creature || this == ModItems.can_mrsugar || this == ModItems.can_overcharge || this == ModItems.can_redbomb || this == ModItems.can_smart || this == ModItems.chocolate_milk || this == ModItems.can_luna || this == ModItems.can_bepis || this == ModItems.can_breen)) + if(!p_77659_3_.inventory.hasItem(ModItems.bottle_opener)) + return p_77659_1_; + + p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_)); + + return p_77659_1_; + } + + @Override @SideOnly(Side.CLIENT) - public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List list, boolean p_77624_4_) - { - if(this == ModItems.can_smart) - { - list.add("Cheap and full of bubbles"); - } - if(this == ModItems.can_creature) - { - list.add("Basically gasoline in a tin can"); - } - if(this == ModItems.can_redbomb) - { - list.add("Liquefied explosives"); - } - if(this == ModItems.can_mrsugar) - { - list.add("An intellectual drink, for the chosen ones!"); - } - if(this == ModItems.can_overcharge) - { - list.add("Possible side effects include heart attacks, seizures or zombification"); - } - if(this == ModItems.can_luna) - { - list.add("Contains actual selenium and star metal. Tastes like night."); - } - if(this == ModItems.can_bepis) - { - list.add("beppp"); - } - if(this == ModItems.can_breen) - { - list.add("Don't drink the water. They put something in it, to make you forget."); - list.add("I don't even know how I got here."); - } - if(this == ModItems.chocolate_milk) - { - list.add("Regular chocolate milk. Safe to drink."); - list.add("Totally not made from nitroglycerine."); - } - if(this == ModItems.bottle_nuka) - { - list.add("Contains about 210 kcal and 1500 mSv."); - list.add("[Requires bottle opener]"); - } - if(this == ModItems.bottle_cherry) - { - list.add("Now with severe radiation poisoning in every seventh bottle!"); - list.add("[Requires bottle opener]"); - } - if(this == ModItems.bottle_quantum) - { - list.add("Comes with a colorful mix of over 70 isotopes!"); - list.add("[Requires bottle opener]"); - } - if(this == ModItems.bottle2_korl) - { - list.add("Contains actual orange juice!"); - list.add("[Requires bottle opener]"); - } - if(this == ModItems.bottle2_fritz) - { - list.add("moremore caffeine"); - list.add("[Requires bottle opener]"); - } - if(this == ModItems.bottle2_korl_special) - { - if(MainRegistry.polaroidID == 11) - list.add("shgehgev u rguer"); - else - list.add("Contains actual orange juice!"); - list.add("[Requires bottle opener]"); - } - if(this == ModItems.bottle2_fritz_special) - { - if(MainRegistry.polaroidID == 11) - list.add("ygrogr fgrof bf"); - else - list.add("moremore caffeine"); - list.add("[Requires bottle opener]"); - } - if(this == ModItems.bottle_sparkle) - { - if(MainRegistry.polaroidID == 11) - list.add("Contains trace amounts of taint."); - else - list.add("The most delicious beverage in the wasteland!"); - list.add("[Requires bottle opener]"); - } - if(this == ModItems.bottle_sparkle) - { - if(MainRegistry.polaroidID == 11) - list.add("Now with 400% more radiation!"); - else - list.add("Tastes like radish and radiation."); - list.add("[Requires bottle opener]"); - } - if(this == ModItems.bottle2_sunset) - { - if(MainRegistry.polaroidID == 11) { - list.add("\"Authentic Sunset Juice\""); - list.add(""); - list.add("This smells like fish."); - list.add("*sip*"); - list.add("Yup, that's pretty disugsting."); - list.add("..."); - list.add("..."); - list.add("*sip*"); - } else { - list.add("The eternal #2. Screw you, Bradberton!"); - } - list.add("[Requires bottle opener]"); - } - } + public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List list, boolean p_77624_4_) { + if(this == ModItems.can_smart) { + list.add("Cheap and full of bubbles"); + } + if(this == ModItems.can_creature) { + list.add("Basically gasoline in a tin can"); + } + if(this == ModItems.can_redbomb) { + list.add("Liquefied explosives"); + } + if(this == ModItems.can_mrsugar) { + list.add("An intellectual drink, for the chosen ones!"); + } + if(this == ModItems.can_overcharge) { + list.add("Possible side effects include heart attacks, seizures or zombification"); + } + if(this == ModItems.can_luna) { + list.add("Contains actual selenium and star metal. Tastes like night."); + } + if(this == ModItems.can_bepis) { + list.add("beppp"); + } + if(this == ModItems.can_breen) { + list.add("Don't drink the water. They put something in it, to make you forget."); + list.add("I don't even know how I got here."); + } + if(this == ModItems.chocolate_milk) { + list.add("Regular chocolate milk. Safe to drink."); + list.add("Totally not made from nitroglycerine."); + } + if(this == ModItems.bottle_nuka) { + list.add("Contains about 210 kcal and 1500 mSv."); + list.add("[Requires bottle opener]"); + } + if(this == ModItems.bottle_cherry) { + list.add("Now with severe radiation poisoning in every seventh bottle!"); + list.add("[Requires bottle opener]"); + } + if(this == ModItems.bottle_quantum) { + list.add("Comes with a colorful mix of over 70 isotopes!"); + list.add("[Requires bottle opener]"); + } + if(this == ModItems.bottle2_korl) { + list.add("Contains actual orange juice!"); + list.add("[Requires bottle opener]"); + } + if(this == ModItems.bottle2_fritz) { + list.add("moremore caffeine"); + list.add("[Requires bottle opener]"); + } + if(this == ModItems.bottle2_korl_special) { + if(MainRegistry.polaroidID == 11) + list.add("shgehgev u rguer"); + else + list.add("Contains actual orange juice!"); + list.add("[Requires bottle opener]"); + } + if(this == ModItems.bottle2_fritz_special) { + if(MainRegistry.polaroidID == 11) + list.add("ygrogr fgrof bf"); + else + list.add("moremore caffeine"); + list.add("[Requires bottle opener]"); + } + if(this == ModItems.bottle_sparkle) { + if(MainRegistry.polaroidID == 11) + list.add("Contains trace amounts of taint."); + else + list.add("The most delicious beverage in the wasteland!"); + list.add("[Requires bottle opener]"); + } + if(this == ModItems.bottle_sparkle) { + if(MainRegistry.polaroidID == 11) + list.add("Now with 400% more radiation!"); + else + list.add("Tastes like radish and radiation."); + list.add("[Requires bottle opener]"); + } + if(this == ModItems.bottle2_sunset) { + if(MainRegistry.polaroidID == 11) { + list.add("\"Authentic Sunset Juice\""); + list.add(""); + list.add("This smells like fish."); + list.add("*sip*"); + list.add("Yup, that's pretty disugsting."); + list.add("..."); + list.add("..."); + list.add("*sip*"); + } else { + list.add("The eternal #2. Screw you, Bradberton!"); + } + list.add("[Requires bottle opener]"); + } + } } diff --git a/src/main/java/com/hbm/items/food/ItemPill.java b/src/main/java/com/hbm/items/food/ItemPill.java index 8932959ab..7e4f6a060 100644 --- a/src/main/java/com/hbm/items/food/ItemPill.java +++ b/src/main/java/com/hbm/items/food/ItemPill.java @@ -3,6 +3,7 @@ package com.hbm.items.food; import java.util.List; import java.util.Random; +import com.hbm.config.VersatileConfig; import com.hbm.extprop.HbmLivingProps; import com.hbm.items.ModItems; import com.hbm.lib.ModDamageSource; @@ -27,6 +28,9 @@ public class ItemPill extends ItemFood { @Override protected void onFoodEaten(ItemStack stack, World world, EntityPlayer player) { if(!world.isRemote) { + + VersatileConfig.applyPotionSickness(player, 5); + if(this == ModItems.pill_iodine) { player.removePotionEffect(Potion.blindness.id); player.removePotionEffect(Potion.confusion.id); @@ -96,7 +100,8 @@ public class ItemPill extends ItemFood { @Override public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { - p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_)); + if(!VersatileConfig.hasPotionSickness(p_77659_3_)) + p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_)); return p_77659_1_; } diff --git a/src/main/java/com/hbm/items/special/ItemSyringe.java b/src/main/java/com/hbm/items/special/ItemSyringe.java index bef0fb59b..1b72b925b 100644 --- a/src/main/java/com/hbm/items/special/ItemSyringe.java +++ b/src/main/java/com/hbm/items/special/ItemSyringe.java @@ -3,6 +3,7 @@ package com.hbm.items.special; import java.util.List; import java.util.Random; +import com.hbm.config.VersatileConfig; import com.hbm.handler.ArmorModHandler; import com.hbm.interfaces.IPartiallyFillable; import com.hbm.items.ModItems; @@ -29,7 +30,7 @@ public class ItemSyringe extends Item { @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { - if(this == ModItems.syringe_antidote) { + if(this == ModItems.syringe_antidote && !VersatileConfig.hasPotionSickness(player)) { if(!world.isRemote) { player.clearActivePotions(); @@ -43,10 +44,12 @@ public class ItemSyringe extends Item { if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_empty))) { player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_empty, 1, 0), false); } + + VersatileConfig.applyPotionSickness(player, 5); } } - if(this == ModItems.syringe_awesome) { + if(this == ModItems.syringe_awesome && !VersatileConfig.hasPotionSickness(player)) { if(!world.isRemote) { player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 50 * 20, 9)); player.addPotionEffect(new PotionEffect(Potion.resistance.id, 50 * 20, 9)); @@ -70,6 +73,8 @@ public class ItemSyringe extends Item { if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_empty))) { player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_empty, 1, 0), false); } + + VersatileConfig.applyPotionSickness(player, 50); } } @@ -93,7 +98,7 @@ public class ItemSyringe extends Item { } } - if(this == ModItems.syringe_metal_stimpak) { + if(this == ModItems.syringe_metal_stimpak && !VersatileConfig.hasPotionSickness(player)) { if(!world.isRemote) { player.heal(5); @@ -107,10 +112,12 @@ public class ItemSyringe extends Item { if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) { player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false); } + + VersatileConfig.applyPotionSickness(player, 5); } } - if(this == ModItems.syringe_metal_medx) { + if(this == ModItems.syringe_metal_medx && !VersatileConfig.hasPotionSickness(player)) { if(!world.isRemote) { player.addPotionEffect(new PotionEffect(Potion.resistance.id, 4 * 60 * 20, 2)); @@ -124,10 +131,12 @@ public class ItemSyringe extends Item { if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) { player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false); } + + VersatileConfig.applyPotionSickness(player, 5); } } - if(this == ModItems.syringe_metal_psycho) { + if(this == ModItems.syringe_metal_psycho && !VersatileConfig.hasPotionSickness(player)) { if(!world.isRemote) { player.addPotionEffect(new PotionEffect(Potion.resistance.id, 2 * 60 * 20, 0)); player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 2 * 60 * 20, 0)); @@ -142,10 +151,12 @@ public class ItemSyringe extends Item { if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) { player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false); } + + VersatileConfig.applyPotionSickness(player, 5); } } - if(this == ModItems.syringe_metal_super) { + if(this == ModItems.syringe_metal_super && !VersatileConfig.hasPotionSickness(player)) { if(!world.isRemote) { player.heal(25); player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 10 * 20, 0)); @@ -160,10 +171,12 @@ public class ItemSyringe extends Item { if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) { player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false); } + + VersatileConfig.applyPotionSickness(player, 15); } } - if(this == ModItems.med_bag) { + if(this == ModItems.med_bag && !VersatileConfig.hasPotionSickness(player)) { if(!world.isRemote) { player.setHealth(player.getMaxHealth()); @@ -176,6 +189,8 @@ public class ItemSyringe extends Item { player.removePotionEffect(Potion.weakness.id); player.removePotionEffect(Potion.wither.id); player.removePotionEffect(HbmPotion.radiation.id); + + VersatileConfig.applyPotionSickness(player, 15); stack.stackSize--; } diff --git a/src/main/java/com/hbm/lib/RefStrings.java b/src/main/java/com/hbm/lib/RefStrings.java index 421ea4e89..d3572142c 100644 --- a/src/main/java/com/hbm/lib/RefStrings.java +++ b/src/main/java/com/hbm/lib/RefStrings.java @@ -3,7 +3,7 @@ package com.hbm.lib; public class RefStrings { public static final String MODID = "hbm"; public static final String NAME = "Hbm's Nuclear Tech Mod"; - public static final String VERSION = "1.0.27 BETA (3801)"; + public static final String VERSION = "1.0.27 BETA (3802)"; //HBM's Beta Naming Convention: //V T (X) //V -> next release version diff --git a/src/main/java/com/hbm/main/ModEventHandlerClient.java b/src/main/java/com/hbm/main/ModEventHandlerClient.java index aaa1c620f..dfa04214a 100644 --- a/src/main/java/com/hbm/main/ModEventHandlerClient.java +++ b/src/main/java/com/hbm/main/ModEventHandlerClient.java @@ -215,6 +215,39 @@ public class ModEventHandlerClient { if(invis != null && invis.getAmplifier() > 0) event.setCanceled(true); + + if(player.getDisplayName().toLowerCase().equals("martmn")) { + + event.setCanceled(true); + + float pX = (float) (player.prevPosX + (player.posX - player.prevPosX) * (double)event.partialRenderTick); + float pY = (float) (player.prevPosY + (player.posY - player.prevPosY) * (double)event.partialRenderTick); + float pZ = (float) (player.prevPosZ + (player.posZ - player.prevPosZ) * (double)event.partialRenderTick); + EntityPlayer me = Minecraft.getMinecraft().thePlayer; + float mX = (float) (me.prevPosX + (me.posX - me.prevPosX) * (double)event.partialRenderTick); + float mY = (float) (me.prevPosY + (me.posY - me.prevPosY) * (double)event.partialRenderTick); + float mZ = (float) (me.prevPosZ + (me.posZ - me.prevPosZ) * (double)event.partialRenderTick); + + Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/particle/fart.png")); + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glTranslatef(pX - mX, pY - mY + 0.75F - (float)player.getYOffset(), pZ - mZ); + GL11.glRotatef(-me.rotationYaw, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(me.rotationPitch, 1.0F, 0.0F, 0.0F); + Tessellator t = Tessellator.instance; + t.startDrawingQuads(); + t.setBrightness(240); + t.addVertexWithUV(-1, 1, 0, 0, 0); + t.addVertexWithUV(1, 1, 0, 1, 0); + t.addVertexWithUV(1, -1, 0, 1, 1); + t.addVertexWithUV(-1, -1, 0, 0, 1); + t.draw(); + + GL11.glEnable(GL11.GL_LIGHTING); + + GL11.glPopMatrix(); + } ResourceLocation cloak = RenderAccessoryUtility.getCloakFromPlayer(player); diff --git a/src/main/java/com/hbm/potion/HbmPotion.java b/src/main/java/com/hbm/potion/HbmPotion.java index 84b8b557a..abf6a4a6f 100644 --- a/src/main/java/com/hbm/potion/HbmPotion.java +++ b/src/main/java/com/hbm/potion/HbmPotion.java @@ -34,6 +34,7 @@ public class HbmPotion extends Potion { public static HbmPotion telekinesis; public static HbmPotion phosphorus; public static HbmPotion stability; + public static HbmPotion potionsickness; public HbmPotion(int id, boolean isBad, int color) { super(id, isBad, color); @@ -50,6 +51,7 @@ public class HbmPotion extends Potion { telekinesis = registerPotion(PotionConfig.telekinesisID, true, 0x00F3FF, "potion.hbm_telekinesis", 0, 1); phosphorus = registerPotion(PotionConfig.phosphorusID, true, 0xFFFF00, "potion.hbm_phosphorus", 1, 1); stability = registerPotion(PotionConfig.stabilityID, false, 0xD0D0D0, "potion.hbm_stability", 2, 1); + potionsickness = registerPotion(PotionConfig.potionsicknessID, false, 0xff8080, "potion.hbm_potionsickness", 3, 1); } public static HbmPotion registerPotion(int id, boolean isBad, int color, String name, int x, int y) { diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineSatDock.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineSatDock.java index 0ba029bea..067b705fd 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineSatDock.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineSatDock.java @@ -339,7 +339,7 @@ public class TileEntityMachineSatDock extends TileEntity implements ISidedInvent if(slots[i].stackSize <= 0) slots[i] = null; - chest.setInventorySlotContents(j, chest.getStackInSlot(j).copy()); + chest.getStackInSlot(j).stackSize++; return; } } @@ -362,9 +362,7 @@ public class TileEntityMachineSatDock extends TileEntity implements ISidedInvent if(slots[i].stackSize <= 0) slots[i] = null; - ItemStack copy = chest.getStackInSlot(j).copy(); - copy.stackSize = 1; - chest.setInventorySlotContents(j, copy); + chest.setInventorySlotContents(j, sta); return; } } diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index fc6ce7ac1..4faef6a75 100755 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -3,7 +3,7 @@ "modid": "hbm", "name": "Hbm's Nuclear Tech", "description": "A mod that adds weapons, nuclear themed stuff and machines", - "version":"1.0.27-3801", + "version":"1.0.27-3802", "mcversion": "1.7.10", "url": "", "updateUrl": "",