Skip to content

Commit 18f8f58

Browse files
committed
Fix fission port item capability
1 parent fcdb3c6 commit 18f8f58

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/main/java/igentuman/nc/block/entity/fission/FissionPortBE.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ protected FluidCapabilityHandler fluidHandler()
138138
public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, @Nullable Direction side) {
139139
if (controller() == null) return super.getCapability(cap, side);
140140
if (cap == ForgeCapabilities.ITEM_HANDLER) {
141-
return controller().contentHandler().itemCapability.cast();
141+
return controller().getCapability(cap, side);
142142
}
143143
if (cap == ForgeCapabilities.FLUID_HANDLER && controller().canAcceptFluid()) {
144144
return controller().getCapability(cap, side);

src/main/java/igentuman/nc/container/FissionPortContainer.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
import static igentuman.nc.NuclearCraft.MODID;
2323

2424
public class FissionPortContainer extends AbstractContainerMenu {
25-
protected FissionPortBE portBE;
26-
protected Player playerEntity;
25+
protected final FissionPortBE portBE;
26+
protected final Player playerEntity;
2727

2828

2929
protected String name = "fission_reactor_port";
@@ -40,8 +40,6 @@ public FissionPortContainer(int pContainerId, BlockPos pos, Inventory playerInve
4040
layoutPlayerInventorySlots();
4141
portBE.getCapability(ForgeCapabilities.ITEM_HANDLER).ifPresent(h -> {
4242
addSlot(new NCSlotItemHandler.Input(h, 0, 56, 35));
43-
});
44-
portBE.getCapability(ForgeCapabilities.ITEM_HANDLER).ifPresent(h -> {
4543
addSlot(new NCSlotItemHandler.Output(h, 1, 116, 35));
4644
});
4745
}
@@ -97,7 +95,6 @@ public Component getTitle() {
9795
return Component.translatable("block."+MODID+"."+name);
9896
}
9997

100-
10198
private void addSlotRange(IItemHandler handler, int x, int y, int amount, int dx) {
10299
for (int i = 0 ; i < amount ; i++) {
103100
addSlot(new SlotItemHandler(handler, slotIndex, x, y));
@@ -120,6 +117,7 @@ protected void layoutPlayerInventorySlots() {
120117
topRow -= 58;
121118
addSlotBox(playerInventory, leftCol, topRow, 9, 18, 3, 18);
122119
}
120+
123121
public int getEnergy() {
124122
return portBE.getEnergyStored();
125123
}

0 commit comments

Comments
 (0)