Bio Reactor works :)

This commit is contained in:
Mrbysco 2024-03-12 17:00:02 +01:00
parent 41e85391be
commit fc75b13b86
2 changed files with 6 additions and 6 deletions

View file

@ -44,7 +44,7 @@ public class GuiBioReactor extends AAScreen<ContainerBioReactor> {
@Override @Override
public void render(@Nonnull GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) { public void render(@Nonnull GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
super.render(guiGraphics, mouseX, mouseY, partialTicks); super.render(guiGraphics, mouseX, mouseY, partialTicks);
//this.energy.render(mouseX, mouseY); this.energy.render(guiGraphics, mouseX, mouseY);
} }
@Override @Override
@ -61,9 +61,9 @@ public class GuiBioReactor extends AAScreen<ContainerBioReactor> {
} }
if (this.tile.producePerTick > 0) { if (this.tile.producePerTick > 0) {
guiGraphics.drawCenteredString(this.font, this.tile.producePerTick + " " + I18n.get("actuallyadditions.cft"), this.leftPos + 87, this.topPos + 86, 0xFFFFFF); guiGraphics.drawCenteredString(this.font, Component.literal(this.tile.producePerTick + " ").append(Component.translatable("misc.actuallyadditions.energy_tick")), this.leftPos + 87, this.topPos + 86, 0xFFFFFF);
} }
//this.energy.draw(); this.energy.draw(guiGraphics);
} }
} }

View file

@ -54,7 +54,7 @@ public class TileEntityBioReactor extends TileEntityInventoryBase implements Men
} }
public static boolean isValidItem(ItemStack stack) { public static boolean isValidItem(ItemStack stack) {
if (StackUtil.isValid(stack)) { if (!stack.isEmpty()) {
Item item = stack.getItem(); Item item = stack.getItem();
if (item.isEdible()) { if (item.isEdible()) {
return true; return true;
@ -85,7 +85,7 @@ public class TileEntityBioReactor extends TileEntityInventoryBase implements Men
if (!tile.isRedstonePowered && tile.storage.getEnergyStored() < tile.storage.getMaxEnergyStored()) { if (!tile.isRedstonePowered && tile.storage.getEnergyStored() < tile.storage.getMaxEnergyStored()) {
for (int i = 0; i < tile.inv.getSlots(); i++) { for (int i = 0; i < tile.inv.getSlots(); i++) {
ItemStack stack = tile.inv.getStackInSlot(i); ItemStack stack = tile.inv.getStackInSlot(i);
if (StackUtil.isValid(stack)) { if (!stack.isEmpty()) {
Item item = stack.getItem(); Item item = stack.getItem();
if (isValidItem(stack) && (types == null || !types.contains(item))) { if (isValidItem(stack) && (types == null || !types.contains(item))) {
if (types == null) { if (types == null) {
@ -187,7 +187,7 @@ public class TileEntityBioReactor extends TileEntityInventoryBase implements Men
@Override @Override
public Component getDisplayName() { public Component getDisplayName() {
return Component.empty(); return Component.translatable("container.actuallyadditions.bioReactor");
} }
@Nullable @Nullable