mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-08-10 17:55:44 +00:00
Hard Exception when setting display mode or active digits with an illegal value
This commit is contained in:
parent
a4a6647502
commit
d57a8c9dc4
@ -280,7 +280,7 @@ public class TileEntityRBMKNumitron extends TileEntityLoadedBase implements IGUI
|
||||
int idx = args.checkInteger(0) - 1;
|
||||
if(idx < 0 || idx >= 2) return new Object[] {false, "Invalid index (1-2)"};
|
||||
long val = (long) args.checkInteger(1);
|
||||
if(val < 0 || val >= 128) return new Object[] {false, "Invalid value (0-127)"};
|
||||
if(val < 0 || val >= 128) throw new IllegalArgumentException("Invalid value (0-127)");
|
||||
displays[idx].active_digits = val;
|
||||
markDirty();
|
||||
return new Object[] {true};
|
||||
@ -292,7 +292,7 @@ public class TileEntityRBMKNumitron extends TileEntityLoadedBase implements IGUI
|
||||
int idx = args.checkInteger(0) - 1;
|
||||
if(idx < 0 || idx >= 2) return new Object[] {false, "Invalid index (1-2)"};
|
||||
long val = (long) args.checkInteger(1) - 1;
|
||||
if(val < 0 || val >= 4) return new Object[] {false, "Invalid value (1-4)"};
|
||||
if(val < 0 || val >= 4) throw new IllegalArgumentException("Invalid value (1-4)");
|
||||
displays[idx].display_mode = val;
|
||||
markDirty();
|
||||
return new Object[] {true};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user