Skip to content

Commit

Permalink
fix: reviews part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
bruberu committed Jun 6, 2024
1 parent 0e96dcf commit 15a80c8
Show file tree
Hide file tree
Showing 21 changed files with 53 additions and 100 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package gregtech.api.metatileentity.multiblock;

public interface IControlRodPort {
// Allows for a special multiblock ability.

/**
* Whether it has a moderator tip, which would increase k_eff at certain control rod insertion values.
*/
boolean hasModeratorTip();
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,4 @@ public interface IFissionReactorHatch {
* @return If the channel directly below the hatch is valid or not
*/
boolean checkValidity(int depth);

boolean isValid();

void setValid(boolean valid);
}
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ public void makeCoolantFlow(int flowRate) {

double heatRemovedPerLiter = prop.getSpecificHeatCapacity() *
(prop.getHotHPCoolant().getFluid().getTemperature() - coolant.getFluid().getTemperature()) /
prop.getSadgeCoefficient();
prop.getSpecialCoolantAbsorption();
// Explained by:
// https://physics.stackexchange.com/questions/153434/heat-transfer-between-the-bulk-of-the-fluid-inside-the-pipe-and-the-pipe-externa
double heatFluxPerAreaAndTemp = 1 /
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public class CoolantChannel extends ReactorComponent {

private ICoolantHandler inputHandler;
private ICoolantHandler outputHandler;

// Allows fission reactors to heat up less than a full liter of coolant.
public double partialCoolant;

public CoolantChannel(double maxTemperature, double thermalConductivity, Material coolant, double mass,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1591,7 +1591,7 @@ public static void register() {
.ingot()
.color(0x566570).iconSet(METALLIC)
.flags(GENERATE_RING)
.components(Zirconium, 9, Tin, 1)
.components(Zirconium, 16, Tin, 2, Chrome, 1)
.blast(1700, GasTier.LOW)
.build();

Expand Down Expand Up @@ -1646,7 +1646,7 @@ public static void register() {
.blastTemp(1610, GasTier.MID, GTValues.VA[EV], 200)
.fluidPipeProperties(2010, 175, true, true, true, false)
.build()
.setFormula("Ni50Cr20Fe20Ni5Mo3", true);
.setFormula("Ni5Cr2Fe2NbMo", true);

HighEnrichedUraniumHexafluoride = new Material.Builder(464, gregtechId("high_enriched_uranium_hexafluoride"))
.gas()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ public static void register() {
*/
DistilledWater.setProperty(PropertyKey.COOLANT,
new CoolantProperty(Steam, HighPressureSteam, 1., 1000,
373, 10., FissionReactor.standardPressure, 2260000, 4168).setSadgeCoefficient(1000)
373, 10., FissionReactor.standardPressure, 2260000, 4168).setSpecialCoolantAbsorption(1000)
.setAccumulatesHydrogen(true));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class CoolantProperty implements IMaterialProperty {
private double heatOfVaporization;
// in J/(kg*K)
private double specificHeatCapacity;
private double sadgeCoefficient = 1;
private double specialCoolantAbsorption = 1;
private boolean accumulatesHydrogen = false;

public CoolantProperty(Material hotCoolant, Material hotHPCoolant, double moderatorFactor, double coolingFactor,
Expand Down Expand Up @@ -116,20 +116,20 @@ public void setSpecificHeatCapacity(double specificHeatCapacity) {
this.specificHeatCapacity = specificHeatCapacity;
}

public double getSadgeCoefficient() {
return sadgeCoefficient;
public double getSpecialCoolantAbsorption() {
return specialCoolantAbsorption;
}

/**
* Used to adjust the amount of heat needed to heat the coolant from the ideal thermodynamic conditions; this is
* really only for distilled water.
*
* @param sadgeCoefficient A divisor to the amount of heat needed to heat the coolant from the ideal thermodynamic
* @param specialCoolantAbsorption A divisor to the amount of heat needed to heat the coolant from the ideal thermodynamic
* conditions.
* @return The property itself.
*/
public CoolantProperty setSadgeCoefficient(double sadgeCoefficient) {
this.sadgeCoefficient = sadgeCoefficient;
public CoolantProperty setSpecialCoolantAbsorption(double specialCoolantAbsorption) {
this.specialCoolantAbsorption = specialCoolantAbsorption;
return this;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
package gregtech.api.unification.material.properties;

public class FissionFuelProperty implements IMaterialProperty {

// The max temperature the fuel can handle before it liquefies.
private int maxTemperature;
// Scales how long the fuel rod lasts in the reactor.
private int duration;
// How likely it is to absorb a neutron that had touched a moderator.
private double slowNeutronCaptureCrossSection;
// How likely it is to absorb a neutron that has not yet touched a moderator.
private double fastNeutronCaptureCrossSection;
// How likely it is for a moderated neutron to cause fission in this fuel.
private double slowNeutronFissionCrossSection;
// How likely it is for a not-yet-moderated neutron to cause fission in this fuel.
private double fastNeutronFissionCrossSection;

@Override
Expand Down
1 change: 1 addition & 0 deletions src/main/java/gregtech/common/ConfigHolder.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public static class MachineOptions {
public double multiblockSteamToEU = 0.5;

@Config.Comment({ "Nuclear Max Power multiplier for balancing purposes", "Default: 2.0" })
@Config.RangeDouble(min = 0, max = 10000)
public double nuclearPowerMultiplier = 2.0;

@Config.Comment({ "Whether machines or boilers damage the terrain when they explode.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public boolean isOpaqueCube(IBlockState state) {

public enum GasCentrifugeCasingType implements IStringSerializable, IStateHarvestLevel {

GAS_CENTRIFUGE_COLUMN("gas_centrifuge_column", 2);
GAS_CENTRIFUGE_COLUMN("gas_centrifuge_column", 2),
GAS_CENTRIFUGE_HEATER("gas_centrifuge_heater", 1);

private String name;
private int harvestLevel;
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/gregtech/common/blocks/BlockNuclearCasing.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ public BlockNuclearCasing() {

public enum NuclearCasingType implements IStringSerializable, IStateHarvestLevel {

SPENT_FUEL_CASING("spent_fuel_casing", 2),
GAS_CENTRIFUGE_HEATER("gas_centrifuge_heater", 1);
SPENT_FUEL_CASING("spent_fuel_casing", 2);

NuclearCasingType(String name, int harvestLevel) {
this.name = name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import gregtech.api.GregTechAPI;
import gregtech.api.capability.GregtechDataCodes;
import gregtech.api.capability.ICoolantHandler;
import gregtech.api.capability.IFuelRodHandler;
import gregtech.api.capability.ILockableHandler;
import gregtech.api.capability.IMaintenanceHatch;
Expand All @@ -15,6 +16,7 @@
import gregtech.api.metatileentity.IDataInfoProvider;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.interfaces.IGregTechTileEntity;
import gregtech.api.metatileentity.multiblock.IControlRodPort;
import gregtech.api.metatileentity.multiblock.IFissionReactorHatch;
import gregtech.api.metatileentity.multiblock.IMultiblockPart;
import gregtech.api.metatileentity.multiblock.MultiblockAbility;
Expand Down Expand Up @@ -45,7 +47,6 @@
import gregtech.common.blocks.BlockFissionCasing;
import gregtech.common.blocks.MetaBlocks;
import gregtech.common.metatileentities.MetaTileEntities;
import gregtech.common.metatileentities.multi.multiblockpart.MetaTileEntityControlRodPort;
import gregtech.common.metatileentities.multi.multiblockpart.MetaTileEntityCoolantExportHatch;
import gregtech.common.metatileentities.multi.multiblockpart.MetaTileEntityCoolantImportHatch;
import gregtech.common.metatileentities.multi.multiblockpart.MetaTileEntityFuelRodImportHatch;
Expand Down Expand Up @@ -270,9 +271,6 @@ public void updateFormedValid() {
this.updateReactorState();

this.syncReactorStats();
if (this.fissionReactor.checkForMeltdown()) {
SoundManager.getInstance().startTileSound(GTSoundEvents.SUS_RECORD.getSoundName(), 1, this.getPos());
}
if (this.fissionReactor.checkForMeltdown()) {
this.performMeltdownEffects();
}
Expand Down Expand Up @@ -678,11 +676,11 @@ private void lockAndPrepareReactor() {
ReactorComponent component = null;
boolean foundPort = true;

if (mte instanceof MetaTileEntityCoolantImportHatch coolantIn) {
FluidStack containedFluid = coolantIn.getImportFluids().getTankAt(0).getFluid();
if (mte instanceof ICoolantHandler coolantIn) {
FluidStack containedFluid = coolantIn.getFluidTank().getFluid();
if (containedFluid != null) {
Material mat = GregTechAPI.materialManager.getMaterial(
coolantIn.getImportFluids().getTankAt(0).getFluid().getFluid().getName());
containedFluid.getFluid().getName());
if (mat != null && mat.hasProperty(PropertyKey.COOLANT)) {
coolantIn.setCoolant(mat);
BlockPos exportHatchPos = currentPos.offset(EnumFacing.DOWN, height - 1);
Expand All @@ -696,9 +694,9 @@ private void lockAndPrepareReactor() {
}
}
}
} else if (mte instanceof MetaTileEntityFuelRodImportHatch fuelIn) {
ItemStack lockedFuel = fuelIn.getImportItems().getStackInSlot(0);
if (lockedFuel != null && !lockedFuel.isEmpty()) {
} else if (mte instanceof IFuelRodHandler fuelIn) {
ItemStack lockedFuel = fuelIn.getStackHandler().getStackInSlot(0);
if (!lockedFuel.isEmpty()) {
MaterialStack mat = OreDictUnifier.getMaterial(lockedFuel);
if (mat != null && OreDictUnifier.getPrefix(lockedFuel) == OrePrefix.fuelRod) {
FissionFuelProperty property = mat.material.getProperty(PropertyKey.FISSION_FUEL);
Expand All @@ -709,7 +707,7 @@ private void lockAndPrepareReactor() {
}
}
}
} else if (mte instanceof MetaTileEntityControlRodPort controlIn) {
} else if (mte instanceof IControlRodPort controlIn) {
component = new ControlRod(100000, controlIn.hasModeratorTip(), 1, 800);
} else {
foundPort = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private IBlockState getPipeState() {
}

private IBlockState getHeaterState() {
return MetaBlocks.NUCLEAR_CASING.getState(BlockNuclearCasing.NuclearCasingType.GAS_CENTRIFUGE_HEATER);
return MetaBlocks.GAS_CENTRIFUGE_CASING.getState(BlockGasCentrifugeCasing.GasCentrifugeCasingType.GAS_CENTRIFUGE_HEATER);
}

private IBlockState getCentrifugeState() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public class MetaTileEntityCoolantExportHatch extends MetaTileEntityMultiblockNo
IControllable, IFissionReactorHatch {

private boolean workingEnabled;
private boolean valid;
private LockableFluidTank fluidTank;
private Material coolant;

Expand Down Expand Up @@ -150,11 +149,6 @@ public LockableFluidTank getFluidTank() {
return this.fluidTank;
}

@Override
public void setValid(boolean valid) {
this.valid = valid;
}

@Override
public MultiblockAbility<ICoolantHandler> getAbility() {
return MultiblockAbility.EXPORT_COOLANT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public class MetaTileEntityCoolantImportHatch extends MetaTileEntityMultiblockNo
IControllable, IFissionReactorHatch {

private boolean workingEnabled;
private boolean valid;
private LockableFluidTank fluidTank;
private Material coolant;

Expand Down Expand Up @@ -133,11 +132,6 @@ public boolean checkValidity(int depth) {
return false;
}

@Override
public void setValid(boolean valid) {
this.valid = valid;
}

@Override
public MultiblockAbility<ICoolantHandler> getAbility() {
return MultiblockAbility.IMPORT_COOLANT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public class MetaTileEntityFuelRodExportHatch extends MetaTileEntityMultiblockNo
IFissionReactorHatch {

private boolean workingEnabled;
private boolean valid;

public MetaTileEntityFuelRodExportHatch(ResourceLocation metaTileEntityId) {
super(metaTileEntityId, 4, true);
Expand Down Expand Up @@ -114,9 +113,4 @@ public void setFrontFacing(EnumFacing frontFacing) {
public boolean checkValidity(int depth) {
return true;
}

@Override
public void setValid(boolean valid) {
this.valid = valid;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public class MetaTileEntityFuelRodImportHatch extends MetaTileEntityMultiblockNo
IControllable, IFissionReactorHatch {

private boolean workingEnabled;
private boolean valid;
private Material mat;
public MetaTileEntityFuelRodExportHatch pairedHatch;

Expand Down Expand Up @@ -129,11 +128,6 @@ public boolean checkValidity(int depth) {
return pairedHatch != null;
}

@Override
public void setValid(boolean valid) {
this.valid = valid;
}

@Override
public void readFromNBT(NBTTagCompound data) {
super.readFromNBT(data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -865,8 +865,8 @@ private static void registerAssemblerRecipes() {
.inputs(MetaBlocks.BOILER_CASING.getItemVariant(
BlockBoilerCasing.BoilerCasingType.POLYTETRAFLUOROETHYLENE_PIPE))
.input(wireGtSingle, Nichrome, 4)
.outputs(MetaBlocks.NUCLEAR_CASING.getItemVariant(
BlockNuclearCasing.NuclearCasingType.GAS_CENTRIFUGE_HEATER))
.outputs(MetaBlocks.GAS_CENTRIFUGE_CASING.getItemVariant(
BlockGasCentrifugeCasing.GasCentrifugeCasingType.GAS_CENTRIFUGE_HEATER))
.buildAndRegister();

ASSEMBLER_RECIPES.recipeBuilder().EUt(64).duration(200)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1144,12 +1144,11 @@ public static void init() {

ModHandler.addShapedRecipe(true, "fission_reactor", MetaTileEntities.FISSION_REACTOR.getStackForm(), "CSC",
"RHR", "CWC",
'C', new UnificationEntry(OrePrefix.circuit, MarkerMaterials.Tier.EV), 'H',
MetaBlocks.FISSION_CASING.getItemVariant(
BlockFissionCasing.FissionCasingType.REACTOR_VESSEL),
'C', new UnificationEntry(OrePrefix.circuit, MarkerMaterials.Tier.EV),
'H', MetaBlocks.FISSION_CASING.getItemVariant(BlockFissionCasing.FissionCasingType.REACTOR_VESSEL),
'S', SENSOR.getIngredient(GTValues.EV),
'R', new UnificationEntry(OrePrefix.rotor, Materials.Steel), 'W',
CABLE_QUAD.getIngredient(GTValues.EV));
'R', new UnificationEntry(OrePrefix.rotor, Materials.Steel),
'W', CABLE_QUAD.getIngredient(GTValues.EV));

ModHandler.addShapedRecipe(true, "heat_exchanger", MetaTileEntities.HEAT_EXCHANGER.getStackForm(), "FFF",
"PCP", "FFF",
Expand Down
Loading

0 comments on commit 15a80c8

Please sign in to comment.