mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
recipes, mug PWR cooling
This commit is contained in:
parent
65587e7db7
commit
21a7337b9f
@ -3,6 +3,7 @@ package com.hbm.crafting;
|
||||
import static com.hbm.inventory.OreDictManager.*;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBreedingRod.*;
|
||||
import com.hbm.items.machine.ItemPWRFuel.EnumPWRFuel;
|
||||
import com.hbm.items.machine.ItemWatzPellet.EnumWatzType;
|
||||
import com.hbm.items.machine.ItemZirnoxRod.EnumZirnoxType;
|
||||
import com.hbm.main.CraftingManager;
|
||||
@ -136,6 +137,23 @@ public class RodRecipes {
|
||||
addPellet(PB, EnumWatzType.LEAD);
|
||||
addPellet(B, EnumWatzType.BORON);
|
||||
addPellet(U238, EnumWatzType.DU);
|
||||
|
||||
//PWR fuel
|
||||
CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.pwr_fuel, EnumPWRFuel.MEU), new Object[] { "F", "I", "F", 'F', ModItems.billet_uranium_fuel, 'I', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.pwr_fuel, EnumPWRFuel.HEU233), new Object[] { "F", "I", "F", 'F', U233.billet(), 'I', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.pwr_fuel, EnumPWRFuel.HEU235), new Object[] { "F", "I", "F", 'F', U235.billet(), 'I', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.pwr_fuel, EnumPWRFuel.MEN), new Object[] { "F", "I", "F", 'F', ModItems.billet_neptunium_fuel, 'I', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.pwr_fuel, EnumPWRFuel.HEN237), new Object[] { "F", "I", "F", 'F', NP237.billet(), 'I', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.pwr_fuel, EnumPWRFuel.MOX), new Object[] { "F", "I", "F", 'F', ModItems.billet_mox_fuel, 'I', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.pwr_fuel, EnumPWRFuel.MEP), new Object[] { "F", "I", "F", 'F', ModItems.billet_pu_mix, 'I', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.pwr_fuel, EnumPWRFuel.HEP239), new Object[] { "F", "I", "F", 'F', PU239.billet(), 'I', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.pwr_fuel, EnumPWRFuel.HEP241), new Object[] { "F", "I", "F", 'F', PU241.billet(), 'I', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.pwr_fuel, EnumPWRFuel.MEA), new Object[] { "F", "I", "F", 'F', ModItems.billet_am_mix, 'I', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.pwr_fuel, EnumPWRFuel.HEA242), new Object[] { "F", "I", "F", 'F', AM242.billet(), 'I', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.pwr_fuel, EnumPWRFuel.HES326), new Object[] { "F", "I", "F", 'F', SA326.billet(), 'I', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.pwr_fuel, EnumPWRFuel.HES327), new Object[] { "F", "I", "F", 'F', SA327.billet(), 'I', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.pwr_fuel, EnumPWRFuel.BFB_AM_MIX), new Object[] { "F", "I", "B", 'F', ModItems.billet_am_mix, 'I', ModItems.plate_polymer, 'B', BI.billet() });
|
||||
CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.pwr_fuel, EnumPWRFuel.BFB_PU241), new Object[] { "F", "I", "B", 'F', PU241.billet(), 'I', ModItems.plate_polymer, 'B', BI.billet() });
|
||||
}
|
||||
|
||||
public static void registerInit() {
|
||||
|
||||
@ -511,7 +511,7 @@ public class Fluids {
|
||||
COOLANT.addTraits(new FT_Heatable().setEff(HeatingType.HEATEXCHANGER, 1.0D).setEff(HeatingType.PWR, 1.0D).addStep(300, 1, COOLANT_HOT, 1));
|
||||
COOLANT_HOT.addTraits(new FT_Coolable(COOLANT, 1, 1, 300).setEff(CoolingType.HEATEXCHANGER, 1.0D));
|
||||
|
||||
MUG.addTraits(new FT_Heatable().setEff(HeatingType.HEATEXCHANGER, 1.0D).addStep(400, 1, MUG_HOT, 1));
|
||||
MUG.addTraits(new FT_Heatable().setEff(HeatingType.HEATEXCHANGER, 1.0D).setEff(HeatingType.PWR, 1.0D).addStep(400, 1, MUG_HOT, 1), new FT_PWRModerator(1.15D));
|
||||
MUG_HOT.addTraits(new FT_Coolable(MUG, 1, 1, 400).setEff(CoolingType.HEATEXCHANGER, 1.0D));
|
||||
|
||||
BLOOD.addTraits(new FT_Heatable().setEff(HeatingType.HEATEXCHANGER, 1.0D).addStep(500, 1, BLOOD_HOT, 1));
|
||||
|
||||
@ -62,8 +62,9 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG
|
||||
public boolean assembled;
|
||||
|
||||
private AudioWrapper audio;
|
||||
|
||||
|
||||
protected List<BlockPos> ports = new ArrayList();
|
||||
protected List<BlockPos> rods = new ArrayList();
|
||||
|
||||
public TileEntityPWRController() {
|
||||
super(3);
|
||||
@ -82,6 +83,8 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG
|
||||
heatexCount = 0;
|
||||
channelCount = 0;
|
||||
sourceCount = 0;
|
||||
ports.clear();
|
||||
rods.clear();
|
||||
|
||||
int connectionsDouble = 0;
|
||||
int connectionsControlledDouble = 0;
|
||||
@ -99,6 +102,8 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG
|
||||
for(Entry<BlockPos, Block> entry : rodMap.entrySet()) {
|
||||
BlockPos fuelPos = entry.getKey();
|
||||
|
||||
rods.add(fuelPos);
|
||||
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
|
||||
boolean controlled = false;
|
||||
@ -211,6 +216,8 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG
|
||||
this.typeLoaded = -1;
|
||||
}
|
||||
|
||||
if(amountLoaded > rodCount) amountLoaded = rodCount;
|
||||
|
||||
/* CORE COOLING */
|
||||
double coreCoolingApproachNum = getXOverE((double) this.heatexCount * 5 / (double) this.rodCount, 2) / 2D;
|
||||
int averageCoreHeat = (this.coreHeat + this.hullHeat) / 2;
|
||||
@ -218,7 +225,8 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG
|
||||
this.hullHeat -= (hullHeat - averageCoreHeat) * coreCoolingApproachNum;
|
||||
|
||||
updateCoolant();
|
||||
|
||||
|
||||
this.coreHeat *= 0.999D;
|
||||
this.hullHeat *= 0.999D;
|
||||
|
||||
this.flux = newFlux;
|
||||
@ -227,6 +235,10 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG
|
||||
this.flux *= tanks[0].getTankType().getTrait(FT_PWRModerator.class).getMultiplier();
|
||||
}
|
||||
|
||||
if(this.coreHeat > this.coreHeatCapacity) {
|
||||
meltDown();
|
||||
}
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
tanks[0].writeToNBT(data, "t0");
|
||||
tanks[1].writeToNBT(data, "t1");
|
||||
@ -264,6 +276,31 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG
|
||||
}
|
||||
}
|
||||
|
||||
protected void meltDown() {
|
||||
|
||||
worldObj.func_147480_a(xCoord, yCoord, zCoord, false);
|
||||
|
||||
double x = 0;
|
||||
double y = 0;
|
||||
double z = 0;
|
||||
|
||||
for(BlockPos pos : this.rods) {
|
||||
Block b = worldObj.getBlock(pos.getX(), pos.getY(), pos.getZ());
|
||||
b.breakBlock(worldObj, pos.getX(), pos.getY(), pos.getZ(), b, worldObj.getBlockMetadata(pos.getX(), pos.getY(), pos.getZ()));
|
||||
worldObj.setBlock(pos.getX(), pos.getY(), pos.getZ(), ModBlocks.corium_block, 5, 3);
|
||||
|
||||
x += pos.getX() + 0.5;
|
||||
y += pos.getY() + 0.5;
|
||||
z += pos.getZ() + 0.5;
|
||||
}
|
||||
|
||||
x /= rods.size();
|
||||
y /= rods.size();
|
||||
z /= rods.size();
|
||||
|
||||
worldObj.newExplosion(null, x, y, z, 15F, true, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AudioWrapper createAudioLoop() {
|
||||
return MainRegistry.proxy.getLoopedSound("hbm:block.reactorLoop", xCoord, yCoord, zCoord, 1F, 10F, 1.0F, 20);
|
||||
@ -398,6 +435,15 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG
|
||||
int[] port = nbt.getIntArray("p" + i);
|
||||
ports.add(new BlockPos(port[0], port[1], port[2]));
|
||||
}
|
||||
|
||||
rods.clear();
|
||||
int rodCount = nbt.getInteger("rodCount");
|
||||
for(int i = 0; i < rodCount; i++) {
|
||||
if(nbt.hasKey("r" + i)) {
|
||||
int[] port = nbt.getIntArray("r" + i);
|
||||
rods.add(new BlockPos(port[0], port[1], port[2]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -430,6 +476,12 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG
|
||||
BlockPos pos = ports.get(i);
|
||||
nbt.setIntArray("p" + i, new int[] { pos.getX(), pos.getY(), pos.getZ() });
|
||||
}
|
||||
|
||||
nbt.setInteger("rodCount", rods.size());
|
||||
for(int i = 0; i < rods.size(); i++) {
|
||||
BlockPos pos = rods.get(i);
|
||||
nbt.setIntArray("r" + i, new int[] { pos.getX(), pos.getY(), pos.getZ() });
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user