Cache enum .values() (#457)

This commit is contained in:
boubou19 authored and GitHub committed 2026-08-10 15:01:37 +07:00
1 parent 049156e63e
commit 23d2142084
6 files changed
+13 -8

No files matched your search

@@ -215,7 +215,7 @@ public class UltraTerminalButtons implements ICustomButtonDataObject {
public void readData(NBTTagCompound tag) {
this.reStock = tag.getBoolean(restockItems);
this.magnetMode = WirelessMagnet.Mode.values()[tag.getInteger(modeKey)];
this.terminalMode = UltraTerminalModes.values()[tag.getInteger(MODE)];
this.terminalMode = UltraTerminalModes.VALUES[tag.getInteger(MODE)];
}
@Override
@@ -229,7 +229,7 @@ public class UltraTerminalButtons implements ICustomButtonDataObject {
public void readByte(ByteBuf buf) {
this.reStock = buf.readBoolean();
this.magnetMode = WirelessMagnet.Mode.values()[buf.readInt()];
this.terminalMode = UltraTerminalModes.values()[buf.readInt()];
this.terminalMode = UltraTerminalModes.VALUES[buf.readInt()];
ItemWirelessUltraTerminal.setMode(this.terminal, this.terminalMode);
toggleMagnetButtonsVisibility();