mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
SILX automation, cleaned up radiation code
This commit is contained in:
parent
a2801ebb1c
commit
de691fbe71
@ -238,7 +238,6 @@ public abstract class BlockDummyable extends BlockContainer {
|
||||
|
||||
// if(pos != null) {
|
||||
|
||||
// TODO: run extensive tests on whether this change doesn't break anything
|
||||
ForgeDirection d = ForgeDirection.getOrientation(i);
|
||||
|
||||
if(world.getBlock(x - d.offsetX, y - d.offsetY, z - d.offsetZ) == this)
|
||||
|
||||
@ -84,8 +84,6 @@ public class CoriumBlock extends BlockFluidClassic {
|
||||
ContaminationUtil.contaminate((EntityLivingBase)entity, HazardType.RADIATION, ContaminationType.CREATIVE, 1F);
|
||||
}
|
||||
|
||||
//TODO: prevent displacement
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
|
||||
|
||||
@ -2,39 +2,38 @@ package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.saveddata.RadiationSavedData;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockAbsorber extends Block {
|
||||
|
||||
|
||||
float absorb = 0;
|
||||
|
||||
|
||||
public BlockAbsorber(Material mat, float ab) {
|
||||
super(mat);
|
||||
this.setTickRandomly(true);
|
||||
absorb = ab;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int tickRate(World world) {
|
||||
|
||||
return 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public int tickRate(World world) {
|
||||
|
||||
return 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
|
||||
RadiationSavedData.decrementRad(world, x, z, absorb);
|
||||
|
||||
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
|
||||
}
|
||||
|
||||
public void onBlockAdded(World world, int x, int y, int z) {
|
||||
super.onBlockAdded(world, x, y, z);
|
||||
|
||||
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
|
||||
}
|
||||
ChunkRadiationManager.proxy.decrementRad(world, x, y, z, absorb);
|
||||
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
|
||||
}
|
||||
|
||||
public void onBlockAdded(World world, int x, int y, int z) {
|
||||
super.onBlockAdded(world, x, y, z);
|
||||
|
||||
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,8 +2,7 @@ package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.saveddata.RadiationSavedData;
|
||||
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import net.minecraft.block.BlockFalling;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.World;
|
||||
@ -15,31 +14,27 @@ public class BlockFallingRad extends BlockFalling {
|
||||
|
||||
public BlockFallingRad(Material mat, float rad, float max) {
|
||||
super(mat);
|
||||
this.setTickRandomly(true);
|
||||
radIn = rad;
|
||||
radMax = max;
|
||||
this.setTickRandomly(true);
|
||||
radIn = rad;
|
||||
radMax = max;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand)
|
||||
{
|
||||
super.updateTick(world, x, y, z, rand);
|
||||
|
||||
RadiationSavedData.incrementRad(world, x, z, radIn, radMax);
|
||||
|
||||
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int tickRate(World world) {
|
||||
|
||||
return 20;
|
||||
}
|
||||
|
||||
public void onBlockAdded(World world, int x, int y, int z)
|
||||
{
|
||||
super.onBlockAdded(world, x, y, z);
|
||||
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
|
||||
}
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
super.updateTick(world, x, y, z, rand);
|
||||
ChunkRadiationManager.proxy.incrementRad(world, x, y, z, radIn);
|
||||
|
||||
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int tickRate(World world) {
|
||||
return 20;
|
||||
}
|
||||
|
||||
public void onBlockAdded(World world, int x, int y, int z) {
|
||||
super.onBlockAdded(world, x, y, z);
|
||||
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -2,10 +2,10 @@ package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.interfaces.IItemHazard;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.modules.ItemHazardModule;
|
||||
import com.hbm.saveddata.RadiationSavedData;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -132,7 +132,7 @@ public class BlockHazard extends Block implements IItemHazard {
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
|
||||
if(this.radIn > 0) {
|
||||
RadiationSavedData.incrementRad(world, x, z, radIn, radMax);
|
||||
ChunkRadiationManager.proxy.incrementRad(world, x, y, z, radIn);
|
||||
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,9 +2,9 @@ package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.interfaces.IItemHazard;
|
||||
import com.hbm.modules.ItemHazardModule;
|
||||
import com.hbm.saveddata.RadiationSavedData;
|
||||
|
||||
import net.minecraft.block.BlockFalling;
|
||||
import net.minecraft.block.material.Material;
|
||||
@ -15,8 +15,7 @@ public class BlockHazardFalling extends BlockFalling implements IItemHazard {
|
||||
|
||||
ItemHazardModule module;
|
||||
|
||||
private float radIn = 0.0F;
|
||||
private float radMax = 0.0F;
|
||||
private float rad = 0.0F;
|
||||
|
||||
private boolean beaconable = false;
|
||||
|
||||
@ -47,16 +46,15 @@ public class BlockHazardFalling extends BlockFalling implements IItemHazard {
|
||||
@Override
|
||||
public IItemHazard addRadiation(float radiation) {
|
||||
this.getModule().addRadiation(radiation);
|
||||
this.radIn = radiation * 0.1F;
|
||||
this.radMax = radiation;
|
||||
this.rad = radiation * 0.1F;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
|
||||
if(this.radIn > 0) {
|
||||
RadiationSavedData.incrementRad(world, x, z, radIn, radMax);
|
||||
if(this.rad > 0) {
|
||||
ChunkRadiationManager.proxy.incrementRad(world, x, y, z, rad);
|
||||
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
|
||||
}
|
||||
|
||||
@ -66,7 +64,7 @@ public class BlockHazardFalling extends BlockFalling implements IItemHazard {
|
||||
@Override
|
||||
public int tickRate(World world) {
|
||||
|
||||
if(this.radIn > 0)
|
||||
if(this.rad > 0)
|
||||
return 20;
|
||||
|
||||
return super.tickRate(world);
|
||||
@ -75,7 +73,7 @@ public class BlockHazardFalling extends BlockFalling implements IItemHazard {
|
||||
public void onBlockAdded(World world, int x, int y, int z) {
|
||||
super.onBlockAdded(world, x, y, z);
|
||||
|
||||
if(this.radIn > 0)
|
||||
if(this.rad > 0)
|
||||
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,10 +3,9 @@ package com.hbm.blocks.generic;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.saveddata.RadiationSavedData;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
@ -22,8 +21,7 @@ import net.minecraft.world.World;
|
||||
|
||||
public class BlockOre extends Block {
|
||||
|
||||
private float radIn = 0.0F;
|
||||
private float radMax = 0.0F;
|
||||
private float rad = 0.0F;
|
||||
|
||||
public BlockOre(Material mat) {
|
||||
super(mat);
|
||||
@ -34,11 +32,11 @@ public class BlockOre extends Block {
|
||||
this.setTickRandomly(tick);
|
||||
}
|
||||
|
||||
@Deprecated() //use hazard module for this
|
||||
public BlockOre(Material mat, float rad, float max) {
|
||||
super(mat);
|
||||
this.setTickRandomly(true);
|
||||
radIn = rad;
|
||||
radMax = max;
|
||||
this.rad = rad;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -316,10 +314,8 @@ public class BlockOre extends Block {
|
||||
return;
|
||||
}
|
||||
|
||||
if(this.radIn > 0) {
|
||||
|
||||
RadiationSavedData.incrementRad(world, x, z, radIn, radMax);
|
||||
|
||||
if(this.rad > 0) {
|
||||
ChunkRadiationManager.proxy.incrementRad(world, x, y, z, rad);
|
||||
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
|
||||
}
|
||||
}
|
||||
@ -327,7 +323,7 @@ public class BlockOre extends Block {
|
||||
@Override
|
||||
public int tickRate(World world) {
|
||||
|
||||
if(this.radIn > 0)
|
||||
if(this.rad > 0)
|
||||
return 20;
|
||||
|
||||
return 100;
|
||||
@ -336,7 +332,7 @@ public class BlockOre extends Block {
|
||||
public void onBlockAdded(World world, int x, int y, int z) {
|
||||
super.onBlockAdded(world, x, y, z);
|
||||
|
||||
if(this.radIn > 0)
|
||||
if(this.rad > 0)
|
||||
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
|
||||
}
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@ import java.util.Random;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.machine.BlockFluidBarrel;
|
||||
import com.hbm.explosion.ExplosionNukeGeneric;
|
||||
import com.hbm.saveddata.RadiationSavedData;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
@ -49,8 +49,7 @@ public class YellowBarrel extends Block {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RadiationSavedData.incrementRad(world, x, z, 35, 1500);
|
||||
ChunkRadiationManager.proxy.incrementRad(world, x, y, z, 35);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -99,9 +98,9 @@ public class YellowBarrel extends Block {
|
||||
super.updateTick(world, x, y, z, rand);
|
||||
|
||||
if(this == ModBlocks.yellow_barrel)
|
||||
RadiationSavedData.incrementRad(world, x, z, 5, 75);
|
||||
ChunkRadiationManager.proxy.incrementRad(world, x, y, z, 5.0F);
|
||||
else
|
||||
RadiationSavedData.incrementRad(world, x, z, 0.5F, 5);
|
||||
ChunkRadiationManager.proxy.incrementRad(world, x, y, z, 0.5F);
|
||||
|
||||
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
|
||||
}
|
||||
|
||||
@ -8,8 +8,6 @@ import java.util.Map.Entry;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.effect.EntityNukeCloudSmall;
|
||||
import com.hbm.saveddata.RadiationSavedData;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.enchantment.EnchantmentProtection;
|
||||
@ -163,7 +161,7 @@ public class TestEventTester extends Block {
|
||||
if(!worldObj.isRemote)
|
||||
worldObj.spawnEntityInWorld(rainbow);*/
|
||||
|
||||
RadiationSavedData data = RadiationSavedData.getData(worldObj);
|
||||
/*RadiationSavedData data = RadiationSavedData.getData(worldObj);
|
||||
|
||||
//ALU SETS RAD TO 1000
|
||||
//BER PRINTS RAD LEVEL
|
||||
@ -227,7 +225,7 @@ public class TestEventTester extends Block {
|
||||
|
||||
worldObj.spawnEntityInWorld(EntityNukeCloudSmall.statFac(worldObj, x1, y1 + 5, z1, 100));
|
||||
worldObj.setBlockToAir(x1, y1, z1);
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,8 +7,8 @@ import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.entity.effect.EntityFalloutRain;
|
||||
import com.hbm.explosion.ExplosionNukeGeneric;
|
||||
import com.hbm.explosion.ExplosionNukeRay;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.saveddata.RadiationSavedData;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@ -52,13 +52,12 @@ public class EntityNukeExplosionMK4 extends Entity {
|
||||
}
|
||||
|
||||
if(!worldObj.isRemote && fallout && explosion != null) {
|
||||
RadiationSavedData data = RadiationSavedData.getData(worldObj);
|
||||
|
||||
//float radMax = (float) (length / 2F * Math.pow(length, 2) / 35F);
|
||||
float radMax = Math.min((float) (length / 2F * Math.pow(length, 1.5) / 35F), 15000);
|
||||
//System.out.println(radMax);
|
||||
float rad = radMax / 4F;
|
||||
data.incrementRad(worldObj, (int)this.posX, (int)this.posZ, rad, radMax);
|
||||
ChunkRadiationManager.proxy.incrementRad(worldObj, (int) Math.floor(posX), (int) Math.floor(posY), (int) Math.floor(posZ), rad);
|
||||
}
|
||||
|
||||
if(!mute) {
|
||||
|
||||
@ -2,10 +2,10 @@ package com.hbm.entity.mob;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
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;
|
||||
@ -140,8 +140,8 @@ public class EntityRADBeast extends EntityMob implements IRadiationImmune {
|
||||
double deltaZ = target.posZ - this.posZ;
|
||||
|
||||
if(this.attackTime == 0 && getEntityToAttack() != null) {
|
||||
|
||||
RadiationSavedData.incrementRad(worldObj, (int) posX, (int) posZ, 150, 1000);
|
||||
|
||||
ChunkRadiationManager.proxy.incrementRad(worldObj, (int) Math.floor(posX), (int) Math.floor(posY), (int) Math.floor(posZ), 100);
|
||||
target.attackEntityFrom(ModDamageSource.radiation, 16.0F);
|
||||
this.swingItem();
|
||||
this.playLivingSound();
|
||||
|
||||
@ -2,11 +2,10 @@ package com.hbm.explosion;
|
||||
|
||||
import com.hbm.config.BombConfig;
|
||||
import com.hbm.entity.logic.EntityNukeExplosionMK4;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.saveddata.RadiationSavedData;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
@ -67,6 +66,6 @@ public class ExplosionNukeSmall {
|
||||
for(int i = -2; i <= 2; i++)
|
||||
for(int j = -2; j <= 2; j++)
|
||||
if(i + j < 4)
|
||||
RadiationSavedData.incrementRad(world, (int)posX + i * 16, (int)posZ + j * 16, 50 / (Math.abs(i) + Math.abs(j) + 1) * radMod, 1000);
|
||||
ChunkRadiationManager.proxy.incrementRad(world, (int) Math.floor(posX + i * 16), (int) Math.floor(posY), (int) Math.floor(posZ + j * 16), 50 / (Math.abs(i) + Math.abs(j) + 1) * radMod);
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,12 +8,12 @@ import com.hbm.config.RadiationConfig;
|
||||
import com.hbm.explosion.ExplosionNukeSmall;
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
import com.hbm.extprop.HbmLivingProps.ContaminationEffect;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.ExtPropPacket;
|
||||
import com.hbm.saveddata.AuxSavedData;
|
||||
import com.hbm.saveddata.RadiationSavedData;
|
||||
import com.hbm.util.ContaminationUtil;
|
||||
import com.hbm.util.ContaminationUtil.ContaminationType;
|
||||
import com.hbm.util.ContaminationUtil.HazardType;
|
||||
@ -92,16 +92,13 @@ public class EntityEffectHandler {
|
||||
|
||||
World world = entity.worldObj;
|
||||
|
||||
RadiationSavedData data = RadiationSavedData.getData(world);
|
||||
|
||||
if(!world.isRemote) {
|
||||
|
||||
int ix = (int)MathHelper.floor_double(entity.posX);
|
||||
int iy = (int)MathHelper.floor_double(entity.posY);
|
||||
int iz = (int)MathHelper.floor_double(entity.posZ);
|
||||
|
||||
Chunk chunk = world.getChunkFromBlockCoords(ix, iz);
|
||||
float rad = data.getRadNumFromCoord(chunk.xPosition, chunk.zPosition);
|
||||
float rad = ChunkRadiationManager.proxy.getRadiation(world, ix, iy, iz);
|
||||
|
||||
if(world.provider.isHellWorld && RadiationConfig.hellRad > 0 && rad < RadiationConfig.hellRad)
|
||||
rad = RadiationConfig.hellRad;
|
||||
|
||||
@ -5,8 +5,6 @@ import java.util.Map.Entry;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.RadiationConfig;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.saveddata.RadiationSavedData;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.network.play.server.S21PacketChunkData;
|
||||
@ -17,9 +15,10 @@ import net.minecraft.world.WorldServer;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.gen.ChunkProviderServer;
|
||||
|
||||
public class RadiationWorldHandler {
|
||||
@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) {
|
||||
public static void handleWorldDestruction(World world) { } /*
|
||||
|
||||
if(!(world instanceof WorldServer))
|
||||
return;
|
||||
@ -74,6 +73,6 @@ public class RadiationWorldHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
@ -126,12 +126,13 @@ public class FluidTank {
|
||||
slots[in] = null;
|
||||
} else if(slots[out] != null && (FluidContainerRegistry.getEmptyContainer(slots[in]) == null || slots[out].getItem() == FluidContainerRegistry.getEmptyContainer(slots[in]).getItem()) && slots[out].stackSize < slots[out].getMaxStackSize()) {
|
||||
fluid += FluidContainerRegistry.getFluidContent(slots[in], type);
|
||||
slots[in].stackSize--;
|
||||
if(slots[in].stackSize <= 0)
|
||||
slots[in] = null;
|
||||
|
||||
if(FluidContainerRegistry.getEmptyContainer(slots[in]) != null)
|
||||
slots[out].stackSize++;
|
||||
|
||||
slots[in].stackSize--;
|
||||
if(slots[in].stackSize <= 0)
|
||||
slots[in] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import java.util.List;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.entity.missile.EntityMissileBaseAdvanced;
|
||||
import com.hbm.inventory.MachineRecipes;
|
||||
import com.hbm.items.tool.ItemSatInterface;
|
||||
import com.hbm.lib.RefStrings;
|
||||
@ -254,7 +255,7 @@ public class GUIScreenSatInterface extends GuiScreen {
|
||||
|
||||
//TODO: fix radar screen implementation
|
||||
/*if(e instanceof EntityMissileBaseAdvanced) {
|
||||
t = ((EntityMissileBaseAdvanced)e).getMissileType();
|
||||
t = ((EntityMissileBaseAdvanced)e).getTargetType().ordinal();
|
||||
}*/
|
||||
|
||||
if(e instanceof EntityMob) {
|
||||
|
||||
@ -8,7 +8,7 @@ import java.util.Map.Entry;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.saveddata.RadiationSavedData;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
@ -513,11 +513,7 @@ public class ArmorFSB extends ItemArmor {
|
||||
|
||||
public static int check(World world, int x, int y, int z) {
|
||||
|
||||
RadiationSavedData data = RadiationSavedData.getData(world);
|
||||
|
||||
Chunk chunk = world.getChunkFromBlockCoords(x, z);
|
||||
int rads = (int) Math.ceil(data.getRadNumFromCoord(chunk.xPosition, chunk.zPosition));
|
||||
|
||||
int rads = (int) Math.ceil(ChunkRadiationManager.proxy.getRadiation(world, x, y, z));
|
||||
return rads;
|
||||
}
|
||||
|
||||
|
||||
@ -8,7 +8,6 @@ import org.lwjgl.opengl.GL11;
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.render.model.ModelArmorHEV;
|
||||
import com.hbm.saveddata.RadiationSavedData;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@ -6,9 +6,9 @@ import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.armor.ArmorFSB;
|
||||
import com.hbm.saveddata.RadiationSavedData;
|
||||
import com.hbm.util.ContaminationUtil;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
@ -84,12 +84,7 @@ public class ItemGeigerCounter extends Item {
|
||||
}
|
||||
|
||||
public static int check(World world, int x, int y, int z) {
|
||||
|
||||
RadiationSavedData data = RadiationSavedData.getData(world);
|
||||
|
||||
Chunk chunk = world.getChunkFromBlockCoords(x, z);
|
||||
int rads = (int)Math.ceil(data.getRadNumFromCoord(chunk.xPosition, chunk.zPosition));
|
||||
|
||||
int rads = (int)Math.ceil(ChunkRadiationManager.proxy.getRadiation(world, x, y, z));
|
||||
return rads;
|
||||
}
|
||||
|
||||
@ -97,8 +92,8 @@ public class ItemGeigerCounter extends Item {
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
|
||||
if(!world.isRemote) {
|
||||
world.playSoundAtEntity(player, "hbm:item.techBoop", 1.0F, 1.0F);
|
||||
ContaminationUtil.printGeigerData(player);
|
||||
world.playSoundAtEntity(player, "hbm:item.techBoop", 1.0F, 1.0F);
|
||||
ContaminationUtil.printGeigerData(player);
|
||||
}
|
||||
|
||||
return stack;
|
||||
|
||||
@ -420,6 +420,7 @@ public class Library {
|
||||
//TODO: jesus christ kill it
|
||||
//Flut-Füll gesteuerter Energieübertragungsalgorithmus
|
||||
//Flood fill controlled energy transmission algorithm
|
||||
//TODO: bring back the @Cursed annotation just for garbage like this
|
||||
public static void ffgeua(int x, int y, int z, boolean newTact, ISource that, World worldObj) {
|
||||
Block block = worldObj.getBlock(x, y, z);
|
||||
TileEntity tileentity = worldObj.getTileEntity(x, y, z);
|
||||
|
||||
@ -92,9 +92,9 @@ public class CraftingManager {
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.canister_empty, 2), new Object[] { "S ", "AA", "AA", 'S', "plateSteel", 'A', "plateAluminum" }));
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.yellow_barrel, 1), new Object[] { "DDD", "DTD", "DDD", 'D', ModItems.nuclear_waste, 'T', ModItems.tank_steel });
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.vitrified_barrel, 1), new Object[] { "DDD", "DTD", "DDD", 'D', ModItems.nuclear_waste_vitrified, 'T', ModItems.tank_steel });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.nuclear_waste, 8), new Object[] { "B", 'B', ModBlocks.yellow_barrel });
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gas_empty, 2), new Object[] { "S ", "AA", "AA", 'A', "plateSteel", 'S', "plateCopper" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.vitrified_barrel, 1), new Object[] { "LSL", "PWP", "LSL", 'L', "plateLead", 'S', Blocks.sand, 'P', "ingotPolymer", 'W', ModBlocks.block_waste }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.block_waste_painted, 1), new Object[] { "dyeYellow", ModBlocks.block_waste }));
|
||||
|
||||
|
||||
|
||||
@ -33,6 +33,7 @@ import com.hbm.handler.ArmorModHandler;
|
||||
import com.hbm.handler.BossSpawnHandler;
|
||||
import com.hbm.handler.EntityEffectHandler;
|
||||
import com.hbm.handler.RadiationWorldHandler;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.interfaces.IBomb;
|
||||
import com.hbm.handler.HTTPHandler;
|
||||
import com.hbm.items.IEquipReceiver;
|
||||
@ -49,7 +50,6 @@ import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.PlayerInformPacket;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.saveddata.AuxSavedData;
|
||||
import com.hbm.saveddata.RadiationSavedData;
|
||||
import com.hbm.util.ArmorUtil;
|
||||
import com.hbm.util.ContaminationUtil;
|
||||
import com.hbm.util.EnchantmentUtil;
|
||||
@ -521,21 +521,10 @@ public class ModEventHandler {
|
||||
AuxSavedData.setThunder(event.world, thunder - 1);
|
||||
|
||||
if(!event.world.loadedEntityList.isEmpty()) {
|
||||
|
||||
RadiationSavedData data = RadiationSavedData.getData(event.world);
|
||||
|
||||
if(data.worldObj == null) {
|
||||
data.worldObj = event.world;
|
||||
}
|
||||
|
||||
if(event.world.getTotalWorldTime() % 20 == 0 && event.phase == Phase.START) {
|
||||
data.updateSystem();
|
||||
}
|
||||
|
||||
List<Object> oList = new ArrayList<Object>();
|
||||
oList.addAll(event.world.loadedEntityList);
|
||||
|
||||
|
||||
/**
|
||||
* REMOVE THIS V V V
|
||||
*/
|
||||
|
||||
@ -1,227 +0,0 @@
|
||||
package com.hbm.saveddata;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.config.RadiationConfig;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.AuxParticlePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.ChunkCoordIntPair;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldSavedData;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
||||
//TODO: urgent, change all references to this abomination to the new system and then put it to death
|
||||
public class RadiationSavedData extends WorldSavedData {
|
||||
|
||||
public HashMap<ChunkCoordIntPair, Float> contamination = new HashMap();
|
||||
|
||||
//in order to reduce read operations
|
||||
private static RadiationSavedData openInstance;
|
||||
|
||||
public World worldObj;
|
||||
|
||||
public RadiationSavedData(String p_i2141_1_) {
|
||||
super(p_i2141_1_);
|
||||
}
|
||||
|
||||
public RadiationSavedData(World p_i1678_1_)
|
||||
{
|
||||
super("radiation");
|
||||
this.worldObj = p_i1678_1_;
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
public void jettisonData() {
|
||||
|
||||
contamination.clear();
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
public void setRadForCoord(int x, int y, float radiation) {
|
||||
|
||||
ChunkRadiationManager.proxy.setRadiation(this.worldObj, x, 0, y, radiation);
|
||||
/*ChunkCoordIntPair pair = new ChunkCoordIntPair(x, y);
|
||||
contamination.put(pair, radiation);
|
||||
this.markDirty();*/
|
||||
|
||||
}
|
||||
|
||||
public float getRadNumFromCoord(int x, int y) {
|
||||
|
||||
return ChunkRadiationManager.proxy.getRadiation(this.worldObj, (x << 4) + 8, 0, (y << 4) + 8);
|
||||
|
||||
/*ChunkCoordIntPair pair = new ChunkCoordIntPair(x, y);
|
||||
Float rad = contamination.get(pair);
|
||||
|
||||
return rad == null ? 0 : rad;*/
|
||||
}
|
||||
|
||||
public void updateSystem() {
|
||||
|
||||
if(true)
|
||||
return;
|
||||
|
||||
HashMap<ChunkCoordIntPair, Float> tempList = new HashMap(contamination);
|
||||
contamination.clear();
|
||||
|
||||
for(Entry<ChunkCoordIntPair, Float> struct : tempList.entrySet()) {
|
||||
|
||||
if(struct.getValue() != 0) {
|
||||
|
||||
float rad = struct.getValue();
|
||||
|
||||
//struct.radiation *= 0.999F;
|
||||
rad *= 0.999F;
|
||||
rad -= 0.05F;
|
||||
|
||||
if(rad <= 0) {
|
||||
rad = 0;
|
||||
}
|
||||
|
||||
if(rad > RadiationConfig.fogRad && worldObj != null && worldObj.rand.nextInt(RadiationConfig.fogCh) == 0 && worldObj.getChunkFromChunkCoords(struct.getKey().chunkXPos, struct.getKey().chunkZPos).isChunkLoaded) {
|
||||
|
||||
int x = struct.getKey().chunkXPos * 16 + worldObj.rand.nextInt(16);
|
||||
int z = struct.getKey().chunkZPos * 16 + worldObj.rand.nextInt(16);
|
||||
int y = worldObj.getHeightValue(x, z) + worldObj.rand.nextInt(5);
|
||||
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacket(x, y, z, 3), new TargetPoint(worldObj.provider.dimensionId, x, y, z, 100));
|
||||
}
|
||||
|
||||
if(rad > 1) {
|
||||
|
||||
float[] rads = new float[9];
|
||||
|
||||
rads[0] = getRadNumFromCoord(struct.getKey().chunkXPos + 1, struct.getKey().chunkZPos + 1);
|
||||
rads[1] = getRadNumFromCoord(struct.getKey().chunkXPos, struct.getKey().chunkZPos + 1);
|
||||
rads[2] = getRadNumFromCoord(struct.getKey().chunkXPos - 1, struct.getKey().chunkZPos + 1);
|
||||
rads[3] = getRadNumFromCoord(struct.getKey().chunkXPos - 1, struct.getKey().chunkZPos);
|
||||
rads[4] = getRadNumFromCoord(struct.getKey().chunkXPos - 1, struct.getKey().chunkZPos - 1);
|
||||
rads[5] = getRadNumFromCoord(struct.getKey().chunkXPos, struct.getKey().chunkZPos - 1);
|
||||
rads[6] = getRadNumFromCoord(struct.getKey().chunkXPos + 1, struct.getKey().chunkZPos - 1);
|
||||
rads[7] = getRadNumFromCoord(struct.getKey().chunkXPos + 1, struct.getKey().chunkZPos);
|
||||
rads[8] = getRadNumFromCoord(struct.getKey().chunkXPos, struct.getKey().chunkZPos);
|
||||
|
||||
float main = 0.6F;
|
||||
float side = 0.075F;
|
||||
float corner = 0.025F;
|
||||
|
||||
setRadForCoord(struct.getKey().chunkXPos + 1, struct.getKey().chunkZPos + 1, rads[0] + rad * corner);
|
||||
setRadForCoord(struct.getKey().chunkXPos, struct.getKey().chunkZPos + 1, rads[1] + rad * side);
|
||||
setRadForCoord(struct.getKey().chunkXPos - 1, struct.getKey().chunkZPos + 1, rads[2] + rad * corner);
|
||||
setRadForCoord(struct.getKey().chunkXPos - 1, struct.getKey().chunkZPos, rads[3] + rad * side);
|
||||
setRadForCoord(struct.getKey().chunkXPos - 1, struct.getKey().chunkZPos - 1, rads[4] + rad * corner);
|
||||
setRadForCoord(struct.getKey().chunkXPos, struct.getKey().chunkZPos - 1, rads[5] + rad * side);
|
||||
setRadForCoord(struct.getKey().chunkXPos + 1, struct.getKey().chunkZPos - 1, rads[6] + rad * corner);
|
||||
setRadForCoord(struct.getKey().chunkXPos + 1, struct.getKey().chunkZPos, rads[7] + rad * side);
|
||||
setRadForCoord(struct.getKey().chunkXPos, struct.getKey().chunkZPos, rads[8] + rad * main);
|
||||
|
||||
} else {
|
||||
|
||||
this.setRadForCoord(struct.getKey().chunkXPos, struct.getKey().chunkZPos, getRadNumFromCoord(struct.getKey().chunkXPos, struct.getKey().chunkZPos) + rad);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
|
||||
if(!GeneralConfig.enableRads) {
|
||||
return;
|
||||
}
|
||||
|
||||
int count = nbt.getInteger("radCount");
|
||||
|
||||
for(int i = 0; i < count; i++) {
|
||||
|
||||
ChunkCoordIntPair pair = new ChunkCoordIntPair(
|
||||
nbt.getInteger("cposX" + i),
|
||||
nbt.getInteger("cposZ" + i)
|
||||
|
||||
);
|
||||
|
||||
contamination.put(
|
||||
pair,
|
||||
nbt.getFloat("crad" + i)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
nbt.setInteger("radCount", contamination.size());
|
||||
|
||||
int i = 0;
|
||||
|
||||
for(Entry<ChunkCoordIntPair, Float> struct : contamination.entrySet()) {
|
||||
nbt.setInteger("cposX" + i, struct.getKey().chunkXPos);
|
||||
nbt.setInteger("cposZ" + i, struct.getKey().chunkZPos);
|
||||
nbt.setFloat("crad" + i, struct.getValue());
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public static RadiationSavedData getData(World worldObj) {
|
||||
|
||||
if(openInstance != null && openInstance.worldObj == worldObj)
|
||||
return openInstance;
|
||||
|
||||
RadiationSavedData data = (RadiationSavedData)worldObj.perWorldStorage.loadData(RadiationSavedData.class, "radiation");
|
||||
if(data == null) {
|
||||
worldObj.perWorldStorage.setData("radiation", new RadiationSavedData(worldObj));
|
||||
|
||||
data = (RadiationSavedData)worldObj.perWorldStorage.loadData(RadiationSavedData.class, "radiation");
|
||||
}
|
||||
|
||||
data.worldObj = worldObj;
|
||||
openInstance = data;
|
||||
|
||||
return openInstance;
|
||||
}
|
||||
|
||||
public static void incrementRad(World worldObj, int x, int z, float rad, float maxRad) {
|
||||
|
||||
ChunkRadiationManager.proxy.incrementRad(worldObj, x, 0, z, rad);
|
||||
|
||||
/*RadiationSavedData data = getData(worldObj);
|
||||
|
||||
Chunk chunk = worldObj.getChunkFromBlockCoords(x, z);
|
||||
|
||||
float r = data.getRadNumFromCoord(chunk.xPosition, chunk.zPosition);
|
||||
|
||||
if(r < maxRad) {
|
||||
|
||||
data.setRadForCoord(chunk.xPosition, chunk.zPosition, r + rad);
|
||||
}*/
|
||||
}
|
||||
|
||||
public static void decrementRad(World worldObj, int x, int z, float rad) {
|
||||
|
||||
ChunkRadiationManager.proxy.decrementRad(worldObj, x, 0, z, rad);
|
||||
|
||||
/*RadiationSavedData data = getData(worldObj);
|
||||
|
||||
Chunk chunk = worldObj.getChunkFromBlockCoords(x, z);
|
||||
|
||||
float r = data.getRadNumFromCoord(chunk.xPosition, chunk.zPosition);
|
||||
|
||||
r -= rad;
|
||||
|
||||
if(r > 0) {
|
||||
data.setRadForCoord(chunk.xPosition, chunk.zPosition, r);
|
||||
} else {
|
||||
data.setRadForCoord(chunk.xPosition, chunk.zPosition, 0);
|
||||
}*/
|
||||
}
|
||||
|
||||
}
|
||||
@ -3,8 +3,7 @@ package com.hbm.tileentity.machine;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.saveddata.RadiationSavedData;
|
||||
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
||||
@ -56,12 +55,7 @@ public class TileEntityGeiger extends TileEntity {
|
||||
}
|
||||
|
||||
public int check() {
|
||||
|
||||
RadiationSavedData data = RadiationSavedData.getData(worldObj);
|
||||
|
||||
Chunk chunk = worldObj.getChunkFromBlockCoords(xCoord, zCoord);
|
||||
int rads = (int)Math.ceil(data.getRadNumFromCoord(chunk.xPosition, chunk.zPosition));
|
||||
|
||||
int rads = (int)Math.ceil(ChunkRadiationManager.proxy.getRadiation(worldObj, xCoord, yCoord, zCoord));
|
||||
return rads;
|
||||
}
|
||||
|
||||
|
||||
@ -4,10 +4,10 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.interfaces.ISource;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.saveddata.RadiationSavedData;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
@ -29,13 +29,11 @@ public class TileEntityMachineAmgen extends TileEntity implements ISource {
|
||||
Block block = worldObj.getBlock(xCoord, yCoord, zCoord);
|
||||
|
||||
if(block == ModBlocks.machine_amgen) {
|
||||
RadiationSavedData data = RadiationSavedData.getData(worldObj);
|
||||
Chunk c = worldObj.getChunkFromBlockCoords(xCoord, zCoord);
|
||||
float rad = data.getRadNumFromCoord(c.xPosition, c.zPosition);
|
||||
float rad = ChunkRadiationManager.proxy.getRadiation(worldObj, xCoord, yCoord, zCoord);
|
||||
|
||||
power += rad;
|
||||
|
||||
data.decrementRad(worldObj, xCoord, zCoord, 5F);
|
||||
ChunkRadiationManager.proxy.decrementRad(worldObj, xCoord, yCoord, zCoord, 5F);
|
||||
|
||||
} else if(block == ModBlocks.machine_geo) {
|
||||
|
||||
|
||||
@ -41,7 +41,6 @@ public class TileEntityMachineMiningDrill extends TileEntityMachineBase implemen
|
||||
public float torque;
|
||||
public float rotation;
|
||||
SoundLoopMachine sound;
|
||||
//TODO: clientside-only animations and sound
|
||||
|
||||
private static final int[] slots_top = new int[] {1};
|
||||
private static final int[] slots_bottom = new int[] {2, 0};
|
||||
|
||||
@ -8,6 +8,7 @@ import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.MobConfig;
|
||||
import com.hbm.explosion.ExplosionNukeGeneric;
|
||||
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
@ -17,7 +18,6 @@ import com.hbm.items.machine.ItemFuelRod;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.saveddata.RadiationSavedData;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.block.Block;
|
||||
@ -525,12 +525,8 @@ public class TileEntityMachineReactorLarge extends TileEntity
|
||||
if (rods > 0 && coreHeat > 0 && age == 5) {
|
||||
|
||||
float rad = (float)coreHeat / (float)maxCoreHeat * 50F;
|
||||
RadiationSavedData data = RadiationSavedData.getData(worldObj);
|
||||
//System.out.println(rad);
|
||||
rad *= checkHull();
|
||||
//System.out.println(rad);
|
||||
|
||||
data.incrementRad(worldObj, xCoord, zCoord, rad, 50 * 4);
|
||||
ChunkRadiationManager.proxy.incrementRad(worldObj, xCoord, yCoord, zCoord, rad);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
@ -704,11 +700,9 @@ public class TileEntityMachineReactorLarge extends TileEntity
|
||||
this.slots[i] = null;
|
||||
}
|
||||
|
||||
RadiationSavedData data = RadiationSavedData.getData(worldObj);
|
||||
|
||||
int rad = (int)(((long)fuel) * 25000L / (fuelBase * 15L));
|
||||
|
||||
data.incrementRad(worldObj, xCoord, zCoord, rad, 75000);
|
||||
ChunkRadiationManager.proxy.incrementRad(worldObj, xCoord, yCoord, zCoord, rad);
|
||||
|
||||
worldObj.createExplosion(null, this.xCoord, this.yCoord, this.zCoord, 7.5F, true);
|
||||
ExplosionNukeGeneric.waste(worldObj, this.xCoord, this.yCoord, this.zCoord, 35);
|
||||
|
||||
@ -8,6 +8,7 @@ import com.hbm.blocks.machine.MachineReactor;
|
||||
import com.hbm.config.MobConfig;
|
||||
import com.hbm.explosion.ExplosionNukeGeneric;
|
||||
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
@ -17,7 +18,6 @@ import com.hbm.items.machine.ItemFuelRod;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.saveddata.RadiationSavedData;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -414,8 +414,7 @@ public class TileEntityMachineReactorSmall extends TileEntity implements ISidedI
|
||||
*/
|
||||
|
||||
float rad = (float) coreHeat / (float) maxCoreHeat * 50F;
|
||||
RadiationSavedData data = RadiationSavedData.getData(worldObj);
|
||||
data.incrementRad(worldObj, xCoord, zCoord, rad, rad * 4);
|
||||
ChunkRadiationManager.proxy.incrementRad(worldObj, xCoord, yCoord, zCoord, rad);
|
||||
}
|
||||
|
||||
for(int i = 0; i < 3; i++)
|
||||
@ -707,8 +706,7 @@ public class TileEntityMachineReactorSmall extends TileEntity implements ISidedI
|
||||
ExplosionNukeGeneric.waste(worldObj, this.xCoord, this.yCoord, this.zCoord, 35);
|
||||
worldObj.setBlock(this.xCoord, this.yCoord, this.zCoord, ModBlocks.toxic_block);
|
||||
|
||||
RadiationSavedData data = RadiationSavedData.getData(worldObj);
|
||||
data.incrementRad(worldObj, xCoord, zCoord, 1000F, 2000F);
|
||||
ChunkRadiationManager.proxy.incrementRad(worldObj, xCoord, yCoord, zCoord, 1000);
|
||||
|
||||
if(MobConfig.enableElementals) {
|
||||
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5).expand(100, 100, 100));
|
||||
|
||||
@ -5,6 +5,7 @@ import java.util.List;
|
||||
|
||||
import com.hbm.explosion.ExplosionNukeGeneric;
|
||||
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
@ -16,7 +17,6 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.saveddata.RadiationSavedData;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
@ -434,8 +434,7 @@ public class TileEntityMachineReactorSmallOld extends TileEntity
|
||||
}*/
|
||||
|
||||
float rad = (float)coreHeat / (float)maxCoreHeat * 50F;
|
||||
RadiationSavedData data = RadiationSavedData.getData(worldObj);
|
||||
data.incrementRad(worldObj, xCoord, zCoord, rad, rad * 4);
|
||||
ChunkRadiationManager.proxy.incrementRad(worldObj, xCoord, yCoord, zCoord, rad);
|
||||
}
|
||||
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxElectricityPacket(xCoord, yCoord, zCoord, power), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
|
||||
@ -544,8 +543,7 @@ public class TileEntityMachineReactorSmallOld extends TileEntity
|
||||
ExplosionNukeGeneric.waste(worldObj, this.xCoord, this.yCoord, this.zCoord, 35);
|
||||
worldObj.setBlock(this.xCoord, this.yCoord, this.zCoord, Blocks.flowing_lava);
|
||||
|
||||
RadiationSavedData data = RadiationSavedData.getData(worldObj);
|
||||
data.incrementRad(worldObj, xCoord, zCoord, 1000F, 2000F);
|
||||
ChunkRadiationManager.proxy.incrementRad(worldObj, xCoord, yCoord, zCoord, 1000F);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -7,6 +7,7 @@ import java.util.Random;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.logic.EntityNukeExplosionMK4;
|
||||
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
@ -17,7 +18,6 @@ import com.hbm.items.machine.ItemFuelRod;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.saveddata.RadiationSavedData;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@ -478,8 +478,7 @@ public class TileEntityReactorMultiblock extends TileEntity implements ISidedInv
|
||||
}*/
|
||||
|
||||
|
||||
RadiationSavedData data = RadiationSavedData.getData(worldObj);
|
||||
data.incrementRad(worldObj, xCoord, zCoord, 50F, 150F);
|
||||
ChunkRadiationManager.proxy.incrementRad(worldObj, xCoord, yCoord, zCoord, 50F);
|
||||
}
|
||||
}
|
||||
|
||||
@ -636,8 +635,7 @@ public class TileEntityReactorMultiblock extends TileEntity implements ISidedInv
|
||||
|
||||
worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, 50, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5));
|
||||
|
||||
RadiationSavedData data = RadiationSavedData.getData(worldObj);
|
||||
data.incrementRad(worldObj, xCoord, zCoord, 1000F, 2000F);
|
||||
ChunkRadiationManager.proxy.incrementRad(worldObj, xCoord, yCoord, zCoord, 1000F);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -220,17 +220,21 @@ public class TileEntitySILEX extends TileEntityMachineBase implements IFluidAcce
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int p_94128_1_) {
|
||||
return new int[] { 0 };
|
||||
return new int[] { 0, 5, 6, 7, 8, 9, 10 };
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
|
||||
if(i == 0)
|
||||
return SILEXRecipes.getOutput(itemStack) != null;
|
||||
if(i == 0) return SILEXRecipes.getOutput(itemStack) != null;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slot, ItemStack itemStack, int side) {
|
||||
return slot >= 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
|
||||
@ -5,9 +5,9 @@ import com.hbm.entity.mob.EntityNuclearCreeper;
|
||||
import com.hbm.entity.mob.EntityQuackos;
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
import com.hbm.handler.HazmatRegistry;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.saveddata.RadiationSavedData;
|
||||
|
||||
import api.hbm.entity.IRadiationImmune;
|
||||
import net.minecraft.entity.Entity;
|
||||
@ -177,9 +177,7 @@ public class ContaminationUtil {
|
||||
|
||||
double eRad = ((int)(HbmLivingProps.getRadiation(player) * 10)) / 10D;
|
||||
|
||||
RadiationSavedData data = RadiationSavedData.getData(player.worldObj);
|
||||
Chunk chunk = world.getChunkFromBlockCoords((int)player.posX, (int)player.posZ);
|
||||
double rads = ((int)(data.getRadNumFromCoord(chunk.xPosition, chunk.zPosition) * 10)) / 10D;
|
||||
double rads = ((int)(ChunkRadiationManager.proxy.getRadiation(world, (int) Math.floor(player.posX), (int) Math.floor(player.posY), (int) Math.floor(player.posZ)) * 10)) / 10D;
|
||||
double env = ((int)(HbmLivingProps.getRadBuf(player) * 10D)) / 10D;
|
||||
|
||||
double res = ((int)(10000D - ContaminationUtil.calculateRadiationMod(player) * 10000D)) / 100D;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user