diff --git a/src/main/java/com/hbm/interfaces/IRadiationImmune.java b/src/main/java/api/hbm/entity/IRadiationImmune.java similarity index 58% rename from src/main/java/com/hbm/interfaces/IRadiationImmune.java rename to src/main/java/api/hbm/entity/IRadiationImmune.java index 575d41a5a..d7150807e 100644 --- a/src/main/java/com/hbm/interfaces/IRadiationImmune.java +++ b/src/main/java/api/hbm/entity/IRadiationImmune.java @@ -1,4 +1,4 @@ -package com.hbm.interfaces; +package api.hbm.entity; public interface IRadiationImmune { diff --git a/src/main/java/assets/hbm/lang/de_DE.lang b/src/main/java/assets/hbm/lang/de_DE.lang index f0d6c2fe2..78e630567 100644 --- a/src/main/java/assets/hbm/lang/de_DE.lang +++ b/src/main/java/assets/hbm/lang/de_DE.lang @@ -971,6 +971,11 @@ item.euphemium_plate.name=Euphemiumbrustpanzer item.euphemium_stopper.name=Stopper item.factory_core_advanced.name=Fortgeschrittener Fabrikenergiecluster item.factory_core_titanium.name=Einfacher Fabrikenergiecluster +item.fallout.name=Fallouthäufchen +item.fau_boots.name=Fau-Stiefel +item.fau_helmet.name=Fau-Helm +item.fau_legs.name=Fau-Beinschienen +item.fau_plate.name=Fau-Brustpanzer item.filter_coal.name=Aktivkohlefilter item.fins_big_steel.name=Große Stahlgitterfinnen item.fins_flat.name=Flache Stahlabdeckung @@ -1086,6 +1091,7 @@ item.gun_bolt_action_ammo.name=12x74 Brenneke (LEGACY) item.gun_bolt_action_green.name=Dream-Repetiergewehr (Grün) item.gun_bolt_action_saturnite.name=Saturnitbüchse item.gun_bolter.name=Boltergewehr +item.gun_bolter_digamma.name=Digammagewehr item.gun_calamity.name=Calamity item.gun_calamity_ammo.name=.50 BMG Patrone (LEGACY) item.gun_calamity_dual.name=Sattelkanone @@ -1287,6 +1293,7 @@ item.ingot_uranium.name=Uranbarren item.ingot_uranium_fuel.name=Urankernbrennstoffbarren item.ingot_verticium.name=Verticiumbarren item.ingot_weidanium.name=Weidaniumbarren +item.ink.name=林-Tinte item.insert_du.name=DU-Einlage item.insert_era.name=Explosive Reaktivpaanzerungseinlage item.insert_esapi.name=ESAPI-Einlage @@ -2219,6 +2226,7 @@ tile.block_dura_steel.name=Verstärketer Schnellarbeitsstahlblock tile.block_electrical_scrap.name=Elektroschrottblock tile.block_euphemium.name=Euphemiumblock tile.block_euphemium_cluster.name=Euphemiumgeätzter Schrabidium-Cluster +tile.block_fallout.name=Fallout-Block tile.block_fiberglass.name=Fiberglasrolle tile.block_fluorite.name=Fluoritblock tile.block_insulator.name=Isolatorrolle @@ -2351,6 +2359,7 @@ tile.factory_titanium_conductor.name=Einfacher Fabriksstromanschluss tile.factory_titanium_core.name=Einfache Fabrikkernkomponente tile.factory_titanium_furnace.name=Einfache Fabrikzugriffsluke tile.factory_titanium_hull.name=Einfache Fabrikshülle +tile.fallout.name=Fallout tile.fence_metal.name=Maschendrahtzaun tile.fireworks.name=Feuerwerksbatterie tile.fireworks.charges=Ladungen: %s diff --git a/src/main/java/assets/hbm/lang/en_US.lang b/src/main/java/assets/hbm/lang/en_US.lang index 2248d7729..418a470de 100644 --- a/src/main/java/assets/hbm/lang/en_US.lang +++ b/src/main/java/assets/hbm/lang/en_US.lang @@ -971,6 +971,11 @@ item.euphemium_plate.name=Euphemium Chestplate item.euphemium_stopper.name=Stopper item.factory_core_advanced.name=Advanced Factory Energy Cluster item.factory_core_titanium.name=Basic Factory Energy Cluster +item.fallout.name=Pile of Fallout +item.fau_boots.name=Fau Boots +item.fau_helmet.name=Fau Helmet +item.fau_legs.name=Fau Leggins +item.fau_plate.name=Fau Chestplate item.filter_coal.name=Activated Carbon Filter item.fins_big_steel.name=Big Steel Grid Fins item.fins_flat.name=Flat Steel Casing @@ -1086,6 +1091,7 @@ item.gun_bolt_action_ammo.name=12x74 Slug (LEGACY) item.gun_bolt_action_green.name=Dream Bolt-Action Rifle (Green) item.gun_bolt_action_saturnite.name=Saturnite Rifle item.gun_bolter.name=Bolter +item.gun_bolter_digamma.name=Digamma Gun item.gun_calamity.name=Calamity item.gun_calamity_ammo.name=.50 BMG Round (LEGACY) item.gun_calamity_dual.name=Saddle Gun @@ -1287,6 +1293,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.ink.name=林 Ink item.insert_du.name=DU Insert item.insert_era.name=Explosive Reactive Armor Insert item.insert_esapi.name=ESAPI Insert @@ -2219,6 +2226,7 @@ tile.block_dura_steel.name=Reinforced Block of High-Speed Steel tile.block_electrical_scrap.name=Block of Electrical Scrap tile.block_euphemium.name=Block of Euphemium tile.block_euphemium_cluster.name=Euphemium-Etched Schrabidium Cluster +tile.block_fallout.name=Block of Fallout tile.block_fiberglass.name=Roll of Fiberglass tile.block_fluorite.name=Block of Fluorite tile.block_insulator.name=Roll of Insulation @@ -2351,6 +2359,7 @@ tile.factory_titanium_conductor.name=Basic Factory Electricity Port tile.factory_titanium_core.name=Basic Factory Core Component tile.factory_titanium_furnace.name=Basic Factory Access Hatch tile.factory_titanium_hull.name=Basic Factory Casing +tile.fallout.name=Fallout tile.fence_metal.name=Chainlink Fence tile.fireworks.name=Firework Battery tile.fireworks.charges=Charges Loaded: %s diff --git a/src/main/java/assets/hbm/sounds.json b/src/main/java/assets/hbm/sounds.json index db82bb773..828acfe7a 100644 --- a/src/main/java/assets/hbm/sounds.json +++ b/src/main/java/assets/hbm/sounds.json @@ -166,6 +166,7 @@ "entity.ducc": {"category": "neutral", "sounds": ["entity/ducc1", "entity/ducc2"]}, "entity.slicer": {"category": "neutral", "sounds": ["entity/slicer1", "entity/slicer2", "entity/slicer3", "entity/slicer4"]}, "entity.megaquacc": {"category": "hostile", "sounds": [{"name": "entity/megaquacc", "stream": false}]}, + "entity.vomit": {"category": "player", "sounds": [{"name": "entity/vomit", "stream": false}]}, "step.metal": {"category": "player", "sounds": [{"name": "footsteps/metal", "stream": false}]}, "step.iron_jump": {"category": "player", "sounds": [{"name": "footsteps/iron_jump", "stream": false}]}, diff --git a/src/main/java/assets/hbm/sounds/entity/vomit.ogg b/src/main/java/assets/hbm/sounds/entity/vomit.ogg new file mode 100644 index 000000000..bdfbbf513 Binary files /dev/null and b/src/main/java/assets/hbm/sounds/entity/vomit.ogg differ diff --git a/src/main/java/assets/hbm/textures/armor/fau_arm.png b/src/main/java/assets/hbm/textures/armor/fau_arm.png index 5d18f6775..2d742b484 100644 Binary files a/src/main/java/assets/hbm/textures/armor/fau_arm.png and b/src/main/java/assets/hbm/textures/armor/fau_arm.png differ diff --git a/src/main/java/assets/hbm/textures/armor/fau_chest.png b/src/main/java/assets/hbm/textures/armor/fau_chest.png index 4d01c2784..7340f6e3b 100644 Binary files a/src/main/java/assets/hbm/textures/armor/fau_chest.png and b/src/main/java/assets/hbm/textures/armor/fau_chest.png differ diff --git a/src/main/java/assets/hbm/textures/armor/fau_helmet.png b/src/main/java/assets/hbm/textures/armor/fau_helmet.png index 8fa220395..dc97c0fc6 100644 Binary files a/src/main/java/assets/hbm/textures/armor/fau_helmet.png and b/src/main/java/assets/hbm/textures/armor/fau_helmet.png differ diff --git a/src/main/java/assets/hbm/textures/armor/fau_leg.png b/src/main/java/assets/hbm/textures/armor/fau_leg.png index 9a167a76e..4e8a61572 100644 Binary files a/src/main/java/assets/hbm/textures/armor/fau_leg.png and b/src/main/java/assets/hbm/textures/armor/fau_leg.png differ diff --git a/src/main/java/assets/hbm/textures/items/fallout.png b/src/main/java/assets/hbm/textures/items/fallout.png new file mode 100644 index 000000000..0ac9ed34d Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/fallout.png differ diff --git a/src/main/java/assets/hbm/textures/items/ink.png b/src/main/java/assets/hbm/textures/items/ink.png new file mode 100644 index 000000000..80f67163f Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/ink.png differ diff --git a/src/main/java/com/hbm/blocks/ModBlocks.java b/src/main/java/com/hbm/blocks/ModBlocks.java index 4f8f8439e..597d0fd37 100644 --- a/src/main/java/com/hbm/blocks/ModBlocks.java +++ b/src/main/java/com/hbm/blocks/ModBlocks.java @@ -18,6 +18,7 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockFalling; import net.minecraft.block.material.*; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; @@ -159,6 +160,7 @@ public class ModBlocks { public static Block block_lithium; public static Block block_white_phosphorus; public static Block block_red_phosphorus; + public static Block block_fallout; public static Block block_australium; public static Block block_weidanium; @@ -282,6 +284,7 @@ public class ModBlocks { public static Block frozen_grass; public static Block frozen_log; public static Block frozen_planks; + public static Block fallout; public static Block sellafield_slaked; public static Block sellafield_0; @@ -1016,6 +1019,7 @@ public class ModBlocks { block_lithium = new BlockLithium(Material.iron).setBlockName("block_lithium").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_lithium"); block_white_phosphorus = new BlockGeneric(Material.rock).setBlockName("block_white_phosphorus").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_white_phosphorus"); block_red_phosphorus = new BlockFalling(Material.sand).setStepSound(Block.soundTypeSand).setBlockName("block_red_phosphorus").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_red_phosphorus"); + block_fallout = new BlockFalling(Material.ground).setStepSound(Block.soundTypeGravel).setBlockName("block_fallout").setCreativeTab(MainRegistry.blockTab).setHardness(0.2F).setBlockTextureName(RefStrings.MODID + ":ash"); block_australium = new BlockGeneric(Material.iron).setBlockName("block_australium").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_australium"); block_weidanium = new BlockGeneric(Material.iron).setBlockName("block_weidanium").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_weidanium"); @@ -1128,8 +1132,8 @@ public class ModBlocks { mush_block = new BlockMushHuge(Material.plants).setBlockName("mush_block").setLightLevel(1.0F).setStepSound(Block.soundTypeGrass).setHardness(0.2F).setBlockTextureName(RefStrings.MODID + ":mush_block_skin"); mush_block_stem = new BlockMushHuge(Material.plants).setBlockName("mush_block_stem").setLightLevel(1.0F).setStepSound(Block.soundTypeGrass).setHardness(0.2F).setBlockTextureName(RefStrings.MODID + ":mush_block_stem"); - waste_earth = new WasteEarth(Material.ground, true).setBlockName("waste_earth").setStepSound(Block.soundTypeGrass).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setResistance(1.0F).setBlockTextureName(RefStrings.MODID + ":waste_earth"); - waste_mycelium = new WasteEarth(Material.ground, true).setBlockName("waste_mycelium").setStepSound(Block.soundTypeGrass).setLightLevel(1F).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setResistance(1.0F).setBlockTextureName(RefStrings.MODID + ":waste_mycelium_side"); + waste_earth = new WasteEarth(Material.ground, false).setBlockName("waste_earth").setStepSound(Block.soundTypeGrass).setCreativeTab(MainRegistry.blockTab).setHardness(0.6F).setBlockTextureName(RefStrings.MODID + ":waste_earth"); + waste_mycelium = new WasteEarth(Material.ground, true).setBlockName("waste_mycelium").setStepSound(Block.soundTypeGrass).setLightLevel(1F).setCreativeTab(MainRegistry.blockTab).setHardness(0.6F).setBlockTextureName(RefStrings.MODID + ":waste_mycelium_side"); waste_trinitite = new BlockOre(Material.sand).setBlockName("waste_trinitite").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setResistance(2.5F).setBlockTextureName(RefStrings.MODID + ":waste_trinitite"); waste_trinitite_red = new BlockOre(Material.sand).setBlockName("waste_trinitite_red").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setResistance(2.5F).setBlockTextureName(RefStrings.MODID + ":waste_trinitite_red"); waste_log = new WasteLog(Material.wood).setBlockName("waste_log").setStepSound(Block.soundTypeWood).setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(2.5F); @@ -1138,6 +1142,7 @@ public class ModBlocks { frozen_grass = new WasteEarth(Material.ground, false).setBlockName("frozen_grass").setStepSound(Block.soundTypeGlass).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setResistance(2.5F); frozen_log = new WasteLog(Material.wood).setBlockName("frozen_log").setStepSound(Block.soundTypeGlass).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setResistance(2.5F); frozen_planks = new BlockOre(Material.wood).setBlockName("frozen_planks").setStepSound(Block.soundTypeGlass).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setResistance(2.5F).setBlockTextureName(RefStrings.MODID + ":frozen_planks"); + fallout = new BlockFallout(Material.snow).setBlockName("fallout").setStepSound(Block.soundTypeGravel).setCreativeTab(MainRegistry.blockTab).setHardness(0.1F).setLightOpacity(0).setBlockTextureName(RefStrings.MODID + ":ash"); sellafield_slaked = new BlockGeneric(Material.rock).setBlockName("sellafield_slaked").setStepSound(Block.soundTypeStone).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_slaked"); sellafield_0 = new BlockOre(Material.rock, 0.5F, 10F).setBlockName("sellafield_0").setStepSound(Block.soundTypeStone).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_0"); @@ -1717,6 +1722,7 @@ public class ModBlocks { GameRegistry.registerBlock(block_yellowcake, block_yellowcake.getUnlocalizedName()); GameRegistry.registerBlock(block_scrap, block_scrap.getUnlocalizedName()); GameRegistry.registerBlock(block_electrical_scrap, block_electrical_scrap.getUnlocalizedName()); + GameRegistry.registerBlock(block_fallout, block_fallout.getUnlocalizedName()); GameRegistry.registerBlock(block_insulator, block_insulator.getUnlocalizedName()); GameRegistry.registerBlock(block_fiberglass, block_fiberglass.getUnlocalizedName()); GameRegistry.registerBlock(block_asbestos, block_asbestos.getUnlocalizedName()); @@ -1862,6 +1868,7 @@ public class ModBlocks { GameRegistry.registerBlock(frozen_dirt, frozen_dirt.getUnlocalizedName()); GameRegistry.registerBlock(frozen_log, frozen_log.getUnlocalizedName()); GameRegistry.registerBlock(frozen_planks, frozen_planks.getUnlocalizedName()); + GameRegistry.registerBlock(fallout, fallout.getUnlocalizedName()); //RAD GameRegistry.registerBlock(sellafield_slaked, sellafield_slaked.getUnlocalizedName()); diff --git a/src/main/java/com/hbm/blocks/generic/BlockFallout.java b/src/main/java/com/hbm/blocks/generic/BlockFallout.java new file mode 100644 index 000000000..0701219f3 --- /dev/null +++ b/src/main/java/com/hbm/blocks/generic/BlockFallout.java @@ -0,0 +1,74 @@ +package com.hbm.blocks.generic; + +import java.util.Random; + +import com.hbm.items.ModItems; +import com.hbm.potion.HbmPotion; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockFallout extends Block { + + public BlockFallout(Material mat) { + super(mat); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return ModItems.fallout; + } + + public boolean canPlaceBlockAt(World world, int x, int y, int z) { + Block block = world.getBlock(x, y - 1, z); + return block != Blocks.ice && block != Blocks.packed_ice ? (block.isLeaves(world, x, y - 1, z) ? true : (block == this && (world.getBlockMetadata(x, y - 1, z) & 7) == 7 ? true : block.isOpaqueCube() && block.getMaterial().blocksMovement())) : false; + } + + @Override + public void onEntityWalking(World world, int x, int y, int z, Entity entity) { + + if(!world.isRemote && entity instanceof EntityLivingBase) { + ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 30 * 20, 1)); + } + } + + public void onBlockClicked(World world, int x, int y, int z, EntityPlayer player) { + + if(!world.isRemote) { + player.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 15 * 20, 1)); + } + } + + public void onNeighborBlockChange(World world, int x, int y, int z, Block b) { + this.func_150155_m(world, x, y, z); + } + + private boolean func_150155_m(World world, int x, int y, int z) { + if(!this.canPlaceBlockAt(world, x, y, z)) { + world.setBlockToAir(x, y, z); + return false; + } else { + return true; + } + } + + public boolean isReplaceable(IBlockAccess world, int x, int y, int z) { + return true; + } +} diff --git a/src/main/java/com/hbm/blocks/generic/WasteEarth.java b/src/main/java/com/hbm/blocks/generic/WasteEarth.java index c419c1552..0062fcc5d 100644 --- a/src/main/java/com/hbm/blocks/generic/WasteEarth.java +++ b/src/main/java/com/hbm/blocks/generic/WasteEarth.java @@ -25,7 +25,7 @@ import net.minecraft.util.IIcon; import net.minecraft.world.World; public class WasteEarth extends Block { - + @SideOnly(Side.CLIENT) private IIcon iconTop; @SideOnly(Side.CLIENT) @@ -33,15 +33,15 @@ public class WasteEarth extends Block { public WasteEarth(Material mat, boolean tick) { super(mat); - this.setTickRandomly(tick); + this.setTickRandomly(tick); } - + @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegister) { - this.iconTop = iconRegister.registerIcon(RefStrings.MODID + (this == ModBlocks.waste_earth ? ":waste_earth_top" : (this == ModBlocks.waste_mycelium ? ":waste_mycelium_top" : ":frozen_grass_top"))); + this.iconTop = iconRegister.registerIcon(RefStrings.MODID + (this == ModBlocks.waste_earth ? ":waste_grass_top" : (this == ModBlocks.waste_mycelium ? ":waste_mycelium_top" : ":frozen_grass_top"))); this.iconBottom = iconRegister.registerIcon(RefStrings.MODID + (this == ModBlocks.waste_earth ? ":waste_earth_bottom" : (this == ModBlocks.waste_mycelium ? ":waste_earth_bottom" : ":frozen_dirt"))); - this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + (this == ModBlocks.waste_earth ? ":waste_earth_side" : (this == ModBlocks.waste_mycelium ? ":waste_mycelium_side" : ":frozen_grass_side"))); + this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + (this == ModBlocks.waste_earth ? ":waste_grass_side" : (this == ModBlocks.waste_mycelium ? ":waste_mycelium_side" : ":frozen_grass_side"))); } @Override @@ -51,148 +51,105 @@ public class WasteEarth extends Block { } @Override - public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) - { - if(this == ModBlocks.waste_earth || this == ModBlocks.waste_mycelium) - { + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + if(this == ModBlocks.waste_earth || this == ModBlocks.waste_mycelium) { return Item.getItemFromBlock(Blocks.dirt); } - - if(this == ModBlocks.frozen_grass) - { + + if(this == ModBlocks.frozen_grass) { return Items.snowball; } - + return Item.getItemFromBlock(this); - } - - @Override - public int quantityDropped(Random p_149745_1_) - { - return 1; - } + } - @Override - public void onEntityWalking(World p_149724_1_, int p_149724_2_, int p_149724_3_, int p_149724_4_, Entity entity) - { - if (entity instanceof EntityLivingBase && this == ModBlocks.waste_earth) { + @Override + public int quantityDropped(Random p_149745_1_) { + return 1; + } - ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 15 * 20, 0)); - } - - if (entity instanceof EntityLivingBase && this == ModBlocks.frozen_grass) { - - ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 2 * 60 * 20, 2)); - } - if (entity instanceof EntityLivingBase && this == ModBlocks.waste_mycelium) { - - ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 30 * 20, 3)); - } - } - - @Override + @Override + public void onEntityWalking(World p_149724_1_, int p_149724_2_, int p_149724_3_, int p_149724_4_, Entity entity) { + if(entity instanceof EntityLivingBase && this == ModBlocks.frozen_grass) { + + ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 2 * 60 * 20, 2)); + } + if(entity instanceof EntityLivingBase && this == ModBlocks.waste_mycelium) { + + ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 30 * 20, 3)); + } + } + + @Override @SideOnly(Side.CLIENT) - public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) - { - super.randomDisplayTick(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_, p_149734_5_); + public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) { + super.randomDisplayTick(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_, p_149734_5_); + if(this == ModBlocks.waste_mycelium) { + p_149734_1_.spawnParticle("townaura", p_149734_2_ + p_149734_5_.nextFloat(), p_149734_3_ + 1.1F, p_149734_4_ + p_149734_5_.nextFloat(), 0.0D, 0.0D, 0.0D); + } + } - if (this == ModBlocks.waste_earth) - { - p_149734_1_.spawnParticle("townaura", p_149734_2_ + p_149734_5_.nextFloat(), p_149734_3_ + 1.1F, p_149734_4_ + p_149734_5_.nextFloat(), 0.0D, 0.0D, 0.0D); - } - if (this == ModBlocks.waste_mycelium) - { - p_149734_1_.spawnParticle("townaura", p_149734_2_ + p_149734_5_.nextFloat(), p_149734_3_ + 1.1F, p_149734_4_ + p_149734_5_.nextFloat(), 0.0D, 0.0D, 0.0D); - } - } - - @Override - public void updateTick(World world, int x, int y, int z, Random rand) { - - if((this == ModBlocks.waste_earth || this == ModBlocks.waste_mycelium) && world.getBlock(x, y + 1, z) == Blocks.air && rand.nextInt(10) == 0) - { - Block b0; - int count = 0; - for(int i = -5; i < 5; i++) { - for(int j = -5; j < 6; j++) { - for(int k = -5; k < 5; k++) { - b0 = world.getBlock(x + i, y + j, z + k); - if((b0 instanceof BlockMushroom) || b0 == ModBlocks.mush) - { - count++; - } - } - } - } - if(count > 0 && count < 5) - world.setBlock(x, y + 1, z, ModBlocks.mush); - } - - if(this == ModBlocks.waste_mycelium && GeneralConfig.enableMycelium) - { - for(int i = -1; i < 2; i++) { - for(int j = -1; j < 2; j++) { - for(int k = -1; k < 2; k++) { - Block b0 = world.getBlock(x + i, y + j, z + k); - Block b1 = world.getBlock(x + i, y + j + 1, z + k); - if(!b1.isOpaqueCube() && (b0 == Blocks.dirt || b0 == Blocks.grass || b0 == Blocks.mycelium || b0 == ModBlocks.waste_earth)) - { - world.setBlock(x + i, y + j, z + k, ModBlocks.waste_mycelium); - } - } - } - } - - if(rand.nextInt(10) == 0) { - Block b0; - int count = 0; - for(int i = -5; i < 5; i++) { - for(int j = -5; j < 6; j++) { - for(int k = -5; k < 5; k++) { - b0 = world.getBlock(x + i, y + j, z + k); - if(b0 == ModBlocks.mush) - { - count++; - } - } - } - } - if(count < 5) - world.setBlock(x, y + 1, z, ModBlocks.mush); - } - } - - if(this == ModBlocks.waste_earth || this == ModBlocks.waste_mycelium) - { - if (!world.isRemote) - { - if (world.getBlockLightValue(x, y + 1, z) < 4 && world.getBlockLightOpacity(x, y + 1, z) > 2) - { - world.setBlock(x, y, z, Blocks.dirt); - } - } - } - - if(GeneralConfig.enableAutoCleanup && (this == ModBlocks.waste_earth | this == ModBlocks.waste_mycelium)) - if(!world.isRemote) - world.setBlock(x, y, z, Blocks.dirt); - } - - /*@Override - public int tickRate(World world) { - - if(this.radIn > 0) - return 20; - - return 100; - } - - public void onBlockAdded(World world, int x, int y, int z) - { - super.onBlockAdded(world, x, y, z); - - if(this.radIn > 0) - world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world)); - }*/ + @Override + public void updateTick(World world, int x, int y, int z, Random rand) { + if((this == ModBlocks.waste_earth || this == ModBlocks.waste_mycelium) && world.getBlock(x, y + 1, z) == Blocks.air && rand.nextInt(10) == 0) { + Block b0; + int count = 0; + for(int i = -5; i < 5; i++) { + for(int j = -5; j < 6; j++) { + for(int k = -5; k < 5; k++) { + b0 = world.getBlock(x + i, y + j, z + k); + if((b0 instanceof BlockMushroom) || b0 == ModBlocks.mush) { + count++; + } + } + } + } + if(count > 0 && count < 5) + world.setBlock(x, y + 1, z, ModBlocks.mush); + } + + if(this == ModBlocks.waste_mycelium && GeneralConfig.enableMycelium) { + for(int i = -1; i < 2; i++) { + for(int j = -1; j < 2; j++) { + for(int k = -1; k < 2; k++) { + Block b0 = world.getBlock(x + i, y + j, z + k); + Block b1 = world.getBlock(x + i, y + j + 1, z + k); + if(!b1.isOpaqueCube() && (b0 == Blocks.dirt || b0 == Blocks.grass || b0 == Blocks.mycelium || b0 == ModBlocks.waste_earth)) { + world.setBlock(x + i, y + j, z + k, ModBlocks.waste_mycelium); + } + } + } + } + + if(rand.nextInt(10) == 0) { + Block b0; + int count = 0; + for(int i = -5; i < 5; i++) { + for(int j = -5; j < 6; j++) { + for(int k = -5; k < 5; k++) { + b0 = world.getBlock(x + i, y + j, z + k); + if(b0 == ModBlocks.mush) { + count++; + } + } + } + } + if(count < 5) + world.setBlock(x, y + 1, z, ModBlocks.mush); + } + } + + if(this == ModBlocks.waste_earth || this == ModBlocks.waste_mycelium) { + if(!world.isRemote) { + if(world.getBlockLightValue(x, y + 1, z) < 4 && world.getBlockLightOpacity(x, y + 1, z) > 2) { + world.setBlock(x, y, z, Blocks.dirt); + } + } + } + + if(GeneralConfig.enableAutoCleanup && (this == ModBlocks.waste_earth | this == ModBlocks.waste_mycelium)) + if(!world.isRemote) + world.setBlock(x, y, z, Blocks.dirt); + } } diff --git a/src/main/java/com/hbm/blocks/test/TestEventTester.java b/src/main/java/com/hbm/blocks/test/TestEventTester.java index 146a581ac..1905eadc8 100644 --- a/src/main/java/com/hbm/blocks/test/TestEventTester.java +++ b/src/main/java/com/hbm/blocks/test/TestEventTester.java @@ -8,8 +8,6 @@ import java.util.Map.Entry; import com.hbm.blocks.ModBlocks; import com.hbm.entity.effect.EntityNukeCloudSmall; -import com.hbm.explosion.ExplosionNT; -import com.hbm.explosion.ExplosionNT.ExAttrib; import com.hbm.saveddata.RadiationSavedData; import net.minecraft.block.Block; diff --git a/src/main/java/com/hbm/crafting/ArmorRecipes.java b/src/main/java/com/hbm/crafting/ArmorRecipes.java index b2a14b2f7..1fe6f3666 100644 --- a/src/main/java/com/hbm/crafting/ArmorRecipes.java +++ b/src/main/java/com/hbm/crafting/ArmorRecipes.java @@ -12,6 +12,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; +import net.minecraftforge.oredict.ShapelessOreRecipe; /** * For player armor @@ -59,6 +60,10 @@ public class ArmorRecipes { GameRegistry.addRecipe(new ItemStack(ModItems.ajr_plate, 1), new Object[] { "MPM", "TBT", "PPP", 'M', ModItems.motor_desh, 'P', ModItems.plate_armor_ajr, 'T', ModItems.gas_empty, 'B', ModItems.alloy_plate }); GameRegistry.addRecipe(new ItemStack(ModItems.ajr_legs, 1), new Object[] { "MPM", "PBP", "P P", 'M', ModItems.motor_desh, 'P', ModItems.plate_armor_ajr, 'B', ModItems.alloy_legs }); GameRegistry.addRecipe(new ItemStack(ModItems.ajr_boots, 1), new Object[] { "P P", "PBP", 'P', ModItems.plate_armor_ajr, 'B', ModItems.alloy_boots }); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.ajro_helmet, 1), new Object[] { ModItems.ajr_helmet, "dyeRed", "dyeBlack" })); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.ajro_plate, 1), new Object[] { ModItems.ajr_plate, "dyeRed", "dyeBlack" })); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.ajro_legs, 1), new Object[] { ModItems.ajr_legs, "dyeRed", "dyeBlack" })); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.ajro_boots, 1), new Object[] { ModItems.ajr_boots, "dyeRed", "dyeBlack" })); GameRegistry.addRecipe(new ItemStack(ModItems.bj_helmet, 1), new Object[] { "SBS", " C ", " I ", 'S', Items.string, 'B', new ItemStack(Blocks.wool, 1, 15), 'C', ModItems.circuit_targeting_tier4, 'I', ModItems.ingot_starmetal }); GameRegistry.addRecipe(new ItemStack(ModItems.bj_plate, 1), new Object[] { "N N", "MSM", "NCN", 'N', ModItems.plate_armor_lunar, 'M', ModItems.motor_desh, 'S', ModItems.starmetal_plate, 'C', ModItems.circuit_targeting_tier5 }); GameRegistry.addRecipe(new ItemStack(ModItems.bj_plate_jetpack, 1), new Object[] { "NFN", "TPT", "ICI", 'N', ModItems.plate_armor_lunar, 'F', ModItems.fins_quad_titanium, 'T', new ItemStack(ModItems.fluid_tank_full, 1, FluidType.XENON.ordinal()), 'P', ModItems.bj_plate, 'I', ModItems.mp_thruster_10_xenon, 'C', ModItems.crystal_phosphorus }); diff --git a/src/main/java/com/hbm/crafting/ConsumableRecipes.java b/src/main/java/com/hbm/crafting/ConsumableRecipes.java index cc0c42b95..758571ce8 100644 --- a/src/main/java/com/hbm/crafting/ConsumableRecipes.java +++ b/src/main/java/com/hbm/crafting/ConsumableRecipes.java @@ -8,6 +8,7 @@ import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; @@ -156,6 +157,8 @@ public class ConsumableRecipes { GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.industrial_magnet, 1), new Object[] { "SMS", " B ", "SMS", 'S', "ingotSteel", 'M', ModItems.horseshoe_magnet, 'B', ModBlocks.fusion_conductor })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.heart_container, 1), new Object[] { "HAH", "ACA", "HAH", 'H', ModItems.heart_piece, 'A', "ingotAluminum", 'C', ModItems.coin_creeper })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.heart_booster, 1), new Object[] { "GHG", "MCM", "GHG", 'G', "ingotGold", 'H', ModItems.heart_container, 'M', ModItems.morning_glory, 'C', ModItems.coin_maskman })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.ink, 1), new Object[] { "FPF", "PIP", "FPF", 'F', new ItemStack(Blocks.red_flower, 1, OreDictionary.WILDCARD_VALUE), 'P', ModItems.armor_polish, 'I', "dyeBlack" })); + GameRegistry.addRecipe(new ItemStack(ModItems.bathwater_mk2, 1), new Object[] { "MWM", "WBW", "MWM", 'M', ModItems.bottle_mercury, 'W', ModItems.nuclear_waste, 'B', ModItems.bathwater }); //Stealth boy GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.stealth_boy, 1), new Object[] { " B", "LI", "LC", 'B', Item.getItemFromBlock(Blocks.stone_button), 'L', Items.leather, 'I', "ingotSteel", 'C', ModItems.circuit_red_copper })); diff --git a/src/main/java/com/hbm/crafting/MineralRecipes.java b/src/main/java/com/hbm/crafting/MineralRecipes.java index 631e320a1..4511b40ec 100644 --- a/src/main/java/com/hbm/crafting/MineralRecipes.java +++ b/src/main/java/com/hbm/crafting/MineralRecipes.java @@ -29,6 +29,10 @@ public class MineralRecipes { RecipesCommon.add9To1(ModItems.ingot_dineutronium, ModBlocks.block_dineutronium); RecipesCommon.add1To9(ModBlocks.block_dineutronium, ModItems.ingot_dineutronium); + RecipesCommon.add9To1(ModItems.fallout, ModBlocks.block_fallout); + RecipesCommon.add1To9(ModBlocks.block_fallout, ModItems.fallout); + GameRegistry.addRecipe(new ItemStack(ModBlocks.fallout, 2), new Object[] { "##", '#', ModItems.fallout }); + GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.block_copper), 1), new Object[] { "###", "###", "###", '#', ModItems.ingot_copper }); GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.block_fluorite), 1), new Object[] { "###", "###", "###", '#', ModItems.fluorite }); GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.block_niter), 1), new Object[] { "###", "###", "###", '#', ModItems.niter }); diff --git a/src/main/java/com/hbm/entity/effect/EntityFalloutRain.java b/src/main/java/com/hbm/entity/effect/EntityFalloutRain.java index e804a555a..b4f6ccbd1 100644 --- a/src/main/java/com/hbm/entity/effect/EntityFalloutRain.java +++ b/src/main/java/com/hbm/entity/effect/EntityFalloutRain.java @@ -101,6 +101,16 @@ public class EntityFalloutRain extends Entity { if(b.getMaterial() == Material.air) continue; + if(b != ModBlocks.fallout && (worldObj.getBlock(x, y + 1, z) == Blocks.air || worldObj.getBlock(x, y + 1, z).isReplaceable(worldObj, x, y + 1, z))) { + + double d = (double) radProgress / (double) getScale() * 0.5; + + double chance = 0.05 - Math.pow((d - 0.6) * 0.5, 2); + + if(chance >= rand.nextDouble() && ModBlocks.fallout.canPlaceBlockAt(worldObj, x, y + 1, z)) + worldObj.setBlock(x, y + 1, z, ModBlocks.fallout); + } + if(b.isFlammable(worldObj, x, y, z, ForgeDirection.UP)) { if(rand.nextInt(5) == 0) worldObj.setBlock(x, y + 1, z, Blocks.fire); diff --git a/src/main/java/com/hbm/entity/mob/EntityCyberCrab.java b/src/main/java/com/hbm/entity/mob/EntityCyberCrab.java index c967e2782..4d6da1f3e 100644 --- a/src/main/java/com/hbm/entity/mob/EntityCyberCrab.java +++ b/src/main/java/com/hbm/entity/mob/EntityCyberCrab.java @@ -1,10 +1,10 @@ package com.hbm.entity.mob; import com.hbm.entity.projectile.EntityBullet; -import com.hbm.interfaces.IRadiationImmune; import com.hbm.items.ModItems; import com.hbm.lib.ModDamageSource; +import api.hbm.entity.IRadiationImmune; import net.minecraft.command.IEntitySelector; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; diff --git a/src/main/java/com/hbm/entity/mob/EntityHunterChopper.java b/src/main/java/com/hbm/entity/mob/EntityHunterChopper.java index 445be4e5a..de95dfbd6 100644 --- a/src/main/java/com/hbm/entity/mob/EntityHunterChopper.java +++ b/src/main/java/com/hbm/entity/mob/EntityHunterChopper.java @@ -3,10 +3,11 @@ package com.hbm.entity.mob; import com.hbm.entity.particle.EntitySmokeFX; import com.hbm.entity.projectile.EntityBullet; import com.hbm.entity.projectile.EntityChopperMine; -import com.hbm.interfaces.IRadiationImmune; import com.hbm.items.ModItems; import com.hbm.lib.Library; import com.hbm.lib.ModDamageSource; + +import api.hbm.entity.IRadiationImmune; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.Entity; diff --git a/src/main/java/com/hbm/entity/mob/EntityMaskMan.java b/src/main/java/com/hbm/entity/mob/EntityMaskMan.java index 8cb4b3db7..6d3683030 100644 --- a/src/main/java/com/hbm/entity/mob/EntityMaskMan.java +++ b/src/main/java/com/hbm/entity/mob/EntityMaskMan.java @@ -5,10 +5,10 @@ import java.util.List; import com.hbm.entity.mob.ai.EntityAIMaskmanCasualApproach; import com.hbm.entity.mob.ai.EntityAIMaskmanLasergun; import com.hbm.entity.mob.ai.EntityAIMaskmanMinigun; -import com.hbm.interfaces.IRadiationImmune; import com.hbm.items.ModItems; import com.hbm.main.MainRegistry; +import api.hbm.entity.IRadiationImmune; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.EntityAIHurtByTarget; import net.minecraft.entity.ai.EntityAILookIdle; diff --git a/src/main/java/com/hbm/entity/mob/EntityRADBeast.java b/src/main/java/com/hbm/entity/mob/EntityRADBeast.java index 44200eb25..d595f3377 100644 --- a/src/main/java/com/hbm/entity/mob/EntityRADBeast.java +++ b/src/main/java/com/hbm/entity/mob/EntityRADBeast.java @@ -2,12 +2,12 @@ package com.hbm.entity.mob; import java.util.List; -import com.hbm.interfaces.IRadiationImmune; import com.hbm.items.ModItems; import com.hbm.lib.ModDamageSource; import com.hbm.main.MainRegistry; import com.hbm.saveddata.RadiationSavedData; +import api.hbm.entity.IRadiationImmune; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.Entity; diff --git a/src/main/java/com/hbm/entity/mob/EntityTaintedCreeper.java b/src/main/java/com/hbm/entity/mob/EntityTaintedCreeper.java index cb3f45ef1..12db53858 100644 --- a/src/main/java/com/hbm/entity/mob/EntityTaintedCreeper.java +++ b/src/main/java/com/hbm/entity/mob/EntityTaintedCreeper.java @@ -3,8 +3,8 @@ package com.hbm.entity.mob; import com.hbm.blocks.ModBlocks; import com.hbm.config.GeneralConfig; import com.hbm.entity.mob.ai.EntityAITaintedCreeperSwell; -import com.hbm.interfaces.IRadiationImmune; +import api.hbm.entity.IRadiationImmune; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; diff --git a/src/main/java/com/hbm/entity/mob/botprime/EntityBOTPrimeBase.java b/src/main/java/com/hbm/entity/mob/botprime/EntityBOTPrimeBase.java index fae13f40d..56442b50f 100644 --- a/src/main/java/com/hbm/entity/mob/botprime/EntityBOTPrimeBase.java +++ b/src/main/java/com/hbm/entity/mob/botprime/EntityBOTPrimeBase.java @@ -2,8 +2,8 @@ package com.hbm.entity.mob.botprime; import com.hbm.entity.projectile.EntityBulletBase; import com.hbm.handler.BulletConfigSyncingUtil; -import com.hbm.interfaces.IRadiationImmune; +import api.hbm.entity.IRadiationImmune; import net.minecraft.command.IEntitySelector; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; diff --git a/src/main/java/com/hbm/handler/EntityEffectHandler.java b/src/main/java/com/hbm/handler/EntityEffectHandler.java index bc93d2745..095310258 100644 --- a/src/main/java/com/hbm/handler/EntityEffectHandler.java +++ b/src/main/java/com/hbm/handler/EntityEffectHandler.java @@ -68,6 +68,16 @@ public class EntityEffectHandler { ContaminationUtil.applyRadData(entity, RadiationConfig.cont * 0.01F); } } + + if(HbmLivingProps.getRadiation(entity) > 600 && world.getTotalWorldTime() % 600 == 0) { + + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setString("type", "vomit"); + nbt.setInteger("entity", entity.getEntityId()); + PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(nbt, 0, 0, 0), new TargetPoint(entity.dimension, entity.posX, entity.posY, entity.posZ, 25)); + + world.playSoundEffect(ix, iy, iz, "hbm:entity.vomit", 1.0F, 1.0F); + } } private static void handleDigamma(EntityLivingBase entity) { diff --git a/src/main/java/com/hbm/handler/RadiationWorldHandler.java b/src/main/java/com/hbm/handler/RadiationWorldHandler.java index ae7242a2c..dca7a0e54 100644 --- a/src/main/java/com/hbm/handler/RadiationWorldHandler.java +++ b/src/main/java/com/hbm/handler/RadiationWorldHandler.java @@ -2,62 +2,66 @@ package com.hbm.handler; import java.util.Map.Entry; +import com.hbm.blocks.ModBlocks; import com.hbm.config.RadiationConfig; import com.hbm.saveddata.RadiationSavedData; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; +import net.minecraft.network.play.server.S21PacketChunkData; +import net.minecraft.network.play.server.S23PacketBlockChange; import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; import net.minecraft.world.WorldServer; +import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.gen.ChunkProviderServer; public class RadiationWorldHandler { - + public static void handleWorldDestruction(World world) { - + if(!(world instanceof WorldServer)) return; - + if(!RadiationConfig.worldRadEffects) return; - - WorldServer serv = (WorldServer)world; - + + WorldServer serv = (WorldServer) world; + RadiationSavedData data = RadiationSavedData.getData(serv); ChunkProviderServer provider = (ChunkProviderServer) serv.getChunkProvider(); - - int count = 50;//MainRegistry.worldRad; - int threshold = 5;//MainRegistry.worldRadThreshold; - + + int count = 50;// MainRegistry.worldRad; + int threshold = 5;// MainRegistry.worldRadThreshold; + Object[] entries = data.contamination.entrySet().toArray(); - + if(entries.length == 0) return; - + Entry randEnt = (Entry) entries[world.rand.nextInt(entries.length)]; - + ChunkCoordIntPair coords = randEnt.getKey(); - + for(int i = 0; i < 1; i++) { - - + if(randEnt == null || randEnt.getValue() < threshold) continue; - - if(provider.chunkExists(coords.chunkXPos, coords.chunkZPos)) { - for(int a = 0; a < 16; a ++) { - for(int b = 0; b < 16; b ++) { - + if(provider.chunkExists(coords.chunkXPos, coords.chunkZPos)) { + + for(int a = 0; a < 16; a++) { + for(int b = 0; b < 16; b++) { + if(world.rand.nextInt(3) != 0) continue; - + int x = coords.getCenterXPos() - 8 + a; int z = coords.getCenterZPosition() - 8 + b; int y = world.getHeightValue(x, z) - world.rand.nextInt(2); - + if(world.getBlock(x, y, z) == Blocks.grass) { - world.setBlock(x, y, z, Blocks.dirt); + world.setBlock(x, y, z, ModBlocks.waste_earth); } else if(world.getBlock(x, y, z) == Blocks.tallgrass) { world.setBlock(x, y, z, Blocks.air); } else if(world.getBlock(x, y, z) == Blocks.leaves) { diff --git a/src/main/java/com/hbm/inventory/FluidTank.java b/src/main/java/com/hbm/inventory/FluidTank.java index 561a2f4db..d15504e2c 100644 --- a/src/main/java/com/hbm/inventory/FluidTank.java +++ b/src/main/java/com/hbm/inventory/FluidTank.java @@ -1,10 +1,10 @@ package com.hbm.inventory; +import com.hbm.handler.ArmorModHandler; import com.hbm.handler.FluidTypeHandler.FluidType; import com.hbm.interfaces.IPartiallyFillable; import com.hbm.inventory.gui.GuiInfoContainer; import com.hbm.items.ModItems; -import com.hbm.items.armor.JetpackBase; import com.hbm.items.machine.ItemFluidIdentifier; import com.hbm.lib.RefStrings; import com.hbm.packet.PacketDispatcher; @@ -13,6 +13,7 @@ import com.hbm.packet.TEFluidPacket; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.resources.I18n; +import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; @@ -128,22 +129,36 @@ public class FluidTank { ItemStack full = null; if(slots[in] != null) { - if(slots[in].getItem() instanceof IPartiallyFillable) { - IPartiallyFillable fillable = (IPartiallyFillable)slots[in].getItem(); - int speed = fillable.getLoadSpeed(slots[in]); + ItemStack partial = slots[in]; + + if(partial.getItem() instanceof ItemArmor && ArmorModHandler.hasMods(partial)) { - if(fillable.getType(slots[in]) == this.type && speed > 0) { + partial = ArmorModHandler.pryMods(partial)[ArmorModHandler.plate_only]; + + if(partial == null) + return; + } + + if(partial.getItem() instanceof IPartiallyFillable) { + IPartiallyFillable fillable = (IPartiallyFillable)partial.getItem(); + int speed = fillable.getLoadSpeed(partial); + + if(fillable.getType(partial) == this.type && speed > 0) { int toLoad = Math.min(this.fluid, speed); - int fill = fillable.getFill(slots[in]); - toLoad = Math.min(toLoad, fillable.getMaxFill(slots[in]) - fill); + int fill = fillable.getFill(partial); + toLoad = Math.min(toLoad, fillable.getMaxFill(partial) - fill); if(toLoad > 0) { this.fluid -= toLoad; - fillable.setFill(slots[in], fill + toLoad); + fillable.setFill(partial, fill + toLoad); } } + if(slots[in].getItem() instanceof ItemArmor) { + ArmorModHandler.applyMod(slots[in], partial); + } + return; } diff --git a/src/main/java/com/hbm/inventory/container/ContainerArmorTable.java b/src/main/java/com/hbm/inventory/container/ContainerArmorTable.java index f0086f3b5..1c80d3fbc 100644 --- a/src/main/java/com/hbm/inventory/container/ContainerArmorTable.java +++ b/src/main/java/com/hbm/inventory/container/ContainerArmorTable.java @@ -93,6 +93,51 @@ public class ContainerArmorTable extends Container { return true; } + @Override + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) { + ItemStack var3 = null; + Slot var4 = (Slot) this.inventorySlots.get(par2); + + if(var4 != null && var4.getHasStack()) { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); + + if(par2 <= 8) { + if(!this.mergeItemStack(var5, 9, this.inventorySlots.size(), true)) { + return null; + } else { + var4.onPickupFromSlot(p_82846_1_, var5); + } + } else { + + if(var5.getItem() instanceof ItemArmor) { + if(!this.mergeItemStack(var5, 8, 9, false)) + return null; + + } else if(this.inventorySlots.get(8) != null && var5.getItem() instanceof ItemArmorMod) { + + ItemArmorMod mod = (ItemArmorMod)var5.getItem(); + int slot = mod.type; + + if(((Slot) this.inventorySlots.get(slot)).isItemValid(var5)) { + if(!this.mergeItemStack(var5, slot, slot + 1, false)) + return null; + } else { + return null; + } + } + } + + if(var5.stackSize == 0) { + var4.putStack((ItemStack) null); + } else { + var4.onSlotChanged(); + } + } + + return var3; + } + @Override public void onContainerClosed(EntityPlayer player) { super.onContainerClosed(player); diff --git a/src/main/java/com/hbm/inventory/container/ContainerCrystallizer.java b/src/main/java/com/hbm/inventory/container/ContainerCrystallizer.java index bae2fa4b9..374d5aad2 100644 --- a/src/main/java/com/hbm/inventory/container/ContainerCrystallizer.java +++ b/src/main/java/com/hbm/inventory/container/ContainerCrystallizer.java @@ -11,13 +11,12 @@ import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; public class ContainerCrystallizer extends Container { - + private TileEntityMachineCrystallizer diFurnace; - + public ContainerCrystallizer(InventoryPlayer invPlayer, TileEntityMachineCrystallizer tedf) { diFurnace = tedf; - this.addSlotToContainer(new Slot(tedf, 0, 80, 35)); this.addSlotToContainer(new Slot(tedf, 1, 8, 53)); this.addSlotToContainer(new SlotMachineOutput(tedf, 2, 140, 35)); @@ -25,57 +24,48 @@ public class ContainerCrystallizer extends Container { this.addSlotToContainer(new SlotMachineOutput(tedf, 4, 26, 53)); this.addSlotToContainer(new SlotUpgrade(tedf, 5, 98, 17)); this.addSlotToContainer(new SlotUpgrade(tedf, 6, 116, 17)); - - for(int i = 0; i < 3; i++) - { - for(int j = 0; j < 9; j++) - { + + for(int i = 0; i < 3; i++) { + for(int j = 0; j < 9; j++) { this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); } } - - for(int i = 0; i < 9; i++) - { + + for(int i = 0; i < 9; i++) { this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142)); } } - + @Override - public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) - { + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) { ItemStack var3 = null; Slot var4 = (Slot) this.inventorySlots.get(par2); - - if (var4 != null && var4.getHasStack()) - { + + if(var4 != null && var4.getHasStack()) { ItemStack var5 = var4.getStack(); var3 = var5.copy(); - - if (par2 <= diFurnace.getSizeInventory() - 1) { - if (!this.mergeItemStack(var5, diFurnace.getSizeInventory(), this.inventorySlots.size(), true)) - { + + if(par2 <= diFurnace.getSizeInventory() - 1) { + if(!this.mergeItemStack(var5, diFurnace.getSizeInventory(), this.inventorySlots.size(), true)) { return null; } } else { - - if (!this.mergeItemStack(var5, 0, 2, false)) - if (!this.mergeItemStack(var5, 3, 4, false)) - if (!this.mergeItemStack(var5, 5, 7, false)) + + if(!this.mergeItemStack(var5, 0, 2, false)) + if(!this.mergeItemStack(var5, 3, 4, false)) + if(!this.mergeItemStack(var5, 5, 7, false)) return null; } - - if (var5.stackSize == 0) - { + + if(var5.stackSize == 0) { var4.putStack((ItemStack) null); - } - else - { + } else { var4.onSlotChanged(); } } - + return var3; - } + } @Override public boolean canInteractWith(EntityPlayer player) { diff --git a/src/main/java/com/hbm/items/ModItems.java b/src/main/java/com/hbm/items/ModItems.java index d0261dfe2..d11e1268a 100644 --- a/src/main/java/com/hbm/items/ModItems.java +++ b/src/main/java/com/hbm/items/ModItems.java @@ -249,6 +249,7 @@ public class ModItems { public static Item powder_uranium; public static Item powder_plutonium; public static Item dust; + public static Item fallout; public static Item powder_power; public static Item powder_thorium; @@ -1825,6 +1826,7 @@ public class ModItems { public static Item bathwater; public static Item bathwater_mk2; public static Item spider_milk; + public static Item ink; public static Item heart_piece; public static Item heart_container; public static Item heart_booster; @@ -2321,6 +2323,7 @@ public class ModItems { powder_uranium = new ItemRadioactive(0.5F, true).setUnlocalizedName("powder_uranium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_uranium"); powder_plutonium = new ItemRadioactive(2.5F, true).setUnlocalizedName("powder_plutonium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_plutonium"); dust = new ItemCustomLore().setUnlocalizedName("dust").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":dust"); + fallout = new ItemRadioactive(0.1F).setUnlocalizedName("fallout").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":fallout"); powder_advanced_alloy = new Item().setUnlocalizedName("powder_advanced_alloy").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_advanced_alloy"); powder_coal = new Item().setUnlocalizedName("powder_coal").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_coal"); powder_combine_steel = new Item().setUnlocalizedName("powder_combine_steel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_combine_steel"); @@ -2746,6 +2749,7 @@ public class ModItems { bathwater = new ItemModBathwater().setUnlocalizedName("bathwater").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":bathwater"); bathwater_mk2 = new ItemModBathwater().setUnlocalizedName("bathwater_mk2").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":bathwater_mk2"); spider_milk = new ItemModMilk().setUnlocalizedName("spider_milk").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":spider_milk"); + ink = new ItemModInk().setUnlocalizedName("ink").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":ink"); heart_piece = new ItemModHealth(5F).setUnlocalizedName("heart_piece").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":heart_piece"); heart_container = new ItemModHealth(20F).setUnlocalizedName("heart_container").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":heart_container"); heart_booster = new ItemModHealth(40F).setUnlocalizedName("heart_booster").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":heart_booster"); @@ -3938,12 +3942,16 @@ public class ModItems { fau_helmet = new ArmorDigamma(aMatFau, 7, 0, RefStrings.MODID + ":textures/armor/starmetal_1.png", 1000000, 10000, 2500, 0).setMod(0.25F).setCap(4.0F).setThreshold(2.0F) .addEffect(new PotionEffect(Potion.moveSpeed.id, 20, 1)) .addEffect(new PotionEffect(Potion.jump.id, 20, 0)) - .setBlastProtection(0.25F) - .setMod(0.2F) + .setBlastProtection(0.1F) + .setMod(0.1F) .setHasGeigerSound(true) .setHasCustomGeiger(true) + .enableThermalSight(true) + .setStep("hbm:step.metal") + .setJump("hbm:step.iron_jump") + .setFall("hbm:step.iron_land") .addResistance("fall", 0.5F) - .addResistance("onFire", 0F).setUnlocalizedName("fau_helmet").setTextureName(RefStrings.MODID + ":fau_helmet"); + .setFireproof(true).setUnlocalizedName("fau_helmet").setTextureName(RefStrings.MODID + ":fau_helmet"); fau_plate = new ArmorDigamma(aMatFau, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 1000000, 10000, 2500, 0).cloneStats((ArmorFSB) fau_helmet).setUnlocalizedName("fau_plate").setTextureName(RefStrings.MODID + ":fau_plate"); fau_legs = new ArmorDigamma(aMatFau, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 1000000, 10000, 2500, 0).cloneStats((ArmorFSB) fau_helmet).setUnlocalizedName("fau_legs").setTextureName(RefStrings.MODID + ":fau_legs"); fau_boots = new ArmorDigamma(aMatFau, 7, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png", 1000000, 10000, 2500, 0).cloneStats((ArmorFSB) fau_helmet).setUnlocalizedName("fau_boots").setTextureName(RefStrings.MODID + ":fau_boots"); @@ -4574,6 +4582,7 @@ public class ModItems { GameRegistry.registerItem(powder_dineutronium, powder_dineutronium.getUnlocalizedName()); GameRegistry.registerItem(redstone_depleted, redstone_depleted.getUnlocalizedName()); GameRegistry.registerItem(dust, dust.getUnlocalizedName()); + GameRegistry.registerItem(fallout, fallout.getUnlocalizedName()); GameRegistry.registerItem(powder_steel_tiny, powder_steel_tiny.getUnlocalizedName()); GameRegistry.registerItem(powder_lithium_tiny, powder_lithium_tiny.getUnlocalizedName()); GameRegistry.registerItem(powder_neodymium_tiny, powder_neodymium_tiny.getUnlocalizedName()); @@ -6189,6 +6198,7 @@ public class ModItems { GameRegistry.registerItem(bathwater, bathwater.getUnlocalizedName()); GameRegistry.registerItem(bathwater_mk2, bathwater_mk2.getUnlocalizedName()); GameRegistry.registerItem(spider_milk, spider_milk.getUnlocalizedName()); + GameRegistry.registerItem(ink, ink.getUnlocalizedName()); GameRegistry.registerItem(heart_piece, heart_piece.getUnlocalizedName()); GameRegistry.registerItem(heart_container, heart_container.getUnlocalizedName()); GameRegistry.registerItem(heart_booster, heart_booster.getUnlocalizedName()); diff --git a/src/main/java/com/hbm/items/armor/ArmorFSB.java b/src/main/java/com/hbm/items/armor/ArmorFSB.java index 172e88c78..166ecc014 100644 --- a/src/main/java/com/hbm/items/armor/ArmorFSB.java +++ b/src/main/java/com/hbm/items/armor/ArmorFSB.java @@ -25,7 +25,6 @@ import net.minecraft.client.resources.I18n; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; diff --git a/src/main/java/com/hbm/items/armor/ArmorFSBPowered.java b/src/main/java/com/hbm/items/armor/ArmorFSBPowered.java index c23e22600..41bda725e 100644 --- a/src/main/java/com/hbm/items/armor/ArmorFSBPowered.java +++ b/src/main/java/com/hbm/items/armor/ArmorFSBPowered.java @@ -130,6 +130,8 @@ public class ArmorFSBPowered extends ArmorFSB implements IBatteryItem { public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { + super.onArmorTick(world, player, itemStack); + if(this.drain > 0 && ArmorFSB.hasFSBArmor(player) && !player.capabilities.isCreativeMode) { this.dischargeBattery(itemStack, drain); } diff --git a/src/main/java/com/hbm/items/armor/ItemModInk.java b/src/main/java/com/hbm/items/armor/ItemModInk.java new file mode 100644 index 000000000..f8604c8f2 --- /dev/null +++ b/src/main/java/com/hbm/items/armor/ItemModInk.java @@ -0,0 +1,48 @@ +package com.hbm.items.armor; + +import java.util.List; + +import com.hbm.handler.ArmorModHandler; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.event.entity.living.LivingHurtEvent; + +public class ItemModInk extends ItemArmorMod { + + public ItemModInk() { + super(ArmorModHandler.extra, true, true, true, true); + } + + @Override + public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) { + + list.add(EnumChatFormatting.LIGHT_PURPLE + "10% chance to nullify damage"); + list.add(EnumChatFormatting.LIGHT_PURPLE + "Flowers!"); + list.add(""); + super.addInformation(itemstack, player, list, bool); + } + + @Override + public void addDesc(List list, ItemStack stack, ItemStack armor) { + list.add(EnumChatFormatting.LIGHT_PURPLE + " " + stack.getDisplayName() + " (10% chance to nullify damage)"); + } + + @Override + public void modDamage(LivingHurtEvent event, ItemStack armor) { + + if(event.entity.worldObj.rand.nextInt(10) == 0) { + event.ammount = 0; + + if(!event.entity.worldObj.isRemote) { + + if(event.entity.worldObj.rand.nextInt(10) == 0) + event.entity.entityDropItem(new ItemStack(Blocks.yellow_flower), 1.0F); + + event.entity.entityDropItem(new ItemStack(Blocks.red_flower, 1, event.entity.worldObj.rand.nextInt(9)), 1.0F); + } + } + } +} diff --git a/src/main/java/com/hbm/items/special/ItemSyringe.java b/src/main/java/com/hbm/items/special/ItemSyringe.java index 4eea86d1f..4467986be 100644 --- a/src/main/java/com/hbm/items/special/ItemSyringe.java +++ b/src/main/java/com/hbm/items/special/ItemSyringe.java @@ -3,9 +3,9 @@ package com.hbm.items.special; import java.util.List; import java.util.Random; -import com.hbm.handler.FluidTypeHandler.FluidType; +import com.hbm.handler.ArmorModHandler; +import com.hbm.interfaces.IPartiallyFillable; import com.hbm.items.ModItems; -import com.hbm.items.armor.JetpackBase; import com.hbm.items.weapon.ItemGunBase; import com.hbm.lib.ModDamageSource; import com.hbm.potion.HbmPotion; @@ -16,578 +16,495 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; public class ItemSyringe extends Item { - + Random rand = new Random(); @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { - - if(this == ModItems.syringe_antidote) - { - if (!world.isRemote) - { - player.clearActivePotions(); - - stack.stackSize--; - world.playSoundAtEntity(player, "hbm:item.syringe", 1.0F, 1.0F); - if (stack.stackSize <= 0) - { - return new ItemStack(ModItems.syringe_empty); - } + if(this == ModItems.syringe_antidote) { + if(!world.isRemote) { + player.clearActivePotions(); - if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_empty))) - { - player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_empty, 1, 0), false); - } - } + stack.stackSize--; + world.playSoundAtEntity(player, "hbm:item.syringe", 1.0F, 1.0F); + + if(stack.stackSize <= 0) { + return new ItemStack(ModItems.syringe_empty); + } + + if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_empty))) { + player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_empty, 1, 0), false); + } + } } - - if(this == ModItems.syringe_awesome) - { - if (!world.isRemote) - { - player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 50 * 20, 9)); - player.addPotionEffect(new PotionEffect(Potion.resistance.id, 50 * 20, 9)); - player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 50 * 20, 0)); - player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 50 * 20, 24)); - player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 50 * 20, 9)); - player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 50 * 20, 6)); - player.addPotionEffect(new PotionEffect(Potion.jump.id, 50 * 20, 9)); - player.addPotionEffect(new PotionEffect(Potion.field_76434_w.id, 50 * 20, 9)); - player.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 50 * 20, 4)); - player.addPotionEffect(new PotionEffect(Potion.confusion.id, 5 * 20, 4)); - player.addPotionEffect(new PotionEffect(HbmPotion.radx.id, 50 * 20, 9)); - - stack.stackSize--; - world.playSoundAtEntity(player, "hbm:item.syringe", 1.0F, 1.0F); - if (stack.stackSize <= 0) - { - return new ItemStack(ModItems.syringe_empty); - } + if(this == ModItems.syringe_awesome) { + if(!world.isRemote) { + player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 50 * 20, 9)); + player.addPotionEffect(new PotionEffect(Potion.resistance.id, 50 * 20, 9)); + player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 50 * 20, 0)); + player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 50 * 20, 24)); + player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 50 * 20, 9)); + player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 50 * 20, 6)); + player.addPotionEffect(new PotionEffect(Potion.jump.id, 50 * 20, 9)); + player.addPotionEffect(new PotionEffect(Potion.field_76434_w.id, 50 * 20, 9)); + player.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 50 * 20, 4)); + player.addPotionEffect(new PotionEffect(Potion.confusion.id, 5 * 20, 4)); + player.addPotionEffect(new PotionEffect(HbmPotion.radx.id, 50 * 20, 9)); - if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_empty))) - { - player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_empty, 1, 0), false); - } - } + stack.stackSize--; + world.playSoundAtEntity(player, "hbm:item.syringe", 1.0F, 1.0F); + + if(stack.stackSize <= 0) { + return new ItemStack(ModItems.syringe_empty); + } + + if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_empty))) { + player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_empty, 1, 0), false); + } + } } - - if(this == ModItems.syringe_poison) - { - if (!world.isRemote) - { - if(rand.nextInt(2) == 0) - player.attackEntityFrom(ModDamageSource.euthanizedSelf, 30); - else - player.attackEntityFrom(ModDamageSource.euthanizedSelf2, 30); - - stack.stackSize--; - world.playSoundAtEntity(player, "hbm:item.syringe", 1.0F, 1.0F); - if (stack.stackSize <= 0) - { - return new ItemStack(ModItems.syringe_empty); - } + if(this == ModItems.syringe_poison) { + if(!world.isRemote) { + if(rand.nextInt(2) == 0) + player.attackEntityFrom(ModDamageSource.euthanizedSelf, 30); + else + player.attackEntityFrom(ModDamageSource.euthanizedSelf2, 30); - if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_empty))) - { - player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_empty, 1, 0), false); - } - } - } - - if(this == ModItems.syringe_metal_stimpak) - { - if (!world.isRemote) - { - player.heal(5); - - stack.stackSize--; - world.playSoundAtEntity(player, "hbm:item.syringe", 1.0F, 1.0F); + stack.stackSize--; + world.playSoundAtEntity(player, "hbm:item.syringe", 1.0F, 1.0F); - if (stack.stackSize <= 0) - { - return new ItemStack(ModItems.syringe_metal_empty); - } + if(stack.stackSize <= 0) { + return new ItemStack(ModItems.syringe_empty); + } - if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) - { - player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false); - } - } + if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_empty))) { + player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_empty, 1, 0), false); + } + } } - - if(this == ModItems.syringe_metal_medx) - { - if (!world.isRemote) - { - player.addPotionEffect(new PotionEffect(Potion.resistance.id, 4 * 60 * 20, 2)); - - stack.stackSize--; - world.playSoundAtEntity(player, "hbm:item.syringe", 1.0F, 1.0F); - if (stack.stackSize <= 0) - { - return new ItemStack(ModItems.syringe_metal_empty); - } + if(this == ModItems.syringe_metal_stimpak) { + if(!world.isRemote) { + player.heal(5); - if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) - { - player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false); - } - } - } - - if(this == ModItems.syringe_metal_psycho) - { - 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)); - - stack.stackSize--; - world.playSoundAtEntity(player, "hbm:item.syringe", 1.0F, 1.0F); + stack.stackSize--; + world.playSoundAtEntity(player, "hbm:item.syringe", 1.0F, 1.0F); - if (stack.stackSize <= 0) - { - return new ItemStack(ModItems.syringe_metal_empty); - } + if(stack.stackSize <= 0) { + return new ItemStack(ModItems.syringe_metal_empty); + } - if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) - { - player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false); - } - } + if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) { + player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false); + } + } } - - if(this == ModItems.syringe_metal_super) - { - if (!world.isRemote) - { - player.heal(25); - player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 10 * 20, 0)); - - stack.stackSize--; - world.playSoundAtEntity(player, "hbm:item.syringe", 1.0F, 1.0F); - if (stack.stackSize <= 0) - { - return new ItemStack(ModItems.syringe_metal_empty); - } + if(this == ModItems.syringe_metal_medx) { + if(!world.isRemote) { + player.addPotionEffect(new PotionEffect(Potion.resistance.id, 4 * 60 * 20, 2)); - if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) - { - player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false); - } - } - } - - if(this == ModItems.med_bag) - { - if (!world.isRemote) - { - player.setHealth(player.getMaxHealth()); - - player.removePotionEffect(Potion.blindness.id); - player.removePotionEffect(Potion.confusion.id); - player.removePotionEffect(Potion.digSlowdown.id); - player.removePotionEffect(Potion.hunger.id); - player.removePotionEffect(Potion.moveSlowdown.id); - player.removePotionEffect(Potion.poison.id); - player.removePotionEffect(Potion.weakness.id); - player.removePotionEffect(Potion.wither.id); - player.removePotionEffect(HbmPotion.radiation.id); - - stack.stackSize--; - } - } - - if(this == ModItems.radaway) - { - if (!world.isRemote) - { - player.addPotionEffect(new PotionEffect(HbmPotion.radaway.id, 14, 9)); - - stack.stackSize--; - world.playSoundAtEntity(player, "hbm:item.radaway", 1.0F, 1.0F); - } - } - - if(this == ModItems.radaway_strong) - { - if (!world.isRemote) - { - int duration = 35; - int level = 9; - - if(!player.isPotionActive(HbmPotion.radaway)) { - player.addPotionEffect(new PotionEffect(HbmPotion.radaway.id, duration, level)); - } else { - - int d = player.getActivePotionEffect(HbmPotion.radaway).getDuration() + duration; - player.addPotionEffect(new PotionEffect(HbmPotion.radaway.id, d, level)); - } - - stack.stackSize--; - world.playSoundAtEntity(player, "hbm:item.radaway", 1.0F, 1.0F); - } - } - - if(this == ModItems.radaway_flush) - { - if (!world.isRemote) - { - player.addPotionEffect(new PotionEffect(HbmPotion.radaway.id, 50, 19)); - - stack.stackSize--; - world.playSoundAtEntity(player, "hbm:item.radaway", 1.0F, 1.0F); - } - } - - if(this == ModItems.syringe_taint) - { - if (!world.isRemote) - { - player.addPotionEffect(new PotionEffect(HbmPotion.taint.id, 60 * 20, 0)); - player.addPotionEffect(new PotionEffect(Potion.confusion.id, 5 * 20, 0)); - - stack.stackSize--; - world.playSoundAtEntity(player, "hbm:item.syringe", 1.0F, 1.0F); - } + stack.stackSize--; + world.playSoundAtEntity(player, "hbm:item.syringe", 1.0F, 1.0F); - if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) - { - player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false); - } + if(stack.stackSize <= 0) { + return new ItemStack(ModItems.syringe_metal_empty); + } - if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle2_empty))) - { - player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.bottle2_empty, 1, 0), false); - } + if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) { + player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false); + } + } } - - if(this == ModItems.gas_mask_filter && player.inventory.armorInventory[3] != null && - (player.inventory.armorInventory[3].getItem() == ModItems.gas_mask || player.inventory.armorInventory[3].getItem() == ModItems.gas_mask_m65)) - { - if (!world.isRemote) - { - if(player.inventory.armorInventory[3].getItemDamage() == 0) - return stack; - - player.inventory.armorInventory[3].setItemDamage(0); - world.playSoundAtEntity(player, "hbm:item.gasmaskScrew", 1.0F, 1.0F); - stack.stackSize--; - } - } - - if(this == ModItems.jetpack_tank && player.inventory.armorInventory[2] != null && player.inventory.armorInventory[2].getItem() instanceof JetpackBase) { - if (!world.isRemote) - { - ItemStack jetpack = player.inventory.armorInventory[2]; - JetpackBase jetItem = (JetpackBase) jetpack.getItem(); - - if(jetItem.fuel != FluidType.KEROSENE) - return stack; - - int fill = JetpackBase.getFuel(jetpack) + 1000; + if(this == ModItems.syringe_metal_psycho) { + 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)); - if(fill > jetItem.maxFuel) - fill = jetItem.maxFuel; - - if(JetpackBase.getFuel(jetpack) == fill) - return stack; - - JetpackBase.setFuel(jetpack, fill); - world.playSoundAtEntity(player, "hbm:item.jetpackTank", 1.0F, 1.0F); - - stack.stackSize--; - } + stack.stackSize--; + world.playSoundAtEntity(player, "hbm:item.syringe", 1.0F, 1.0F); + + if(stack.stackSize <= 0) { + return new ItemStack(ModItems.syringe_metal_empty); + } + + if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) { + player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false); + } + } } - - if(this == ModItems.gun_kit_1 || this == ModItems.gun_kit_2) - { - if (!world.isRemote) - { - float repair = 0; - - if(this == ModItems.gun_kit_1) { - repair = 0.1F; - world.playSoundAtEntity(player, "hbm:item.spray", 1.0F, 1.0F); - } - if(this == ModItems.gun_kit_2) { - repair = 0.5F; - world.playSoundAtEntity(player, "hbm:item.repair", 1.0F, 1.0F); - } - - for(int i = 0; i < 9; i++) { - - ItemStack gun = player.inventory.mainInventory[i]; - - if(gun != null && gun.getItem() instanceof ItemGunBase) { - - int full = ((ItemGunBase)gun.getItem()).mainConfig.durability; - int wear = ItemGunBase.getItemWear(gun); - - int nWear = (int) (wear - (full * repair)); - - if(nWear < 0) - nWear = 0; - - ItemGunBase.setItemWear(gun, nWear); - } - } - - stack.stackSize--; - } + + if(this == ModItems.syringe_metal_super) { + if(!world.isRemote) { + player.heal(25); + player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 10 * 20, 0)); + + stack.stackSize--; + world.playSoundAtEntity(player, "hbm:item.syringe", 1.0F, 1.0F); + + if(stack.stackSize <= 0) { + return new ItemStack(ModItems.syringe_metal_empty); + } + + if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) { + player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false); + } + } } - - if(this == ModItems.cbt_device) - { - if (!world.isRemote) - { - player.addPotionEffect(new PotionEffect(HbmPotion.bang.id, 30, 0)); - - stack.stackSize--; - world.playSoundAtEntity(player, "hbm:item.vice", 1.0F, 1.0F); - } + + if(this == ModItems.med_bag) { + if(!world.isRemote) { + player.setHealth(player.getMaxHealth()); + + player.removePotionEffect(Potion.blindness.id); + player.removePotionEffect(Potion.confusion.id); + player.removePotionEffect(Potion.digSlowdown.id); + player.removePotionEffect(Potion.hunger.id); + player.removePotionEffect(Potion.moveSlowdown.id); + player.removePotionEffect(Potion.poison.id); + player.removePotionEffect(Potion.weakness.id); + player.removePotionEffect(Potion.wither.id); + player.removePotionEffect(HbmPotion.radiation.id); + + stack.stackSize--; + } } - + + if(this == ModItems.radaway) { + if(!world.isRemote) { + player.addPotionEffect(new PotionEffect(HbmPotion.radaway.id, 14, 9)); + + stack.stackSize--; + world.playSoundAtEntity(player, "hbm:item.radaway", 1.0F, 1.0F); + } + } + + if(this == ModItems.radaway_strong) { + if(!world.isRemote) { + int duration = 35; + int level = 9; + + if(!player.isPotionActive(HbmPotion.radaway)) { + player.addPotionEffect(new PotionEffect(HbmPotion.radaway.id, duration, level)); + } else { + + int d = player.getActivePotionEffect(HbmPotion.radaway).getDuration() + duration; + player.addPotionEffect(new PotionEffect(HbmPotion.radaway.id, d, level)); + } + + stack.stackSize--; + world.playSoundAtEntity(player, "hbm:item.radaway", 1.0F, 1.0F); + } + } + + if(this == ModItems.radaway_flush) { + if(!world.isRemote) { + player.addPotionEffect(new PotionEffect(HbmPotion.radaway.id, 50, 19)); + + stack.stackSize--; + world.playSoundAtEntity(player, "hbm:item.radaway", 1.0F, 1.0F); + } + } + + if(this == ModItems.syringe_taint) { + if(!world.isRemote) { + player.addPotionEffect(new PotionEffect(HbmPotion.taint.id, 60 * 20, 0)); + player.addPotionEffect(new PotionEffect(Potion.confusion.id, 5 * 20, 0)); + + stack.stackSize--; + world.playSoundAtEntity(player, "hbm:item.syringe", 1.0F, 1.0F); + } + + if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) { + player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false); + } + + if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle2_empty))) { + player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.bottle2_empty, 1, 0), false); + } + } + + if(this == ModItems.gas_mask_filter && player.inventory.armorInventory[3] != null && (player.inventory.armorInventory[3].getItem() == ModItems.gas_mask || player.inventory.armorInventory[3].getItem() == ModItems.gas_mask_m65)) { + if(!world.isRemote) { + if(player.inventory.armorInventory[3].getItemDamage() == 0) + return stack; + + player.inventory.armorInventory[3].setItemDamage(0); + + world.playSoundAtEntity(player, "hbm:item.gasmaskScrew", 1.0F, 1.0F); + stack.stackSize--; + } + } + + if(this == ModItems.jetpack_tank && player.inventory.armorInventory[2] != null) { + + if(!world.isRemote) { + + ItemStack jetpack = player.inventory.armorInventory[2]; + + if(jetpack == null) + return stack; + + if(jetpack.getItem() instanceof ItemArmor && ArmorModHandler.hasMods(jetpack)) { + jetpack = ArmorModHandler.pryMods(jetpack)[ArmorModHandler.plate_only]; + + if(jetpack == null || !(jetpack.getItem() instanceof IPartiallyFillable)) + return stack; + } + + IPartiallyFillable fillable = (IPartiallyFillable) jetpack.getItem(); + int fill = Math.min(fillable.getFill(jetpack) + 1000, fillable.getMaxFill(jetpack)); + fillable.setFill(jetpack, fill); + + if(jetpack.getItem() != player.inventory.armorInventory[2].getItem()) + ArmorModHandler.applyMod(player.inventory.armorInventory[2], jetpack); + + world.playSoundAtEntity(player, "hbm:item.jetpackTank", 1.0F, 1.0F); + + stack.stackSize--; + } + } + + if(this == ModItems.gun_kit_1 || this == ModItems.gun_kit_2) { + if(!world.isRemote) { + float repair = 0; + + if(this == ModItems.gun_kit_1) { + repair = 0.1F; + world.playSoundAtEntity(player, "hbm:item.spray", 1.0F, 1.0F); + } + if(this == ModItems.gun_kit_2) { + repair = 0.5F; + world.playSoundAtEntity(player, "hbm:item.repair", 1.0F, 1.0F); + } + + for(int i = 0; i < 9; i++) { + + ItemStack gun = player.inventory.mainInventory[i]; + + if(gun != null && gun.getItem() instanceof ItemGunBase) { + + int full = ((ItemGunBase) gun.getItem()).mainConfig.durability; + int wear = ItemGunBase.getItemWear(gun); + + int nWear = (int) (wear - (full * repair)); + + if(nWear < 0) + nWear = 0; + + ItemGunBase.setItemWear(gun, nWear); + } + } + + stack.stackSize--; + } + } + + if(this == ModItems.cbt_device) { + if(!world.isRemote) { + player.addPotionEffect(new PotionEffect(HbmPotion.bang.id, 30, 0)); + + stack.stackSize--; + world.playSoundAtEntity(player, "hbm:item.vice", 1.0F, 1.0F); + } + } + return stack; } - @Override - @SideOnly(Side.CLIENT) - public boolean hasEffect(ItemStack p_77636_1_) - { - if(this == ModItems.syringe_awesome) - { - return true; - } - - return false; - } - - @Override - public EnumRarity getRarity(ItemStack p_77613_1_) - { - if(this == ModItems.syringe_awesome) - { - return EnumRarity.uncommon; - } - if(this == ModItems.euphemium_stopper) - { - return EnumRarity.epic; - } - - return EnumRarity.common; - } - - @Override - public boolean hitEntity(ItemStack stack, EntityLivingBase entity, EntityLivingBase entityPlayer) - { - World world = entity.worldObj; - - if(this == ModItems.syringe_antidote) - { - if (!world.isRemote) - { - entity.clearActivePotions(); - - stack.stackSize--; - world.playSoundAtEntity(entity, "hbm:item.syringe", 1.0F, 1.0F); - - if(entityPlayer instanceof EntityPlayer) - { - EntityPlayer player = (EntityPlayer)entityPlayer; - if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_empty))) - { - player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_empty, 1, 0), false); - } - } - } - } - - if(this == ModItems.syringe_awesome) - { - if (!world.isRemote) - { - entity.addPotionEffect(new PotionEffect(Potion.regeneration.id, 50 * 20, 9)); - entity.addPotionEffect(new PotionEffect(Potion.resistance.id, 50 * 20, 9)); - entity.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 50 * 20, 0)); - entity.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 50 * 20, 24)); - entity.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 50 * 20, 9)); - entity.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 50 * 20, 6)); - entity.addPotionEffect(new PotionEffect(Potion.jump.id, 50 * 20, 9)); - entity.addPotionEffect(new PotionEffect(Potion.field_76434_w.id, 50 * 20, 9)); - entity.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 50 * 20, 4)); - entity.addPotionEffect(new PotionEffect(Potion.confusion.id, 5 * 20, 4)); - - stack.stackSize--; - world.playSoundAtEntity(entity, "hbm:item.syringe", 1.0F, 1.0F); - - if(entityPlayer instanceof EntityPlayer) - { - EntityPlayer player = (EntityPlayer)entityPlayer; - if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_empty))) - { - player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_empty, 1, 0), false); - } - } - } - } - - if(this == ModItems.syringe_poison) - { - if (!world.isRemote) - { - entity.attackEntityFrom(ModDamageSource.euthanized(entityPlayer, entityPlayer), 30); - - stack.stackSize--; - world.playSoundAtEntity(entity, "hbm:item.syringe", 1.0F, 1.0F); - - if(entityPlayer instanceof EntityPlayer) - { - EntityPlayer player = (EntityPlayer)entityPlayer; - if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_empty))) - { - player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_empty, 1, 0), false); - } - } - } - } - - if(this == ModItems.syringe_metal_stimpak) - { - if (!world.isRemote) - { - entity.heal(5); - - stack.stackSize--; - world.playSoundAtEntity(entity, "hbm:item.syringe", 1.0F, 1.0F); - - if(entityPlayer instanceof EntityPlayer) - { - EntityPlayer player = (EntityPlayer)entityPlayer; - if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) - { - player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false); - } - } - } - } - - if(this == ModItems.syringe_metal_medx) - { - if (!world.isRemote) - { - entity.addPotionEffect(new PotionEffect(Potion.resistance.id, 4 * 60 * 20, 2)); - - stack.stackSize--; - world.playSoundAtEntity(entity, "hbm:item.syringe", 1.0F, 1.0F); - - if(entityPlayer instanceof EntityPlayer) - { - EntityPlayer player = (EntityPlayer)entityPlayer; - if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) - { - player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false); - } - } - } - } - - if(this == ModItems.syringe_metal_psycho) - { - if (!world.isRemote) - { - entity.addPotionEffect(new PotionEffect(Potion.resistance.id, 2 * 60 * 20, 0)); - entity.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 2 * 60 * 20, 0)); - - stack.stackSize--; - world.playSoundAtEntity(entity, "hbm:item.syringe", 1.0F, 1.0F); - - if(entityPlayer instanceof EntityPlayer) - { - EntityPlayer player = (EntityPlayer)entityPlayer; - if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) - { - player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false); - } - } - } - } - - if(this == ModItems.syringe_metal_super) - { - if (!world.isRemote) - { - entity.heal(25); - entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 10 * 20, 0)); - - stack.stackSize--; - world.playSoundAtEntity(entity, "hbm:item.syringe", 1.0F, 1.0F); - - if(entityPlayer instanceof EntityPlayer) - { - EntityPlayer player = (EntityPlayer)entityPlayer; - if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) - { - player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false); - } - } - } - } - - if(this == ModItems.syringe_taint) - { - if (!world.isRemote) - { - entity.addPotionEffect(new PotionEffect(HbmPotion.taint.id, 60 * 20, 0)); - entity.addPotionEffect(new PotionEffect(Potion.confusion.id, 5 * 20, 0)); - - stack.stackSize--; - world.playSoundAtEntity(entity, "hbm:item.syringe", 1.0F, 1.0F); - - if(entityPlayer instanceof EntityPlayer) - { - EntityPlayer player = (EntityPlayer)entityPlayer; - if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) - { - player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false); - } - if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle2_empty))) - { - player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.bottle2_empty, 1, 0), false); - } - } - } - } - - if(this == ModItems.euphemium_stopper) - { - if (!world.isRemote) - { - entity.addPotionEffect(new PotionEffect(Potion.weakness.id, 30 * 20, 9)); - entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 30 * 20, 9)); - entity.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 30 * 20, 9)); - } - } - - return false; - } - @Override - public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) - { + @SideOnly(Side.CLIENT) + public boolean hasEffect(ItemStack p_77636_1_) { + if(this == ModItems.syringe_awesome) { + return true; + } + + return false; + } + + @Override + public EnumRarity getRarity(ItemStack p_77613_1_) { + if(this == ModItems.syringe_awesome) { + return EnumRarity.uncommon; + } + if(this == ModItems.euphemium_stopper) { + return EnumRarity.epic; + } + + return EnumRarity.common; + } + + @Override + public boolean hitEntity(ItemStack stack, EntityLivingBase entity, EntityLivingBase entityPlayer) { + World world = entity.worldObj; + + if(this == ModItems.syringe_antidote) { + if(!world.isRemote) { + entity.clearActivePotions(); + + stack.stackSize--; + world.playSoundAtEntity(entity, "hbm:item.syringe", 1.0F, 1.0F); + + if(entityPlayer instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) entityPlayer; + if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_empty))) { + player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_empty, 1, 0), false); + } + } + } + } + + if(this == ModItems.syringe_awesome) { + if(!world.isRemote) { + entity.addPotionEffect(new PotionEffect(Potion.regeneration.id, 50 * 20, 9)); + entity.addPotionEffect(new PotionEffect(Potion.resistance.id, 50 * 20, 9)); + entity.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 50 * 20, 0)); + entity.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 50 * 20, 24)); + entity.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 50 * 20, 9)); + entity.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 50 * 20, 6)); + entity.addPotionEffect(new PotionEffect(Potion.jump.id, 50 * 20, 9)); + entity.addPotionEffect(new PotionEffect(Potion.field_76434_w.id, 50 * 20, 9)); + entity.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 50 * 20, 4)); + entity.addPotionEffect(new PotionEffect(Potion.confusion.id, 5 * 20, 4)); + + stack.stackSize--; + world.playSoundAtEntity(entity, "hbm:item.syringe", 1.0F, 1.0F); + + if(entityPlayer instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) entityPlayer; + if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_empty))) { + player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_empty, 1, 0), false); + } + } + } + } + + if(this == ModItems.syringe_poison) { + if(!world.isRemote) { + entity.attackEntityFrom(ModDamageSource.euthanized(entityPlayer, entityPlayer), 30); + + stack.stackSize--; + world.playSoundAtEntity(entity, "hbm:item.syringe", 1.0F, 1.0F); + + if(entityPlayer instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) entityPlayer; + if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_empty))) { + player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_empty, 1, 0), false); + } + } + } + } + + if(this == ModItems.syringe_metal_stimpak) { + if(!world.isRemote) { + entity.heal(5); + + stack.stackSize--; + world.playSoundAtEntity(entity, "hbm:item.syringe", 1.0F, 1.0F); + + if(entityPlayer instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) entityPlayer; + if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) { + player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false); + } + } + } + } + + if(this == ModItems.syringe_metal_medx) { + if(!world.isRemote) { + entity.addPotionEffect(new PotionEffect(Potion.resistance.id, 4 * 60 * 20, 2)); + + stack.stackSize--; + world.playSoundAtEntity(entity, "hbm:item.syringe", 1.0F, 1.0F); + + if(entityPlayer instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) entityPlayer; + if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) { + player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false); + } + } + } + } + + if(this == ModItems.syringe_metal_psycho) { + if(!world.isRemote) { + entity.addPotionEffect(new PotionEffect(Potion.resistance.id, 2 * 60 * 20, 0)); + entity.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 2 * 60 * 20, 0)); + + stack.stackSize--; + world.playSoundAtEntity(entity, "hbm:item.syringe", 1.0F, 1.0F); + + if(entityPlayer instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) entityPlayer; + if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) { + player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false); + } + } + } + } + + if(this == ModItems.syringe_metal_super) { + if(!world.isRemote) { + entity.heal(25); + entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 10 * 20, 0)); + + stack.stackSize--; + world.playSoundAtEntity(entity, "hbm:item.syringe", 1.0F, 1.0F); + + if(entityPlayer instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) entityPlayer; + if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) { + player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false); + } + } + } + } + + if(this == ModItems.syringe_taint) { + if(!world.isRemote) { + entity.addPotionEffect(new PotionEffect(HbmPotion.taint.id, 60 * 20, 0)); + entity.addPotionEffect(new PotionEffect(Potion.confusion.id, 5 * 20, 0)); + + stack.stackSize--; + world.playSoundAtEntity(entity, "hbm:item.syringe", 1.0F, 1.0F); + + if(entityPlayer instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) entityPlayer; + if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) { + player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false); + } + if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle2_empty))) { + player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.bottle2_empty, 1, 0), false); + } + } + } + } + + if(this == ModItems.euphemium_stopper) { + if(!world.isRemote) { + entity.addPotionEffect(new PotionEffect(Potion.weakness.id, 30 * 20, 9)); + entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 30 * 20, 9)); + entity.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 30 * 20, 9)); + } + } + + return false; + } + + @Override + public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) { if(this == ModItems.syringe_antidote) { list.add("Removes all potion effects"); } diff --git a/src/main/java/com/hbm/lib/RefStrings.java b/src/main/java/com/hbm/lib/RefStrings.java index 68d3ae7c2..ae208adc3 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 (3745)"; + public static final String VERSION = "1.0.27 BETA (3766)"; //HBM's Beta Naming Convention: //V T (X) //V -> next release version diff --git a/src/main/java/com/hbm/main/ClientProxy.java b/src/main/java/com/hbm/main/ClientProxy.java index 813bf18da..da590c660 100644 --- a/src/main/java/com/hbm/main/ClientProxy.java +++ b/src/main/java/com/hbm/main/ClientProxy.java @@ -1072,6 +1072,26 @@ public class ClientProxy extends ServerProxy { } } + if("vomit".equals(type)) { + + Entity e = world.getEntityByID(data.getInteger("entity")); + + if(e instanceof EntityLivingBase) { + + double ix = e.posX; + double iy = e.posY - e.getYOffset() + e.getEyeHeight() + 1; + double iz = e.posZ; + + Vec3 vec = e.getLookVec(); + + for(int i = 0; i < 25; i++) { + EntityFX fx = new net.minecraft.client.particle.EntityBlockDustFX(world, ix, iy, iz, (vec.xCoord + rand.nextGaussian() * 0.2) * 0.2, (vec.yCoord + rand.nextGaussian() * 0.2) * 0.2, (vec.zCoord + rand.nextGaussian() * 0.2) * 0.2, Blocks.redstone_block, 0); + ReflectionHelper.setPrivateValue(EntityFX.class, fx, 150 + rand.nextInt(50), "particleMaxAge", "field_70547_e"); + Minecraft.getMinecraft().effectRenderer.addEffect(fx); + } + } + } + if("hadron".equals(type)) { Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleHadron(man, world, x, y, z)); diff --git a/src/main/java/com/hbm/main/MainRegistry.java b/src/main/java/com/hbm/main/MainRegistry.java index da4b9a32d..d5cb6d914 100644 --- a/src/main/java/com/hbm/main/MainRegistry.java +++ b/src/main/java/com/hbm/main/MainRegistry.java @@ -1052,6 +1052,10 @@ public class MainRegistry { HazmatRegistry.registerHazmat(ModItems.ajr_plate, 0.8F); HazmatRegistry.registerHazmat(ModItems.ajr_legs, 0.6F); HazmatRegistry.registerHazmat(ModItems.ajr_boots, 0.2F); + HazmatRegistry.registerHazmat(ModItems.ajro_helmet, 0.4F); + HazmatRegistry.registerHazmat(ModItems.ajro_plate, 0.8F); + HazmatRegistry.registerHazmat(ModItems.ajro_legs, 0.6F); + HazmatRegistry.registerHazmat(ModItems.ajro_boots, 0.2F); HazmatRegistry.registerHazmat(ModItems.bj_helmet, 0.4F); HazmatRegistry.registerHazmat(ModItems.bj_plate, 0.8F); @@ -1064,6 +1068,11 @@ public class MainRegistry { HazmatRegistry.registerHazmat(ModItems.hev_legs, 0.7F); HazmatRegistry.registerHazmat(ModItems.hev_boots, 0.3F); + HazmatRegistry.registerHazmat(ModItems.fau_helmet, 0.5F); + HazmatRegistry.registerHazmat(ModItems.fau_plate, 1.0F); + HazmatRegistry.registerHazmat(ModItems.fau_legs, 0.7F); + HazmatRegistry.registerHazmat(ModItems.fau_boots, 0.3F); + HazmatRegistry.registerHazmat(ModItems.paa_plate, 0.8F); HazmatRegistry.registerHazmat(ModItems.paa_legs, 0.6F); HazmatRegistry.registerHazmat(ModItems.paa_boots, 0.2F); diff --git a/src/main/java/com/hbm/main/ModEventHandler.java b/src/main/java/com/hbm/main/ModEventHandler.java index 3bd6ad391..85ddff0c1 100644 --- a/src/main/java/com/hbm/main/ModEventHandler.java +++ b/src/main/java/com/hbm/main/ModEventHandler.java @@ -18,6 +18,7 @@ import com.hbm.config.MobConfig; import com.hbm.config.WorldConfig; import com.hbm.entity.missile.EntityMissileBaseAdvanced; import com.hbm.entity.missile.EntityMissileCustom; +import com.hbm.entity.mob.EntityCyberCrab; import com.hbm.entity.mob.EntityDuck; import com.hbm.entity.mob.EntityNuclearCreeper; import com.hbm.entity.mob.EntityQuackos; @@ -62,6 +63,7 @@ import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.EntitySkeleton; import net.minecraft.entity.monster.EntitySpider; import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.passive.EntityAnimal; import net.minecraft.entity.passive.EntityCow; import net.minecraft.entity.passive.EntityMooshroom; import net.minecraft.entity.passive.EntityVillager; @@ -185,10 +187,20 @@ public class ModEventHandler event.entityLiving.dropItem(ModItems.spider_milk, 1); } + if(event.entityLiving instanceof EntityAnimal && event.entityLiving.getRNG().nextInt(5) == 0) { + + event.entityLiving.dropItem(ModItems.bandaid, 1); + } + if(event.entityLiving instanceof EntitySpider && event.entityLiving.getRNG().nextInt(1000) == 0) { event.entityLiving.dropItem(ModItems.heart_piece, 1); } + + if(event.entityLiving instanceof EntityCyberCrab && event.entityLiving.getRNG().nextInt(500) == 0) { + + event.entityLiving.dropItem(ModItems.wd40, 1); + } } } } @@ -707,6 +719,14 @@ public class ModEventHandler else e.player.inventoryContainer.detectAndSendChanges(); } + + if(!e.player.worldObj.isRemote && e.smelting.getItem() == ModItems.ingot_uranium && e.player.getRNG().nextInt(64) == 0) { + + if(!e.player.inventory.addItemStackToInventory(new ItemStack(ModItems.quartz_plutonium))) + e.player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.quartz_plutonium), false); + else + e.player.inventoryContainer.detectAndSendChanges(); + } } @SubscribeEvent diff --git a/src/main/java/com/hbm/main/ModEventHandlerClient.java b/src/main/java/com/hbm/main/ModEventHandlerClient.java index 1601fb9a4..cbafd5fd1 100644 --- a/src/main/java/com/hbm/main/ModEventHandlerClient.java +++ b/src/main/java/com/hbm/main/ModEventHandlerClient.java @@ -181,7 +181,7 @@ public class ModEventHandlerClient { ItemStack stack = player.inventory.armorInventory[2]; float tot = (float) ((JetpackBase)stack.getItem()).getFuel(stack) / (float) ((JetpackBase)stack.getItem()).getMaxFill(stack); - top -= 3; + top -= 3; GL11.glDisable(GL11.GL_TEXTURE_2D); tess.startDrawingQuads(); diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityDecon.java b/src/main/java/com/hbm/tileentity/machine/TileEntityDecon.java index 32cc4d457..83ccc73c2 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityDecon.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityDecon.java @@ -3,6 +3,7 @@ package com.hbm.tileentity.machine; import java.util.List; import com.hbm.extprop.HbmLivingProps; +import com.hbm.potion.HbmPotion; import net.minecraft.entity.EntityLivingBase; import net.minecraft.tileentity.TileEntity; @@ -20,6 +21,7 @@ public class TileEntityDecon extends TileEntity { if(!entities.isEmpty()) { for(EntityLivingBase e : entities) { HbmLivingProps.incrementRadiation(e, -0.5F); + e.removePotionEffect(HbmPotion.radiation.id); } } } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineRadGen.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineRadGen.java index c41262b49..7398b1acf 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineRadGen.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineRadGen.java @@ -377,7 +377,8 @@ public class TileEntityMachineRadGen extends TileEntity implements ISidedInvento if(item == Item.getItemFromBlock(ModBlocks.block_yellowcake)) return 1000; if(item == Item.getItemFromBlock(ModBlocks.mush)) return 10; - if(item == Item.getItemFromBlock(ModBlocks.waste_earth)) return 25; + if(item == ModItems.fallout) return 25; + if(item == Item.getItemFromBlock(ModBlocks.block_fallout)) return 250; if(item == Item.getItemFromBlock(ModBlocks.waste_mycelium)) return 150; return 0; diff --git a/src/main/java/com/hbm/util/ContaminationUtil.java b/src/main/java/com/hbm/util/ContaminationUtil.java index 013b23b8b..9fcdde767 100644 --- a/src/main/java/com/hbm/util/ContaminationUtil.java +++ b/src/main/java/com/hbm/util/ContaminationUtil.java @@ -2,10 +2,10 @@ package com.hbm.util; import com.hbm.extprop.HbmLivingProps; import com.hbm.handler.HazmatRegistry; -import com.hbm.interfaces.IRadiationImmune; import com.hbm.potion.HbmPotion; import com.hbm.saveddata.RadiationSavedData; +import api.hbm.entity.IRadiationImmune; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 8c9559dc3..97ca10cb2 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-3735", + "version":"1.0.27-3766", "mcversion": "1.7.10", "url": "", "updateUrl": "",