mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
Script validation
This commit is contained in:
parent
0feace9c06
commit
2e7291c3a5
@ -470,7 +470,12 @@ public class ProgrammableAndroid extends SlimefunItem implements InventoryBlock,
|
||||
|
||||
menu.addItem(1, new CustomItem(HeadTexture.SCRIPT_FORWARD.getAsItemStack(), "&2> Edit Script", "", "&aEdits your current Script"));
|
||||
menu.addMenuClickHandler(1, (pl, slot, item, action) -> {
|
||||
if (PatternUtils.DASH.split(BlockStorage.getLocationInfo(b.getLocation()).getString("script")).length <= MAX_SCRIPT_LENGTH) {
|
||||
openScript(pl, b, getScript(b.getLocation()));
|
||||
} else {
|
||||
pl.closeInventory();
|
||||
pl.sendMessage("&cThe script is too large to edit!");
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user