mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Modified RBMK fuels, added effects for boron/foam on RBMK and ZIRNOX
This commit is contained in:
parent
e89464038b
commit
48c8ab84db
@ -2,6 +2,7 @@ package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.machine.ZirnoxDestroyed;
|
||||
import com.hbm.blocks.machine.rbmk.RBMKDebris;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -55,7 +56,7 @@ public class BlockLayering extends Block {
|
||||
public boolean canPlaceBlockAt(World world, int x, int y, int z) {
|
||||
Block block = world.getBlock(x, y - 1, z);
|
||||
|
||||
if(block instanceof RBMKDebris)
|
||||
if(block instanceof RBMKDebris || block instanceof ZirnoxDestroyed)
|
||||
return true;
|
||||
|
||||
return block != Blocks.ice && block != Blocks.packed_ice ? (block.isLeaves(world, x, y - 1, z) ? true : (block == this && (world.getBlockMetadata(x, y - 1, z) & 7) == 7 ? true : block.isOpaqueCube() && block.getMaterial().blocksMovement())) : false;
|
||||
|
||||
@ -13,6 +13,7 @@ import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityZirnoxDestroyed;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
@ -47,13 +48,29 @@ public class ZirnoxDestroyed extends BlockDummyable {
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(rand.nextInt(6));
|
||||
|
||||
if(rand.nextInt(4) == 0 && world.getBlock(x + dir.offsetX, y + dir.offsetY + 1, z + dir.offsetZ) == Blocks.air) {
|
||||
world.setBlock(x + dir.offsetX, y + dir.offsetY + 1, z + dir.offsetZ, ModBlocks.gas_meltdown);
|
||||
|
||||
Block block = world.getBlock(x, y + 1, z);
|
||||
|
||||
if(block == Blocks.air) {
|
||||
if(rand.nextInt(10) == 0)
|
||||
world.setBlock(x, y + 1, z, ModBlocks.gas_meltdown);
|
||||
|
||||
} else if(block == ModBlocks.foam_layer || block == ModBlocks.block_foam) {
|
||||
if(rand.nextInt(25) == 0) {
|
||||
int pos[] = this.findCore(world, x, y, z);
|
||||
|
||||
if(pos != null) {
|
||||
TileEntity te = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
|
||||
if(te instanceof TileEntityZirnoxDestroyed)
|
||||
((TileEntityZirnoxDestroyed)te).onFire = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(rand.nextInt(10) == 0 && world.getBlock(x, y + 1, z) == Blocks.air)
|
||||
world.setBlock(x, y + 1, z, ModBlocks.gas_meltdown);
|
||||
|
||||
super.updateTick(world, x, y, z, rand);
|
||||
}
|
||||
|
||||
|
||||
@ -8,6 +8,7 @@ import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
@ -37,11 +38,16 @@ public class RBMKDebrisBurning extends RBMKDebris {
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(rand.nextInt(6));
|
||||
|
||||
if(rand.nextInt(7) == 0 && world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ) == Blocks.air) {
|
||||
if(rand.nextInt(10) == 0 && world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ) == Blocks.air) {
|
||||
world.setBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, ModBlocks.gas_meltdown);
|
||||
}
|
||||
|
||||
if(rand.nextInt(100) == 0) {
|
||||
Block block = world.getBlock(x, y + 1, z);
|
||||
|
||||
//Foam helps stop the fire.
|
||||
int chance = block == ModBlocks.foam_layer || block == ModBlocks.block_foam ? 20 : 100;
|
||||
|
||||
if(rand.nextInt(chance) == 0) {
|
||||
world.setBlock(x, y, z, ModBlocks.pribris);
|
||||
} else {
|
||||
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
|
||||
|
||||
@ -13,6 +13,7 @@ import com.hbm.util.ContaminationUtil.ContaminationType;
|
||||
import com.hbm.util.ContaminationUtil.HazardType;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
@ -50,11 +51,16 @@ public class RBMKDebrisRadiating extends RBMKDebrisBurning {
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(rand.nextInt(6));
|
||||
|
||||
if(rand.nextInt(5) == 0 && world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ) == Blocks.air) {
|
||||
if(rand.nextInt(10) == 0 && world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ) == Blocks.air) {
|
||||
world.setBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, ModBlocks.gas_meltdown);
|
||||
}
|
||||
|
||||
if(rand.nextInt(1000) == 0) {
|
||||
Block block = world.getBlock(x, y + 1, z);
|
||||
|
||||
//Boron sand helps stop the fission reaction.
|
||||
int chance = block == ModBlocks.sand_boron_layer || block == ModBlocks.sand_boron ? 50 : 1000;
|
||||
|
||||
if(rand.nextInt(chance) == 0) {
|
||||
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
|
||||
@ -3684,14 +3684,14 @@ public class ModItems {
|
||||
.setUnlocalizedName("rbmk_fuel_meu").setTextureName(RefStrings.MODID + ":rbmk_fuel_meu");
|
||||
rbmk_fuel_heu233 = (ItemRBMKRod) new ItemRBMKRod(rbmk_pellet_heu233)
|
||||
.setYield(100000000D)
|
||||
.setStats(50)
|
||||
.setFunction(EnumBurnFunc.SQUARE_ROOT)
|
||||
.setStats(27.5D)
|
||||
.setFunction(EnumBurnFunc.LINEAR)
|
||||
.setHeat(1.25D)
|
||||
.setMeltingPoint(2865)
|
||||
.setUnlocalizedName("rbmk_fuel_heu233").setTextureName(RefStrings.MODID + ":rbmk_fuel_heu233");
|
||||
rbmk_fuel_heu235 = (ItemRBMKRod) new ItemRBMKRod(rbmk_pellet_heu235)
|
||||
.setYield(100000000D)
|
||||
.setStats(40)
|
||||
.setStats(50) //Consistency with HEN; its critical mass is too high to justify a linear function
|
||||
.setFunction(EnumBurnFunc.SQUARE_ROOT)
|
||||
.setMeltingPoint(2865)
|
||||
.setUnlocalizedName("rbmk_fuel_heu235").setTextureName(RefStrings.MODID + ":rbmk_fuel_heu235");
|
||||
@ -3768,7 +3768,7 @@ public class ModItems {
|
||||
.setDepletionFunction(EnumDepleteFunc.RAISING_SLOPE)
|
||||
.setHeat(0.75)
|
||||
.setMeltingPoint(2800)
|
||||
.setNeutronTypes(NType.FAST, NType.FAST)
|
||||
.setNeutronTypes(NType.ANY, NType.FAST) //Build-up of Pu-239 leads to both speeds of neutrons grooving
|
||||
.setUnlocalizedName("rbmk_fuel_men").setTextureName(RefStrings.MODID + ":rbmk_fuel_men");
|
||||
rbmk_fuel_hen = (ItemRBMKRod) new ItemRBMKRod(rbmk_pellet_hen)
|
||||
.setYield(100000000D)
|
||||
@ -3788,9 +3788,9 @@ public class ModItems {
|
||||
.setYield(100000000D)
|
||||
.setStats(50)
|
||||
.setFunction(EnumBurnFunc.SQUARE_ROOT)
|
||||
.setDepletionFunction(EnumDepleteFunc.RAISING_SLOPE)
|
||||
.setHeat(1.25D)
|
||||
.setMeltingPoint(2500)
|
||||
.setNeutronTypes(NType.SLOW, NType.SLOW) //Beryllium Moderation
|
||||
.setUnlocalizedName("rbmk_fuel_les").setTextureName(RefStrings.MODID + ":rbmk_fuel_les");
|
||||
rbmk_fuel_mes = (ItemRBMKRod) new ItemRBMKRod(rbmk_pellet_mes)
|
||||
.setYield(100000000D)
|
||||
@ -3824,13 +3824,14 @@ public class ModItems {
|
||||
.setMeltingPoint(5211).setUnlocalizedName("rbmk_fuel_heaus").setTextureName(RefStrings.MODID + ":rbmk_fuel_heaus");
|
||||
rbmk_fuel_po210be = (ItemRBMKRod) new ItemRBMKRod(rbmk_pellet_po210be)
|
||||
.setYield(25000000D)
|
||||
.setStats(15, 40)
|
||||
.setFunction(EnumBurnFunc.SQUARE_ROOT)
|
||||
.setStats(0D, 50)
|
||||
.setFunction(EnumBurnFunc.PASSIVE)
|
||||
.setDepletionFunction(EnumDepleteFunc.LINEAR)
|
||||
.setXenon(0.0D, 50D)
|
||||
.setHeat(0.1D)
|
||||
.setDiffusion(0.05D)
|
||||
.setMeltingPoint(1287)
|
||||
.setNeutronTypes(NType.SLOW, NType.SLOW) //Beryllium Moderation
|
||||
.setUnlocalizedName("rbmk_fuel_po210be").setTextureName(RefStrings.MODID + ":rbmk_fuel_po210be");
|
||||
rbmk_fuel_ra226be = (ItemRBMKRod) new ItemRBMKRod(rbmk_pellet_ra226be)
|
||||
.setYield(100000000D)
|
||||
@ -3841,14 +3842,16 @@ public class ModItems {
|
||||
.setHeat(0.035D)
|
||||
.setDiffusion(0.5D)
|
||||
.setMeltingPoint(700)
|
||||
.setNeutronTypes(NType.SLOW, NType.SLOW) //Beryllium Moderation
|
||||
.setUnlocalizedName("rbmk_fuel_ra226be").setTextureName(RefStrings.MODID + ":rbmk_fuel_ra226be");
|
||||
rbmk_fuel_pu238be = (ItemRBMKRod) new ItemRBMKRod(rbmk_pellet_pu238be)
|
||||
.setYield(50000000D)
|
||||
.setStats(10, 50)
|
||||
.setStats(40, 40)
|
||||
.setFunction(EnumBurnFunc.SQUARE_ROOT)
|
||||
.setHeat(0.1D)
|
||||
.setDiffusion(0.05D)
|
||||
.setMeltingPoint(1287)
|
||||
.setNeutronTypes(NType.SLOW, NType.SLOW) //Beryllium Moderation
|
||||
.setUnlocalizedName("rbmk_fuel_pu238be").setTextureName(RefStrings.MODID + ":rbmk_fuel_pu238be");
|
||||
rbmk_fuel_balefire_gold = (ItemRBMKRod) new ItemRBMKRod(rbmk_pellet_balefire_gold)
|
||||
.setYield(100000000D)
|
||||
|
||||
@ -219,7 +219,7 @@ public class ItemRBMKRod extends Item {
|
||||
PASSIVE(EnumChatFormatting.DARK_GREEN + "SAFE / PASSIVE"), //const, no reactivity
|
||||
LOG_TEN(EnumChatFormatting.YELLOW + "MEDIUM / LOGARITHMIC"), //log10(x + 1) * reactivity * 50
|
||||
PLATEU(EnumChatFormatting.GREEN + "SAFE / EULER"), //(1 - e^(-x/25)) * reactivity * 100
|
||||
ARCH(EnumChatFormatting.YELLOW + "MEDIUM / NEGATIVE-QUADRATIC"), //x-(x²/1000) * reactivity
|
||||
ARCH(EnumChatFormatting.RED + "DANGEROUS / NEGATIVE-QUADRATIC"), //x-(x²/1000) * reactivity
|
||||
SIGMOID(EnumChatFormatting.GREEN + "SAFE / SIGMOID"), //100 / (1 + e^(-(x - 50) / 10)) <- tiny amount of reactivity at x=0 !
|
||||
SQUARE_ROOT(EnumChatFormatting.YELLOW + "MEDIUM / SQUARE ROOT"), //sqrt(x) * 10 * reactivity
|
||||
LINEAR(EnumChatFormatting.RED + "DANGEROUS / LINEAR"), //x * reactivity
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
package com.hbm.items.tool;
|
||||
|
||||
import com.hbm.blocks.machine.ReactorZirnox;
|
||||
import com.hbm.blocks.machine.rbmk.RBMKBase;
|
||||
import com.hbm.tileentity.machine.TileEntityReactorZirnox;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKBase;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -15,9 +18,11 @@ public class ItemDyatlov extends Item {
|
||||
|
||||
if(!world.isRemote) {
|
||||
|
||||
if(world.getBlock(x, y, z) instanceof RBMKBase) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
|
||||
if(block instanceof RBMKBase) {
|
||||
|
||||
RBMKBase rbmk = (RBMKBase)world.getBlock(x, y, z);
|
||||
RBMKBase rbmk = (RBMKBase)block;
|
||||
|
||||
int[] pos = rbmk.findCore(world, x, y, z);
|
||||
|
||||
@ -32,6 +37,22 @@ public class ItemDyatlov extends Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(block instanceof ReactorZirnox) {
|
||||
|
||||
ReactorZirnox zirnox = (ReactorZirnox)block;
|
||||
|
||||
int[] pos = zirnox.findCore(world, x, y, z);
|
||||
|
||||
if(pos != null) {
|
||||
|
||||
TileEntity te = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
|
||||
if(te instanceof TileEntityReactorZirnox) {
|
||||
((TileEntityReactorZirnox)te).heat = 200000;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@ -21,13 +21,30 @@ import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityZirnoxDestroyed extends TileEntity {
|
||||
|
||||
|
||||
public boolean onFire = true;
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
onFire = nbt.getBoolean("fire");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setBoolean("onFire", onFire);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if(!worldObj.isRemote) {
|
||||
radiate(worldObj, this.xCoord, this.yCoord, this.zCoord);
|
||||
|
||||
if(this.worldObj.getTotalWorldTime() % 50 == 0) {
|
||||
if(this.worldObj.rand.nextInt(5000) == 0)
|
||||
onFire = false;
|
||||
|
||||
if(onFire && this.worldObj.getTotalWorldTime() % 50 == 0) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "rbmkflame");
|
||||
data.setInteger("maxAge", 90);
|
||||
@ -40,7 +57,7 @@ public class TileEntityZirnoxDestroyed extends TileEntity {
|
||||
|
||||
private void radiate(World world, int x, int y, int z) {
|
||||
|
||||
float rads = 500000F;
|
||||
float rads = onFire ? 500000F : 75000F;
|
||||
double range = 100D;
|
||||
|
||||
List<EntityLivingBase> entities = world.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(x + 0.5, y + 0.5, z + 0.5, x + 0.5, y + 0.5, z + 0.5).expand(range, range, range));
|
||||
@ -71,7 +88,7 @@ public class TileEntityZirnoxDestroyed extends TileEntity {
|
||||
|
||||
ContaminationUtil.contaminate(e, HazardType.RADIATION, ContaminationType.CREATIVE, eRads);
|
||||
|
||||
if(len < 5) {
|
||||
if(onFire && len < 5) {
|
||||
e.attackEntityFrom(DamageSource.onFire, 2);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user