Add VersionedRunnable to ScriptListener
Dieser Commit ist enthalten in:
Ursprung
d45c39c528
Commit
1696aa4e54
@ -23,7 +23,7 @@ import de.steamwar.bausystem.BauSystem;
|
|||||||
import de.steamwar.bausystem.commands.CommandScript;
|
import de.steamwar.bausystem.commands.CommandScript;
|
||||||
import de.steamwar.bausystem.commands.CommandTNT;
|
import de.steamwar.bausystem.commands.CommandTNT;
|
||||||
import de.steamwar.bausystem.tracer.record.RecordStateMachine;
|
import de.steamwar.bausystem.tracer.record.RecordStateMachine;
|
||||||
import de.steamwar.core.Core;
|
import de.steamwar.core.VersionedCallable;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -72,13 +72,8 @@ public class ScriptListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean isNoBook(ItemStack item){
|
private boolean isNoBook(ItemStack item){
|
||||||
switch(Core.getVersion()){
|
return VersionedCallable.call(new VersionedCallable<>(() -> ScriptListener_12.isNoBook(item), 8),
|
||||||
case 12:
|
new VersionedCallable<>(() -> ScriptListener_15.isNoBook(item), 15));
|
||||||
return ScriptListener_12.isNoBook(item);
|
|
||||||
case 15:
|
|
||||||
default:
|
|
||||||
return ScriptListener_15.isNoBook(item);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class ScriptExecutor {
|
private static class ScriptExecutor {
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren