1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Script validation

This commit is contained in:
Seggan 2021-01-16 11:38:19 -05:00
parent 0feace9c06
commit 2e7291c3a5

View File

@ -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) -> {
openScript(pl, b, getScript(b.getLocation()));
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;
});