RBMK chain reaction

This commit is contained in:
Bob 2021-04-11 15:17:51 +02:00
parent f572329046
commit b7fcdee709
11 changed files with 84 additions and 46 deletions

View File

@ -26,6 +26,12 @@ public class MineralRecipes {
RecipesCommon.add9To1(ModItems.ingot_schraranium, ModBlocks.block_schraranium);
RecipesCommon.add1To9(ModBlocks.block_schraranium, ModItems.ingot_schraranium);
RecipesCommon.add9To1(ModItems.ingot_lanthanium, ModBlocks.block_lanthanium);
RecipesCommon.add1To9(ModBlocks.block_lanthanium, ModItems.ingot_lanthanium);
RecipesCommon.add9To1(ModItems.ingot_actinium, ModBlocks.block_actinium);
RecipesCommon.add1To9(ModBlocks.block_actinium, ModItems.ingot_actinium);
RecipesCommon.add9To1(ModItems.ingot_schrabidate, ModBlocks.block_schrabidate);
RecipesCommon.add1To9(ModBlocks.block_schrabidate, ModItems.ingot_schrabidate);

View File

@ -1531,8 +1531,9 @@ public class ModItems {
public static Item canteen_13;
public static Item canteen_vodka;
public static Item canteen_fab;
public static Item defuser;
public static Item reacher;
public static Item flame_pony;
public static Item flame_conspiracy;
@ -3083,35 +3084,35 @@ public class ModItems {
rbmk_fuel_empty = new Item().setUnlocalizedName("rbmk_fuel_empty").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":rbmk_fuel_empty");
rbmk_fuel_meu = new ItemRBMKRod("Medium Enriched Uranium")
.setYield(10D)
.setStats(0, 100).setUnlocalizedName("rbmk_fuel_meu").setTextureName(RefStrings.MODID + ":rbmk_fuel_meu");
.setYield(100000000D)
.setStats(100).setUnlocalizedName("rbmk_fuel_meu").setTextureName(RefStrings.MODID + ":rbmk_fuel_meu");
rbmk_fuel_thmeu = new ItemRBMKRod("Thorium with MEU Driver Fuel")
.setYield(10D)
.setStats(0, 100).setUnlocalizedName("rbmk_fuel_thmeu").setTextureName(RefStrings.MODID + ":rbmk_fuel_thmeu");
.setYield(100000000D)
.setStats(100).setUnlocalizedName("rbmk_fuel_thmeu").setTextureName(RefStrings.MODID + ":rbmk_fuel_thmeu");
rbmk_fuel_lep = new ItemRBMKRod("Low Enriched Plutonium")
.setYield(10D)
.setStats(0, 100).setUnlocalizedName("rbmk_fuel_lep").setTextureName(RefStrings.MODID + ":rbmk_fuel_lep");
.setYield(100000000D)
.setStats(100).setUnlocalizedName("rbmk_fuel_lep").setTextureName(RefStrings.MODID + ":rbmk_fuel_lep");
rbmk_fuel_mep = new ItemRBMKRod("Medium Enriched Plutonium")
.setYield(10D)
.setStats(15, 100).setUnlocalizedName("rbmk_fuel_mep").setTextureName(RefStrings.MODID + ":rbmk_fuel_mep");
.setYield(100000000D)
.setStats(100, 20).setUnlocalizedName("rbmk_fuel_mep").setTextureName(RefStrings.MODID + ":rbmk_fuel_mep");
rbmk_fuel_mox = new ItemRBMKRod("Mixed LEU & LEP Oxide")
.setYield(10D)
.setStats(0, 100).setUnlocalizedName("rbmk_fuel_mox").setTextureName(RefStrings.MODID + ":rbmk_fuel_mox");
.setYield(100000000D)
.setStats(100).setUnlocalizedName("rbmk_fuel_mox").setTextureName(RefStrings.MODID + ":rbmk_fuel_mox");
rbmk_fuel_les = new ItemRBMKRod("Low Enriched Schrabidium")
.setYield(10D)
.setStats(0, 100).setUnlocalizedName("rbmk_fuel_les").setTextureName(RefStrings.MODID + ":rbmk_fuel_les");
.setYield(100000000D)
.setStats(100).setUnlocalizedName("rbmk_fuel_les").setTextureName(RefStrings.MODID + ":rbmk_fuel_les");
rbmk_fuel_mes = new ItemRBMKRod("Medium Enriched Schrabidium")
.setYield(10D)
.setStats(0, 100).setUnlocalizedName("rbmk_fuel_mes").setTextureName(RefStrings.MODID + ":rbmk_fuel_mes");
.setYield(100000000D)
.setStats(100).setUnlocalizedName("rbmk_fuel_mes").setTextureName(RefStrings.MODID + ":rbmk_fuel_mes");
rbmk_fuel_hes = new ItemRBMKRod("Highly Enriched Schrabidium")
.setYield(10D)
.setStats(0, 100).setUnlocalizedName("rbmk_fuel_hes").setTextureName(RefStrings.MODID + ":rbmk_fuel_hes");
.setYield(100000000D)
.setStats(100).setUnlocalizedName("rbmk_fuel_hes").setTextureName(RefStrings.MODID + ":rbmk_fuel_hes");
rbmk_fuel_po210be = new ItemRBMKRod("Polonium-210 & Beryllium Neutron Source")
.setYield(10D)
.setStats(50, 70).setUnlocalizedName("rbmk_fuel_po210be").setTextureName(RefStrings.MODID + ":rbmk_fuel_po210be");
.setYield(100000000D)
.setStats(70, 50).setUnlocalizedName("rbmk_fuel_po210be").setTextureName(RefStrings.MODID + ":rbmk_fuel_po210be");
rbmk_fuel_pu238be = new ItemRBMKRod("Plutonium-238 & Beryllium Neutron Source")
.setYield(10D)
.setStats(35, 60).setUnlocalizedName("rbmk_fuel_pu238be").setTextureName(RefStrings.MODID + ":rbmk_fuel_pu238be");
.setYield(100000000D)
.setStats(60, 35).setUnlocalizedName("rbmk_fuel_pu238be").setTextureName(RefStrings.MODID + ":rbmk_fuel_pu238be");
trinitite = new ItemHazard().addRadiation(ItemHazard.trn * ItemHazard.ingot).toItem().setUnlocalizedName("trinitite").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":trinitite_new");
nuclear_waste_long = new ItemHazard(5F).setUnlocalizedName("nuclear_waste_long").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nuclear_waste_long");
@ -3707,6 +3708,7 @@ public class ModItems {
peas = new ItemPeas().setUnlocalizedName("peas").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":peas");
defuser = new Item().setUnlocalizedName("defuser").setMaxStackSize(1).setFull3D().setCreativeTab(MainRegistry.nukeTab).setTextureName(RefStrings.MODID + ":defuser");
reacher = new Item().setUnlocalizedName("reacher").setMaxStackSize(1).setFull3D().setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":reacher");
flame_pony = new ItemCustomLore().setUnlocalizedName("flame_pony").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":flame_pony");
flame_conspiracy = new ItemCustomLore().setUnlocalizedName("flame_conspiracy").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":flame_conspiracy");
@ -6725,6 +6727,8 @@ public class ModItems {
GameRegistry.registerItem(bomb_caller, bomb_caller.getUnlocalizedName());
GameRegistry.registerItem(meteor_remote, meteor_remote.getUnlocalizedName());
GameRegistry.registerItem(defuser, defuser.getUnlocalizedName());
GameRegistry.registerItem(reacher, reacher.getUnlocalizedName());
GameRegistry.registerItem(hazmat_helmet, hazmat_helmet.getUnlocalizedName());
GameRegistry.registerItem(hazmat_plate, hazmat_plate.getUnlocalizedName());
GameRegistry.registerItem(hazmat_legs, hazmat_legs.getUnlocalizedName());

View File

@ -15,9 +15,9 @@ import net.minecraft.util.EnumChatFormatting;
public class ItemRBMKRod extends ItemHazard {
public String fullName = ""; //full name of the fuel rod
public double funcStart; //starting point of the linear reactivity function
public double funcEnd; //endpoint of the function
public double xGen = 0.5D;; //multiplier for xenon production
public double selfRate; //self-inflicted flux from self-igniting fuels
public double xGen = 0.5D; //multiplier for xenon production
public double xBurn = 50D; //divider for xenon burnup
public double heat = 1D; //heat produced per outFlux
public double yield; //total potential inFlux the rod can take in its lifetime
@ -60,9 +60,13 @@ public class ItemRBMKRod extends ItemHazard {
return this;
}
public ItemRBMKRod setStats(double funcStart, double funcEnd) {
this.funcStart = funcStart;
public ItemRBMKRod setStats(double funcStart) {
return setStats(funcEnd, 0);
}
public ItemRBMKRod setStats(double funcEnd, double selfRate) {
this.funcEnd = funcEnd;
this.selfRate = selfRate;
return this;
}
@ -83,7 +87,9 @@ public class ItemRBMKRod extends ItemHazard {
*/
public double burn(ItemStack stack, double inFlux) {
inFlux *= getPoisonLevel(stack);
inFlux += selfRate;
inFlux *= (1D - getPoisonLevel(stack));
double xenon = getPoison(stack);
xenon += xenonGenFunc(inFlux);
@ -104,6 +110,14 @@ public class ItemRBMKRod extends ItemHazard {
setYield(stack, y);
//TODO: core heatup
/*System.out.println("=== FUEL SUMMARY REPORT ===");
System.out.println("I AM " + this.getUnlocalizedName());
System.out.println("I RECEIVE " + inFlux);
System.out.println("I HAVE " + xenon);
System.out.println("I CREATE " + outFlux);
System.out.println("I YIELD " + y);
System.out.println("=== END OF REPORT ===");*/
return outFlux;
}
@ -130,7 +144,7 @@ public class ItemRBMKRod extends ItemHazard {
* @return the amount of reactivity yielded, unmodified by xenon
*/
public double reactivityFunc(double flux) {
return funcStart + (funcEnd - funcStart) * flux / 100D; //goodness gracious i guessed the right formula on the first try!
return funcEnd * flux / 100D; //goodness gracious i guessed the right formula on the first try!
}
/**
@ -172,15 +186,15 @@ public class ItemRBMKRod extends ItemHazard {
list.add(EnumChatFormatting.ITALIC + this.fullName);
if(funcStart > 0) {
if(selfRate > 0) {
list.add(EnumChatFormatting.RED + "Self-igniting");
}
list.add(EnumChatFormatting.GREEN + "Depletion: " + (100D - ((getYield(stack) * 1000D / yield) / 10D)) + "%");
list.add(EnumChatFormatting.DARK_PURPLE + "Xenon poison: " + ((getPoison(stack) * 10D) / 10D) + "%");
list.add(EnumChatFormatting.GREEN + "Depletion: " + ((int)(((yield - getYield(stack)) / yield) * 10000)) / 10000D + "%");
list.add(EnumChatFormatting.DARK_PURPLE + "Xenon poison: " + ((getPoison(stack) * 100D) / 100D) + "%");
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 + "Flux function: " + EnumChatFormatting.WHITE + "" + funcEnd + " * x" + (selfRate > 0 ? (EnumChatFormatting.RED + " + " + selfRate) : ""));
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");

View File

@ -7,7 +7,6 @@ import java.util.Set;
import org.lwjgl.opengl.GL11;
import com.google.common.collect.Sets;
import com.hbm.blocks.machine.rbmk.RBMKBase;
import com.hbm.packet.NBTPacket;
import com.hbm.packet.PacketDispatcher;
@ -198,8 +197,9 @@ public abstract class TileEntityRBMKBase extends TileEntity implements INBTPacke
String title = "Dump of Ordered Data Diagnostic (DODD)";
mc.fontRenderer.drawString(title, pX + 1, pZ - 19, 0x006000);
mc.fontRenderer.drawString(title, pX, pZ - 20, 0x00FF00);
mc.fontRenderer.drawString(I18nUtil.resolveKey(rbmk.getUnlocalizedName() + ".name"), pX, pZ - 10, 0xFFFFFF);
mc.fontRenderer.drawString(I18nUtil.resolveKey(rbmk.getUnlocalizedName() + ".name"), pX + 1, pZ - 9, 0x606000);
mc.fontRenderer.drawString(I18nUtil.resolveKey(rbmk.getUnlocalizedName() + ".name"), pX, pZ - 10, 0xffff00);
String[] ents = new String[keys.size()];
keys.toArray(ents);

View File

@ -32,20 +32,30 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
@Override
public void updateEntity() {
if(!worldObj.isRemote && slots[0] != null && slots[0].getItem() instanceof ItemRBMKRod) {
if(!worldObj.isRemote) {
ItemRBMKRod rod = ((ItemRBMKRod)slots[0].getItem());
super.updateEntity();
double fluxIn = fluxFromType(rod.nType);
double fluxOut = rod.burn(slots[0], fluxIn);
NType rType = rod.rType;
spreadFlux(rType, fluxOut);
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;
//for spreading, we want the buffered flux to be 0 because we want to know exactly how much gets reflected back
this.fluxFast = 0;
this.fluxSlow = 0;
spreadFlux(rType, fluxOut);
} else {
this.fluxFast = 0;
this.fluxSlow = 0;
}
}
super.updateEntity();
}
/**
@ -131,7 +141,6 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
public void getDiagData(NBTTagCompound nbt) {
this.writeToNBT(nbt);
if(slots[0] != null && slots[0].getItem() instanceof ItemRBMKRod) {

View File

@ -144,6 +144,7 @@ public abstract class TileEntityRBMKSlottedBase extends TileEntityRBMKActiveBase
}
public void networkUnpack(NBTTagCompound nbt) {
super.networkUnpack(nbt);
}
public void handleButtonPacket(int value, int meta) {

View File

@ -2334,6 +2334,7 @@ tile.barrel_plastic.name=Sicheres Fass™
tile.barrel_steel.name=Stahlfass
tile.barricade.name=Sandsäcke
tile.blast_door.name=Abschluss-Sprengtür
tile.block_actinium.name=Actiniumblock
tile.block_advanced_alloy.name=Fortgeschrittener Legierungsblock
tile.block_aluminium.name=Aluminiumblock
tile.block_asbestos.name=Asbestblock
@ -2362,6 +2363,7 @@ tile.block_fiberglass.name=Fiberglasrolle
tile.block_fluorite.name=Fluoritblock
tile.block_insulator.name=Isolatorrolle
tile.block_lead.name=Bleiblock
tile.block_lanthanium.name=Lanthanblock
tile.block_lithium.name=Lithiumblock
tile.block_magnetized_tungsten.name=Magnetisierter Wolframblock
tile.block_meteor.name=Meteoritenblock

View File

@ -2345,6 +2345,7 @@ tile.barrel_plastic.name=Safe Barrel™
tile.barrel_steel.name=Steel Barrel
tile.barricade.name=Sand Bags
tile.blast_door.name=Sliding Blast Door
tile.block_actinium.name=Block of Actinium
tile.block_advanced_alloy.name=Block of Advanced Alloy
tile.block_aluminium.name=Block of Aluminium
tile.block_asbestos.name=Block of Asbestos
@ -2373,6 +2374,7 @@ tile.block_fiberglass.name=Roll of Fiberglass
tile.block_fluorite.name=Block of Fluorite
tile.block_insulator.name=Roll of Insulation
tile.block_lead.name=Block of Lead
tile.block_lanthanium.name=Block of Lanthanium
tile.block_lithium.name=Block of Lithium
tile.block_magnetized_tungsten.name=Block of Magnetized Tungsten
tile.block_meteor.name=Meteorite Block

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B