13
0

Adding explicit support for 1.8, 1.9, 1.10

Dieser Commit ist enthalten in:
Lixfel 2019-12-22 15:57:06 +01:00
Ursprung cf9889e15f
Commit 9411a7826f
15 geänderte Dateien mit 313 neuen und 19 gelöschten Zeilen

61
SchematicSystem_10/pom.xml Normale Datei
Datei anzeigen

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>steamwar</groupId>
<artifactId>SchematicSystem</artifactId>
<version>1.0</version>
</parent>
<artifactId>SchematicSystem_10</artifactId>
<version>1.0</version>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
<exclude>**/*.kt</exclude>
</excludes>
</resource>
</resources>
</build>
<dependencies>
<dependency>
<groupId>steamwar</groupId>
<artifactId>Spigot</artifactId>
<version>1.10</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>WorldEdit</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>FAWE</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>SchematicSystem_9</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>SchematicSystem_API</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

Datei anzeigen

@ -0,0 +1,11 @@
package de.steamwar.schematicsystem;
import java.util.List;
class CheckSchemType_10 {
private CheckSchemType_10(){}
static void autoCheck(List<String> errors) {
errors.add("In der 1.10 können keine Schematics eingesendet werden");
}
}

Datei anzeigen

@ -0,0 +1,16 @@
package de.steamwar.schematicsystem;
import com.sk89q.worldedit.EditSession;
import de.steamwar.sql.NoClipboardException;
import de.steamwar.sql.Schematic;
import org.bukkit.entity.Player;
import java.io.IOException;
class WorldEdit_10 {
private WorldEdit_10(){}
static EditSession pasteSchematic(Player player, Schematic schematic) throws Schematic.WrongVersionException, NoClipboardException, IOException {
return WorldEdit_8.pasteSchematic(player, schematic);
}
}

Datei anzeigen

@ -45,6 +45,12 @@
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>SchematicSystem_10</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>SchematicSystem_API</artifactId>

Datei anzeigen

@ -1,16 +1,8 @@
package de.steamwar.schematicsystem;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.bukkit.BukkitWorld;
import com.sk89q.worldedit.extent.clipboard.Clipboard;
import com.sk89q.worldedit.function.operation.Operations;
import com.sk89q.worldedit.session.ClipboardHolder;
import com.sk89q.worldedit.world.World;
import de.steamwar.sql.NoClipboardException;
import de.steamwar.sql.Schematic;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import java.io.IOException;
@ -19,16 +11,6 @@ class WorldEdit_12 {
private WorldEdit_12(){}
static EditSession pasteSchematic(Player player, Schematic schematic) throws Schematic.WrongVersionException, NoClipboardException, IOException {
World weWorld = new BukkitWorld(player.getWorld());
Location playerLocation = player.getLocation();
Vector vector = new Vector(playerLocation.getBlockX(), playerLocation.getBlockY(), playerLocation.getBlockZ());
Clipboard clipboard = schematic.load();
Vector offset = new Vector(clipboard.getRegion().getMinimumPoint()).subtract(clipboard.getOrigin());
Vector dimensions = clipboard.getDimensions();
Vector v = vector.subtract(dimensions.getX()/2 - dimensions.getX()%2, 0, dimensions.getZ()).subtract(offset);
EditSession e = WorldEdit.getInstance().getEditSessionFactory().getEditSession(weWorld, -1);
Operations.completeBlindly(new ClipboardHolder(clipboard, weWorld.getWorldData()).createPaste(e, weWorld.getWorldData()).to(v).build());
e.flushQueue();
return e;
return WorldEdit_8.pasteSchematic(player, schematic);
}
}

49
SchematicSystem_8/pom.xml Normale Datei
Datei anzeigen

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>steamwar</groupId>
<artifactId>SchematicSystem</artifactId>
<version>1.0</version>
</parent>
<artifactId>SchematicSystem_8</artifactId>
<version>1.0</version>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
<exclude>**/*.kt</exclude>
</excludes>
</resource>
</resources>
</build>
<dependencies>
<dependency>
<groupId>steamwar</groupId>
<artifactId>Spigot</artifactId>
<version>1.8</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>WorldEdit</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>SchematicSystem_API</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

Datei anzeigen

@ -0,0 +1,11 @@
package de.steamwar.schematicsystem;
import java.util.List;
class CheckSchemType_8 {
private CheckSchemType_8(){}
static void autoCheck(List<String> errors) {
errors.add("In der 1.8 können keine Schematics eingesendet werden");
}
}

Datei anzeigen

@ -0,0 +1,34 @@
package de.steamwar.schematicsystem;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.bukkit.BukkitWorld;
import com.sk89q.worldedit.extent.clipboard.Clipboard;
import com.sk89q.worldedit.function.operation.Operations;
import com.sk89q.worldedit.session.ClipboardHolder;
import com.sk89q.worldedit.world.World;
import de.steamwar.sql.NoClipboardException;
import de.steamwar.sql.Schematic;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import java.io.IOException;
class WorldEdit_8 {
private WorldEdit_8(){}
static EditSession pasteSchematic(Player player, Schematic schematic) throws Schematic.WrongVersionException, NoClipboardException, IOException {
World weWorld = new BukkitWorld(player.getWorld());
Location playerLocation = player.getLocation();
Vector vector = new Vector(playerLocation.getBlockX(), playerLocation.getBlockY(), playerLocation.getBlockZ());
Clipboard clipboard = schematic.load();
Vector offset = new Vector(clipboard.getRegion().getMinimumPoint()).subtract(clipboard.getOrigin());
Vector dimensions = clipboard.getDimensions();
Vector v = vector.subtract(dimensions.getX()/2 - dimensions.getX()%2, 0, dimensions.getZ()).subtract(offset);
EditSession e = WorldEdit.getInstance().getEditSessionFactory().getEditSession(weWorld, -1);
Operations.completeBlindly(new ClipboardHolder(clipboard, weWorld.getWorldData()).createPaste(e, weWorld.getWorldData()).to(v).build());
e.flushQueue();
return e;
}
}

61
SchematicSystem_9/pom.xml Normale Datei
Datei anzeigen

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>steamwar</groupId>
<artifactId>SchematicSystem</artifactId>
<version>1.0</version>
</parent>
<artifactId>SchematicSystem_9</artifactId>
<version>1.0</version>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
<exclude>**/*.kt</exclude>
</excludes>
</resource>
</resources>
</build>
<dependencies>
<dependency>
<groupId>steamwar</groupId>
<artifactId>Spigot</artifactId>
<version>1.9</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>WorldEdit</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>FAWE</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>SchematicSystem_8</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>SchematicSystem_API</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

Datei anzeigen

@ -0,0 +1,11 @@
package de.steamwar.schematicsystem;
import java.util.List;
class CheckSchemType_9 {
private CheckSchemType_9(){}
static void autoCheck(List<String> errors) {
errors.add("In der 1.9 können keine Schematics eingesendet werden");
}
}

Datei anzeigen

@ -0,0 +1,16 @@
package de.steamwar.schematicsystem;
import com.sk89q.worldedit.EditSession;
import de.steamwar.sql.NoClipboardException;
import de.steamwar.sql.Schematic;
import org.bukkit.entity.Player;
import java.io.IOException;
class WorldEdit_9 {
private WorldEdit_9(){}
static EditSession pasteSchematic(Player player, Schematic schematic) throws Schematic.WrongVersionException, NoClipboardException, IOException {
return WorldEdit_8.pasteSchematic(player, schematic);
}
}

Datei anzeigen

@ -80,6 +80,24 @@
<version>1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>SchematicSystem_10</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>SchematicSystem_9</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>SchematicSystem_8</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>SchematicSystem_API</artifactId>

Datei anzeigen

@ -66,6 +66,15 @@ public class CheckSchemType implements ICheckSchemType {
case 14:
CheckSchemType_14.autoCheck(errors);
break;
case 10:
CheckSchemType_10.autoCheck(errors);
break;
case 9:
CheckSchemType_9.autoCheck(errors);
break;
case 8:
CheckSchemType_8.autoCheck(errors);
break;
default:
CheckSchemType_12.autoCheck(schematic, errors, warnings, this);
}

Datei anzeigen

@ -17,6 +17,12 @@ public class WorldEdit {
return WorldEdit_15.pasteSchematic(player, schematic);
case 14:
return WorldEdit_14.pasteSchematic(player, schematic);
case 10:
return WorldEdit_10.pasteSchematic(player, schematic);
case 9:
return WorldEdit_9.pasteSchematic(player, schematic);
case 8:
return WorldEdit_8.pasteSchematic(player, schematic);
default:
return WorldEdit_12.pasteSchematic(player, schematic);
}

Datei anzeigen

@ -36,6 +36,9 @@
</build>
<modules>
<module>SchematicSystem_8</module>
<module>SchematicSystem_9</module>
<module>SchematicSystem_10</module>
<module>SchematicSystem_12</module>
<module>SchematicSystem_14</module>
<module>SchematicSystem_15</module>