SteamWar/BauSystem
Archiviert
13
0

Add VersionedRunnable to AutoLoader

Dieser Commit ist enthalten in:
jojo 2021-02-08 21:02:19 +01:00
Ursprung de2f4a1c53
Commit 461e6d17a0

Datei anzeigen

@ -20,7 +20,6 @@
package de.steamwar.bausystem.world;
import de.steamwar.bausystem.BauSystem;
import de.steamwar.core.Core;
import de.steamwar.core.VersionedCallable;
import org.bukkit.Bukkit;
import org.bukkit.Location;
@ -225,12 +224,8 @@ public class AutoLoader extends IAutoLoader implements Listener {
@Override
boolean setRedstone(Location location, boolean active){
switch(Core.getVersion()){
case 15:
return AutoLoader_15.setRedstone(location, active);
default:
return AutoLoader_12.setRedstone(location, active);
}
return VersionedCallable.call(new VersionedCallable<>(() -> AutoLoader_12.setRedstone(location, active), 8),
new VersionedCallable<>(() -> AutoLoader_15.setRedstone(location, active), 15));
}
@Override
@ -256,12 +251,8 @@ public class AutoLoader extends IAutoLoader implements Listener {
@Override
public boolean perform() {
switch(Core.getVersion()){
case 15:
return AutoLoader_15.tntPlaceActionPerform(location);
default:
return AutoLoader_12.tntPlaceActionPerform(location);
}
return VersionedCallable.call(new VersionedCallable<>(() -> AutoLoader_12.tntPlaceActionPerform(location), 8),
new VersionedCallable<>(() -> AutoLoader_15.tntPlaceActionPerform(location), 15));
}
@Override