SteamWar/BauSystem
Archiviert
13
0

Update versioned dependant code to new SpigotCore version dependant calls

Dieser Commit ist enthalten in:
jojo 2020-12-25 23:25:09 +01:00
Ursprung d332977a1d
Commit f8d69deaa3
2 geänderte Dateien mit 8 neuen und 27 gelöschten Zeilen

Datei anzeigen

@ -23,6 +23,7 @@ package de.steamwar.bausystem.tracer.show.mode;
import de.steamwar.bausystem.tracer.*; import de.steamwar.bausystem.tracer.*;
import de.steamwar.core.Core; import de.steamwar.core.Core;
import de.steamwar.core.VersionedCallable;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
@ -60,30 +61,16 @@ public class Advanced extends Basic {
if (updateEntityMap.containsKey(updatePointPosition)) { if (updateEntityMap.containsKey(updatePointPosition)) {
return; return;
} }
updateEntityMap.put(updatePointPosition, VersionedCallable.call(new VersionedCallable<>(() -> TNTTracer_12.createUpdatePoint(player.getWorld(), updatePointY, player), 8),
switch (Core.getVersion()) { new VersionedCallable<>(() -> TNTTracer_15.createUpdatePoint(player.getWorld(), updatePointY, player), 14)));
case 12:
updateEntityMap.put(updatePointPosition, TNTTracer_12.createUpdatePoint(player.getWorld(), new TNTPosition(updatePointY).getLocation(), player));
break;
default:
updateEntityMap.put(updatePointPosition, TNTTracer_15.createUpdatePoint(player.getWorld(), new TNTPosition(updatePointY).getLocation(), player));
break;
}
} }
if (!position.getLocation().equals(updatePointXZ)) { if (!position.getLocation().equals(updatePointXZ)) {
RoundedTNTPosition updatePointPosition = new RoundedTNTPosition(updatePointXZ); RoundedTNTPosition updatePointPosition = new RoundedTNTPosition(updatePointXZ);
if (updateEntityMap.containsKey(updatePointPosition)) { if (updateEntityMap.containsKey(updatePointPosition)) {
return; return;
} }
updateEntityMap.put(updatePointPosition, VersionedCallable.call(new VersionedCallable<>(() -> TNTTracer_12.createUpdatePoint(player.getWorld(), updatePointXZ, player), 8),
switch (Core.getVersion()) { new VersionedCallable<>(() -> TNTTracer_15.createUpdatePoint(player.getWorld(), updatePointXZ, player), 14)));
case 12:
updateEntityMap.put(updatePointPosition, TNTTracer_12.createUpdatePoint(player.getWorld(), new TNTPosition(updatePointXZ).getLocation(), player));
break;
default:
updateEntityMap.put(updatePointPosition, TNTTracer_15.createUpdatePoint(player.getWorld(), new TNTPosition(updatePointXZ).getLocation(), player));
break;
}
} }
} }

Datei anzeigen

@ -3,6 +3,7 @@ package de.steamwar.bausystem.tracer.show.mode;
import de.steamwar.bausystem.tracer.*; import de.steamwar.bausystem.tracer.*;
import de.steamwar.bausystem.tracer.show.ShowMode; import de.steamwar.bausystem.tracer.show.ShowMode;
import de.steamwar.core.Core; import de.steamwar.core.Core;
import de.steamwar.core.VersionedCallable;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import java.util.HashMap; import java.util.HashMap;
@ -24,15 +25,8 @@ public class Basic implements ShowMode {
if (tntEntityMap.containsKey(roundedTNTPosition)) { if (tntEntityMap.containsKey(roundedTNTPosition)) {
return; return;
} }
tntEntityMap.put(roundedTNTPosition, VersionedCallable.call(new VersionedCallable<>(() -> TNTTracer_12.createTNT(player.getWorld(), position.getLocation(), player, position.isExploded()), 8),
switch (Core.getVersion()) { new VersionedCallable<>(() -> TNTTracer_15.createTNT(player.getWorld(), position.getLocation(), player, position.isExploded()), 14)));
case 12:
tntEntityMap.put(roundedTNTPosition, TNTTracer_12.createTNT(player.getWorld(), position.getLocation(), player, position.isExploded()));
break;
default:
tntEntityMap.put(roundedTNTPosition, TNTTracer_15.createTNT(player.getWorld(), position.getLocation(), player, position.isExploded()));
break;
}
} }
@Override @Override