Remove craftbukkit dependency in 'ShopChest' artifact

This commit is contained in:
Eric 2016-07-06 18:27:35 +02:00
parent 3a7e96f88d
commit fbbe519381
3 changed files with 4 additions and 16 deletions

View File

@ -8,12 +8,6 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>ShopChest</artifactId> <artifactId>ShopChest</artifactId>
<dependencies> <dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.10-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId> <artifactId>spigot-api</artifactId>

View File

@ -12,13 +12,6 @@
<artifactId>ShopChest</artifactId> <artifactId>ShopChest</artifactId>
<dependencies> <dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.10-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency> <dependency>
<groupId>de.epiceric</groupId> <groupId>de.epiceric</groupId>
<artifactId>ShopChest_NMS-Abstract</artifactId> <artifactId>ShopChest_NMS-Abstract</artifactId>

View File

@ -1,12 +1,13 @@
package de.epiceric.shopchest.utils; package de.epiceric.shopchest.utils;
import org.apache.commons.codec.binary.Base64;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory; import org.bukkit.inventory.PlayerInventory;
import javax.xml.bind.DatatypeConverter;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList; import java.util.ArrayList;
public class Utils { public class Utils {
@ -82,7 +83,7 @@ public class Utils {
public static String encode(ItemStack itemStack) { public static String encode(ItemStack itemStack) {
YamlConfiguration config = new YamlConfiguration(); YamlConfiguration config = new YamlConfiguration();
config.set("i", itemStack); config.set("i", itemStack);
return new String(Base64.encodeBase64(config.saveToString().getBytes())); return DatatypeConverter.printBase64Binary(config.saveToString().getBytes(StandardCharsets.UTF_8));
} }
/** /**
@ -93,7 +94,7 @@ public class Utils {
public static ItemStack decode(String string) { public static ItemStack decode(String string) {
YamlConfiguration config = new YamlConfiguration(); YamlConfiguration config = new YamlConfiguration();
try { try {
config.loadFromString(new String(Base64.decodeBase64(string.getBytes()))); config.loadFromString(new String(DatatypeConverter.parseBase64Binary(string), StandardCharsets.UTF_8));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
return null; return null;