Add VersionedRunnable to Region
Dieser Commit ist enthalten in:
Ursprung
461e6d17a0
Commit
9dc5c535f5
@ -21,7 +21,7 @@ package de.steamwar.bausystem.world;
|
|||||||
|
|
||||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||||
import de.steamwar.bausystem.commands.CommandTNT.TNTMode;
|
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.NoClipboardException;
|
||||||
import de.steamwar.sql.Schematic;
|
import de.steamwar.sql.Schematic;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -298,14 +298,8 @@ public class Region {
|
|||||||
int x = region.minX + offsetX + sizeX/2;
|
int x = region.minX + offsetX + sizeX/2;
|
||||||
int y = region.minY + offsetY;
|
int y = region.minY + offsetY;
|
||||||
int z = region.minZ + offsetZ + sizeZ/2;
|
int z = region.minZ + offsetZ + sizeZ/2;
|
||||||
switch(Core.getVersion()){
|
VersionedRunnable.call(new VersionedRunnable(() -> Region_12.paste(file, x, y, z, rotate), 8),
|
||||||
case 12:
|
new VersionedRunnable(() -> Region_15.fastpaste(file, x, y, z, rotate), 15));
|
||||||
Region_12.paste(file, x, y, z, rotate);
|
|
||||||
break;
|
|
||||||
case 15:
|
|
||||||
default:
|
|
||||||
Region_15.fastpaste(file, x, y, z, rotate);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reset(Region region, Schematic schem) throws IOException, NoClipboardException {
|
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
|
private static void paste(File file, int x, int y, int z, boolean rotate){ //Type of protect
|
||||||
switch(Core.getVersion()){
|
VersionedRunnable.call(new VersionedRunnable(() -> Region_12.paste(file, x, y, z, rotate), 8),
|
||||||
case 12:
|
new VersionedRunnable(() -> Region_15.paste(file, x, y, z, rotate), 15));
|
||||||
Region_12.paste(file, x, y, z, rotate);
|
|
||||||
break;
|
|
||||||
case 15:
|
|
||||||
default:
|
|
||||||
Region_15.paste(file, x, y, z, rotate);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void paste(Clipboard clipboard, int x, int y, int z, boolean rotate){
|
private static void paste(Clipboard clipboard, int x, int y, int z, boolean rotate){
|
||||||
switch(Core.getVersion()){
|
VersionedRunnable.call(new VersionedRunnable(() -> Region_12.paste(clipboard, x, y, z, rotate), 8),
|
||||||
case 12:
|
new VersionedRunnable(() -> Region_15.paste(clipboard, x, y, z, rotate), 15));
|
||||||
Region_12.paste(clipboard, x, y, z, rotate);
|
|
||||||
break;
|
|
||||||
case 15:
|
|
||||||
default:
|
|
||||||
Region_15.paste(clipboard, x, y, z, rotate);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren