diff --git a/assets/hbm/lang/de_DE.lang b/assets/hbm/lang/de_DE.lang index 6068eb60e..7294d9d24 100644 --- a/assets/hbm/lang/de_DE.lang +++ b/assets/hbm/lang/de_DE.lang @@ -50,6 +50,7 @@ potion.hbm_radiation=Kontaminiert potion.hbm_bang=! ! ! potion.hbm_radx=Rad-X potion.hbm_lead=Bleivergiftung +potion.hbm_radaway=Radaway hbmfluid.none=Nichts hbmfluid.water=Wasser diff --git a/assets/hbm/lang/en_US.lang b/assets/hbm/lang/en_US.lang index f744d2ce6..e7a6f04f2 100644 --- a/assets/hbm/lang/en_US.lang +++ b/assets/hbm/lang/en_US.lang @@ -50,6 +50,7 @@ potion.hbm_radiation=Contaminated potion.hbm_bang=! ! ! potion.hbm_radx=Rad-X potion.hbm_lead=Lead Poisoning +potion.hbm_radaway=Radaway hbmfluid.none=None hbmfluid.water=Water diff --git a/assets/hbm/textures/gui/potions.png b/assets/hbm/textures/gui/potions.png index 87da40f5c..4ddcc22a4 100644 Binary files a/assets/hbm/textures/gui/potions.png and b/assets/hbm/textures/gui/potions.png differ diff --git a/assets/hbm/textures/items/ingot_copper.png b/assets/hbm/textures/items/ingot_copper.png index eff12f1e1..86c00337d 100644 Binary files a/assets/hbm/textures/items/ingot_copper.png and b/assets/hbm/textures/items/ingot_copper.png differ diff --git a/assets/hbm/textures/models/CapeNostalgia2.png b/assets/hbm/textures/models/CapeNostalgia2.png new file mode 100644 index 000000000..432f29cb8 Binary files /dev/null and b/assets/hbm/textures/models/CapeNostalgia2.png differ diff --git a/com/hbm/blocks/machine/GeigerCounter.java b/com/hbm/blocks/machine/GeigerCounter.java index 8752bfef8..388eebec3 100644 --- a/com/hbm/blocks/machine/GeigerCounter.java +++ b/com/hbm/blocks/machine/GeigerCounter.java @@ -1,13 +1,7 @@ package com.hbm.blocks.machine; -import com.hbm.blocks.ModBlocks; -import com.hbm.main.MainRegistry; -import com.hbm.saveddata.RadEntitySavedData; import com.hbm.saveddata.RadiationSavedData; -import com.hbm.tileentity.machine.TileEntityBroadcaster; -import com.hbm.tileentity.machine.TileEntityMachineBattery; -import cpw.mods.fml.common.network.internal.FMLNetworkHandler; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; @@ -129,8 +123,7 @@ public class GeigerCounter extends BlockContainer { { world.playSoundAtEntity(player, "hbm:item.techBoop", 1.0F, 1.0F); - RadEntitySavedData eData = RadEntitySavedData.getData(player.worldObj); - int eRad = (int)eData.getRadFromEntity(player); + int eRad = (int)player.getEntityData().getFloat("hfr_radiation"); RadiationSavedData data = RadiationSavedData.getData(player.worldObj); Chunk chunk = world.getChunkFromBlockCoords((int)player.posX, (int)player.posZ); diff --git a/com/hbm/items/food/ItemEnergy.java b/com/hbm/items/food/ItemEnergy.java index 0c5f7603f..c1bb61190 100644 --- a/com/hbm/items/food/ItemEnergy.java +++ b/com/hbm/items/food/ItemEnergy.java @@ -20,8 +20,8 @@ import net.minecraft.world.World; public class ItemEnergy extends Item { @Override - public ItemStack onEaten(ItemStack stack, World world, EntityPlayer player) - { + public ItemStack onEaten(ItemStack stack, World world, EntityPlayer player) { + if (!player.capabilities.isCreativeMode) { --stack.stackSize; diff --git a/com/hbm/items/food/ItemLemon.java b/com/hbm/items/food/ItemLemon.java index 5c5dfbeee..86045960d 100644 --- a/com/hbm/items/food/ItemLemon.java +++ b/com/hbm/items/food/ItemLemon.java @@ -7,7 +7,6 @@ import com.hbm.items.ModItems; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; -import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; diff --git a/com/hbm/items/special/ItemRadioactive.java b/com/hbm/items/special/ItemRadioactive.java index ac2a32c02..9cc352b0b 100644 --- a/com/hbm/items/special/ItemRadioactive.java +++ b/com/hbm/items/special/ItemRadioactive.java @@ -4,14 +4,10 @@ import java.util.List; import com.hbm.items.ModItems; import com.hbm.lib.Library; -import com.hbm.lib.ModDamageSource; -import com.hbm.potion.HbmPotion; -import com.hbm.saveddata.RadEntitySavedData; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; diff --git a/com/hbm/items/special/ItemSyringe.java b/com/hbm/items/special/ItemSyringe.java index c4f3ec54a..3c32b36ed 100644 --- a/com/hbm/items/special/ItemSyringe.java +++ b/com/hbm/items/special/ItemSyringe.java @@ -11,7 +11,6 @@ import com.hbm.items.gear.JetpackVectorized; import com.hbm.items.weapon.ItemGunBase; import com.hbm.lib.ModDamageSource; import com.hbm.potion.HbmPotion; -import com.hbm.saveddata.RadEntitySavedData; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -66,6 +65,7 @@ public class ItemSyringe extends Item { 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); @@ -216,17 +216,7 @@ public class ItemSyringe extends Item { { if (!world.isRemote) { - //player.removePotionEffect(HbmPotion.radiation.id); - - RadEntitySavedData entityData = RadEntitySavedData.getData(world); - - float rad = entityData.getRadFromEntity(player); - rad -= 140F; - - if(rad < 0) - rad = 0; - - entityData.setRadForEntity(player, rad); + player.addPotionEffect(new PotionEffect(HbmPotion.radaway.id, 14, 9)); stack.stackSize--; world.playSoundAtEntity(player, "hbm:item.radaway", 1.0F, 1.0F); @@ -237,15 +227,16 @@ public class ItemSyringe extends Item { { if (!world.isRemote) { - RadEntitySavedData entityData = RadEntitySavedData.getData(world); - - float rad = entityData.getRadFromEntity(player); - rad -= 350F; - - if(rad < 0) - rad = 0; - - entityData.setRadForEntity(player, rad); + 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); @@ -256,15 +247,7 @@ public class ItemSyringe extends Item { { if (!world.isRemote) { - RadEntitySavedData entityData = RadEntitySavedData.getData(world); - - float rad = entityData.getRadFromEntity(player); - rad -= 1000F; - - if(rad < 0) - rad = 0; - - entityData.setRadForEntity(player, rad); + player.addPotionEffect(new PotionEffect(HbmPotion.radaway.id, 50, 19)); stack.stackSize--; world.playSoundAtEntity(player, "hbm:item.radaway", 1.0F, 1.0F); diff --git a/com/hbm/items/tool/ItemGeigerCounter.java b/com/hbm/items/tool/ItemGeigerCounter.java index 2d029d8db..22c629f8f 100644 --- a/com/hbm/items/tool/ItemGeigerCounter.java +++ b/com/hbm/items/tool/ItemGeigerCounter.java @@ -6,10 +6,8 @@ import java.util.Random; import com.hbm.blocks.ModBlocks; import com.hbm.items.ModItems; -import com.hbm.saveddata.RadEntitySavedData; import com.hbm.saveddata.RadiationSavedData; -import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -18,7 +16,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ChatComponentText; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; -import scala.Int; public class ItemGeigerCounter extends Item { @@ -108,8 +105,7 @@ public class ItemGeigerCounter extends Item { if(!world.isRemote) { world.playSoundAtEntity(player, "hbm:item.techBoop", 1.0F, 1.0F); - RadEntitySavedData eData = RadEntitySavedData.getData(player.worldObj); - int eRad = (int)eData.getRadFromEntity(player); + int eRad = (int)player.getEntityData().getFloat("hfr_radiation"); RadiationSavedData data = RadiationSavedData.getData(player.worldObj); Chunk chunk = world.getChunkFromBlockCoords((int)player.posX, (int)player.posZ); diff --git a/com/hbm/lib/Library.java b/com/hbm/lib/Library.java index df7a3aa25..634585d38 100644 --- a/com/hbm/lib/Library.java +++ b/com/hbm/lib/Library.java @@ -7,8 +7,6 @@ import java.util.Random; import com.hbm.blocks.ModBlocks; import com.hbm.calc.UnionOfTileEntitiesAndBooleans; import com.hbm.calc.UnionOfTileEntitiesAndBooleansForFluids; -import com.hbm.calc.UnionOfTileEntitiesAndBooleansForGas; -import com.hbm.calc.UnionOfTileEntitiesAndBooleansForOil; import com.hbm.entity.mob.EntityHunterChopper; import com.hbm.entity.projectile.EntityChopperMine; import com.hbm.handler.FluidTypeHandler.FluidType; @@ -18,18 +16,10 @@ import com.hbm.interfaces.IConsumer; import com.hbm.interfaces.IFluidAcceptor; import com.hbm.interfaces.IFluidDuct; import com.hbm.interfaces.IFluidSource; -import com.hbm.interfaces.IGasAcceptor; -import com.hbm.interfaces.IGasDuct; -import com.hbm.interfaces.IGasSource; -import com.hbm.interfaces.IOilDuct; -import com.hbm.interfaces.IOilAcceptor; -import com.hbm.interfaces.IOilSource; import com.hbm.interfaces.ISource; import com.hbm.items.ModItems; import com.hbm.items.special.ItemBattery; -import com.hbm.main.MainRegistry; import com.hbm.potion.HbmPotion; -import com.hbm.saveddata.RadEntitySavedData; import com.hbm.tileentity.conductor.TileEntityCable; import com.hbm.tileentity.conductor.TileEntityCableSwitch; import com.hbm.tileentity.conductor.TileEntityFluidDuct; @@ -51,7 +41,6 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; @@ -83,103 +72,7 @@ public class Library { public static List superuser = new ArrayList(); public static void initBooks() { - - book1.add("This book contains detailed information about the resources in Hbm's Nuclear Tech Mod. Some can be found underground, some have to be processed in special machines before becoming useful."); - book1.add("Uranium\nRare metal which spawns below Y:25. Impure uranium which is not useful by itself. Can be crafted into uranium hexafluoride, which can be seperated by the centrifuge."); - book1.add("Uranium 235\nRare uranium isotope obtained from processing uranium hexafluoride in the centrifuge. This isotope is fissile, it can be used for reactor fuel and bombs. Np237 can be bred from U235."); - book1.add("Uranium 238\nVery abundant isotope which is not as useful as it's fissile counterpart. Used in reactor fuel and for breeding fissile Pu239."); - book1.add("Plutonium\nTransuranic element which cannot be found underground. It can be found in the nether (config option required) or bred from impure uranium."); - book1.add("Plutonium 238\nAlpha emitter that can be bred from Np237, useful for making RTG pellets which is needed for the RTG furnace."); - book1.add("Plutonium 239\nFissile plutonium isotope that can be crafted into reactor fuel. Implosion-type nukes also need this isotope."); - book1.add("Plutonium 240\nIsotope with a high spontaneous fission rate. Not very useful."); - book1.add("Neptunium\nNeptunium 237 can only be obtained by breeding U235. Other than being crucial for Pu238 production, it doesn't have many uses."); - book1.add("Titanium\nTough metal which can be found underground below Y:35. Titanium is important for crafting machines and stong tools."); - book1.add("Copper\nMetal found below Y:50. Very important metal for machines, mostly used for alloys."); - book1.add("Minecraft Grade Copper\nMinecraft Grade Copper (or red copper) is used for all machines that use electricity. Every conductor is made from red copper."); - book1.add("Advanced Alloy\nAlloy made from red copper and steel. Very tough, used for super conductors, late game machines and heavy duty tools."); - book1.add("Tungsten\nFound below Y:35 or in the nether, needed for heating elements, neutron reflectors and late game alloys."); - book1.add("Aluminium\nSoft metal found below Y:45. Can be used to craft shells and canisters."); - book1.add("Steel\nAlloy made from coal and iron. Almost everything needs steel, shells, frames, machines, tools, etc."); - book1.add("Lead\n.Found below Y:35. Used for nuclear reactors, hazmat equpiment and bullets."); - book1.add("Beryllium\n.Brittle metal found below Y:35, used for deco elements and atom bombs."); - book1.add("Schrabidium\n.Weird. Can be created using the schrabidium transmutation device or by setting off nukes near uranium ore. Can be crafted into extremely powerful equipment and machines."); - book1.add("Magnetized Tungsten\nTungsten with traces of schrabidium. Strong super conductor which withstands very high temparatures. Used for 4000K magnets and calculation matrices."); - book1.add("Lithium\nCan be extracted from quartz using the centrifuge, used for breeding tritium."); - book1.add("Sulfur\nDust found underground below Y:35. Useful for matchsticks, deuterium production and crafting gunpowder."); - book1.add("Niter\nDust found below Y:35. Can be used to craft gunpowder and det cord."); - book1.add("Fluorite\nCan be found below Y:40. Only used for crafting uranium and plutonium hexafluoride."); - book1.add("Uranium Hexafluoride\nCan be seperated in the centrifuge. Storable in the UF6 tank."); - book1.add("Plutonium Hexafluoride\nCan be seperated in the centrifuge. Storable in the PuF6 tank."); - - book2.add("This book contains detailed information about the machines in Hbm's Nuclear Tech Mod. Most machines use electricity in the form of HE."); - book2.add("Alloy Furnace\nType: Processor\nUses fuels like redstone, coal and netherrack to combine two items. Accepts RTG pellets."); - book2.add("Centrifuge\nType: Processor\nUses the same fuels as the alloy furnace to seperate an imput to up to four outputs. Used for uranium enrichment."); - book2.add("Hexafluoride Tanks\nType: Storage\nComes in two different variations, for uranium and plutonium."); - book2.add("Breeding Reactor\nType: Processor\nUses nuclear rods as fuel to breed other rods. Used to process isotopes."); - book2.add("Nuclear Furnace\nType: Processor\nUses nuclear rods as fuel to smelt items like a normal furnace does, but much faster."); - book2.add("RTG-Furnace\nType: Processor\nUtilizes three plutonium 238 pellets which never run out to smelt items very fast."); - book2.add("Coal Generator\nType: Generator\nUses coal and water in order to create little amounts of HE."); - book2.add("Diesel Generator\nType: Generator\nUses diesel fuel to create HE, does not need water in order to run."); - book2.add("Small Nuclear Reactor\nType: Generator\nUses reactor fuel, water and coolant to generate HE, the reactor explodes when it overheats."); - book2.add("Red Copper Cable\nType: Conductor\nConnects to other cables and machines, transfers HE."); - book2.add("Coated Red Copper Cable\nType: Conductor\nFull block conductors which are more resistant than normal cables."); - book2.add("Energy Storage Block\nType: Storage\nStores energy when connected to a power source, releases it if it's powered with a redstone signal."); - book2.add("HE to RF Converter\nType: Power Converter\nCollects HE and converts it to RF, which can be used by machines from other mods which are RF compatible."); - book2.add("RF to HE Converter\nType: Power Converter\nCollects RF and converts it to HE."); - book2.add("Electric Furnace\nType: Processor\nNeeds HE in order to smelt items much faster than a normal furnace."); - book2.add("Shredder\nType: Processor\nNeeds HE and two blades in order to run. Ingots and ores are turned into dust, other blocks get processed into scrap. Useful to make fuel out of junk."); - book2.add("Deuterium Extractor\nType: Processor\nNeeds HE, water and sulfur in order to extract deuterium out of the water. Sulfur is used up slower than water."); - book2.add("Schrabidium Transmutation Device\nType: Processor\nWith 500 million HE, a special capacitor and uranium, this machine creates schrabidium ingots."); - book2.add("CMB Steel Factory\nType: Processor\nCombines magnetized tungsten, advanced alloy and poisonous mud into CMB steel."); - book2.add("Basic Factory\nType: Processor\nLarge furnace with in- and output queue that smelts two items at a time. Needs a specific energy core to run, though it also accepts external energy if it has an electricity port."); - book2.add("Advanced Factory\nType: Processor\nThis factory smelts four items at a time, twice as fast, making it four times better than the basic factory."); - book2.add("Large Nuclear Reactor\nType: Generator\nA much larger version of the nuclear reactor which works similarly, but needs a fuse to run. The optional concrete coating will prevent radiation from leaking out."); - book2.add("Fusion Reactor\nType: Generator\nA very large reactor which fuses deuterium and tritium to create power. It needs startup energy in form of four energy cores (and or fusion cores) and a fuse."); - book2.add("Watz Power Plant\nType: Generator\nA special fission reactor whcih needs a titanium filter and fuel pellets to run. Pellets have different modifiers changing lifetime and efficiency of all other components. Mind the waste."); - book2.add("Fusionary Watz Plant\nType: Generator\nThe strongest reactor which fuses antimatter with antischrabidium with the help of a singularity. Different singularities have different effects. Beware the screwdriver."); - - book3.add("This book contains detailed information about the explosives in Hbm's Nuclear Tech Mod. All explosives can also be used with the detonator."); - book3.add("The Gadget\nType: Nuke\nStrength: " + MainRegistry.gadgetRadius + "\nItems required: 4x bundled propellant, 1x Gadget plutonium core, 1x Wiring"); - book3.add("Little Boy\nType: Nuke\nStrength: " + MainRegistry.boyRadius + "\nItems required: 1x neutron shielding, 1x U235 target, 1x U235 bullet, 1x Little Boy propellant, 1x Little Boy igniter"); - book3.add("Fat Man\nType: Nuke\nStrength: " + MainRegistry.manRadius + "\nItems required: 4x bundled propellant, 1x Fat Man plutonium core, 1x Fatman fuse"); - book3.add("Ivy Mike\nType: H-Bomb\nStrength (nuke): " + MainRegistry.manRadius + "\nStrength (h-bomb): " + MainRegistry.mikeRadius + "\nItems required: 4x bundled propellant, 1x Fat Man plutonium core\nOptional: 1x deuterium supercooler, 1x uranium covered deuterium tank, 1x deuterium tank"); - book3.add("Tsar Bomba\nType: H-Bomb\nStrength (nuke): " + MainRegistry.manRadius + "\nStrength (h-bomb): " + MainRegistry.tsarRadius + "\nItems required: 4x bundled propellant, 1x Fat Man plutonium core\nOptional: Tsar Bomba core"); - book3.add("The Prototype\nType: Schrabidium-Bomb\nStrength:" + MainRegistry.prototypeRadius + "\nItems required: 4x schrabidium-trisulfide, 4x uranium quad rod, 4x lead quad rod, 2x neptunium quad rod"); - book3.add("F.L.E.I.J.A.\nType: Schrabidium-Bomb\nStrength:" + MainRegistry.fleijaRadius + "\nItems required: 2x pulse igniter, 3x schrabidium propellant, 6x F.L.E.I.J.A. uranium charge"); - book3.add("Multi Purpose Bomb\nType: Generic\nStrength: Variable\nNeeds four blocks of TNT in the marked slots, special items can be added in the right two slots. Equal items have their own icon, unequal items show a ?-icon, though they still work together."); - book3.add("Multi Purpose Bomb (cont.)\nGunpowder: +1 explosion strength, TNT: +4 explosion strength, explosive pellets: +50 bomblets, fire powder: +10 fire radius, poison powder: +15 poison radius, gas cartridge: +15 gas radius"); - book3.add("Dud\nType: ???\nStrength:" + MainRegistry.fatmanRadius + "\nUncraftable, right-click with empty cells to extract antimatter. Can explode via detonator."); - book3.add("Flame War in a Box\nType: Box\nSpawns random explosions, sets everything on fire."); - book3.add("Levitation Bomb\nRadius: 15\nHeight: 50\nLifts all blocks and entites caught in it's area of effect."); - book3.add("Endothermic Bomb\nRadius: 15\nTurns blocks into ice, freezes entities solid."); - book3.add("Exothermic Bomb\nRadius: 15\nBurns/melts blocks, sets all entities on fire."); - book3.add("Explosive Barrel\nType: Barrel\nExplodes when shot/set on fire."); - book3.add("Radioactive Barrel\nType: Barrel\nOnly set off by explosions, contaminates area."); - book4.add("This book contains detailed information about the missiles in Hbm's Nuclear Tech Mod. All missiles are launched from the launch pad, the coordinates are set using the short range target designator."); - book4.add("HE Missiles\nNormal missile which explodes on impact.\nSmall: 10\nMedium: 25\nLarge: 50 x 5"); - book4.add("Incendiary Missiles\nSpecial missile which explodes and sets the surrounding area on fire.\nSmall: 10 + F\nMedium: 25 + F\nLarge: 35 + F"); - book4.add("Cluster Missiles\nMissile which explodes mid-air and releases small bomblets.\nSmall: 5 + 25B\nMedium: 15 + 50B\nLarge: 25 + 100B"); - book4.add("Bunker Buster\nMissile which creates vertical explosions.\nSmall: 5 x 15\nMedium: 7.5 x 20\nLarge: 10 x 30B"); - book4.add("Thermal Missiles\nEndo or exothermic, area of effect is twice as large as for their stationary counterparts."); - book4.add("Nuclear Missile\nLarge missile equipped with a nuclear warhead.\nRadius: " + MainRegistry.missileRadius); - book4.add("Nuclear MIRV\nCrossbreed of a nuclear missile and a cluster missile...splits into eight smaller nukes.\nRadius per MIRV: " + MainRegistry.mirvRadius); - - book5.add("This book contains detailed information about the miscellaneous items in Hbm's Nuclear Tech Mod. All missiles are launched from the launch pad, the coordinates are set using the short range target designator."); - book5.add("Revolvers\nThese guns come in different variants, each one has it's own ammo. Charge them like a bow for half a second and release to shoot."); - book5.add("Rocket Launcher\nWorks much like a revolver, but it needs to be completely charged up to fire. Shoots explosive rockets instead of bullets. Duh."); - book5.add("M42 Nuclear Catapult\nIs basically just an RPG. That shoots nukes. In an arch. Which kill everybody. Full stop."); - book5.add("Waffle of Mass Destruction\nEat & explode."); - book5.add("Vegan Schnitzel\nEat & die."); - book5.add("Radioactive Cotton Candy\nEat & enjoy."); - book5.add("Schrabidium Apples\nGives you an epic bizeps in 1.2 seconds."); - book5.add("Tem Flakes\nfood of tem. com in 3 flavurs, on sale, nurmal & PREMIUM!!! (expensiv) heals 2HP. construction paper."); - book5.add("Oversugared Unhealthy Beverages\nHalf of them taste like urine, all of them are unhealthy."); - book5.add("Grenades\nMany different types with effects, do not use the schrabidium/drill ones."); - book5.add("Detonator\nRight click a block to set the position, shift-right click to detonate."); - book5.add("Supply Drop Requester\nRight click to call in a supply drop, has five uses in survival mode."); - book5.add("Magazines\nRight click to retrieve ammo for a specific gun."); - book5.add("Syringes\nRight click to inject the syringe's content, hit somebody else to give them the effects."); } public static boolean checkArmor(EntityPlayer player, Item helmet, Item plate, Item legs, Item boots) { @@ -283,9 +176,9 @@ public class Library { float koeff = 5.0F; f *= (float) Math.pow(koeff, -HazmatRegistry.instance.getResistance(player)); } - - RadEntitySavedData data = RadEntitySavedData.getData(entity.worldObj); - data.increaseRad(entity, f); + + float rad = e.getEntityData().getFloat("hfr_radiation"); + e.getEntityData().setFloat("hfr_radiation", rad + f); } public static void applyRadDirect(Entity e, float f) { @@ -296,8 +189,8 @@ public class Library { if(((EntityLivingBase)e).isPotionActive(HbmPotion.mutation)) return; - RadEntitySavedData data = RadEntitySavedData.getData(e.worldObj); - data.increaseRad(e, f); + float rad = e.getEntityData().getFloat("hfr_radiation"); + e.getEntityData().setFloat("hfr_radiation", rad + f); } public static boolean checkForHazmat(EntityPlayer player) { diff --git a/com/hbm/main/MainRegistry.java b/com/hbm/main/MainRegistry.java index d3a5af338..35dd9985e 100644 --- a/com/hbm/main/MainRegistry.java +++ b/com/hbm/main/MainRegistry.java @@ -330,6 +330,7 @@ public class MainRegistry public static int mutationID = 65; public static int radxID = 66; public static int leadID = 67; + public static int radawayID = 68; public static int x; public static int y; @@ -1766,6 +1767,7 @@ public class MainRegistry mutationID = createConfigInt(config, CATEGORY_POTION, "8.03_mutationPotionID", "What potion ID the taint mutation effect will have", 65); radxID = createConfigInt(config, CATEGORY_POTION, "8.04_radxPotionID", "What potion ID the Rad-X effect will have", 66); leadID = createConfigInt(config, CATEGORY_POTION, "8.05_leadPotionID", "What potion ID the lead poisoning effect will have", 67); + radawayID = createConfigInt(config, CATEGORY_POTION, "8.06_radawayPotionID", "What potion ID the radaway effect will have", 68); final String CATEGORY_MACHINE = "09_machines"; templateBlacklist = Arrays.asList(createConfigStringList(config, CATEGORY_MACHINE, "9.00_templateBlacklist", "Which machine templates should be prohibited from being created (args: enum names)")); diff --git a/com/hbm/main/ModEventHandler.java b/com/hbm/main/ModEventHandler.java index 214dc7482..620bbc6bd 100644 --- a/com/hbm/main/ModEventHandler.java +++ b/com/hbm/main/ModEventHandler.java @@ -19,7 +19,6 @@ import com.hbm.packet.PacketDispatcher; import com.hbm.packet.RadSurveyPacket; import com.hbm.potion.HbmPotion; import com.hbm.saveddata.AuxSavedData; -import com.hbm.saveddata.RadEntitySavedData; import com.hbm.saveddata.RadiationSavedData; import cpw.mods.fml.common.eventhandler.SubscribeEvent; @@ -69,9 +68,8 @@ public class ModEventHandler @SubscribeEvent public void onPlayerDeath(LivingDeathEvent event) { - - RadEntitySavedData eData = RadEntitySavedData.getData(event.entityLiving.worldObj); - eData.setRadForEntity(event.entityLiving, 0); + + event.entityLiving.getEntityData().setFloat("hfr_radiation", 0); if(MainRegistry.enableCataclysm) { EntityBurningFOEQ foeq = new EntityBurningFOEQ(event.entity.worldObj); @@ -176,11 +174,6 @@ public class ModEventHandler if(!event.world.loadedEntityList.isEmpty()) { RadiationSavedData data = RadiationSavedData.getData(event.world); - RadEntitySavedData eData = RadEntitySavedData.getData(event.world); - - if(eData.worldObj == null) { - eData.worldObj = event.world; - } if(data.worldObj == null) { data.worldObj = event.world; @@ -189,7 +182,7 @@ public class ModEventHandler for(Object o : event.world.playerEntities) { EntityPlayer player = (EntityPlayer)o; - PacketDispatcher.wrapper.sendTo(new RadSurveyPacket(eData.getRadFromEntity(player)), (EntityPlayerMP) player); + PacketDispatcher.wrapper.sendTo(new RadSurveyPacket(player.getEntityData().getFloat("hfr_radiation")), (EntityPlayerMP) player); } if(event.world.getTotalWorldTime() % 20 == 0) { @@ -226,7 +219,7 @@ public class ModEventHandler } } - float eRad = eData.getRadFromEntity(entity); + float eRad = entity.getEntityData().getFloat("hfr_radiation"); if(entity instanceof EntityCreeper && eRad >= 200 && entity.getHealth() > 0) { @@ -269,7 +262,7 @@ public class ModEventHandler if(eRad >= 1000) { if(entity.attackEntityFrom(ModDamageSource.radiation, 1000)) - eData.setRadForEntity(entity, 0); + entity.getEntityData().setFloat("hfr_radiation", 0); } else if(eRad >= 800) { if(event.world.rand.nextInt(300) == 0) entity.addPotionEffect(new PotionEffect(Potion.confusion.id, 5 * 30, 0)); diff --git a/com/hbm/main/ModEventHandlerClient.java b/com/hbm/main/ModEventHandlerClient.java index f77b9eff1..7551a1353 100644 --- a/com/hbm/main/ModEventHandlerClient.java +++ b/com/hbm/main/ModEventHandlerClient.java @@ -1,26 +1,19 @@ package com.hbm.main; -import org.lwjgl.opengl.GL11; - import com.hbm.entity.mob.EntityHunterChopper; import com.hbm.entity.projectile.EntityChopperMine; import com.hbm.handler.BulletConfigSyncingUtil; import com.hbm.handler.BulletConfiguration; import com.hbm.handler.GunConfiguration; import com.hbm.interfaces.IHoldableWeapon; +import com.hbm.interfaces.Spaghetti; import com.hbm.items.ModItems; -import com.hbm.items.tool.ItemGeigerCounter; import com.hbm.items.weapon.ItemGunBase; import com.hbm.lib.Library; -import com.hbm.lib.RefStrings; import com.hbm.packet.GunButtonPacket; import com.hbm.packet.PacketDispatcher; -import com.hbm.render.model.ModelCloak; import com.hbm.render.util.RenderAccessoryUtility; import com.hbm.render.util.RenderScreenOverlay; -import com.hbm.render.util.RenderScreenOverlay.Crosshair; -import com.hbm.saveddata.RadEntitySavedData; -import com.hbm.saveddata.RadiationSavedData; import com.hbm.sound.MovingSoundChopper; import com.hbm.sound.MovingSoundChopperMine; import com.hbm.sound.MovingSoundCrashing; @@ -33,13 +26,10 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.multiplayer.WorldClient; -import net.minecraft.client.renderer.EntityRenderer; import net.minecraft.client.renderer.entity.RenderPlayer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; -import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.ResourceLocation; -import net.minecraft.world.chunk.Chunk; import net.minecraftforge.client.event.MouseEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; @@ -84,10 +74,8 @@ public class ModEventHandlerClient { if(player.inventory.hasItem(ModItems.geiger_counter)) { float rads = 0; - float abs = 0; - RadEntitySavedData data = RadEntitySavedData.getData(player.worldObj); - rads = data.getRadFromEntity(player); + rads = player.getEntityData().getFloat("hfr_radiation"); RenderScreenOverlay.renderRadCounter(event.resolution, rads, Minecraft.getMinecraft().ingameGUI); } @@ -150,6 +138,7 @@ public class ModEventHandlerClient { } + @Spaghetti("please get this shit out of my face") @SubscribeEvent public void onPlaySound(PlaySoundEvent17 e) { ResourceLocation r = e.sound.getPositionedSoundLocation(); diff --git a/com/hbm/main/NEIConfig.java b/com/hbm/main/NEIConfig.java index 8ae4e53a3..b3625a97d 100644 --- a/com/hbm/main/NEIConfig.java +++ b/com/hbm/main/NEIConfig.java @@ -7,7 +7,6 @@ import com.hbm.lib.RefStrings; import codechicken.nei.api.API; import codechicken.nei.api.IConfigureNEI; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class NEIConfig implements IConfigureNEI { diff --git a/com/hbm/packet/RadSurveyPacket.java b/com/hbm/packet/RadSurveyPacket.java index fa603ff25..c1fbc6981 100644 --- a/com/hbm/packet/RadSurveyPacket.java +++ b/com/hbm/packet/RadSurveyPacket.java @@ -1,11 +1,5 @@ package com.hbm.packet; -import com.hbm.interfaces.IConsumer; -import com.hbm.interfaces.ISource; -import com.hbm.saveddata.RadEntitySavedData; -import com.hbm.saveddata.RadiationSavedData; -import com.hbm.tileentity.machine.TileEntityMachinePress; - import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; @@ -14,10 +8,6 @@ import cpw.mods.fml.relauncher.SideOnly; import io.netty.buffer.ByteBuf; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.chunk.Chunk; public class RadSurveyPacket implements IMessage { @@ -53,9 +43,7 @@ public class RadSurveyPacket implements IMessage { try { EntityPlayer player = Minecraft.getMinecraft().thePlayer; - RadEntitySavedData data = RadEntitySavedData.getData(player.worldObj); - - data.setRadForEntity(player, m.rad); + player.getEntityData().setFloat("hfr_radiation", m.rad); } catch (Exception x) { } return null; diff --git a/com/hbm/potion/HbmPotion.java b/com/hbm/potion/HbmPotion.java index d9b7636f0..dd09f614b 100644 --- a/com/hbm/potion/HbmPotion.java +++ b/com/hbm/potion/HbmPotion.java @@ -9,7 +9,6 @@ import com.hbm.explosion.ExplosionLarge; import com.hbm.lib.Library; import com.hbm.lib.ModDamageSource; import com.hbm.main.MainRegistry; -import com.hbm.saveddata.RadEntitySavedData; import cpw.mods.fml.relauncher.ReflectionHelper; import cpw.mods.fml.relauncher.Side; @@ -28,6 +27,7 @@ public class HbmPotion extends Potion { public static HbmPotion mutation; public static HbmPotion radx; public static HbmPotion lead; + public static HbmPotion radaway; public HbmPotion(int id, boolean isBad, int color) { super(id, isBad, color); @@ -39,7 +39,8 @@ public class HbmPotion extends Potion { bang = registerPotion(MainRegistry.bangID, true, 1118481, "potion.hbm_bang", 3, 0); mutation = registerPotion(MainRegistry.mutationID, false, 8388736, "potion.hbm_mutation", 2, 0); radx = registerPotion(MainRegistry.radxID, false, 0xBB4B00, "potion.hbm_radx", 5, 0); - lead = registerPotion(MainRegistry.leadID, false, 0x767682, "potion.hbm_lead", 6, 0); + lead = registerPotion(MainRegistry.leadID, true, 0x767682, "potion.hbm_lead", 6, 0); + radaway = registerPotion(MainRegistry.radawayID, false, 0xBB4B00, "potion.hbm_radaway", 7, 0); } public static HbmPotion registerPotion(int id, boolean isBad, int color, String name, int x, int y) { @@ -102,15 +103,17 @@ public class HbmPotion extends Potion { } if(this == radiation) { - /*if (entity.getHealth() > entity.getMaxHealth() - (level + 1)) { - entity.attackEntityFrom(ModDamageSource.radiation, 1); - }*/ - - //RadEntitySavedData data = RadEntitySavedData.getData(entity.worldObj); - //data.increaseRad(entity, (float)(level + 1F) * 0.05F); - Library.applyRadData(entity, (float)(level + 1F) * 0.05F); } + if(this == radaway) { + + float rad = entity.getEntityData().getFloat("hfr_radiation"); + rad -= (level + 1); + if(rad < 0) rad = 0; + + entity.getEntityData().setFloat("hfr_radiation", rad); + + } if(this == bang) { entity.attackEntityFrom(ModDamageSource.bang, 1000); @@ -134,7 +137,7 @@ public class HbmPotion extends Potion { return par1 % 2 == 0; } - if(this == radiation) { + if(this == radiation || this == radaway) { return true; } diff --git a/com/hbm/render/item/ItemRenderTemplate.java b/com/hbm/render/item/ItemRenderTemplate.java index 7123aed64..fd0fd3b47 100644 --- a/com/hbm/render/item/ItemRenderTemplate.java +++ b/com/hbm/render/item/ItemRenderTemplate.java @@ -5,16 +5,11 @@ import org.lwjgl.opengl.GL11; import com.hbm.inventory.MachineRecipes; import com.hbm.items.ModItems; -import com.hbm.render.util.RenderDecoItem; import com.hbm.render.util.RenderItemStack; -import codechicken.lib.render.RenderUtils; -import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraftforge.client.IItemRenderer; diff --git a/com/hbm/render/util/RenderAccessoryUtility.java b/com/hbm/render/util/RenderAccessoryUtility.java index 22e744c7f..c4f374ede 100644 --- a/com/hbm/render/util/RenderAccessoryUtility.java +++ b/com/hbm/render/util/RenderAccessoryUtility.java @@ -1,6 +1,5 @@ package com.hbm.render.util; -import com.hbm.items.ModItems; import com.hbm.lib.Library; import com.hbm.lib.RefStrings; import com.hbm.main.MainRegistry; @@ -18,6 +17,7 @@ public class RenderAccessoryUtility { private static ResourceLocation red = new ResourceLocation(RefStrings.MODID + ":textures/models/CapeRed.png"); private static ResourceLocation ayy = new ResourceLocation(RefStrings.MODID + ":textures/models/CapeAyy.png"); private static ResourceLocation nostalgia = new ResourceLocation(RefStrings.MODID + ":textures/models/CapeNostalgia.png"); + private static ResourceLocation nostalgia2 = new ResourceLocation(RefStrings.MODID + ":textures/models/CapeNostalgia2.png"); private static ResourceLocation sam = new ResourceLocation(RefStrings.MODID + ":textures/models/CapeSam.png"); private static ResourceLocation hoboy = new ResourceLocation(RefStrings.MODID + ":textures/models/CapeHoboy.png"); private static ResourceLocation master = new ResourceLocation(RefStrings.MODID + ":textures/models/CapeMaster.png"); @@ -52,7 +52,11 @@ public class RenderAccessoryUtility { return ayy; } if(uuid.equals(Library.Dr_Nostalgia)) { - return nostalgia; + + if(MainRegistry.polaroidID == 11) + return nostalgia2; + else + return nostalgia; } if(uuid.equals(Library.Samino2)) { return sam; diff --git a/com/hbm/saveddata/RadEntitySavedData.java b/com/hbm/saveddata/RadEntitySavedData.java deleted file mode 100644 index 0a33b0493..000000000 --- a/com/hbm/saveddata/RadEntitySavedData.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.hbm.saveddata; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import net.minecraft.world.WorldSavedData; -import net.minecraft.world.chunk.Chunk; - -public class RadEntitySavedData extends WorldSavedData { - - public List contaminated = new ArrayList(); - - public World worldObj; - - public RadEntitySavedData(String p_i2141_1_) { - super(p_i2141_1_); - } - - public RadEntitySavedData(World p_i1678_1_) - { - super("radentity"); - this.worldObj = p_i1678_1_; - this.markDirty(); - } - - public float getRadFromEntity(Entity e) { - - for(int i = 0; i < contaminated.size(); i++) { - if(new UUID(contaminated.get(i).hID, contaminated.get(i).lID).equals(e.getUniqueID())) - return contaminated.get(i).rad; - } - - return 0F; - } - - public void setRadForEntity(Entity e, float rad) { - - if(!(e instanceof EntityLivingBase)) - return; - - if(rad < 0) - rad = 0; - - for(int i = 0; i < contaminated.size(); i++) { - if(new UUID(contaminated.get(i).hID, contaminated.get(i).lID).equals(e.getUniqueID())) { - contaminated.get(i).rad = rad; - - if(contaminated.get(i).rad > 2500) - contaminated.get(i).rad = 2500; - - this.markDirty(); - return; - } - } - - contaminated.add(new RadEntry(e.getUniqueID().getMostSignificantBits(), e.getUniqueID().getLeastSignificantBits(), rad)); - - this.markDirty(); - } - - public void increaseRad(Entity e, float rad) { - - setRadForEntity(e, getRadFromEntity(e) + rad); - } - - @Override - public void readFromNBT(NBTTagCompound nbt) { - int count = nbt.getInteger("contCount"); - - for(int i = 0; i < count; i++) { - - contaminated.add(new RadEntry( - nbt.getLong("uH_" + i), - nbt.getLong("uL_" + i), - nbt.getFloat("cont_" + i))); - } - } - - @Override - public void writeToNBT(NBTTagCompound nbt) { - nbt.setInteger("contCount", contaminated.size()); - - int i = 0; - - for (RadEntry entry : contaminated) { - - nbt.setLong("uH_" + i, entry.hID); - nbt.setLong("uL_" + i, entry.lID); - nbt.setFloat("cont_" + i, entry.rad); - - i++; - } - } - - public static RadEntitySavedData getData(World worldObj) { - - RadEntitySavedData data = (RadEntitySavedData)worldObj.perWorldStorage.loadData(RadEntitySavedData.class, "radentity"); - if(data == null) { - worldObj.perWorldStorage.setData("radentity", new RadEntitySavedData(worldObj)); - - data = (RadEntitySavedData)worldObj.perWorldStorage.loadData(RadEntitySavedData.class, "radentity"); - } - - return data; - } - - public class RadEntry { - - long hID; - long lID; - float rad; - - public RadEntry(long hID, long lID, float rad) { - this.hID = hID; - this.lID = lID; - this.rad = rad; - } - } -} diff --git a/com/hbm/tileentity/machine/TileEntityDecon.java b/com/hbm/tileentity/machine/TileEntityDecon.java index 374ae31c7..66c4c7284 100644 --- a/com/hbm/tileentity/machine/TileEntityDecon.java +++ b/com/hbm/tileentity/machine/TileEntityDecon.java @@ -2,10 +2,6 @@ package com.hbm.tileentity.machine; import java.util.List; -import com.hbm.packet.AuxElectricityPacket; -import com.hbm.packet.PacketDispatcher; -import com.hbm.saveddata.RadEntitySavedData; - import net.minecraft.entity.Entity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; @@ -22,9 +18,13 @@ public class TileEntityDecon extends TileEntity { if (!entities.isEmpty()) { for (Entity e : entities) { - - RadEntitySavedData entityData = RadEntitySavedData.getData(worldObj); - entityData.increaseRad(e, -0.5F); + + float f = e.getEntityData().getFloat("hfr_radiation"); + f -= 0.5F; + + if(f < 0) f = 0; + + e.getEntityData().setFloat("hfr_radiation", f); } } }