diff --git a/CHANGELOG.md b/CHANGELOG.md index 0842b97deb..38eee39bbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Version: 1.1.4.b ### ADDITIONS: ### FIXES: +- fixed client error when opening multiblock UI for the first time - fixed Large assembler & circuit assembler being able to have >1 energy hatch - fix server crash in LDlib diff --git a/src/main/java/com/gregtechceu/gtceu/api/machine/feature/multiblock/IDisplayUIMachine.java b/src/main/java/com/gregtechceu/gtceu/api/machine/feature/multiblock/IDisplayUIMachine.java index cf3477ebfc..522ba3afb5 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/machine/feature/multiblock/IDisplayUIMachine.java +++ b/src/main/java/com/gregtechceu/gtceu/api/machine/feature/multiblock/IDisplayUIMachine.java @@ -41,6 +41,7 @@ default ModularUI createUI(Player entityPlayer) { var screen = new DraggableScrollableWidgetGroup(7, 4, 162, 121).setBackground(getScreenTexture()); screen.addWidget(new LabelWidget(4, 5, self().getBlockState().getBlock().getDescriptionId())); screen.addWidget(new ComponentPanelWidget(4, 17, this::addDisplayText) + .textSupplier(this.self().getLevel().isClientSide ? null : this::addDisplayText) .setMaxWidthLimit(150) .clickHandler(this::handleDisplayClick)); return new ModularUI(176, 216, this, entityPlayer) diff --git a/src/main/java/com/gregtechceu/gtceu/api/machine/multiblock/WorkableElectricMultiblockMachine.java b/src/main/java/com/gregtechceu/gtceu/api/machine/multiblock/WorkableElectricMultiblockMachine.java index 5c227a2455..32c6db6642 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/machine/multiblock/WorkableElectricMultiblockMachine.java +++ b/src/main/java/com/gregtechceu/gtceu/api/machine/multiblock/WorkableElectricMultiblockMachine.java @@ -20,10 +20,8 @@ import com.gregtechceu.gtceu.utils.GTUtil; import com.lowdragmc.lowdraglib.gui.modular.ModularUI; import com.lowdragmc.lowdraglib.gui.widget.*; -import net.minecraft.ChatFormatting; import net.minecraft.MethodsReturnNonnullByDefault; import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.Style; import net.minecraft.world.entity.player.Player; import javax.annotation.ParametersAreNonnullByDefault; @@ -97,6 +95,7 @@ public Widget createUIWidget() { group.addWidget(new DraggableScrollableWidgetGroup(4, 4, 182, 117).setBackground(getScreenTexture()) .addWidget(new LabelWidget(4, 5, self().getBlockState().getBlock().getDescriptionId())) .addWidget(new ComponentPanelWidget(4, 17, this::addDisplayText) + .textSupplier(this.getLevel().isClientSide ? null : this::addDisplayText) .setMaxWidthLimit(150) .clickHandler(this::handleDisplayClick))); group.setBackground(GuiTextures.BACKGROUND_INVERSE); @@ -146,7 +145,9 @@ public void setOverclockTier(int tier) { @Override public long getOverclockVoltage() { - IEnergyContainer energyContainer = this.energyContainer; + if (this.energyContainer == null) { + this.energyContainer = getEnergyContainer(); + } if (energyContainer instanceof EnergyContainerList) { long voltage; long amperage; @@ -208,7 +209,6 @@ public IEnergyContainer getEnergyContainer() { } public long getMaxVoltage() { - IEnergyContainer energyContainer = this.energyContainer; if (this.energyContainer == null) { this.energyContainer = getEnergyContainer(); }