From e0a5d3f1d0b8bc0637d864ca26b918dd9d6e017d Mon Sep 17 00:00:00 2001 From: Bob Date: Fri, 9 Apr 2021 00:28:56 +0200 Subject: [PATCH] RBMK flux and ladders, many ladders --- src/main/java/com/hbm/blocks/ModBlocks.java | 42 ++++- .../hbm/blocks/generic/BlockNTMLadder.java | 10 ++ .../com/hbm/inventory/gui/GUIRBMKRod.java | 2 +- .../com/hbm/items/machine/ItemRBMKRod.java | 169 +++++++++++++----- .../machine/rbmk/IRBMKFluxReceiver.java | 14 +- .../machine/rbmk/TileEntityRBMKBase.java | 1 - .../machine/rbmk/TileEntityRBMKRod.java | 99 +++++++++- .../hbm/textures/blocks/block_actinium.png | Bin 554 -> 678 bytes .../hbm/textures/blocks/block_lanthanium.png | Bin 570 -> 615 bytes .../hbm/textures/blocks/ladder_aluminium.png | Bin 0 -> 477 bytes .../hbm/textures/blocks/ladder_cobalt.png | Bin 0 -> 490 bytes .../hbm/textures/blocks/ladder_copper.png | Bin 0 -> 501 bytes .../hbm/textures/blocks/ladder_gold.png | Bin 0 -> 459 bytes .../hbm/textures/blocks/ladder_iron.png | Bin 0 -> 459 bytes .../hbm/textures/blocks/ladder_lead.png | Bin 0 -> 480 bytes .../hbm/textures/blocks/ladder_steel.png | Bin 0 -> 469 bytes .../hbm/textures/blocks/ladder_sturdy.png | Bin 0 -> 540 bytes .../hbm/textures/blocks/ladder_titanium.png | Bin 0 -> 482 bytes .../hbm/textures/blocks/ladder_tungsten.png | Bin 0 -> 368 bytes .../hbm/textures/items/billet_australium.png | Bin 0 -> 271 bytes .../items/billet_australium_greater.png | Bin 0 -> 297 bytes .../items/billet_australium_lesser.png | Bin 0 -> 299 bytes .../hbm/textures/items/rbmk_fuel_drx.png | Bin 0 -> 635 bytes .../hbm/textures/items/rbmk_fuel_heaus.png | Bin 0 -> 519 bytes .../hbm/textures/items/rbmk_fuel_leaus.png | Bin 0 -> 518 bytes 25 files changed, 284 insertions(+), 53 deletions(-) create mode 100644 src/main/java/com/hbm/blocks/generic/BlockNTMLadder.java create mode 100644 src/main/resources/assets/hbm/textures/blocks/ladder_aluminium.png create mode 100644 src/main/resources/assets/hbm/textures/blocks/ladder_cobalt.png create mode 100644 src/main/resources/assets/hbm/textures/blocks/ladder_copper.png create mode 100644 src/main/resources/assets/hbm/textures/blocks/ladder_gold.png create mode 100644 src/main/resources/assets/hbm/textures/blocks/ladder_iron.png create mode 100644 src/main/resources/assets/hbm/textures/blocks/ladder_lead.png create mode 100644 src/main/resources/assets/hbm/textures/blocks/ladder_steel.png create mode 100644 src/main/resources/assets/hbm/textures/blocks/ladder_sturdy.png create mode 100644 src/main/resources/assets/hbm/textures/blocks/ladder_titanium.png create mode 100644 src/main/resources/assets/hbm/textures/blocks/ladder_tungsten.png create mode 100644 src/main/resources/assets/hbm/textures/items/billet_australium.png create mode 100644 src/main/resources/assets/hbm/textures/items/billet_australium_greater.png create mode 100644 src/main/resources/assets/hbm/textures/items/billet_australium_lesser.png create mode 100644 src/main/resources/assets/hbm/textures/items/rbmk_fuel_drx.png create mode 100644 src/main/resources/assets/hbm/textures/items/rbmk_fuel_heaus.png create mode 100644 src/main/resources/assets/hbm/textures/items/rbmk_fuel_leaus.png diff --git a/src/main/java/com/hbm/blocks/ModBlocks.java b/src/main/java/com/hbm/blocks/ModBlocks.java index cc2f3e140..051988075 100644 --- a/src/main/java/com/hbm/blocks/ModBlocks.java +++ b/src/main/java/com/hbm/blocks/ModBlocks.java @@ -34,6 +34,7 @@ import com.hbm.main.MainRegistry; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.block.Block; import net.minecraft.block.BlockFalling; +import net.minecraft.block.BlockLadder; import net.minecraft.block.material.*; import net.minecraft.creativetab.CreativeTabs; import net.minecraftforge.fluids.Fluid; @@ -182,6 +183,8 @@ public class ModBlocks { public static Block block_white_phosphorus; public static Block block_red_phosphorus; public static Block block_fallout; + public static Block block_lanthanium; + public static Block block_actinium; public static Block block_australium; public static Block block_weidanium; @@ -560,9 +563,20 @@ public class ModBlocks { public static Block fluid_duct; public static Block conveyor; - + public static Block chain; + public static Block ladder_sturdy; + public static Block ladder_iron; + public static Block ladder_gold; + public static Block ladder_aluminium; + public static Block ladder_copper; + public static Block ladder_titanium; + public static Block ladder_lead; + public static Block ladder_cobalt; + public static Block ladder_steel; + public static Block ladder_tungsten; + public static Block barrel_plastic; public static Block barrel_corroded; public static Block barrel_iron; @@ -1098,6 +1112,8 @@ public class ModBlocks { block_white_phosphorus = new BlockHazard(Material.rock).addFire(15).toBlock().setBlockName("block_white_phosphorus").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_white_phosphorus"); block_red_phosphorus = new BlockHazardFalling().addFire(15).toBlock().setStepSound(Block.soundTypeSand).setBlockName("block_red_phosphorus").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_red_phosphorus"); block_fallout = new BlockHazardFalling().addRadiation(ItemHazard.fo * ItemHazard.block).toBlock().setStepSound(Block.soundTypeGravel).setBlockName("block_fallout").setCreativeTab(MainRegistry.blockTab).setHardness(0.2F).setBlockTextureName(RefStrings.MODID + ":ash"); + block_lanthanium = new BlockGeneric(Material.iron).setBlockName("block_lanthanium").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_lanthanium"); + block_actinium = new BlockGeneric(Material.iron).setBlockName("block_actinium").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_actinium"); block_australium = new BlockGeneric(Material.iron).setBlockName("block_australium").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_australium"); block_weidanium = new BlockGeneric(Material.iron).setBlockName("block_weidanium").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_weidanium"); @@ -1395,6 +1411,17 @@ public class ModBlocks { chain = new BlockChain(Material.iron).setBlockName("dungeon_chain").setHardness(0.25F).setResistance(2.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":chain"); + ladder_sturdy = new BlockNTMLadder().setBlockName("ladder_sturdy").setHardness(0.25F).setResistance(2.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":ladder_sturdy"); + ladder_iron = new BlockNTMLadder().setBlockName("ladder_iron").setHardness(0.25F).setResistance(2.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":ladder_iron"); + ladder_gold = new BlockNTMLadder().setBlockName("ladder_gold").setHardness(0.25F).setResistance(2.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":ladder_gold"); + ladder_aluminium = new BlockNTMLadder().setBlockName("ladder_aluminium").setHardness(0.25F).setResistance(2.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":ladder_aluminium"); + ladder_copper = new BlockNTMLadder().setBlockName("ladder_copper").setHardness(0.25F).setResistance(2.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":ladder_copper"); + ladder_titanium = new BlockNTMLadder().setBlockName("ladder_titanium").setHardness(0.25F).setResistance(2.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":ladder_titanium"); + ladder_lead = new BlockNTMLadder().setBlockName("ladder_lead").setHardness(0.25F).setResistance(2.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":ladder_lead"); + ladder_cobalt = new BlockNTMLadder().setBlockName("ladder_cobalt").setHardness(0.25F).setResistance(2.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":ladder_cobalt"); + ladder_steel = new BlockNTMLadder().setBlockName("ladder_steel").setHardness(0.25F).setResistance(2.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":ladder_steel"); + ladder_tungsten = new BlockNTMLadder().setBlockName("ladder_tungsten").setHardness(0.25F).setResistance(2.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":ladder_tungsten"); + barrel_plastic = new BlockFluidBarrel(Material.iron, 12000).setBlockName("barrel_plastic").setStepSound(Block.soundTypeStone).setHardness(2.0F).setResistance(5.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":barrel_plastic"); barrel_corroded = new BlockFluidBarrel(Material.iron, 6000).setBlockName("barrel_corroded").setStepSound(Block.soundTypeMetal).setHardness(2.0F).setResistance(5.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":barrel_corroded"); barrel_iron = new BlockFluidBarrel(Material.iron, 8000).setBlockName("barrel_iron").setStepSound(Block.soundTypeMetal).setHardness(2.0F).setResistance(5.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":barrel_iron"); @@ -1872,6 +1899,8 @@ public class ModBlocks { GameRegistry.registerBlock(block_unobtainium, ItemOreBlock.class, block_unobtainium.getUnlocalizedName()); GameRegistry.registerBlock(block_daffergon, ItemOreBlock.class, block_daffergon.getUnlocalizedName()); GameRegistry.registerBlock(block_verticium, ItemOreBlock.class, block_verticium.getUnlocalizedName()); + GameRegistry.registerBlock(block_lanthanium, block_lanthanium.getUnlocalizedName()); + GameRegistry.registerBlock(block_actinium, block_actinium.getUnlocalizedName()); //Bottlecap Blocks GameRegistry.registerBlock(block_cap_nuka, block_cap_nuka.getUnlocalizedName()); @@ -2212,6 +2241,17 @@ public class ModBlocks { GameRegistry.registerBlock(fluid_duct, fluid_duct.getUnlocalizedName()); GameRegistry.registerBlock(conveyor, conveyor.getUnlocalizedName()); GameRegistry.registerBlock(chain, chain.getUnlocalizedName()); + + GameRegistry.registerBlock(ladder_sturdy, ladder_sturdy.getUnlocalizedName()); + GameRegistry.registerBlock(ladder_iron, ladder_iron.getUnlocalizedName()); + GameRegistry.registerBlock(ladder_gold, ladder_gold.getUnlocalizedName()); + GameRegistry.registerBlock(ladder_titanium, ladder_titanium.getUnlocalizedName()); + GameRegistry.registerBlock(ladder_copper, ladder_copper.getUnlocalizedName()); + GameRegistry.registerBlock(ladder_tungsten, ladder_tungsten.getUnlocalizedName()); + GameRegistry.registerBlock(ladder_aluminium, ladder_aluminium.getUnlocalizedName()); + GameRegistry.registerBlock(ladder_steel, ladder_steel.getUnlocalizedName()); + GameRegistry.registerBlock(ladder_lead, ladder_lead.getUnlocalizedName()); + GameRegistry.registerBlock(ladder_cobalt, ladder_cobalt.getUnlocalizedName()); GameRegistry.registerBlock(barrel_plastic, ItemBlockLore.class, barrel_plastic.getUnlocalizedName()); GameRegistry.registerBlock(barrel_corroded, ItemBlockLore.class, barrel_corroded.getUnlocalizedName()); diff --git a/src/main/java/com/hbm/blocks/generic/BlockNTMLadder.java b/src/main/java/com/hbm/blocks/generic/BlockNTMLadder.java new file mode 100644 index 000000000..e1fa92f89 --- /dev/null +++ b/src/main/java/com/hbm/blocks/generic/BlockNTMLadder.java @@ -0,0 +1,10 @@ +package com.hbm.blocks.generic; + +import net.minecraft.block.BlockLadder; + +public class BlockNTMLadder extends BlockLadder { + + public BlockNTMLadder() { + super(); + } +} diff --git a/src/main/java/com/hbm/inventory/gui/GUIRBMKRod.java b/src/main/java/com/hbm/inventory/gui/GUIRBMKRod.java index a02740622..27e6ab9c9 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIRBMKRod.java +++ b/src/main/java/com/hbm/inventory/gui/GUIRBMKRod.java @@ -43,7 +43,7 @@ public class GUIRBMKRod extends GuiContainer { if(rod.slots[0] != null) { drawTexturedModalRect(guiLeft + 34, guiTop + 21, 176, 0, 18, 67); - double depletion = ItemRBMKRod.getEnrichment(rod.slots[0]); + double depletion = 1D - ItemRBMKRod.getEnrichment(rod.slots[0]); int d = (int)(depletion * 67); drawTexturedModalRect(guiLeft + 34, guiTop + 21, 194, 0, 18, d); diff --git a/src/main/java/com/hbm/items/machine/ItemRBMKRod.java b/src/main/java/com/hbm/items/machine/ItemRBMKRod.java index c0958cb15..1d938715d 100644 --- a/src/main/java/com/hbm/items/machine/ItemRBMKRod.java +++ b/src/main/java/com/hbm/items/machine/ItemRBMKRod.java @@ -5,6 +5,7 @@ import java.util.List; import com.hbm.items.ModItems; import com.hbm.items.special.ItemHazard; import com.hbm.main.MainRegistry; +import com.hbm.tileentity.machine.rbmk.IRBMKFluxReceiver.NType; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -13,13 +14,37 @@ import net.minecraft.util.EnumChatFormatting; public class ItemRBMKRod extends ItemHazard { - String fullName = ""; //full name of the fuel rod - double funcStart; //starting point of the linear reactivity function - double funcEnd; //endpoint of the function - double xGen = 0.5D;; //multiplier for xenon production - double xBurn = 50D; //divider for xenon burnup - double heat = 1D; //heat produced per outFlux - double yield; //total potential inFlux the rod can take in its lifetime + String fullName = ""; //full name of the fuel rod + double funcStart; //starting point of the linear reactivity function + double funcEnd; //endpoint of the function + double xGen = 0.5D;; //multiplier for xenon production + double xBurn = 50D; //divider for xenon burnup + double heat = 1D; //heat produced per outFlux + double yield; //total potential inFlux the rod can take in its lifetime + double meltingPoint = 1000D; //the maximum heat of the rod's hull before shit hits the fan. the core can be as hot as it wants to be + double diffusion = 1D; //the speed at which the core heats the hull + public NType nType = NType.SLOW; //neutronType, the most efficient neutron type for fission + public NType rType = NType.FAST; //releaseType, the type of neutrons released by this fuel + + /* _____ + * ,I I I I, + * |'-----'| + * | | + * '-----' + * I I I I + * I I I I + * I I I I + * I I I I + * I I I I + * I I I I + * I I I I + * |'-----'| + * | | + * '-----' + * I I I I + * + * i drew a fuel rod yay + */ public ItemRBMKRod(String fullName) { @@ -40,6 +65,12 @@ public class ItemRBMKRod extends ItemHazard { this.funcEnd = funcEnd; return this; } + + public ItemRBMKRod setNeutronTypes(NType nType, NType rType) { + this.nType = nType; + this.rType = rType; + return this; + } /** * Adjusts the input flux using the poison level @@ -72,16 +103,26 @@ public class ItemRBMKRod extends ItemHazard { setYield(stack, y); + //TODO: core heatup + return outFlux; } /** - * Call this after 'burn' and supply its returned outFlux to get the appropriate heat - * @param flux - * @return heat generated from outFlux + * Heat up the core based on the outFlux, then move some heat to the hull + * @param stack */ - public double heatFromFlux(double flux) { - return flux * this.heat; + public void updateHeat(ItemStack stack) { + //TODO + } + + /** + * return one tick's worth of heat and cool the hull of the fuel rod, this heat goes into the fuel rod assembly block + * @param stack + * @return + */ + public double provideHeat(ItemStack stack) { + return 0; //TODO } /** @@ -136,65 +177,101 @@ public class ItemRBMKRod extends ItemHazard { } list.add(EnumChatFormatting.GREEN + "Depletion: " + (100D - ((getYield(stack) * 1000D / yield) / 10D)) + "%"); - list.add(EnumChatFormatting.LIGHT_PURPLE + "Xenon poison: " + ((getPoison(stack) * 10D) / 10D) + "%"); - list.add(EnumChatFormatting.GOLD + "Heat per tick at full power: " + heat); - list.add(EnumChatFormatting.YELLOW + "Flux function:"); - list.add(EnumChatFormatting.WHITE + " f(0) = " + funcStart); - list.add(EnumChatFormatting.WHITE + " f(1) = " + funcEnd); - list.add(EnumChatFormatting.WHITE + " f(x) = " + funcStart + " + " + (funcEnd - funcStart) + " * x"); - list.add(EnumChatFormatting.YELLOW + "Xenon gen function:"); - list.add(EnumChatFormatting.WHITE + " g(x) = x * " + xGen); - list.add(EnumChatFormatting.YELLOW + "Xenon burn function:"); - list.add(EnumChatFormatting.WHITE + " b(x) = x² * " + xBurn); + list.add(EnumChatFormatting.DARK_PURPLE + "Xenon poison: " + ((getPoison(stack) * 10D) / 10D) + "%"); + list.add(EnumChatFormatting.BLUE + "Splits with: " + nType.localized); + list.add(EnumChatFormatting.BLUE + "Splits into: " + rType.localized); + list.add(EnumChatFormatting.YELLOW + "Flux function: " + EnumChatFormatting.WHITE + "" + funcStart + " + " + (funcEnd - funcStart) + " * x"); + list.add(EnumChatFormatting.YELLOW + "Xenon gen function: " + EnumChatFormatting.WHITE + "x * " + xGen); + list.add(EnumChatFormatting.YELLOW + "Xenon burn function: " + EnumChatFormatting.WHITE + "x² * " + xBurn); + list.add(EnumChatFormatting.GOLD + "Heat per tick at full power: " + heat + "°C"); + list.add(EnumChatFormatting.GOLD + "Diffusion: " + diffusion + "°C/t"); + list.add(EnumChatFormatting.RED + "Skin temp: " + ((int)(getHullHeat(stack) * 10D) / 10D) + "°C"); + list.add(EnumChatFormatting.RED + "Core temp: " + ((int)(getCoreHeat(stack) * 10D) / 10D) + "°C"); + list.add(EnumChatFormatting.DARK_RED + "Melting point: " + meltingPoint + "°C"); super.addInformation(stack, player, list, bool); } + /* __ __ ____ ________ + * | \ | | | __ \ |__ __| + * | \ | | | |__| | | | + * | |\\| | | __ < | | + * | | \ | | |__| | | | + * |__| \__| |_____/ |__| + */ + public static void setYield(ItemStack stack, double yield) { - - if(!stack.hasTagCompound()) - stack.stackTagCompound = new NBTTagCompound(); - - stack.stackTagCompound.setDouble("yield", yield); + setDouble(stack, "yield", yield); } public static double getYield(ItemStack stack) { - if(stack.hasTagCompound()) { - return stack.stackTagCompound.getDouble("yield"); - } - if(stack.getItem() instanceof ItemRBMKRod) { - return ((ItemRBMKRod)stack.getItem()).yield; + return getDouble(stack, "yield"); } return 0; } - public static void setPoison(ItemStack stack, double yield) { - - if(!stack.hasTagCompound()) - stack.stackTagCompound = new NBTTagCompound(); - - stack.stackTagCompound.setDouble("xenon", yield); + public static void setPoison(ItemStack stack, double xenon) { + setDouble(stack, "xenon", xenon); } public static double getPoison(ItemStack stack) { - - if(stack.hasTagCompound()) { - return stack.stackTagCompound.getDouble("xenon"); - } - - return 0; + return getDouble(stack, "xenon"); + } + + public static void setCoreHeat(ItemStack stack, double heat) { + setDouble(stack, "core", heat); + } + + public static double getCoreHeat(ItemStack stack) { + return getDouble(stack, "core"); + } + + public static void setHullHeat(ItemStack stack, double heat) { + setDouble(stack, "hull", heat); + } + + public static double getHullHeat(ItemStack stack) { + return getDouble(stack, "hull"); } @Override public boolean showDurabilityBar(ItemStack stack) { - return getDurabilityForDisplay(stack) < 1D; + return getDurabilityForDisplay(stack) > 0D; } @Override public double getDurabilityForDisplay(ItemStack stack) { - return getEnrichment(stack); + return 1D - getEnrichment(stack); + } + + public static void setDouble(ItemStack stack, String key, double yield) { + + if(!stack.hasTagCompound()) + setNBTDefaults(stack); + + stack.stackTagCompound.setDouble(key, yield); + } + + public static double getDouble(ItemStack stack, String key) { + + if(!stack.hasTagCompound()) + setNBTDefaults(stack); + + return stack.stackTagCompound.getDouble(key); + } + + /** + * Sets up the default values for all NBT data because doing it one-by-one will only correctly set the first called value and the rest stays 0 which is very not good + * @param stack + */ + private static void setNBTDefaults(ItemStack stack) { + + stack.stackTagCompound = new NBTTagCompound(); + setYield(stack, ((ItemRBMKRod)stack.getItem()).yield); + setCoreHeat(stack, 20.0D); + setHullHeat(stack, 20.0D); } } diff --git a/src/main/java/com/hbm/tileentity/machine/rbmk/IRBMKFluxReceiver.java b/src/main/java/com/hbm/tileentity/machine/rbmk/IRBMKFluxReceiver.java index bebbdaa0e..6eff26108 100644 --- a/src/main/java/com/hbm/tileentity/machine/rbmk/IRBMKFluxReceiver.java +++ b/src/main/java/com/hbm/tileentity/machine/rbmk/IRBMKFluxReceiver.java @@ -2,5 +2,17 @@ package com.hbm.tileentity.machine.rbmk; public interface IRBMKFluxReceiver { - public void receiveFlux(float flux); + public enum NType { + FAST("Fast Neutrons"), + SLOW("Slow Neutrons"), + ANY("All Neutrons"); //not to be used for reactor flux calculation, only for the fuel designation + + public String localized; + + private NType(String loc) { + this.localized = loc; + } + } + + public void receiveFlux(NType type, double flux); } diff --git a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBase.java b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBase.java index 356ad12f8..a19f7c306 100644 --- a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBase.java +++ b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBase.java @@ -47,7 +47,6 @@ public abstract class TileEntityRBMKBase extends TileEntity { coolPassively(); } - public static final ForgeDirection[] heatDirs = new ForgeDirection[] { ForgeDirection.NORTH, ForgeDirection.EAST, diff --git a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKRod.java b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKRod.java index 4b257c4d2..244ae2115 100644 --- a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKRod.java +++ b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKRod.java @@ -1,9 +1,15 @@ package com.hbm.tileentity.machine.rbmk; +import com.hbm.items.machine.ItemRBMKRod; + +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBMKFluxReceiver { //amount of "neutron energy" buffered for the next tick to use for the reaction - private float flux; + private double fluxFast; + private double fluxSlow; public TileEntityRBMKRod() { super(1); @@ -15,7 +21,94 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM } @Override - public void receiveFlux(float flux) { - this.flux += flux; + public void receiveFlux(NType type, double flux) { + + switch(type) { + case FAST: this.fluxFast += flux; break; + case SLOW: this.fluxSlow += flux; break; + } + } + + @Override + public void updateEntity() { + + if(slots[0] != null && slots[0].getItem() instanceof ItemRBMKRod) { + + ItemRBMKRod rod = ((ItemRBMKRod)slots[0].getItem()); + + double fluxIn = fluxFromType(rod.nType); + + double fluxOut = rod.burn(slots[0], fluxIn); + NType rType = rod.rType; + + spreadFlux(rType, fluxOut); + } + + super.updateEntity(); + } + + /** + * SLOW: full efficiency for slow neutrons, fast neutrons have half efficiency + * FAST: fast neutrons have 100% efficiency, slow only 30% + * ANY: just add together whatever we have because who cares + * @param type + * @return + */ + + private double fluxFromType(NType type) { + + switch(type) { + case SLOW: return this.fluxFast * 0.5D + this.fluxSlow; + case FAST: return this.fluxFast + this.fluxSlow * 0.3D; + case ANY: return this.fluxFast + this.fluxSlow; + } + + return 0.0D; + } + + public static final ForgeDirection[] fluxDirs = new ForgeDirection[] { + ForgeDirection.NORTH, + ForgeDirection.EAST, + ForgeDirection.SOUTH, + ForgeDirection.WEST + }; + + private void spreadFlux(NType type, double fluxOut) { + + int range = 5; + + for(ForgeDirection dir : fluxDirs) { + + NType stream = type; + + for(int i = 1; i <= range; i++) { + + TileEntity te = worldObj.getTileEntity(xCoord + dir.offsetX * i, yCoord, zCoord + dir.offsetZ * i); + + //burn baby burn + if(te instanceof TileEntityRBMKRod) { + TileEntityRBMKRod rod = (TileEntityRBMKRod)te; + rod.receiveFlux(stream, fluxOut); + break; + } + + //set neutrons to slow + if(te instanceof TileEntityRBMKModerator) { + stream = NType.SLOW; + continue; + } + + //return the neutrons back to this with no further action required + if(te instanceof TileEntityRBMKReflector) { + this.receiveFlux(stream, fluxOut); + break; + } + + //break the neutron flow and nothign else + if(te instanceof TileEntityRBMKAbsorber) { + break; + } + } + } } } diff --git a/src/main/resources/assets/hbm/textures/blocks/block_actinium.png b/src/main/resources/assets/hbm/textures/blocks/block_actinium.png index b909aa3ba8031e221185bfb7a9ffa1ed7148f60e..3d6333d54653ca4b815486c2961d7208d6ae9451 100644 GIT binary patch delta 655 zcmV;A0&xAR1f~U$BYy&HNklbmirsXv=N3YO9%UFl{3{Ta;%Kop_$P z;}m_ap7%M=`97cbd7npkFgdBKl?vKgTTw2TK|YyevA}AzVt*~4=QEjTHbbjc`CHwD zyJKT|r?b-tkYg4_R5fi+?4Uy;k%Vw>d|Y>(^TO5L%{gZAD5~1u9baUzimLKC5{ck; zD1>~Wz<&C38cg8!dN3RaV0&u|rsn2DE6>c&Vbi{+&_1bPLl z?KotI!w~3nyW#eDkxaz7nZ12}ynFkG1;XJlve_(RsT9&AaDQS#KP8`mYRa z^pFYu0idd)C^8KRZ5E4A6hA8JFDC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/blocks/ladder_copper.png new file mode 100644 index 0000000000000000000000000000000000000000..32b2f686478804ccf7bcaec02fc2a88613b16cb0 GIT binary patch literal 501 zcmV zhWvor^l>R0hhVmm%5hxE8w9dIXdKKcg)`DR?0WO6VR&=r-7|L#faT4bCQVZS-haC{ zxKNwVZySKsYQ?*+KMe~&2tiR41VO;^>Z;Lu0FL9dhm}$&r6`Jm~yYA= z-2_rfY}+ObLpD2%8G`nvhoKXkcJO5r#TRaJEY zLI`ZzWyz+6_N}aqv4B2S12kLK5Bl z0(LBcL7AXi8KDeZDoN8LF*%2m_KXU?>Ggm2-rf7%zW}VJT@?*c(GbOvP)lE_rLV@% zdaniGx-NMx2!bxFsa|kh7XZg`s$wZ6QcChX=i@_b7C@foxGtorFwQb_D9bu;x52WE z2D6#q{ap)Jw=@oo@bZ8vOW16T2B)W8=5ukVu8J`11MvE~s2ilIz_uX_ebllBnPpj3 zn5Kdt@GE_{(|Q9m**H#+^80D+cAc9HE-ri~lZ5k28WunlCDlyVcgGo+``O=M{7m(> zhvHWsWLZX0z+g}_Fz1Kb7g9d-W+D|c#nE|N@zCq_a}U1zjeKnIS~K=002ovPDHLkV1j#^ B%DMmm literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/hbm/textures/blocks/ladder_iron.png b/src/main/resources/assets/hbm/textures/blocks/ladder_iron.png new file mode 100644 index 0000000000000000000000000000000000000000..c17a3c275eb026bb0926c4588a67dfcd261d6433 GIT binary patch literal 459 zcmV;+0W|)JP)d(zpRhisz94yOf1=2L- ze!l~-Uavo%u-RFRxE_s0G#t8l!=bUh5tvLSWLZXDV!d}9GTJ^kqNJO^O6d$AaZ=jWdtz;?SO z%eIySAcR0lNgT(_X0uM80eGHgij`6*rI1o`y)+0``e&|D4KU|+fr2(05-sUK1T>))*gx^Nl21}AP8<76h(pSx+F;gtU7(U zEK5^Z6a{e{oAb-%0)PcQ+0AByQtED+@B9B`kfy151xxGFn(F%SB?Ew}s;KLOW$TV% z7!rozmkiQ0HTM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`8n1U;|%5QUCw|07*qoM6N<$f(!TBy8r+H literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/hbm/textures/blocks/ladder_tungsten.png b/src/main/resources/assets/hbm/textures/blocks/ladder_tungsten.png new file mode 100644 index 0000000000000000000000000000000000000000..c65ba88b4078724ed07a37d8d75165e6efa2bbef GIT binary patch literal 368 zcmV-$0gwKPP)N4j&(jkCA%r3#MMMf4rm96%i}$_&bO3$dQ%WI(08o}3fVH-QbI#O~~(>j2Z62=%} zjH?ObI96aviD4LO{(ir|x~gii)|Mx@x^u32n{Qv?e>hN8y!UwTH#tz%T3 zMF)#@0Q>zOfYa#&P>#nV@XbRTFFY*LFXg%L@*CUr4u``>EwnoLGY4OjaEzN8Km+yw O0000kX`CN!w0+_EFaP%J@TtDM^Ff|=@zMhl7fw|1cs<%6&!WIAB`L+cy_&=G@rJb) zZF}z-nSK%5^ud3@lo{?Gk8{l~o@8TXC<-?;s0x>`4Q4224Rb!t@y?&`6-Oy&>}#Wg z%3-X3>zGe(ol$#r>6ch;^|wXw_0giAV%wSb#Bcgmv1?Ubg^)n=nnw@hUou}yv3kk- TbioFoj~F~%{an^LB{Ts5H6>~x literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/hbm/textures/items/billet_australium_greater.png b/src/main/resources/assets/hbm/textures/items/billet_australium_greater.png new file mode 100644 index 0000000000000000000000000000000000000000..906a4037a78646c0a92088202a19e3e81b900caf GIT binary patch literal 297 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#VfX@V+ z`LFu@-J9hfz6ZS5>*5W2w>j3{yi$G6`8#ph25ek+Dsz@3Z4_aez%(^lig|f)#-t;U z%#zf_ieE=Ie-@1bjte+Z($oyTgZ;8}H&fls|ERV`h_5l6L;OXk;vd$@?2>_X=b*umY literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/hbm/textures/items/billet_australium_lesser.png b/src/main/resources/assets/hbm/textures/items/billet_australium_lesser.png new file mode 100644 index 0000000000000000000000000000000000000000..6f6ceb3dd69a0e9de2a4b40a001e9a1b8da8c0f1 GIT binary patch literal 299 zcmV+`0o4A9P)>v=m76?#K!O8Wy0Y$P6JPAXXqV1c^al0J@}e z4`~=66i(u^2_Q0)+jEP)KWGzC9LK-!d=G6GrwkPf>7ZL2T*L+n;uw$+X@`yyY(X6S zGx&#!*ww+Jql2qXMNp_ih7K)tXiF)S(0Y+1U?rJ)Z7=1$-p?U-m)ym{7k#JxAcXIa z_kQ=e-=D`j;4d5NcjNxfCb@PMwO4P@`dY{6#!_FgEZq&u7sqJr`Xn8cZJZoFgQNN` z2F|7N{lk0O+gc~%00ZaKII8dB)bJ1v%U^o5QGh}&LzWO=LV%VSOS0S zC^m+PHK7$7ySO$Ez{CkK-d%#IP5_|u#@#(YNdOdb8S1XNr=mUJsRXWM({m310JG_< z{us71@OXP6Tw@FX=v>KW=I7gv=l4SYe|aSf0SE|d$A06BN!M8La0amW|IaoUxsvGs z>}{=+YgaM;Y%1cPJ9`DKN*$M17yHW|0TldxW&P^430k@^O8YyT)cEvK`@II%S|Nf+3wf#_ z^;2ZrI;QFmk7vlt9Jm%}NqB8TA`MOx(UPE>Xe#w|RRW1LytP3R9*J=UD(M>vdemn_M?wV=dbo6Bz-3TrNi{m7-W2&fB(4 ztyYVcfR93r4u@KNh7f~>dg}_7= z(1R;>hU3TyOk4rK=Wch!;W!oolUKm(_dFcOLSXU=7$F7z%_;CL*>^W#{QGO=g3sy#~+*<$u literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/hbm/textures/items/rbmk_fuel_leaus.png b/src/main/resources/assets/hbm/textures/items/rbmk_fuel_leaus.png new file mode 100644 index 0000000000000000000000000000000000000000..bb418d50b9833553081f6b18ccec6a81f2a31acc GIT binary patch literal 518 zcmV+h0{Q)kP)_k%#P48T9SVZ8B1P~I2!hZ>6kPlcZh}w{ zTtyJUp$@ur(8;-e0JkEI?GQ!5Cf6ZNnx-JV)uxJP%DueYciy@0JU@<|$HPr;3?vS@<*gTl( z%HLepXfuD03$dmwu5#qEs~Az;QXqG+55fsra; zMpx|i#zQACas`5(d+im+<3tFIUV&7n=kYiZ0;5;JiYf4KPC;PFzPbsAZpk*beCt)( ztA+}g7VI1*Y{_