Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging in old CEu nuclear fission PR #360

Draft
wants to merge 166 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
166 commits
Select commit Hold shift + click to select a range
8ad9bfe
Start of work on nuclear fission
Zalgo239 Apr 7, 2023
03eb9e3
Start implementation of reactor states
Zalgo239 Apr 7, 2023
7d69a5d
Smoother transitions and better logic
Zalgo239 Apr 11, 2023
78c8aa5
More reactor states
Zalgo239 Apr 16, 2023
95d2029
Reorganising packages
Zalgo239 Apr 19, 2023
5411c6a
Other nuclear components
Zalgo239 Apr 19, 2023
b3701ad
New material properties
Zalgo239 Apr 19, 2023
cca8bf0
Basic stats for nuclear properties
Zalgo239 Apr 19, 2023
d75dc30
Large amount of reactor calculations
Zalgo239 Apr 24, 2023
422be36
Significantly improved and simplified logic
Zalgo239 May 2, 2023
a072145
Reactor stats calculation cleanup
Zalgo239 May 5, 2023
1a12f7a
Fission Reactor meta tile entity
Zalgo239 May 5, 2023
7b2042e
Fission reactor rebase
Zalgo239 May 10, 2023
f3d8cfb
Start of work on reactor multiblock structure logic
Zalgo239 May 11, 2023
61c8bd0
Proper handling of minimum and maximum dimensions
Zalgo239 May 11, 2023
10fe569
More reactor structure logic
Zalgo239 May 12, 2023
a75686e
Fixed height calculation and extra tricorder info
Zalgo239 May 12, 2023
51fa257
Reactor dimensions NBT saving
Zalgo239 May 14, 2023
f30a33e
Extra structure pattern checks
Zalgo239 May 14, 2023
22707a1
Rebase and fixes due to changes to IMaterialProperty
Zalgo239 May 29, 2023
47406c3
Start work on custom hatches for fission reactor
Zalgo239 May 31, 2023
6eab9bd
API fixes and fuel rod hatch rendering
Zalgo239 Jun 6, 2023
1a1566c
Add coolant hatches and control rod port
Zalgo239 Jun 13, 2023
1d3f4b9
Add hatches to the fission reactor's structure
bruberu Jun 19, 2023
a8f1838
Fuel rod hatch, coolant hatch, and control rod hatch checks put in place
bruberu Jun 20, 2023
a3a155e
Allow coolant import and fuel rod import hatches to be locked
bruberu Jun 20, 2023
2136214
Basic work on actually constructing the reactor (doesn't compile)
bruberu Jun 21, 2023
160595a
Complete nuclear reactor checks (but apparently locking needs to be c…
bruberu Jun 25, 2023
860bbb8
Proper server-to-client locking sync
bruberu Jun 28, 2023
daa3385
Start thinking about how to actually update the fission reactor
bruberu Jul 5, 2023
4f2dac6
Reactor state update order
Zalgo239 Jul 13, 2023
89d2b10
Reactor failiure checks
Zalgo239 Jul 13, 2023
f44f7bd
Fix MTE ID conflicts
Zalgo239 Aug 16, 2023
bb0a76d
Refactor logic to remove coolant headaches
Zalgo239 Aug 16, 2023
b6e6d89
Coolant consumption logic
Zalgo239 Aug 17, 2023
b40666e
Remove unecessary variable
Zalgo239 Aug 17, 2023
a667433
Make reactor consume the fuel
Zalgo239 Aug 31, 2023
fbcd3af
Add components for gas centrifuges and spent fuel pool
Zalgo239 Aug 31, 2023
26a6174
Added spent fuel pool multiblock
Zalgo239 Sep 2, 2023
bd0f505
New epic paneling for spent fuel pools and other decor
Zalgo239 Sep 4, 2023
8c117fe
Spent fuel pool structure changes and light on spent fuel casings
Zalgo239 Sep 7, 2023
b530ea4
Blocks cleanup
Zalgo239 Sep 7, 2023
ac53cd2
Structure fixes
Zalgo239 Sep 7, 2023
92f9884
Remove unused import
Zalgo239 Sep 7, 2023
49c6a8b
Textures for the empty fuel casings variant
Zalgo239 Sep 15, 2023
99f0d8e
Remove light from nuclear casings
Zalgo239 Sep 16, 2023
ffbb0cb
Remove unused defaults
Zalgo239 Sep 16, 2023
ec306bb
Added gas centrifuge multiblock
Zalgo239 Sep 16, 2023
25166f3
fixes
serenibyss Dec 7, 2023
c0dcf88
spotless
serenibyss Dec 7, 2023
6a0dc5d
a couple spotless cleanups
serenibyss Dec 7, 2023
c78eddf
Added consequences for failures
Zalgo239 Dec 23, 2023
023b278
Hot coolant output logic
Zalgo239 Dec 28, 2023
7b9ed0f
Add item models and textures
Zalgo239 Dec 30, 2023
ede0c2e
Add coolant properties to material builder
Zalgo239 Dec 30, 2023
ceacfc2
Fix reactor not outputting the correct coolant
Zalgo239 Dec 31, 2023
2380468
try to make github run the action
serenibyss Jan 5, 2024
814762a
spotless
serenibyss Jan 5, 2024
3b492b4
Various Fission Reactor fixes (#2338)
loxoDev Jan 8, 2024
6fab87f
Almost workable fission reactor (#2433)
bruberu Jun 2, 2024
b913bc3
feat: couple textures I forgot
bruberu Jun 3, 2024
669309c
feat: coolant config as requested by Zalgo
bruberu Jun 4, 2024
2f91b7c
feat: resolve some TODOs
bruberu Jun 5, 2024
9b1912a
fix: reviews part 1
bruberu Jun 6, 2024
90e0dac
fix: reviews part 2
bruberu Jun 6, 2024
193ba9a
fix: splotlam 49oianuhwsegrd
bruberu Jun 6, 2024
bd896df
fix: how did I not notice that
bruberu Jun 6, 2024
4f2edda
fix: revert gas centrifuge shenanigans
bruberu Jun 7, 2024
defaa0c
fix: one fuel rod doesn't literally break things anymore
bruberu Jun 7, 2024
d0119d4
fix: the daily spotless :)
bruberu Jun 7, 2024
4d7bbe8
fix: better structural feedback
bruberu Jun 7, 2024
a2d5df0
fix: better coolant saving
bruberu Jun 7, 2024
3ed7155
fix: useless layers now actually mean something
bruberu Jun 7, 2024
04e1fc6
fix: spotless last files
bruberu Jun 7, 2024
b27dfac
fix: plateZircaloy and anode basket
bruberu Jun 8, 2024
bd9be40
fix: min instead of max, and another structure bug
bruberu Jun 8, 2024
f97d02f
feat: maintenance
bruberu Jun 8, 2024
1009602
fix: remove error type that might not mean anything important
bruberu Jun 9, 2024
e15e30f
fix: composition
bruberu Jun 18, 2024
cec78c4
Nuclear fission intermediate work (#2507)
bruberu Jun 18, 2024
fedc9fe
feat: UX 101
bruberu Jun 21, 2024
3b36862
feat: I should probably push these textures too
bruberu Jun 21, 2024
aaee974
feat: UX 102
bruberu Jun 21, 2024
a6ab5ae
feat: a friendly nuclear engineer
bruberu Jun 23, 2024
a6686ef
fix: flow rate + UI calculations
bruberu Jun 23, 2024
80de788
fix: NPE
bruberu Jun 23, 2024
124c554
fix: more NPEs :weary:
bruberu Jun 23, 2024
751dd3a
fix: non-updating block
bruberu Jun 23, 2024
e4a4dc6
fix: now consumes fuel on first place
bruberu Jun 23, 2024
e56a711
fix: recheck fuel if work check failed before
bruberu Jun 24, 2024
f92de5a
feat: partial fuel rods (I want to boil myself alive in glyoxylic acid)
bruberu Jun 24, 2024
e4ca5fa
feat: base fuel rods on partial fuel
bruberu Jun 26, 2024
250946e
fix: "pathIsClear"
bruberu Jun 26, 2024
5694c1b
fix: villager feedback
bruberu Jun 27, 2024
d84f87b
fix: 7-9 is now 7/16-9/16
bruberu Jun 28, 2024
df1571e
fix: it is NPE sunday today
bruberu Jun 30, 2024
9b5d1df
fix: potential floating point errors
bruberu Jun 30, 2024
be1dc5c
fix: remove debug depletion
bruberu Jun 30, 2024
197b294
feat: display max power limitation better
bruberu Jul 1, 2024
caa445d
feat: critical rod insertion -> generation rate
bruberu Jul 3, 2024
9bd1438
fix: temperature min limit & control rod normalization
bruberu Jul 4, 2024
0d1dedd
fix: prevent NaN
bruberu Jul 4, 2024
fa13e97
fix: more things I can technically blame on Zalgo
bruberu Jul 4, 2024
e4bae3a
feat: fuel and coolant tooltips
bruberu Jul 5, 2024
b04a31c
fix: material-registry-agnostic
bruberu Jul 7, 2024
84372df
feat: try to lower reactor volatility
bruberu Jul 7, 2024
185d398
feat: ok that was a bad idea
bruberu Jul 7, 2024
11052a3
fix: reactor meltdown NPE #1234798
bruberu Jul 7, 2024
3567654
feat: upstream merge and deal with fluidstoragekeys
bruberu Jul 7, 2024
640f557
fix: 2.8.10 compat pt.1
bruberu Jun 7, 2024
0997ac1
More nuclear fission stuff (#2533)
vrejhead Jul 8, 2024
d48bb7f
feat: spotless + power overhaul
bruberu Jul 8, 2024
07367ff
feat: rebalance a little
bruberu Jul 8, 2024
df6183b
feat: logarithmic power
bruberu Jul 8, 2024
e4d7a2d
feat: mean generation time time
bruberu Jul 8, 2024
b9b2fe1
fix: temperature spikes
bruberu Jul 9, 2024
778bfd6
feat: add k_eff to reactor NBT
bruberu Jul 9, 2024
b19872d
fix: zbodlezz
bruberu Jul 9, 2024
c851dbc
feat: redo control rod regulation
bruberu Jul 9, 2024
befe770
fix: that is not the right array
bruberu Jul 9, 2024
23a2358
feat: large reactor stability
bruberu Jul 9, 2024
2ea3319
fix: more robust shutdown
bruberu Jul 9, 2024
a34d6db
fix: I want to say a curse word to spotless
bruberu Jul 9, 2024
ffa6812
feat: smiley lobotomy procedure #1
bruberu Jul 9, 2024
f38ff2b
fix: sseltops
bruberu Jul 9, 2024
04ec090
feat: delta temperature (lobotomy #2)
bruberu Jul 10, 2024
6d9fa0b
feat: fuel rod danger levels
bruberu Jul 10, 2024
a9ad0d9
Assorted fission fixes (#2536)
loxoDev Jul 10, 2024
a4bf66f
feat: extended facing
bruberu Jul 10, 2024
8ec4c7b
feat: coolant calculations
bruberu Jul 12, 2024
a486a56
fix: spptptptpppttptppt
bruberu Jul 12, 2024
c7bb521
fix: partialCoolant actually works, maybe
bruberu Jul 12, 2024
1806096
feat: set default balancing to 14, thanks to whatsapp2
bruberu Jul 13, 2024
d135af8
feat: refactor PrimitiveRecipeLogic
bruberu Jul 13, 2024
c4b2945
feat: all review comments responded to
bruberu Jul 13, 2024
fc74940
feat: parallel tooltip (accidentally missed it)
bruberu Jul 13, 2024
329ed6b
fix: custom preview relative directions
bruberu Jul 17, 2024
859e08d
feat: better spent fuel pool structure
bruberu Jul 17, 2024
760677f
feat: making even better fuel pool structure when I have a job to get…
bruberu Jul 17, 2024
7978dcf
fix: alson's comments
bruberu Jul 20, 2024
7b78e42
fix: spitless
bruberu Jul 20, 2024
ac1e25c
feat: the overhaul, part one
bruberu Jul 20, 2024
83eb708
feat: primitive multiblocks plan C plus homogenousmore
bruberu Jul 21, 2024
fd88a70
feat: overhaul part 2 so I can see more review comments
bruberu Jul 21, 2024
66acf4c
feat: overhaul part 4
bruberu Jul 21, 2024
1996c38
feat: overhaul part 5: panelling edition
bruberu Jul 21, 2024
0152676
fix: sporkless again
bruberu Jul 21, 2024
cd1d3cf
feat: gas centrifuge columns now look OK
bruberu Jul 21, 2024
085526c
feat: the great refactor
bruberu Jul 21, 2024
e741879
feat: JEI integration
bruberu Jul 21, 2024
2d4720a
feat: revert the en-enterprisation
bruberu Jul 21, 2024
ce199ac
fix: plutonium localization + structure checking + geometry hiccups
bruberu Jul 21, 2024
946b8cd
fix: setPartialFuel skill issue
bruberu Jul 21, 2024
18e8d1b
feat: balance conversation part 1
bruberu Jul 21, 2024
805451a
feat: JEI improvements
bruberu Jul 21, 2024
064e49e
feat: widget locking displays
bruberu Jul 21, 2024
f696ec3
fix: spotless? more like feckless
bruberu Jul 22, 2024
dc234bd
feat: config to bump down heat exchanger efficiency
bruberu Jul 24, 2024
2557108
fix: JEI pages + GUI scaling
bruberu Jul 27, 2024
e29d9de
fix: oh right spotless exists
bruberu Jul 27, 2024
b817c7e
feat: use block/block
bruberu Jul 28, 2024
d4a19d2
feat: set to ZPM (whatsapp2 recommendation)
bruberu Jul 30, 2024
936d44c
refactor: hashed map -> string-indexed map
bruberu Aug 7, 2024
3d374ba
feat: first runnable version
MCTian-mi Dec 15, 2024
1a983d1
fix: oops method name conflict
MCTian-mi Dec 16, 2024
00108fb
Merge branch 'main' into nuclear-fission
bruberu Dec 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ dependencies {
implementation rfg.deobf("curse.maven:athenaeum-284350:4633750")
implementation rfg.deobf("curse.maven:dropt-284973:5405050")

compileOnly rfg.deobf("curse.maven:opencomputers-223008:5274236")
compileOnly rfg.deobf("curse.maven:yungs-better-mineshafts-forge-389665:3247154")

api("CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-4.1.20.700")
Expand Down
24 changes: 24 additions & 0 deletions src/main/java/supersymmetry/api/capability/ICoolantHandler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package supersymmetry.api.capability;


import net.minecraft.util.EnumFacing;
import net.minecraftforge.fluids.Fluid;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import supersymmetry.api.capability.impl.LockableFluidTank;
import supersymmetry.api.nuclear.fission.ICoolantStats;

public interface ICoolantHandler extends ILockableHandler<Fluid> {

@Nullable
ICoolantStats getCoolant();

void setCoolant(@Nullable ICoolantStats prop);

@NotNull
LockableFluidTank getFluidTank();

@NotNull
EnumFacing getFrontFacing();
}
28 changes: 28 additions & 0 deletions src/main/java/supersymmetry/api/capability/IFuelRodHandler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package supersymmetry.api.capability;


import net.minecraft.item.ItemStack;
import supersymmetry.api.items.itemhandlers.LockableItemStackHandler;
import supersymmetry.api.nuclear.fission.IFissionFuelStats;
import supersymmetry.api.nuclear.fission.components.FuelRod;

public interface IFuelRodHandler extends ILockableHandler<ItemStack> {

IFissionFuelStats getFuel();

void setFuel(IFissionFuelStats prop);

IFissionFuelStats getPartialFuel();

/**
* Set the fuel type that's currently being processed by this specific handler.
*
* @param prop The new fuel type.
* @return true if the partial fuel changed.
*/
boolean setPartialFuel(IFissionFuelStats prop);

void setInternalFuelRod(FuelRod rod);

LockableItemStackHandler getStackHandler();
}
13 changes: 13 additions & 0 deletions src/main/java/supersymmetry/api/capability/ILockableHandler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package supersymmetry.api.capability;

import org.jetbrains.annotations.Nullable;

public interface ILockableHandler<T> {

void setLock(boolean isLocked);

boolean isLocked();

@Nullable
T getLockedObject();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
package supersymmetry.api.capability.impl;

import gregtech.api.capability.impl.NotifiableFluidTank;
import gregtech.api.metatileentity.MetaTileEntity;

import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTank;
import supersymmetry.api.capability.ILockableHandler;

public class LockableFluidTank extends NotifiableFluidTank implements ILockableHandler<Fluid> {

private boolean locked;
private Fluid lockedFluid;

public LockableFluidTank(int capacity, MetaTileEntity entityToNotify, boolean isExport) {
super(capacity, entityToNotify, isExport);
}

@Override
public Fluid getLockedObject() {
return lockedFluid;
}

@Override
public void setLock(boolean isLocked) {
locked = isLocked;
}

@Override
public int fill(FluidStack resource, boolean doFill) {
int filled = super.fill(resource, doFill);
if (doFill && this.fluid != null && this.fluid.amount != 0) {
this.lockedFluid = this.fluid.getFluid();
}
return filled;
}

@Override
public void setFluid(FluidStack fluid) {
super.setFluid(fluid);
if (this.fluid != null && this.fluid.amount != 0) {
this.lockedFluid = this.fluid.getFluid();
}
}

@Override
public boolean isLocked() {
return locked;
}

@Override
public boolean canFillFluidType(FluidStack fluid) {
if (locked && fluid.getFluid() != lockedFluid) {
return false;
}
return super.canFillFluidType(fluid);
}

@Override
public FluidTank readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
if (nbt.hasKey("LockedFluid")) {
this.lockedFluid = FluidRegistry.getFluid(nbt.getString("LockedFluid"));
} else if (this.fluid != null && this.fluid.amount != 0) {
this.lockedFluid = this.fluid.getFluid();
}
return this;
}

@Override
public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
if (lockedFluid != null) {
nbt.setString("LockedFluid", lockedFluid.getName());
}
return nbt;
}
}
18 changes: 18 additions & 0 deletions src/main/java/supersymmetry/api/cover/ICustomEnergyCover.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package supersymmetry.api.cover;

/**
* Simple interface specifying that an attached energy detector(advanced or not) cover reads custom EU values from the
* MTE
*/
public interface ICustomEnergyCover {

/**
* @return The total EU capacity
*/
long getCoverCapacity();

/**
* @return The stored EU capacity
*/
long getCoverStored();
}
9 changes: 9 additions & 0 deletions src/main/java/supersymmetry/api/gui/SusyGuiTextures.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,13 @@ public class SusyGuiTextures {
public static final TextureArea BUTTON_INT_CIRCUIT_PLUS_PRIMITIVE = TextureArea.fullImage("textures/gui/widget/button_circuit_plus_primitive.png");
public static final TextureArea BUTTON_INT_CIRCUIT_MINUS_PRIMITIVE = TextureArea.fullImage("textures/gui/widget/button_circuit_minus_primitive.png");
public static final TextureArea FLUID_SLOT_PRIMITIVE = TextureArea.fullImage("textures/gui/base/fluid_slot_primitive.png");

// Nuclear GuiTextures
public static final TextureArea BUTTON_CONTROL_ROD_HELPER = TextureArea.fullImage("textures/gui/widget/button_control_rod_helper.png");
public static final TextureArea DARK_SLIDER_BACKGROUND = TextureArea.fullImage("textures/gui/widget/dark_slider_background.png");
public static final TextureArea DARK_SLIDER_BACKGROUND_VERTICAL = TextureArea.fullImage("textures/gui/widget/dark_slider_background_vertical.png");
public static final TextureArea DARK_SLIDER_ICON = TextureArea.fullImage("textures/gui/widget/dark_slider.png");
public static final TextureArea PROGRESS_BAR_FISSION_HEAT = TextureArea.fullImage("textures/gui/progress_bar/progress_bar_fission_heat.png");
public static final TextureArea PROGRESS_BAR_FISSION_PRESSURE = TextureArea.fullImage("textures/gui/progress_bar/progress_bar_fission_pressure.png");
public static final TextureArea PROGRESS_BAR_FISSION_ENERGY = TextureArea.fullImage("textures/gui/progress_bar/progress_bar_fission_energy.png");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package supersymmetry.api.gui.widgets;

import gregtech.api.gui.IRenderContext;
import gregtech.api.gui.widgets.SliderWidget;
import gregtech.api.util.Position;
import gregtech.api.util.Size;
import gregtech.api.util.function.FloatConsumer;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import supersymmetry.api.util.function.FloatSupplier;
import supersymmetry.mixins.gregtech.SliderWidgetAccessor;

public class UpdatedSliderWidget extends SliderWidget {

private FloatSupplier detector;
private final SliderWidgetAccessor self;

public UpdatedSliderWidget(String name, int xPosition, int yPosition, int width, int height, float min, float max,
float currentValue, FloatConsumer responder, FloatSupplier detector) {
super(name, xPosition, yPosition, width, height, min, max, currentValue, responder);
this.detector = detector;
this.self = (SliderWidgetAccessor) this;
}

@Override
public void drawInBackground(int mouseX, int mouseY, float partialTicks, IRenderContext context) {
Position pos = getPosition();
Size size = getSize();
if (self.getBackgroundArea() != null) {
self.getBackgroundArea().draw(pos.x, pos.y, size.width, size.height);
}
self.setSliderPosition((detector.get() - self.getMin()) / (self.getMax() - self.getMin()));
self.setDisplayString2(getDisplayString());

self.getSliderIcon().draw(pos.x + (int) (self.getSliderPosition() * (float) (size.width - 8)), pos.y, self.getSliderWidth(),
size.height);
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
fontRenderer.drawString(self.getDisplayString2(),
pos.x + size.width / 2 - fontRenderer.getStringWidth(self.getDisplayString2()) / 2,
pos.y + size.height / 2 - fontRenderer.FONT_HEIGHT / 2, self.getTextColor());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package supersymmetry.api.items.itemhandlers;

import gregtech.api.capability.impl.NotifiableItemStackHandler;
import gregtech.api.metatileentity.MetaTileEntity;

import net.minecraft.item.ItemStack;

import org.jetbrains.annotations.NotNull;
import supersymmetry.api.capability.ILockableHandler;

public class LockableItemStackHandler extends NotifiableItemStackHandler implements ILockableHandler<ItemStack> {

protected boolean locked;
protected ItemStack lockedItemStack;

public LockableItemStackHandler(MetaTileEntity entityToNotify, boolean isExport) {
super(entityToNotify, 1, entityToNotify, isExport);
}

@Override
public void setLock(boolean isLocked) {
this.locked = isLocked;
if (isLocked && !this.getStackInSlot(0).isEmpty()) {
lockedItemStack = this.getStackInSlot(0).copy();
}
}

public boolean isLocked() {
return this.locked;
}

@NotNull
@Override
public ItemStack insertItem(int slot, @NotNull ItemStack stack, boolean simulate) {
if (this.locked && !this.lockedItemStack.isItemEqual(stack)) {
return stack;
}
return super.insertItem(slot, stack, simulate);
}

@Override
public ItemStack getLockedObject() {
return lockedItemStack;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package supersymmetry.api.metatileentity.multiblock;

import net.minecraft.util.math.BlockPos;

import org.jetbrains.annotations.Nullable;

public interface IFissionReactorHatch {

/**
* @param depth The depth of the reactor that needs checking
* @return If the channel directly below the hatch is valid or not
*/
boolean checkValidity(int depth);

@Nullable
BlockPos getPos();
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,19 @@

import gregtech.api.metatileentity.multiblock.MultiblockAbility;
import net.minecraftforge.items.IItemHandlerModifiable;
import supersymmetry.api.capability.ICoolantHandler;
import supersymmetry.api.capability.IFuelRodHandler;
import supersymmetry.common.metatileentities.multi.multiblockpart.MetaTileEntityControlRodPort;

@SuppressWarnings("InstantiationOfUtilityClass")
public class SuSyMultiblockAbilities {

public static final MultiblockAbility<IItemHandlerModifiable> PRIMITIVE_IMPORT_ITEMS = new MultiblockAbility<>("primitive_import_items");
public static final MultiblockAbility<IItemHandlerModifiable> PRIMITIVE_EXPORT_ITEMS = new MultiblockAbility<>("primitive_export_items");

public static final MultiblockAbility<IFuelRodHandler> IMPORT_FUEL_ROD = new MultiblockAbility<>("import_fuel_rod");
public static final MultiblockAbility<IItemHandlerModifiable> EXPORT_FUEL_ROD = new MultiblockAbility<>("export_fuel_rod");
public static final MultiblockAbility<ICoolantHandler> IMPORT_COOLANT = new MultiblockAbility<>("import_coolant");
public static final MultiblockAbility<ICoolantHandler> EXPORT_COOLANT = new MultiblockAbility<>("export_coolant");
public static final MultiblockAbility<MetaTileEntityControlRodPort> CONTROL_ROD_PORT = new MultiblockAbility<>("control_rod_port");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package supersymmetry.api.nuclear.fission;

import net.minecraftforge.fluids.Fluid;

import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Collection;
import java.util.Map;

public class CoolantRegistry {

private static final Map<Fluid, ICoolantStats> COOLANTS = new Object2ObjectOpenHashMap<>();
private static final Map<ICoolantStats, Fluid> COOLANTS_INVERSE = new Object2ObjectOpenHashMap<>();

public static void registerCoolant(@NotNull Fluid fluid, @NotNull ICoolantStats coolant) {
COOLANTS.put(fluid, coolant);
COOLANTS_INVERSE.put(coolant, fluid);
}

@Nullable
public static ICoolantStats getCoolant(Fluid fluid) {
return COOLANTS.get(fluid);
}

@NotNull
public static Collection<Fluid> getAllCoolants() {
return COOLANTS.keySet();
}

@Nullable
public static Fluid originalFluid(ICoolantStats stats) {
return COOLANTS_INVERSE.get(stats);
}
}
Loading
Loading