调整充电站外部输入方法

This commit is contained in:
17146 2024-12-08 00:51:25 +08:00
parent bfefe85f21
commit fdabea761e
3 changed files with 5 additions and 5 deletions

View file

@ -207,7 +207,7 @@ public class ChargingStationBlockEntity extends BlockEntity implements WorldlyCo
@Override
public int[] getSlotsForFace(Direction pSide) {
return new int[0];
return new int[]{SLOT_FUEL};
}
@Override
@ -289,7 +289,6 @@ public class ChargingStationBlockEntity extends BlockEntity implements WorldlyCo
public CompoundTag getUpdateTag() {
CompoundTag compoundtag = new CompoundTag();
ContainerHelper.saveAllItems(compoundtag, this.items, true);
getCapability(ForgeCapabilities.ENERGY).ifPresent(handler -> compoundtag.put("Energy", ((EnergyStorage) handler).serializeNBT()));
return compoundtag;
}

View file

@ -37,7 +37,7 @@ public class ChargingStationMenu extends AbstractContainerMenu {
this.containerData = containerData;
this.addSlot(new Slot(container, 0, 44, 54));
this.addSlot(new ChargingStationMenu.ChargingSlot(container, 1, 116, 54));
this.addSlot(new ChargingSlot(container, 1, 116, 54));
this.addDataSlots(containerData);
@ -116,7 +116,7 @@ public class ChargingStationMenu extends AbstractContainerMenu {
return this.containerData.get(2);
}
class ChargingSlot extends Slot {
static class ChargingSlot extends Slot {
public ChargingSlot(Container pContainer, int pSlot, int pX, int pY) {
super(pContainer, pSlot, pX, pY);

View file

@ -65,7 +65,8 @@ public class ChargingStationScreen extends AbstractContainerScreen<ChargingStati
int j = (this.height - this.imageHeight) / 2;
List<Component> tooltip = new ArrayList<>();
tooltip.add(Component.translatable("des.superbwarfare.charging_station.energy", this.menu.getEnergy(), ChargingStationBlockEntity.MAX_ENERGY));
tooltip.add(Component.translatable("des.superbwarfare.charging_station.energy", ChargingStationScreen.this.menu.getEnergy(),
ChargingStationBlockEntity.MAX_ENERGY));
if ((pX - i) >= 80 && (pX - i) <= 96 && (pY - j) >= 16 && (pY - j) <= 70) {
pGuiGraphics.renderTooltip(this.font, tooltip, Optional.empty(), pX, pY);