SteamWar/BauSystem
Archiviert
13
0

Add VersionedRunnable to Region

Dieser Commit ist enthalten in:
jojo 2021-02-08 21:02:31 +01:00
Ursprung 461e6d17a0
Commit 9dc5c535f5

Datei anzeigen

@ -21,7 +21,7 @@ package de.steamwar.bausystem.world;
import com.sk89q.worldedit.extent.clipboard.Clipboard;
import de.steamwar.bausystem.commands.CommandTNT.TNTMode;
import de.steamwar.core.Core;
import de.steamwar.core.VersionedRunnable;
import de.steamwar.sql.NoClipboardException;
import de.steamwar.sql.Schematic;
import org.bukkit.Bukkit;
@ -298,14 +298,8 @@ public class Region {
int x = region.minX + offsetX + sizeX/2;
int y = region.minY + offsetY;
int z = region.minZ + offsetZ + sizeZ/2;
switch(Core.getVersion()){
case 12:
Region_12.paste(file, x, y, z, rotate);
break;
case 15:
default:
Region_15.fastpaste(file, x, y, z, rotate);
}
VersionedRunnable.call(new VersionedRunnable(() -> Region_12.paste(file, x, y, z, rotate), 8),
new VersionedRunnable(() -> Region_15.fastpaste(file, x, y, z, rotate), 15));
}
public void reset(Region region, Schematic schem) throws IOException, NoClipboardException {
@ -345,25 +339,13 @@ public class Region {
}
private static void paste(File file, int x, int y, int z, boolean rotate){ //Type of protect
switch(Core.getVersion()){
case 12:
Region_12.paste(file, x, y, z, rotate);
break;
case 15:
default:
Region_15.paste(file, x, y, z, rotate);
}
VersionedRunnable.call(new VersionedRunnable(() -> Region_12.paste(file, x, y, z, rotate), 8),
new VersionedRunnable(() -> Region_15.paste(file, x, y, z, rotate), 15));
}
private static void paste(Clipboard clipboard, int x, int y, int z, boolean rotate){
switch(Core.getVersion()){
case 12:
Region_12.paste(clipboard, x, y, z, rotate);
break;
case 15:
default:
Region_15.paste(clipboard, x, y, z, rotate);
}
VersionedRunnable.call(new VersionedRunnable(() -> Region_12.paste(clipboard, x, y, z, rotate), 8),
new VersionedRunnable(() -> Region_15.paste(clipboard, x, y, z, rotate), 15));
}
}
}