SteamWar/SpigotCore
Archiviert
13
0

Adding 1.9 and 1.10 support

Dieser Commit ist enthalten in:
Lixfel 2019-12-13 15:53:40 +01:00
Ursprung 087191be98
Commit 28db3c0844
15 geänderte Dateien mit 209 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -8,11 +8,11 @@ class SWItem_12 {
private SWItem_12(){} private SWItem_12(){}
static Material getMaterial(String material){ static Material getMaterial(String material){
return Material.valueOf(material); return SWItem_8.getMaterial(material);
} }
static Material getDye(){ static Material getDye(){
return Material.INK_SACK; return SWItem_8.getDye();
} }
static void setSkullOwner(OfflinePlayer player, SkullMeta meta){ static void setSkullOwner(OfflinePlayer player, SkullMeta meta){

Datei anzeigen

@ -43,6 +43,19 @@
<groupId>steamwar</groupId> <groupId>steamwar</groupId>
<artifactId>SpigotCore_API</artifactId> <artifactId>SpigotCore_API</artifactId>
<version>2.0</version> <version>2.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>SpigotCore_12</artifactId>
<version>2.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>SpigotCore_12</artifactId>
<version>2.0</version>
<scope>compile</scope>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

Datei anzeigen

@ -1,6 +1,8 @@
package de.steamwar.inventory; package de.steamwar.inventory;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.OfflinePlayer;
import org.bukkit.inventory.meta.SkullMeta;
class SWItem_14 { class SWItem_14 {
private SWItem_14(){} private SWItem_14(){}
@ -45,4 +47,8 @@ class SWItem_14 {
return Material.BLACK_DYE; return Material.BLACK_DYE;
} }
} }
static void setSkullOwner(OfflinePlayer player, SkullMeta meta){
SWItem_12.setSkullOwner(player, meta);
}
} }

Datei anzeigen

@ -1,6 +1,8 @@
package de.steamwar.inventory; package de.steamwar.inventory;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.OfflinePlayer;
import org.bukkit.inventory.meta.SkullMeta;
class SWItem_15 { class SWItem_15 {
private SWItem_15(){} private SWItem_15(){}
@ -12,4 +14,8 @@ class SWItem_15 {
static Material getDye(int colorCode){ static Material getDye(int colorCode){
return SWItem_14.getDye(colorCode); return SWItem_14.getDye(colorCode);
} }
static void setSkullOwner(OfflinePlayer player, SkullMeta meta){
SWItem_12.setSkullOwner(player, meta);
}
} }

Datei anzeigen

@ -1,11 +1,20 @@
package de.steamwar.inventory; package de.steamwar.inventory;
import org.bukkit.Material;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
import org.bukkit.inventory.meta.SkullMeta; import org.bukkit.inventory.meta.SkullMeta;
class SWItem_8 { class SWItem_8 {
private SWItem_8(){} private SWItem_8(){}
static Material getMaterial(String material){
return Material.valueOf(material);
}
static Material getDye(){
return Material.INK_SACK;
}
static void setSkullOwner(OfflinePlayer player, SkullMeta meta){ static void setSkullOwner(OfflinePlayer player, SkullMeta meta){
meta.setOwner(player.getName()); meta.setOwner(player.getName());
} }

Datei anzeigen

@ -45,7 +45,7 @@ class Schematic_8 {
} }
static Clipboard getClipboard(InputStream is) throws IOException { static Clipboard getClipboard(InputStream is) throws IOException {
return ClipboardFormat.findByAlias("mcedit").getReader(is).read(WorldEdit.getInstance().getServer().getWorlds().get(0).getWorldData()); return ClipboardFormat.SCHEMATIC.getReader(is).read(WorldEdit.getInstance().getServer().getWorlds().get(0).getWorldData());
} }
private static WorldEditPlugin getWorldEditPlugin() { private static WorldEditPlugin getWorldEditPlugin() {

53
SpigotCore_9/pom.xml Normale Datei
Datei anzeigen

@ -0,0 +1,53 @@
<?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>SpigotCore</artifactId>
<version>2.0</version>
</parent>
<artifactId>SpigotCore_9</artifactId>
<version>2.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>SpigotCore_API</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>SpigotCore_8</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
</project>

Datei anzeigen

@ -0,0 +1,13 @@
package de.steamwar.inventory;
import org.bukkit.craftbukkit.v1_9_R2.inventory.CraftInventoryCustom;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
class SWInventory_9 {
private SWInventory_9(){}
static Inventory get(Player player, int size, String title){
return new CraftInventoryCustom(player, size, title);
}
}

Datei anzeigen

@ -0,0 +1,21 @@
package de.steamwar.inventory;
import org.bukkit.Material;
import org.bukkit.OfflinePlayer;
import org.bukkit.inventory.meta.SkullMeta;
class SWItem_9 {
private SWItem_9(){}
static Material getMaterial(String material){
return SWItem_8.getMaterial(material);
}
static Material getDye(){
return SWItem_8.getDye();
}
static void setSkullOwner(OfflinePlayer player, SkullMeta meta){
SWItem_8.setSkullOwner(player, meta);
}
}

Datei anzeigen

@ -0,0 +1,23 @@
package de.steamwar.sql;
import com.sk89q.worldedit.extent.clipboard.Clipboard;
import org.bukkit.entity.Player;
import java.io.IOException;
import java.io.InputStream;
class Schematic_9 {
private Schematic_9(){}
static byte[] getPlayerClipboard(Player player) throws IOException, NoClipboardException {
return Schematic_8.getPlayerClipboard(player);
}
static void setPlayerClipboard(Player player, InputStream is) throws IOException {
Schematic_8.setPlayerClipboard(player, is);
}
static Clipboard getClipboard(InputStream is) throws IOException {
return Schematic_8.getClipboard(is);
}
}

Datei anzeigen

@ -68,6 +68,18 @@
<version>2.0</version> <version>2.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>SpigotCore_9</artifactId>
<version>2.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>SpigotCore_10</artifactId>
<version>2.0</version>
<scope>compile</scope>
</dependency>
<dependency> <dependency>
<groupId>steamwar</groupId> <groupId>steamwar</groupId>
<artifactId>SpigotCore_12</artifactId> <artifactId>SpigotCore_12</artifactId>

Datei anzeigen

@ -28,6 +28,12 @@ public class SWInventory implements Listener {
case 8: case 8:
inventory = SWInventory_8.get(p, size, t); inventory = SWInventory_8.get(p, size, t);
break; break;
case 9:
inventory = SWInventory_9.get(p, size, t);
break;
case 10:
inventory = SWInventory_10.get(p, size, t);
break;
case 14: case 14:
inventory = SWInventory_14.get(p, size, t); inventory = SWInventory_14.get(p, size, t);
break; break;

Datei anzeigen

@ -26,6 +26,18 @@ public class SWItem {
case 8: case 8:
SWItem_8.setSkullOwner(player, headmeta); SWItem_8.setSkullOwner(player, headmeta);
break; break;
case 9:
SWItem_9.setSkullOwner(player, headmeta);
break;
case 10:
SWItem_10.setSkullOwner(player, headmeta);
break;
case 14:
SWItem_14.setSkullOwner(player, headmeta);
break;
case 15:
SWItem_15.setSkullOwner(player, headmeta);
break;
default: default:
SWItem_12.setSkullOwner(player, headmeta); SWItem_12.setSkullOwner(player, headmeta);
} }
@ -38,6 +50,12 @@ public class SWItem {
public static Material getMaterial(String material){ public static Material getMaterial(String material){
try{ try{
switch(Core.getVersion()){ switch(Core.getVersion()){
case 8:
return SWItem_8.getMaterial(material);
case 9:
return SWItem_9.getMaterial(material);
case 10:
return SWItem_10.getMaterial(material);
case 14: case 14:
return SWItem_14.getMaterial(material); return SWItem_14.getMaterial(material);
case 15: case 15:
@ -52,6 +70,12 @@ public class SWItem {
public static Material getDye(int colorCode){ public static Material getDye(int colorCode){
switch(Core.getVersion()){ switch(Core.getVersion()){
case 8:
return SWItem_8.getDye();
case 9:
return SWItem_9.getDye();
case 10:
return SWItem_10.getDye();
case 14: case 14:
return SWItem_14.getDye(colorCode); return SWItem_14.getDye(colorCode);
case 15: case 15:

Datei anzeigen

@ -162,6 +162,10 @@ public class Schematic {
switch(Core.getVersion()){ switch(Core.getVersion()){
case 8: case 8:
return Schematic_8.getClipboard(is); return Schematic_8.getClipboard(is);
case 9:
return Schematic_9.getClipboard(is);
case 10:
return Schematic_10.getClipboard(is);
case 14: case 14:
return Schematic_14.getClipboard(is, schemFormat); return Schematic_14.getClipboard(is, schemFormat);
case 15: case 15:
@ -186,6 +190,12 @@ public class Schematic {
case 8: case 8:
Schematic_8.setPlayerClipboard(player, is); Schematic_8.setPlayerClipboard(player, is);
break; break;
case 9:
Schematic_9.setPlayerClipboard(player, is);
break;
case 10:
Schematic_10.setPlayerClipboard(player, is);
break;
case 14: case 14:
Schematic_14.setPlayerClipboard(player, is, schemFormat); Schematic_14.setPlayerClipboard(player, is, schemFormat);
break; break;
@ -217,6 +227,14 @@ public class Schematic {
newFormat = false; newFormat = false;
data = Schematic_8.getPlayerClipboard(player); data = Schematic_8.getPlayerClipboard(player);
break; break;
case 9:
newFormat = false;
data = Schematic_9.getPlayerClipboard(player);
break;
case 10:
newFormat = false;
data = Schematic_10.getPlayerClipboard(player);
break;
case 14: case 14:
data = Schematic_14.getPlayerClipboard(player, newFormat); data = Schematic_14.getPlayerClipboard(player, newFormat);
break; break;

Datei anzeigen

@ -39,6 +39,8 @@
<modules> <modules>
<module>SpigotCore_API</module> <module>SpigotCore_API</module>
<module>SpigotCore_8</module> <module>SpigotCore_8</module>
<module>SpigotCore_9</module>
<module>SpigotCore_10</module>
<module>SpigotCore_12</module> <module>SpigotCore_12</module>
<module>SpigotCore_14</module> <module>SpigotCore_14</module>
<module>SpigotCore_15</module> <module>SpigotCore_15</module>