SteamWar/BauSystem
Archiviert
13
0

Merge pull request 'Add Comments to scripts' (#135) from ScriptComments into master

Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
YoyoNow 2020-12-12 16:36:34 +01:00
Commit e0060deca4

Datei anzeigen

@ -48,6 +48,8 @@ public class ScriptListener implements Listener {
BookMeta meta = (BookMeta) item.getItemMeta(); BookMeta meta = (BookMeta) item.getItemMeta();
for(String page : meta.getPages()){ for(String page : meta.getPages()){
for(String command : page.split("\n")){ for(String command : page.split("\n")){
if (command.startsWith("#")) continue;
PlayerCommandPreprocessEvent preprocessEvent = new PlayerCommandPreprocessEvent(player, "/" + command); PlayerCommandPreprocessEvent preprocessEvent = new PlayerCommandPreprocessEvent(player, "/" + command);
Bukkit.getServer().getPluginManager().callEvent(preprocessEvent); Bukkit.getServer().getPluginManager().callEvent(preprocessEvent);
if(preprocessEvent.isCancelled()) if(preprocessEvent.isCancelled())
@ -68,4 +70,5 @@ public class ScriptListener implements Listener {
return ScriptListener_15.isNoBook(item); return ScriptListener_15.isNoBook(item);
} }
} }
} }