Cache enum .values() (#248)

Co-authored-by: Martin Robertz <[email protected]>
This commit is contained in:
boubou19andMartin Robertz authored and GitHub committed 2026-08-10 21:03:55 +02:00
1 parent b46cfbb351
commit 8750005be5
20 files changed
+59 -52

No files matched your search

@@ -472,10 +472,10 @@ public abstract class AbstractMachineEntity extends TileEntityEio
}
int rsContr = nbtRoot.getInteger("redstoneControlMode");
if (rsContr < 0 || rsContr >= RedstoneControlMode.values().length) {
if (rsContr < 0 || rsContr >= RedstoneControlMode.VALUES.length) {
rsContr = 0;
}
redstoneControlMode = RedstoneControlMode.values()[rsContr];
redstoneControlMode = RedstoneControlMode.VALUES[rsContr];
if (nbtRoot.hasKey("hasFaces")) {
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {