mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
brought back radiation world destruction, radfog, some more hazard types
This commit is contained in:
parent
a42974d61e
commit
9932b377b3
@ -1,78 +0,0 @@
|
||||
package com.hbm.handler;
|
||||
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.RadiationConfig;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
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;
|
||||
|
||||
@Deprecated //wasn't in use anyway so who cares
|
||||
public class RadiationWorldHandler { //TODO: cram all this into the radiation system instance
|
||||
|
||||
public static void handleWorldDestruction(World world) { } /*
|
||||
|
||||
if(!(world instanceof WorldServer))
|
||||
return;
|
||||
|
||||
if(!RadiationConfig.worldRadEffects)
|
||||
return;
|
||||
|
||||
WorldServer serv = (WorldServer) world;
|
||||
|
||||
RadiationSavedData data = RadiationSavedData.getData(serv);
|
||||
ChunkProviderServer provider = (ChunkProviderServer) serv.getChunkProvider();
|
||||
|
||||
int count = 50;// MainRegistry.worldRad;
|
||||
int threshold = 5;// MainRegistry.worldRadThreshold;
|
||||
|
||||
Object[] entries = data.contamination.entrySet().toArray();
|
||||
|
||||
if(entries.length == 0)
|
||||
return;
|
||||
|
||||
Entry<ChunkCoordIntPair, Float> randEnt = (Entry<ChunkCoordIntPair, Float>) 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(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, 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) {
|
||||
world.setBlock(x, y, z, Blocks.air);
|
||||
} else if(world.getBlock(x, y, z) == Blocks.leaves2) {
|
||||
world.setBlock(x, y, z, Blocks.air);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
@ -26,4 +26,6 @@ public abstract class ChunkRadiationHandler {
|
||||
public void receiveChunkLoad(ChunkDataEvent.Load event) { }
|
||||
public void receiveChunkSave(ChunkDataEvent.Save event) { }
|
||||
public void receiveChunkUnload(ChunkEvent.Unload event) { }
|
||||
|
||||
public void handleWorldDestruction() { }
|
||||
}
|
||||
@ -3,8 +3,17 @@ package com.hbm.handler.radiation;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.RadiationConfig;
|
||||
import com.hbm.packet.AuxParticlePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.ChunkCoordIntPair;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraft.world.gen.ChunkProviderServer;
|
||||
import net.minecraftforge.event.world.ChunkDataEvent;
|
||||
import net.minecraftforge.event.world.ChunkEvent;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
@ -63,6 +72,7 @@ public class ChunkRadiationHandlerSimple extends ChunkRadiationHandler {
|
||||
HashMap<ChunkCoordIntPair, Float> radiation = entry.getValue().radiation;
|
||||
HashMap<ChunkCoordIntPair, Float> buff = new HashMap(radiation);
|
||||
radiation.clear();
|
||||
World world = entry.getKey();
|
||||
|
||||
for(Entry<ChunkCoordIntPair, Float> chunk : buff.entrySet()) {
|
||||
|
||||
@ -87,6 +97,16 @@ public class ChunkRadiationHandlerSimple extends ChunkRadiationHandler {
|
||||
} else {
|
||||
radiation.put(newCoord, chunk.getValue() * percent);
|
||||
}
|
||||
|
||||
float rad = radiation.get(newCoord);
|
||||
if(rad > RadiationConfig.fogRad && world != null && world.rand.nextInt(RadiationConfig.fogCh) == 0 && world.getChunkFromChunkCoords(coord.chunkXPos, coord.chunkZPos).isChunkLoaded) {
|
||||
|
||||
int x = coord.chunkXPos * 16 + world.rand.nextInt(16);
|
||||
int z = coord.chunkZPos * 16 + world.rand.nextInt(16);
|
||||
int y = world.getHeightValue(x, z) + world.rand.nextInt(5);
|
||||
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacket(x, y, z, 3), new TargetPoint(world.provider.dimensionId, x, y, z, 100));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -149,4 +169,66 @@ public class ChunkRadiationHandlerSimple extends ChunkRadiationHandler {
|
||||
|
||||
public HashMap<ChunkCoordIntPair, Float> radiation = new HashMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleWorldDestruction() {
|
||||
|
||||
int count = 25;
|
||||
int threshold = 10;
|
||||
int chunks = 2;
|
||||
|
||||
//for all worlds
|
||||
for(Entry<World, SimpleRadiationPerWorld> per : perWorld.entrySet()) {
|
||||
|
||||
World world = per.getKey();
|
||||
SimpleRadiationPerWorld list = per.getValue();
|
||||
|
||||
Object[] entries = list.radiation.entrySet().toArray();
|
||||
|
||||
if(entries.length == 0)
|
||||
return;
|
||||
|
||||
//chose this many random chunks
|
||||
for(int c = 0; c < chunks; c++) {
|
||||
|
||||
Entry<ChunkCoordIntPair, Float> randEnt = (Entry<ChunkCoordIntPair, Float>) entries[world.rand.nextInt(entries.length)];
|
||||
|
||||
ChunkCoordIntPair coords = randEnt.getKey();
|
||||
WorldServer serv = (WorldServer) world;
|
||||
ChunkProviderServer provider = (ChunkProviderServer) serv.getChunkProvider();
|
||||
|
||||
//choose this many random locations within the chunk
|
||||
for(int i = 0; i < count; 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(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, 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) {
|
||||
world.setBlock(x, y, z, Blocks.air);
|
||||
} else if(world.getBlock(x, y, z) == Blocks.leaves2) {
|
||||
world.setBlock(x, y, z, Blocks.air);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package com.hbm.handler.radiation;
|
||||
|
||||
import com.hbm.config.RadiationConfig;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
@ -50,6 +52,10 @@ public class ChunkRadiationManager {
|
||||
proxy.updateSystem();
|
||||
eggTimer = 0;
|
||||
}
|
||||
|
||||
if(RadiationConfig.worldRadEffects) {
|
||||
proxy.handleWorldDestruction();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ public class HazardEntry {
|
||||
}
|
||||
|
||||
public void applyHazard(ItemStack stack, EntityLivingBase entity) {
|
||||
type.onUpdate(entity, HazardModifier.evalAllModifiers(stack, entity, baseLevel, mods));
|
||||
type.onUpdate(entity, HazardModifier.evalAllModifiers(stack, entity, baseLevel, mods), stack);
|
||||
}
|
||||
|
||||
public HazardTypeBase getType() {
|
||||
|
||||
@ -2,7 +2,6 @@ package com.hbm.hazard;
|
||||
|
||||
import com.hbm.hazard.transformer.HazardTransformerRadiationNBT;
|
||||
import com.hbm.hazard.type.*;
|
||||
import com.hbm.items.special.ItemHazard;
|
||||
|
||||
public class HazardRegistry {
|
||||
|
||||
@ -94,6 +93,9 @@ public class HazardRegistry {
|
||||
public static final HazardTypeBase HOT = new HazardTypeHot();
|
||||
public static final HazardTypeBase BLINDING = new HazardTypeBlinding();
|
||||
public static final HazardTypeBase ASBESTOS = new HazardTypeAsbestos();
|
||||
public static final HazardTypeBase COAL = new HazardTypeCoal();
|
||||
public static final HazardTypeBase HYDROACTIVE = new HazardTypeHydroactive();
|
||||
public static final HazardTypeBase EXPLOSIVE = new HazardTypeExplosive();
|
||||
|
||||
public static void registerItems() {
|
||||
//HazardSystem.register("ingotPlutonium", makeData(RADIATION, pu * ingot));
|
||||
|
||||
@ -10,6 +10,7 @@ import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.ArmorRegistry.HazardClass;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
@ -17,17 +18,19 @@ import net.minecraft.util.EnumChatFormatting;
|
||||
public class HazardTypeAsbestos extends HazardTypeBase {
|
||||
|
||||
@Override
|
||||
public void onUpdate(EntityLivingBase target, float level) {
|
||||
public void onUpdate(EntityLivingBase target, float level, ItemStack stack) {
|
||||
|
||||
if(!ArmorRegistry.hasProtection(target, 3, HazardClass.PARTICLE_FINE))
|
||||
HbmLivingProps.incrementAsbestos(target, (int) Math.min(level, 10));
|
||||
else
|
||||
ArmorUtil.damageGasMaskFilter(target, (int)level);
|
||||
ArmorUtil.damageGasMaskFilter(target, (int) level);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity(EntityItem item, float level) { }
|
||||
|
||||
@Override
|
||||
public void addHazardInformation(EntityPlayer player, List list, float level, ItemStack stack, List<HazardModifier> modifiers) {
|
||||
list.add(EnumChatFormatting.WHITE + "[" + I18nUtil.resolveKey("trait.asbestos") + "]");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@ import com.hbm.hazard.HazardModifier;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@ -16,8 +17,16 @@ public abstract class HazardTypeBase {
|
||||
* Does the thing. Called by HazardEntry.applyHazard
|
||||
* @param target the holder
|
||||
* @param level the final level after calculating all the modifiers
|
||||
* @param the stack that is being updated
|
||||
*/
|
||||
public abstract void onUpdate(EntityLivingBase target, float level);
|
||||
public abstract void onUpdate(EntityLivingBase target, float level, ItemStack stack);
|
||||
|
||||
/**
|
||||
* Updates the hazard for dropped items. Used for things like explosive and hydroactive items.
|
||||
* @param item
|
||||
* @param level
|
||||
*/
|
||||
public abstract void updateEntity(EntityItem item, float level);
|
||||
|
||||
/**
|
||||
* Adds item tooltip info. Called by Item.addInformation
|
||||
|
||||
@ -8,6 +8,7 @@ import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.ArmorRegistry.HazardClass;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
@ -17,13 +18,16 @@ import net.minecraft.util.EnumChatFormatting;
|
||||
public class HazardTypeBlinding extends HazardTypeBase {
|
||||
|
||||
@Override
|
||||
public void onUpdate(EntityLivingBase target, float level) {
|
||||
public void onUpdate(EntityLivingBase target, float level, ItemStack stack) {
|
||||
|
||||
if(!ArmorRegistry.hasProtection(target, 3, HazardClass.LIGHT)) {
|
||||
target.addPotionEffect(new PotionEffect(Potion.blindness.id, (int)level, 0));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity(EntityItem item, float level) { }
|
||||
|
||||
@Override
|
||||
public void addHazardInformation(EntityPlayer player, List list, float level, ItemStack stack, List<HazardModifier> modifiers) {
|
||||
list.add(EnumChatFormatting.DARK_AQUA + "[" + I18nUtil.resolveKey("trait.blinding") + "]");
|
||||
|
||||
37
src/main/java/com/hbm/hazard/type/HazardTypeCoal.java
Normal file
37
src/main/java/com/hbm/hazard/type/HazardTypeCoal.java
Normal file
@ -0,0 +1,37 @@
|
||||
package com.hbm.hazard.type;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
import com.hbm.hazard.HazardModifier;
|
||||
import com.hbm.util.ArmorRegistry;
|
||||
import com.hbm.util.ArmorUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.ArmorRegistry.HazardClass;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
public class HazardTypeCoal extends HazardTypeBase {
|
||||
|
||||
@Override
|
||||
public void onUpdate(EntityLivingBase target, float level, ItemStack stack) {
|
||||
|
||||
if(!ArmorRegistry.hasProtection(target, 3, HazardClass.PARTICLE_COARSE))
|
||||
HbmLivingProps.incrementBlackLung(target, (int) Math.min(level, 10));
|
||||
else
|
||||
ArmorUtil.damageGasMaskFilter(target, (int) level);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity(EntityItem item, float level) { }
|
||||
|
||||
@Override
|
||||
public void addHazardInformation(EntityPlayer player, List list, float level, ItemStack stack, List<HazardModifier> modifiers) {
|
||||
list.add(EnumChatFormatting.DARK_GRAY + "[" + I18nUtil.resolveKey("trait.coal") + "]");
|
||||
}
|
||||
|
||||
}
|
||||
@ -7,6 +7,7 @@ import com.hbm.util.ContaminationUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
@ -14,10 +15,13 @@ import net.minecraft.util.EnumChatFormatting;
|
||||
public class HazardTypeDigamma extends HazardTypeBase {
|
||||
|
||||
@Override
|
||||
public void onUpdate(EntityLivingBase target, float level) {
|
||||
public void onUpdate(EntityLivingBase target, float level, ItemStack stack) {
|
||||
ContaminationUtil.applyDigammaData(target, level / 20F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity(EntityItem item, float level) { }
|
||||
|
||||
@Override
|
||||
public void addHazardInformation(EntityPlayer player, List list, float level, ItemStack stack, List<HazardModifier> modifiers) {
|
||||
|
||||
|
||||
38
src/main/java/com/hbm/hazard/type/HazardTypeExplosive.java
Normal file
38
src/main/java/com/hbm/hazard/type/HazardTypeExplosive.java
Normal file
@ -0,0 +1,38 @@
|
||||
package com.hbm.hazard.type;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.hazard.HazardModifier;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
public class HazardTypeExplosive extends HazardTypeBase {
|
||||
|
||||
@Override
|
||||
public void onUpdate(EntityLivingBase target, float level, ItemStack stack) {
|
||||
|
||||
if(!target.worldObj.isRemote && target.isBurning()) {
|
||||
stack = null;
|
||||
target.worldObj.newExplosion(null, target.posX, target.posY + target.getEyeHeight() - target.getYOffset(), target.posZ, level, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity(EntityItem item, float level) {
|
||||
if(item.isBurning()) {
|
||||
item.setDead();
|
||||
item.worldObj.newExplosion(null, item.posX, item.posY + item.height * 0.5, item.posZ, level, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addHazardInformation(EntityPlayer player, List list, float level, ItemStack stack, List<HazardModifier> modifiers) {
|
||||
list.add(EnumChatFormatting.RED + "[" + I18nUtil.resolveKey("trait.explosive") + "]");
|
||||
}
|
||||
}
|
||||
@ -8,6 +8,7 @@ import com.hbm.items.ModItems;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
@ -15,7 +16,7 @@ import net.minecraft.util.EnumChatFormatting;
|
||||
public class HazardTypeHot extends HazardTypeBase {
|
||||
|
||||
@Override
|
||||
public void onUpdate(EntityLivingBase target, float level) {
|
||||
public void onUpdate(EntityLivingBase target, float level, ItemStack stack) {
|
||||
|
||||
boolean reacher = false;
|
||||
|
||||
@ -26,6 +27,9 @@ public class HazardTypeHot extends HazardTypeBase {
|
||||
target.setFire((int) Math.ceil(level));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity(EntityItem item, float level) { }
|
||||
|
||||
@Override
|
||||
public void addHazardInformation(EntityPlayer player, List list, float level, ItemStack stack, List<HazardModifier> modifiers) {
|
||||
list.add(EnumChatFormatting.GOLD + "[" + I18nUtil.resolveKey("trait.hot") + "]");
|
||||
|
||||
37
src/main/java/com/hbm/hazard/type/HazardTypeHydroactive.java
Normal file
37
src/main/java/com/hbm/hazard/type/HazardTypeHydroactive.java
Normal file
@ -0,0 +1,37 @@
|
||||
package com.hbm.hazard.type;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.hazard.HazardModifier;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
public class HazardTypeHydroactive extends HazardTypeBase {
|
||||
|
||||
@Override
|
||||
public void onUpdate(EntityLivingBase target, float level, ItemStack stack) {
|
||||
if(target.isWet()) {
|
||||
stack = null;
|
||||
target.worldObj.newExplosion(null, target.posX, target.posY + target.getEyeHeight() - target.getYOffset(), target.posZ, level, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity(EntityItem item, float level) {
|
||||
if(item.worldObj.getBlock((int)Math.floor(item.posX), (int)Math.floor(item.posY), (int)Math.floor(item.posZ)).getMaterial() == Material.water) {
|
||||
item.setDead();
|
||||
item.worldObj.newExplosion(null, item.posX, item.posY + item.height * 0.5, item.posZ, level, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addHazardInformation(EntityPlayer player, List list, float level, ItemStack stack, List<HazardModifier> modifiers) {
|
||||
list.add(EnumChatFormatting.RED + "[" + I18nUtil.resolveKey("trait.hydro") + "]");
|
||||
}
|
||||
}
|
||||
@ -13,6 +13,7 @@ import com.hbm.util.ContaminationUtil.HazardType;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
@ -20,7 +21,7 @@ import net.minecraft.util.EnumChatFormatting;
|
||||
public class HazardTypeRadiation extends HazardTypeBase {
|
||||
|
||||
@Override
|
||||
public void onUpdate(EntityLivingBase target, float level) {
|
||||
public void onUpdate(EntityLivingBase target, float level, ItemStack stack) {
|
||||
|
||||
boolean reacher = false;
|
||||
|
||||
@ -37,6 +38,9 @@ public class HazardTypeRadiation extends HazardTypeBase {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity(EntityItem item, float level) { }
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addHazardInformation(EntityPlayer player, List list, float level, ItemStack stack, List<HazardModifier> modifiers) {
|
||||
|
||||
@ -716,6 +716,14 @@ public class AssemblerRecipes {
|
||||
new OreDictStack("ingotCopper", 4),
|
||||
new ComparableStack(ModItems.plate_polymer, 4)
|
||||
}, 100);
|
||||
|
||||
makeRecipe(new ComparableStack(ModItems.multitool_hit, 1), new AStack[] {
|
||||
new OreDictStack("ingotTcAlloy", 4),
|
||||
new OreDictStack("plateSteel", 4),
|
||||
new ComparableStack(ModItems.wire_gold, 12),
|
||||
new ComparableStack(ModItems.motor, 4),
|
||||
new ComparableStack(ModItems.circuit_tantalium, 16)
|
||||
}, 100);
|
||||
|
||||
makeRecipe(new ComparableStack(ModBlocks.block_cap_nuka, 1), new AStack[] { new ComparableStack(ModItems.cap_nuka, 128) }, 10);
|
||||
makeRecipe(new ComparableStack(ModBlocks.block_cap_quantum, 1), new AStack[] { new ComparableStack(ModItems.cap_quantum, 128) }, 10);
|
||||
|
||||
@ -38,28 +38,28 @@ public class OreDictManager {
|
||||
/*
|
||||
* RADIOACTIVE
|
||||
*/
|
||||
new DictFrame("Uranium") .rad(HazardRegistry.u) .nugget(nugget_uranium) .billet(billet_uranium) .ingot(ingot_uranium) .dust(powder_uranium) .block(block_uranium) .ore(ore_uranium, ore_uranium_scorched, ore_gneiss_uranium, ore_gneiss_uranium_scorched, ore_nether_uranium, ore_nether_uranium_scorched, ore_meteor_uranium);
|
||||
new DictFrame("Uranium233", "U233") .rad(HazardRegistry.u233) .nugget(nugget_u233) .billet(billet_u233) .ingot(ingot_u233) .block(block_u233);
|
||||
new DictFrame("Uranium235", "U235") .rad(HazardRegistry.u235) .nugget(nugget_u235) .billet(billet_u235) .ingot(ingot_u235) .block(block_u235);
|
||||
new DictFrame("Uranium238", "U238") .rad(HazardRegistry.u238) .nugget(nugget_u238) .billet(billet_u238) .ingot(ingot_u238) .block(block_u238);
|
||||
new DictFrame("Thorium232", "Th232", "Thorium") .rad(HazardRegistry.th232) .nugget(nugget_th232) .billet(billet_th232) .ingot(ingot_th232) .dust(powder_thorium) .block(block_thorium) .ore(ore_thorium, ore_meteor_thorium);
|
||||
new DictFrame("Plutonium") .rad(HazardRegistry.pu) .nugget(nugget_plutonium) .billet(billet_plutonium) .ingot(ingot_plutonium) .dust(powder_plutonium) .block(block_plutonium) .ore(ore_nether_plutonium);
|
||||
new DictFrame("PlutoniumRG") .rad(HazardRegistry.purg) .nugget(nugget_pu_mix) .billet(billet_pu_mix) .ingot(ingot_pu_mix) .block(block_pu_mix);
|
||||
new DictFrame("Plutonium238", "Pu238") .rad(HazardRegistry.pu238) .nugget(nugget_pu238) .billet(billet_pu238) .ingot(ingot_pu238) .block(block_pu238);
|
||||
new DictFrame("Plutonium239", "Pu239") .rad(HazardRegistry.pu239) .nugget(nugget_pu239) .billet(billet_pu239) .ingot(ingot_pu239) .block(block_pu239);
|
||||
new DictFrame("Plutonium240", "Pu240") .rad(HazardRegistry.pu240) .nugget(nugget_pu240) .billet(billet_pu240) .ingot(ingot_pu240) .block(block_pu240);
|
||||
new DictFrame("Plutonium241", "Pu241") .rad(HazardRegistry.pu241) .nugget(nugget_pu241) .billet(billet_pu241) .ingot(ingot_pu241); //.block(block_pu241);
|
||||
new DictFrame("Americium241", "Am241") .rad(HazardRegistry.am241) .nugget(nugget_am241) .billet(billet_am241) .ingot(ingot_am241);
|
||||
new DictFrame("Americium242", "Am242") .rad(HazardRegistry.am242) .nugget(nugget_am242) .billet(billet_am242) .ingot(ingot_am242);
|
||||
new DictFrame("AmericiumRG") .rad(HazardRegistry.amrg) .nugget(nugget_am_mix) .billet(billet_am_mix) .ingot(ingot_am_mix);
|
||||
new DictFrame("Neptunium237", "Np237", "Neptunium") .rad(HazardRegistry.np237) .nugget(nugget_neptunium) .billet(billet_neptunium) .ingot(ingot_neptunium) .dust(powder_neptunium) .block(block_neptunium);
|
||||
new DictFrame("Polonium210", "Po210") .rad(HazardRegistry.po210).hot(3) .nugget(nugget_polonium) .billet(billet_polonium) .ingot(ingot_polonium) .dust(powder_polonium) .block(block_polonium);
|
||||
new DictFrame("Technetium99", "Tc99") .rad(HazardRegistry.tc99) .nugget(nugget_technetium) .billet(billet_technetium) .ingot(ingot_technetium);
|
||||
new DictFrame("Radium226", "Ra226") .rad(HazardRegistry.ra226) .nugget(nugget_ra226);
|
||||
new DictFrame("Cobalt60", "Co60") .rad(HazardRegistry.co60).hot(1) .nugget(nugget_co60) .billet(billet_co60) .ingot(ingot_co60) .dust(powder_co60);
|
||||
new DictFrame("Gold198", "Au198") .rad(HazardRegistry.au198).hot(5) .nugget(nugget_au198) .billet(billet_au198) .ingot(ingot_au198) .dust(powder_au198);
|
||||
new DictFrame("Schrabidium") .rad(HazardRegistry.sa326) .nugget(nugget_schrabidium) .billet(billet_schrabidium) .ingot(ingot_schrabidium) .dust(powder_schrabidium) .plate(plate_schrabidium) .block(block_schrabidium) .ore(ore_schrabidium, ore_gneiss_schrabidium, ore_nether_schrabidium);
|
||||
new DictFrame("Solinium") .rad(HazardRegistry.sa327) .nugget(nugget_solinium) .billet(billet_solinium) .ingot(ingot_solinium) .block(block_solinium);
|
||||
new DictFrame("Uranium") .rad(HazardRegistry.u) .nugget(nugget_uranium) .billet(billet_uranium) .ingot(ingot_uranium) .dust(powder_uranium) .block(block_uranium) .ore(ore_uranium, ore_uranium_scorched, ore_gneiss_uranium, ore_gneiss_uranium_scorched, ore_nether_uranium, ore_nether_uranium_scorched, ore_meteor_uranium);
|
||||
new DictFrame("Uranium233", "U233") .rad(HazardRegistry.u233) .nugget(nugget_u233) .billet(billet_u233) .ingot(ingot_u233) .block(block_u233);
|
||||
new DictFrame("Uranium235", "U235") .rad(HazardRegistry.u235) .nugget(nugget_u235) .billet(billet_u235) .ingot(ingot_u235) .block(block_u235);
|
||||
new DictFrame("Uranium238", "U238") .rad(HazardRegistry.u238) .nugget(nugget_u238) .billet(billet_u238) .ingot(ingot_u238) .block(block_u238);
|
||||
new DictFrame("Thorium232", "Th232", "Thorium") .rad(HazardRegistry.th232) .nugget(nugget_th232) .billet(billet_th232) .ingot(ingot_th232) .dust(powder_thorium) .block(block_thorium) .ore(ore_thorium, ore_meteor_thorium);
|
||||
new DictFrame("Plutonium") .rad(HazardRegistry.pu) .nugget(nugget_plutonium) .billet(billet_plutonium) .ingot(ingot_plutonium) .dust(powder_plutonium) .block(block_plutonium) .ore(ore_nether_plutonium);
|
||||
new DictFrame("PlutoniumRG") .rad(HazardRegistry.purg) .nugget(nugget_pu_mix) .billet(billet_pu_mix) .ingot(ingot_pu_mix) .block(block_pu_mix);
|
||||
new DictFrame("Plutonium238", "Pu238") .rad(HazardRegistry.pu238) .nugget(nugget_pu238) .billet(billet_pu238) .ingot(ingot_pu238) .block(block_pu238);
|
||||
new DictFrame("Plutonium239", "Pu239") .rad(HazardRegistry.pu239) .nugget(nugget_pu239) .billet(billet_pu239) .ingot(ingot_pu239) .block(block_pu239);
|
||||
new DictFrame("Plutonium240", "Pu240") .rad(HazardRegistry.pu240) .nugget(nugget_pu240) .billet(billet_pu240) .ingot(ingot_pu240) .block(block_pu240);
|
||||
new DictFrame("Plutonium241", "Pu241") .rad(HazardRegistry.pu241) .nugget(nugget_pu241) .billet(billet_pu241) .ingot(ingot_pu241); //.block(block_pu241);
|
||||
new DictFrame("Americium241", "Am241") .rad(HazardRegistry.am241) .nugget(nugget_am241) .billet(billet_am241) .ingot(ingot_am241);
|
||||
new DictFrame("Americium242", "Am242") .rad(HazardRegistry.am242) .nugget(nugget_am242) .billet(billet_am242) .ingot(ingot_am242);
|
||||
new DictFrame("AmericiumRG") .rad(HazardRegistry.amrg) .nugget(nugget_am_mix) .billet(billet_am_mix) .ingot(ingot_am_mix);
|
||||
new DictFrame("Neptunium237", "Np237", "Neptunium") .rad(HazardRegistry.np237) .nugget(nugget_neptunium) .billet(billet_neptunium) .ingot(ingot_neptunium) .dust(powder_neptunium) .block(block_neptunium);
|
||||
new DictFrame("Polonium210", "Po210") .rad(HazardRegistry.po210).hot(3) .nugget(nugget_polonium) .billet(billet_polonium) .ingot(ingot_polonium) .dust(powder_polonium) .block(block_polonium);
|
||||
new DictFrame("Technetium99", "Tc99") .rad(HazardRegistry.tc99) .nugget(nugget_technetium) .billet(billet_technetium) .ingot(ingot_technetium);
|
||||
new DictFrame("Radium226", "Ra226") .rad(HazardRegistry.ra226) .nugget(nugget_ra226);
|
||||
new DictFrame("Cobalt60", "Co60") .rad(HazardRegistry.co60).hot(1) .nugget(nugget_co60) .billet(billet_co60) .ingot(ingot_co60) .dust(powder_co60);
|
||||
new DictFrame("Gold198", "Au198") .rad(HazardRegistry.au198).hot(5) .nugget(nugget_au198) .billet(billet_au198) .ingot(ingot_au198) .dust(powder_au198);
|
||||
new DictFrame("Schrabidium") .rad(HazardRegistry.sa326).blinding(3F) .nugget(nugget_schrabidium) .billet(billet_schrabidium) .ingot(ingot_schrabidium) .dust(powder_schrabidium) .plate(plate_schrabidium) .block(block_schrabidium) .ore(ore_schrabidium, ore_gneiss_schrabidium, ore_nether_schrabidium);
|
||||
new DictFrame("Solinium") .rad(HazardRegistry.sa327).blinding(3F) .nugget(nugget_solinium) .billet(billet_solinium) .ingot(ingot_solinium) .block(block_solinium);
|
||||
|
||||
/*
|
||||
* STABLE
|
||||
@ -93,7 +93,7 @@ public class OreDictManager {
|
||||
new DictFrame("Dineutronium") .nugget(nugget_dineutronium) .ingot(ingot_dineutronium) .dust(powder_dineutronium) .block(block_dineutronium);
|
||||
new DictFrame("Lithium") .ingot(lithium) .dustSmall(powder_lithium_tiny) .dust(powder_lithium) .block(block_lithium) .ore(ore_gneiss_lithium, ore_meteor_lithium);
|
||||
new DictFrame("Fiberglass") .ingot(ingot_fiberglass) .block(block_fiberglass);
|
||||
new DictFrame("Asbestos") .ingot(ingot_asbestos) .dust(powder_asbestos) .block(block_asbestos) .ore(ore_asbestos, ore_gneiss_asbestos, basalt_asbestos);
|
||||
new DictFrame("Asbestos") .asbestos(1F) .ingot(ingot_asbestos) .dust(powder_asbestos) .block(block_asbestos) .ore(ore_asbestos, ore_gneiss_asbestos, basalt_asbestos);
|
||||
|
||||
/*
|
||||
* DUST AND GEM ORES
|
||||
@ -206,6 +206,12 @@ public class OreDictManager {
|
||||
public DictFrame hot(float time) {
|
||||
return this.haz(new HazardEntry(HazardRegistry.HOT, time));
|
||||
}
|
||||
public DictFrame blinding(float time) {
|
||||
return this.haz(new HazardEntry(HazardRegistry.BLINDING, time));
|
||||
}
|
||||
public DictFrame asbestos(float asb) {
|
||||
return this.haz(new HazardEntry(HazardRegistry.ASBESTOS, asb));
|
||||
}
|
||||
public DictFrame haz(HazardEntry hazard) {
|
||||
hazards.add(hazard);
|
||||
return this;
|
||||
|
||||
@ -32,7 +32,6 @@ import com.hbm.extprop.HbmPlayerProps;
|
||||
import com.hbm.handler.ArmorModHandler;
|
||||
import com.hbm.handler.BossSpawnHandler;
|
||||
import com.hbm.handler.EntityEffectHandler;
|
||||
import com.hbm.handler.RadiationWorldHandler;
|
||||
import com.hbm.hazard.HazardSystem;
|
||||
import com.hbm.interfaces.IBomb;
|
||||
import com.hbm.handler.HTTPHandler;
|
||||
@ -696,11 +695,10 @@ public class ModEventHandler {
|
||||
* REMOVE THIS ^ ^ ^
|
||||
*/
|
||||
}
|
||||
/// RADIATION STUFF END ///
|
||||
}
|
||||
/// RADIATION STUFF END ///
|
||||
|
||||
if(event.phase == Phase.START) {
|
||||
RadiationWorldHandler.handleWorldDestruction(event.world);
|
||||
BossSpawnHandler.rollTheDice(event.world);
|
||||
TimedGenerator.automaton(event.world, 100);
|
||||
}
|
||||
|
||||
@ -18,6 +18,7 @@ import com.hbm.hazard.HazardSystem;
|
||||
import com.hbm.interfaces.IHoldableWeapon;
|
||||
import com.hbm.interfaces.IItemHUD;
|
||||
import com.hbm.interfaces.Spaghetti;
|
||||
import com.hbm.inventory.BreederRecipes;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.gui.GUIArmorTable;
|
||||
import com.hbm.items.ModItems;
|
||||
@ -531,6 +532,15 @@ public class ModEventHandlerClient {
|
||||
}
|
||||
}
|
||||
|
||||
/// BREEDING ///
|
||||
int[] breeder = BreederRecipes.getFuelValue(stack);
|
||||
|
||||
if(breeder != null) {
|
||||
list.add(BreederRecipes.getHEATString("[" + I18nUtil.resolveKey("trait.heat", breeder[0]) + "]", breeder[0]));
|
||||
list.add(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("trait.breeding", breeder[1]));
|
||||
list.add(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("trait.furnace", (breeder[0] * breeder[1] * 5)));
|
||||
}
|
||||
|
||||
/// CUSTOM NUKE ///
|
||||
ComparableStack comp = new ComparableStack(stack).makeSingular();
|
||||
CustomNukeEntry entry = TileEntityNukeCustom.entries.get(comp);
|
||||
|
||||
@ -82,85 +82,13 @@ public class ItemHazardModule {
|
||||
}
|
||||
|
||||
public void applyEffects(EntityLivingBase entity, float mod, int slot, boolean currentItem) {
|
||||
|
||||
boolean reacher = false;
|
||||
|
||||
if(this.coal > 0) {
|
||||
if(!ArmorRegistry.hasProtection(entity, 3, HazardClass.PARTICLE_COARSE))
|
||||
HbmLivingProps.incrementBlackLung(entity, (int) (this.coal * Math.min(mod, 10)));
|
||||
else
|
||||
ArmorUtil.damageGasMaskFilter(entity, (int) (this.coal));
|
||||
}
|
||||
|
||||
if(this.hydro && currentItem) {
|
||||
|
||||
if(!entity.worldObj.isRemote && entity.isInWater() && entity instanceof EntityPlayer) {
|
||||
|
||||
EntityPlayer player = (EntityPlayer) entity;
|
||||
ItemStack held = player.getHeldItem();
|
||||
|
||||
player.inventory.mainInventory[player.inventory.currentItem] = held.getItem().getContainerItem(held);
|
||||
player.inventoryContainer.detectAndSendChanges();
|
||||
player.worldObj.newExplosion(null, player.posX, player.posY + player.getEyeHeight() - player.getYOffset(), player.posZ, 2F, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
if(this.explosive > 0 && currentItem) {
|
||||
|
||||
if(!entity.worldObj.isRemote && entity.isBurning() && entity instanceof EntityPlayer) {
|
||||
|
||||
EntityPlayer player = (EntityPlayer) entity;
|
||||
ItemStack held = player.getHeldItem();
|
||||
|
||||
player.inventory.mainInventory[player.inventory.currentItem] = held.getItem().getContainerItem(held);
|
||||
player.inventoryContainer.detectAndSendChanges();
|
||||
player.worldObj.newExplosion(null, player.posX, player.posY + player.getEyeHeight() - player.getYOffset(), player.posZ, this.explosive, true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
|
||||
|
||||
if(this.coal > 0) {
|
||||
list.add(EnumChatFormatting.DARK_GRAY + "[" + I18nUtil.resolveKey("trait.coal") + "]");
|
||||
}
|
||||
|
||||
if(this.hydro) {
|
||||
list.add(EnumChatFormatting.RED + "[" + I18nUtil.resolveKey("trait.hydro") + "]");
|
||||
}
|
||||
|
||||
if(this.explosive > 0) {
|
||||
list.add(EnumChatFormatting.RED + "[" + I18nUtil.resolveKey("trait.explosive") + "]");
|
||||
}
|
||||
|
||||
int[] breeder = BreederRecipes.getFuelValue(stack);
|
||||
|
||||
if(breeder != null) {
|
||||
list.add(BreederRecipes.getHEATString("[" + I18nUtil.resolveKey("trait.heat", breeder[0]) + "]", breeder[0]));
|
||||
list.add(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("trait.breeding", breeder[1]));
|
||||
list.add(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("trait.furnace", (breeder[0] * breeder[1] * 5)));
|
||||
}
|
||||
}
|
||||
|
||||
public boolean onEntityItemUpdate(EntityItem item) {
|
||||
|
||||
if(!item.worldObj.isRemote) {
|
||||
|
||||
if(this.hydro && item.worldObj.getBlock((int)Math.floor(item.posX), (int)Math.floor(item.posY), (int)Math.floor(item.posZ)).getMaterial() == Material.water) {
|
||||
|
||||
item.setDead();
|
||||
item.worldObj.newExplosion(item, item.posX, item.posY, item.posZ, 2F, true, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
if(this.explosive > 0 && item.isBurning()) {
|
||||
|
||||
item.setDead();
|
||||
item.worldObj.newExplosion(item, item.posX, item.posY, item.posZ, this.explosive, true, true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user