mirror of
https://github.com/songoda/SongodaCore.git
synced 2025-02-09 08:01:39 +01:00
Added support for nbt tags.
This commit is contained in:
parent
959193699a
commit
9007d32fd5
@ -2,8 +2,8 @@ package com.songoda.core.gui;
|
|||||||
|
|
||||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||||
import com.songoda.core.gui.methods.Clickable;
|
import com.songoda.core.gui.methods.Clickable;
|
||||||
import com.songoda.core.nms.CoreNMS;
|
import com.songoda.core.nms.anvil.AnvilCore;
|
||||||
import com.songoda.core.nms.CustomAnvil;
|
import com.songoda.core.nms.anvil.CustomAnvil;
|
||||||
import com.songoda.core.nms.NmsManager;
|
import com.songoda.core.nms.NmsManager;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -115,7 +115,7 @@ public class AnvilGui extends Gui {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void createInventory() {
|
protected void createInventory() {
|
||||||
CoreNMS nms = NmsManager.getNMS();
|
AnvilCore nms = NmsManager.getAnvil();
|
||||||
if (nms != null) {
|
if (nms != null) {
|
||||||
anvil = nms.createAnvil(player, new GuiHolder(guiManager, this));
|
anvil = nms.createAnvil(player, new GuiHolder(guiManager, this));
|
||||||
anvil.setCustomTitle(title);
|
anvil.setCustomTitle(title);
|
||||||
|
@ -1,57 +1,90 @@
|
|||||||
package com.songoda.core.nms;
|
package com.songoda.core.nms;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.anvil.AnvilCore;
|
||||||
|
import com.songoda.core.nms.nbt.NBTCore;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
|
|
||||||
public class NmsManager {
|
public class NmsManager {
|
||||||
|
|
||||||
private final static String serverPackagePath = Bukkit.getServer().getClass().getPackage().getName();
|
private final static String serverPackagePath = Bukkit.getServer().getClass().getPackage().getName();
|
||||||
private final static String serverPackageVersion = serverPackagePath.substring(serverPackagePath.lastIndexOf('.') + 1);
|
private final static String serverPackageVersion = serverPackagePath.substring(serverPackagePath.lastIndexOf('.') + 1);
|
||||||
private final static CoreNMS nms = _getNMS();
|
private final static AnvilCore anvil;
|
||||||
|
private final static NBTCore nbt;
|
||||||
|
|
||||||
private static CoreNMS _getNMS() {
|
static {
|
||||||
// try {
|
|
||||||
// return (CoreNMS) Class.forName("com.songoda.core.nms." + serverPackageVersion + ".NMS").newInstance();
|
|
||||||
// } catch (Exception ex) {
|
|
||||||
// Logger.getLogger(NmsManager.class.getName()).log(Level.SEVERE, "Failed to load NMS for this server version", ex);
|
|
||||||
// }
|
|
||||||
// this block was only added to keep minimizeJar happy
|
|
||||||
switch (serverPackageVersion) {
|
switch (serverPackageVersion) {
|
||||||
case "v1_8_R1":
|
case "v1_8_R1":
|
||||||
return new com.songoda.core.nms.v1_8_R1.NMS();
|
anvil = new com.songoda.core.nms.v1_8_R1.anvil.AnvilCore();
|
||||||
|
nbt = new com.songoda.core.nms.v1_8_R1.nbt.NBTCoreImpl();
|
||||||
|
break;
|
||||||
case "v1_8_R2":
|
case "v1_8_R2":
|
||||||
return new com.songoda.core.nms.v1_8_R2.NMS();
|
anvil = new com.songoda.core.nms.v1_8_R2.anvil.AnvilCore();
|
||||||
|
nbt = new com.songoda.core.nms.v1_8_R2.nbt.NBTCoreImpl();
|
||||||
|
break;
|
||||||
case "v1_8_R3":
|
case "v1_8_R3":
|
||||||
return new com.songoda.core.nms.v1_8_R3.NMS();
|
anvil = new com.songoda.core.nms.v1_8_R3.anvil.AnvilCore();
|
||||||
|
nbt = new com.songoda.core.nms.v1_8_R3.nbt.NBTCoreImpl();
|
||||||
|
break;
|
||||||
case "v1_9_R1":
|
case "v1_9_R1":
|
||||||
return new com.songoda.core.nms.v1_9_R1.NMS();
|
anvil = new com.songoda.core.nms.v1_9_R1.anvil.AnvilCore();
|
||||||
|
nbt = new com.songoda.core.nms.v1_9_R1.nbt.NBTCoreImpl();
|
||||||
|
break;
|
||||||
case "v1_9_R2":
|
case "v1_9_R2":
|
||||||
return new com.songoda.core.nms.v1_9_R2.NMS();
|
anvil = new com.songoda.core.nms.v1_9_R2.anvil.AnvilCore();
|
||||||
|
nbt = new com.songoda.core.nms.v1_9_R2.nbt.NBTCoreImpl();
|
||||||
|
break;
|
||||||
case "v1_10_R1":
|
case "v1_10_R1":
|
||||||
return new com.songoda.core.nms.v1_10_R1.NMS();
|
anvil = new com.songoda.core.nms.v1_10_R1.anvil.AnvilCore();
|
||||||
|
nbt = new com.songoda.core.nms.v1_10_R1.nbt.NBTCoreImpl();
|
||||||
|
break;
|
||||||
case "v1_11_R1":
|
case "v1_11_R1":
|
||||||
return new com.songoda.core.nms.v1_11_R1.NMS();
|
anvil = new com.songoda.core.nms.v1_11_R1.anvil.AnvilCore();
|
||||||
|
nbt = new com.songoda.core.nms.v1_11_R1.nbt.NBTCoreImpl();
|
||||||
|
break;
|
||||||
case "v1_12_R1":
|
case "v1_12_R1":
|
||||||
return new com.songoda.core.nms.v1_12_R1.NMS();
|
anvil = new com.songoda.core.nms.v1_12_R1.anvil.AnvilCore();
|
||||||
|
nbt = new com.songoda.core.nms.v1_12_R1.nbt.NBTCoreImpl();
|
||||||
|
break;
|
||||||
case "v1_13_R1":
|
case "v1_13_R1":
|
||||||
return new com.songoda.core.nms.v1_13_R1.NMS();
|
anvil = new com.songoda.core.nms.v1_13_R1.anvil.AnvilCore();
|
||||||
|
nbt = new com.songoda.core.nms.v1_13_R1.nbt.NBTCoreImpl();
|
||||||
|
break;
|
||||||
case "v1_13_R2":
|
case "v1_13_R2":
|
||||||
return new com.songoda.core.nms.v1_13_R2.NMS();
|
anvil = new com.songoda.core.nms.v1_13_R2.anvil.AnvilCore();
|
||||||
|
nbt = new com.songoda.core.nms.v1_13_R2.nbt.NBTCoreImpl();
|
||||||
|
break;
|
||||||
case "v1_14_R1":
|
case "v1_14_R1":
|
||||||
return new com.songoda.core.nms.v1_14_R1.NMS();
|
anvil = new com.songoda.core.nms.v1_14_R1.anvil.AnvilCore();
|
||||||
|
nbt = new com.songoda.core.nms.v1_14_R1.nbt.NBTCoreImpl();
|
||||||
|
break;
|
||||||
case "v1_15_R1":
|
case "v1_15_R1":
|
||||||
return new com.songoda.core.nms.v1_15_R1.NMS();
|
anvil = new com.songoda.core.nms.v1_15_R1.anvil.AnvilCore();
|
||||||
}
|
nbt = new com.songoda.core.nms.v1_15_R1.nbt.NBTCoreImpl();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
Logger.getLogger(NmsManager.class.getName()).log(Level.SEVERE, "Failed to load NMS for this server version: version {0} not found", serverPackageVersion);
|
Logger.getLogger(NmsManager.class.getName()).log(Level.SEVERE, "Failed to load NMS for this server version: version {0} not found", serverPackageVersion);
|
||||||
return null;
|
anvil = null;
|
||||||
|
nbt = null;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CoreNMS getNMS() {
|
public static AnvilCore getAnvil() {
|
||||||
return nms;
|
return anvil;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean hasNMS() {
|
public static boolean hasAnvil() {
|
||||||
return nms != null;
|
return anvil != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static NBTCore getNbt() {
|
||||||
|
return nbt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean hasNbt() {
|
||||||
|
return nbt != null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package com.songoda.core.nms;
|
package com.songoda.core.nms.anvil;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.InventoryHolder;
|
import org.bukkit.inventory.InventoryHolder;
|
||||||
|
|
||||||
public interface CoreNMS {
|
public interface AnvilCore {
|
||||||
public CustomAnvil createAnvil(Player player);
|
public CustomAnvil createAnvil(Player player);
|
||||||
public CustomAnvil createAnvil(Player player, InventoryHolder holder);
|
public CustomAnvil createAnvil(Player player, InventoryHolder holder);
|
||||||
}
|
}
|
@ -1,6 +1,6 @@
|
|||||||
package com.songoda.core.nms;
|
package com.songoda.core.nms.anvil;
|
||||||
|
|
||||||
import com.songoda.core.nms.methods.AnvilTextChange;
|
import com.songoda.core.nms.anvil.methods.AnvilTextChange;
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.songoda.core.nms.methods;
|
package com.songoda.core.nms.anvil.methods;
|
||||||
|
|
||||||
public interface AnvilTextChange {
|
public interface AnvilTextChange {
|
||||||
|
|
23
NMS/NMS-API/src/com/songoda/core/nms/nbt/NBTCompound.java
Normal file
23
NMS/NMS-API/src/com/songoda/core/nms/nbt/NBTCompound.java
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
package com.songoda.core.nms.nbt;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface NBTCompound {
|
||||||
|
|
||||||
|
NBTCompound set(String tag, String s);
|
||||||
|
|
||||||
|
NBTCompound set(String tag, boolean b);
|
||||||
|
|
||||||
|
NBTCompound set(String tag, int i);
|
||||||
|
|
||||||
|
NBTCompound set(String tag, long l);
|
||||||
|
|
||||||
|
NBTCompound set(String tag, short s);
|
||||||
|
|
||||||
|
NBTCompound set(String tag, byte b);
|
||||||
|
|
||||||
|
boolean has(String tag);
|
||||||
|
|
||||||
|
NBTObject getNBTObject(String tag);
|
||||||
|
|
||||||
|
}
|
11
NMS/NMS-API/src/com/songoda/core/nms/nbt/NBTCore.java
Normal file
11
NMS/NMS-API/src/com/songoda/core/nms/nbt/NBTCore.java
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
package com.songoda.core.nms.nbt;
|
||||||
|
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public interface NBTCore {
|
||||||
|
|
||||||
|
NBTItem of(ItemStack item);
|
||||||
|
|
||||||
|
NBTCompound newCompound();
|
||||||
|
|
||||||
|
}
|
9
NMS/NMS-API/src/com/songoda/core/nms/nbt/NBTItem.java
Normal file
9
NMS/NMS-API/src/com/songoda/core/nms/nbt/NBTItem.java
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
package com.songoda.core.nms.nbt;
|
||||||
|
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public interface NBTItem extends NBTCompound {
|
||||||
|
|
||||||
|
ItemStack finish();
|
||||||
|
|
||||||
|
}
|
18
NMS/NMS-API/src/com/songoda/core/nms/nbt/NBTObject.java
Normal file
18
NMS/NMS-API/src/com/songoda/core/nms/nbt/NBTObject.java
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
package com.songoda.core.nms.nbt;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface NBTObject {
|
||||||
|
|
||||||
|
String asString();
|
||||||
|
|
||||||
|
boolean asBoolean();
|
||||||
|
|
||||||
|
int asInt();
|
||||||
|
|
||||||
|
long asLong();
|
||||||
|
|
||||||
|
short asShort();
|
||||||
|
|
||||||
|
byte asByte();
|
||||||
|
}
|
@ -1,12 +1,11 @@
|
|||||||
package com.songoda.core.nms.v1_10_R1;
|
package com.songoda.core.nms.v1_10_R1.anvil;
|
||||||
|
|
||||||
import com.songoda.core.nms.CoreNMS;
|
import com.songoda.core.nms.anvil.CustomAnvil;
|
||||||
import com.songoda.core.nms.CustomAnvil;
|
|
||||||
import org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.InventoryHolder;
|
import org.bukkit.inventory.InventoryHolder;
|
||||||
|
|
||||||
public class NMS implements CoreNMS {
|
public class AnvilCore implements com.songoda.core.nms.anvil.AnvilCore {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CustomAnvil createAnvil(Player player) {
|
public CustomAnvil createAnvil(Player player) {
|
@ -1,4 +1,4 @@
|
|||||||
package com.songoda.core.nms.v1_10_R1;
|
package com.songoda.core.nms.v1_10_R1.anvil;
|
||||||
|
|
||||||
import net.minecraft.server.v1_10_R1.IInventory;
|
import net.minecraft.server.v1_10_R1.IInventory;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
@ -1,7 +1,7 @@
|
|||||||
package com.songoda.core.nms.v1_10_R1;
|
package com.songoda.core.nms.v1_10_R1.anvil;
|
||||||
|
|
||||||
import com.songoda.core.nms.CustomAnvil;
|
import com.songoda.core.nms.anvil.CustomAnvil;
|
||||||
import com.songoda.core.nms.methods.AnvilTextChange;
|
import com.songoda.core.nms.anvil.methods.AnvilTextChange;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
@ -0,0 +1,65 @@
|
|||||||
|
package com.songoda.core.nms.v1_10_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTCompound;
|
||||||
|
import com.songoda.core.nms.nbt.NBTObject;
|
||||||
|
import net.minecraft.server.v1_10_R1.NBTTagCompound;
|
||||||
|
|
||||||
|
public class NBTCompoundImpl implements NBTCompound {
|
||||||
|
|
||||||
|
protected NBTTagCompound compound;
|
||||||
|
|
||||||
|
protected NBTCompoundImpl(NBTTagCompound compound) {
|
||||||
|
this.compound = compound;
|
||||||
|
}
|
||||||
|
|
||||||
|
public NBTCompoundImpl() {
|
||||||
|
this.compound = new NBTTagCompound();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, String s) {
|
||||||
|
compound.setString(tag, s);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, boolean b) {
|
||||||
|
compound.setBoolean(tag, b);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, int i) {
|
||||||
|
compound.setInt(tag, i);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, long l) {
|
||||||
|
compound.setLong(tag, l);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, short s) {
|
||||||
|
compound.setShort(tag, s);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, byte b) {
|
||||||
|
compound.setByte(tag, b);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean has(String tag) {
|
||||||
|
return compound.hasKey(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTObject getNBTObject(String tag) {
|
||||||
|
return new NBTObjectImpl(compound, tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.songoda.core.nms.v1_10_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTCompound;
|
||||||
|
import com.songoda.core.nms.nbt.NBTCore;
|
||||||
|
import com.songoda.core.nms.nbt.NBTItem;
|
||||||
|
import org.bukkit.craftbukkit.v1_10_R1.inventory.CraftItemStack;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class NBTCoreImpl implements NBTCore {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTItem of(ItemStack item) {
|
||||||
|
return new NBTItemImpl(CraftItemStack.asNMSCopy(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound newCompound() {
|
||||||
|
return new NBTCompoundImpl();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.songoda.core.nms.v1_10_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTItem;
|
||||||
|
import net.minecraft.server.v1_10_R1.NBTTagCompound;
|
||||||
|
import org.bukkit.craftbukkit.v1_10_R1.inventory.CraftItemStack;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class NBTItemImpl extends NBTCompoundImpl implements NBTItem {
|
||||||
|
|
||||||
|
private net.minecraft.server.v1_10_R1.ItemStack nmsItem;
|
||||||
|
|
||||||
|
public NBTItemImpl(net.minecraft.server.v1_10_R1.ItemStack nmsItem) {
|
||||||
|
super(nmsItem.hasTag() ? nmsItem.getTag() : new NBTTagCompound());
|
||||||
|
this.nmsItem = nmsItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack finish() {
|
||||||
|
return CraftItemStack.asBukkitCopy(nmsItem);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.songoda.core.nms.v1_10_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTObject;
|
||||||
|
import net.minecraft.server.v1_10_R1.NBTTagCompound;
|
||||||
|
|
||||||
|
public class NBTObjectImpl implements NBTObject {
|
||||||
|
|
||||||
|
private final NBTTagCompound compound;
|
||||||
|
private final String tag;
|
||||||
|
|
||||||
|
public NBTObjectImpl(NBTTagCompound compound, String tag) {
|
||||||
|
this.compound = compound;
|
||||||
|
this.tag = tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String asString() {
|
||||||
|
return compound.getString(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean asBoolean() {
|
||||||
|
return compound.getBoolean(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int asInt() {
|
||||||
|
return compound.getInt(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long asLong() {
|
||||||
|
return compound.getLong(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public short asShort() {
|
||||||
|
return compound.getShort(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte asByte() {
|
||||||
|
return compound.getByte(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,12 +1,11 @@
|
|||||||
package com.songoda.core.nms.v1_11_R1;
|
package com.songoda.core.nms.v1_11_R1.anvil;
|
||||||
|
|
||||||
import com.songoda.core.nms.CoreNMS;
|
import com.songoda.core.nms.anvil.CustomAnvil;
|
||||||
import com.songoda.core.nms.CustomAnvil;
|
|
||||||
import org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.InventoryHolder;
|
import org.bukkit.inventory.InventoryHolder;
|
||||||
|
|
||||||
public class NMS implements CoreNMS {
|
public class AnvilCore implements com.songoda.core.nms.anvil.AnvilCore {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CustomAnvil createAnvil(Player player) {
|
public CustomAnvil createAnvil(Player player) {
|
@ -1,4 +1,4 @@
|
|||||||
package com.songoda.core.nms.v1_11_R1;
|
package com.songoda.core.nms.v1_11_R1.anvil;
|
||||||
|
|
||||||
import net.minecraft.server.v1_11_R1.ContainerAnvil;
|
import net.minecraft.server.v1_11_R1.ContainerAnvil;
|
||||||
import net.minecraft.server.v1_11_R1.IInventory;
|
import net.minecraft.server.v1_11_R1.IInventory;
|
@ -1,7 +1,7 @@
|
|||||||
package com.songoda.core.nms.v1_11_R1;
|
package com.songoda.core.nms.v1_11_R1.anvil;
|
||||||
|
|
||||||
import com.songoda.core.nms.CustomAnvil;
|
import com.songoda.core.nms.anvil.CustomAnvil;
|
||||||
import com.songoda.core.nms.methods.AnvilTextChange;
|
import com.songoda.core.nms.anvil.methods.AnvilTextChange;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
@ -0,0 +1,65 @@
|
|||||||
|
package com.songoda.core.nms.v1_11_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTCompound;
|
||||||
|
import com.songoda.core.nms.nbt.NBTObject;
|
||||||
|
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||||
|
|
||||||
|
public class NBTCompoundImpl implements NBTCompound {
|
||||||
|
|
||||||
|
protected NBTTagCompound compound;
|
||||||
|
|
||||||
|
protected NBTCompoundImpl(NBTTagCompound compound) {
|
||||||
|
this.compound = compound;
|
||||||
|
}
|
||||||
|
|
||||||
|
public NBTCompoundImpl() {
|
||||||
|
this.compound = new NBTTagCompound();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, String s) {
|
||||||
|
compound.setString(tag, s);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, boolean b) {
|
||||||
|
compound.setBoolean(tag, b);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, int i) {
|
||||||
|
compound.setInt(tag, i);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, long l) {
|
||||||
|
compound.setLong(tag, l);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, short s) {
|
||||||
|
compound.setShort(tag, s);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, byte b) {
|
||||||
|
compound.setByte(tag, b);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean has(String tag) {
|
||||||
|
return compound.hasKey(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTObject getNBTObject(String tag) {
|
||||||
|
return new NBTObjectImpl(compound, tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.songoda.core.nms.v1_11_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTCompound;
|
||||||
|
import com.songoda.core.nms.nbt.NBTCore;
|
||||||
|
import com.songoda.core.nms.nbt.NBTItem;
|
||||||
|
import org.bukkit.craftbukkit.v1_11_R1.inventory.CraftItemStack;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class NBTCoreImpl implements NBTCore {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTItem of(ItemStack item) {
|
||||||
|
return new NBTItemImpl(CraftItemStack.asNMSCopy(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound newCompound() {
|
||||||
|
return new NBTCompoundImpl();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.songoda.core.nms.v1_11_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTItem;
|
||||||
|
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||||
|
import org.bukkit.craftbukkit.v1_11_R1.inventory.CraftItemStack;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class NBTItemImpl extends NBTCompoundImpl implements NBTItem {
|
||||||
|
|
||||||
|
private net.minecraft.server.v1_11_R1.ItemStack nmsItem;
|
||||||
|
|
||||||
|
public NBTItemImpl(net.minecraft.server.v1_11_R1.ItemStack nmsItem) {
|
||||||
|
super(nmsItem.hasTag() ? nmsItem.getTag() : new NBTTagCompound());
|
||||||
|
this.nmsItem = nmsItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack finish() {
|
||||||
|
return CraftItemStack.asBukkitCopy(nmsItem);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.songoda.core.nms.v1_11_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTObject;
|
||||||
|
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||||
|
|
||||||
|
public class NBTObjectImpl implements NBTObject {
|
||||||
|
|
||||||
|
private final NBTTagCompound compound;
|
||||||
|
private final String tag;
|
||||||
|
|
||||||
|
public NBTObjectImpl(NBTTagCompound compound, String tag) {
|
||||||
|
this.compound = compound;
|
||||||
|
this.tag = tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String asString() {
|
||||||
|
return compound.getString(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean asBoolean() {
|
||||||
|
return compound.getBoolean(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int asInt() {
|
||||||
|
return compound.getInt(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long asLong() {
|
||||||
|
return compound.getLong(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public short asShort() {
|
||||||
|
return compound.getShort(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte asByte() {
|
||||||
|
return compound.getByte(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,12 +1,11 @@
|
|||||||
package com.songoda.core.nms.v1_12_R1;
|
package com.songoda.core.nms.v1_12_R1.anvil;
|
||||||
|
|
||||||
import com.songoda.core.nms.CoreNMS;
|
import com.songoda.core.nms.anvil.CustomAnvil;
|
||||||
import com.songoda.core.nms.CustomAnvil;
|
|
||||||
import org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.InventoryHolder;
|
import org.bukkit.inventory.InventoryHolder;
|
||||||
|
|
||||||
public class NMS implements CoreNMS {
|
public class AnvilCore implements com.songoda.core.nms.anvil.AnvilCore {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CustomAnvil createAnvil(Player player) {
|
public CustomAnvil createAnvil(Player player) {
|
@ -1,4 +1,4 @@
|
|||||||
package com.songoda.core.nms.v1_12_R1;
|
package com.songoda.core.nms.v1_12_R1.anvil;
|
||||||
|
|
||||||
import net.minecraft.server.v1_12_R1.ContainerAnvil;
|
import net.minecraft.server.v1_12_R1.ContainerAnvil;
|
||||||
import net.minecraft.server.v1_12_R1.IInventory;
|
import net.minecraft.server.v1_12_R1.IInventory;
|
@ -1,7 +1,7 @@
|
|||||||
package com.songoda.core.nms.v1_12_R1;
|
package com.songoda.core.nms.v1_12_R1.anvil;
|
||||||
|
|
||||||
import com.songoda.core.nms.CustomAnvil;
|
import com.songoda.core.nms.anvil.CustomAnvil;
|
||||||
import com.songoda.core.nms.methods.AnvilTextChange;
|
import com.songoda.core.nms.anvil.methods.AnvilTextChange;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
@ -0,0 +1,65 @@
|
|||||||
|
package com.songoda.core.nms.v1_12_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTCompound;
|
||||||
|
import com.songoda.core.nms.nbt.NBTObject;
|
||||||
|
import net.minecraft.server.v1_12_R1.NBTTagCompound;
|
||||||
|
|
||||||
|
public class NBTCompoundImpl implements NBTCompound {
|
||||||
|
|
||||||
|
protected NBTTagCompound compound;
|
||||||
|
|
||||||
|
protected NBTCompoundImpl(NBTTagCompound compound) {
|
||||||
|
this.compound = compound;
|
||||||
|
}
|
||||||
|
|
||||||
|
public NBTCompoundImpl() {
|
||||||
|
this.compound = new NBTTagCompound();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, String s) {
|
||||||
|
compound.setString(tag, s);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, boolean b) {
|
||||||
|
compound.setBoolean(tag, b);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, int i) {
|
||||||
|
compound.setInt(tag, i);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, long l) {
|
||||||
|
compound.setLong(tag, l);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, short s) {
|
||||||
|
compound.setShort(tag, s);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, byte b) {
|
||||||
|
compound.setByte(tag, b);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean has(String tag) {
|
||||||
|
return compound.hasKey(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTObject getNBTObject(String tag) {
|
||||||
|
return new NBTObjectImpl(compound, tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.songoda.core.nms.v1_12_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTCompound;
|
||||||
|
import com.songoda.core.nms.nbt.NBTCore;
|
||||||
|
import com.songoda.core.nms.nbt.NBTItem;
|
||||||
|
import org.bukkit.craftbukkit.v1_12_R1.inventory.CraftItemStack;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class NBTCoreImpl implements NBTCore {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTItem of(ItemStack item) {
|
||||||
|
return new NBTItemImpl(CraftItemStack.asNMSCopy(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound newCompound() {
|
||||||
|
return new NBTCompoundImpl();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.songoda.core.nms.v1_12_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTItem;
|
||||||
|
import net.minecraft.server.v1_12_R1.NBTTagCompound;
|
||||||
|
import org.bukkit.craftbukkit.v1_12_R1.inventory.CraftItemStack;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class NBTItemImpl extends NBTCompoundImpl implements NBTItem {
|
||||||
|
|
||||||
|
private net.minecraft.server.v1_12_R1.ItemStack nmsItem;
|
||||||
|
|
||||||
|
public NBTItemImpl(net.minecraft.server.v1_12_R1.ItemStack nmsItem) {
|
||||||
|
super(nmsItem.hasTag() ? nmsItem.getTag() : new NBTTagCompound());
|
||||||
|
this.nmsItem = nmsItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack finish() {
|
||||||
|
return CraftItemStack.asBukkitCopy(nmsItem);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.songoda.core.nms.v1_12_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTObject;
|
||||||
|
import net.minecraft.server.v1_12_R1.NBTTagCompound;
|
||||||
|
|
||||||
|
public class NBTObjectImpl implements NBTObject {
|
||||||
|
|
||||||
|
private final NBTTagCompound compound;
|
||||||
|
private final String tag;
|
||||||
|
|
||||||
|
public NBTObjectImpl(NBTTagCompound compound, String tag) {
|
||||||
|
this.compound = compound;
|
||||||
|
this.tag = tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String asString() {
|
||||||
|
return compound.getString(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean asBoolean() {
|
||||||
|
return compound.getBoolean(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int asInt() {
|
||||||
|
return compound.getInt(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long asLong() {
|
||||||
|
return compound.getLong(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public short asShort() {
|
||||||
|
return compound.getShort(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte asByte() {
|
||||||
|
return compound.getByte(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,12 +1,11 @@
|
|||||||
package com.songoda.core.nms.v1_13_R1;
|
package com.songoda.core.nms.v1_13_R1.anvil;
|
||||||
|
|
||||||
import com.songoda.core.nms.CoreNMS;
|
import com.songoda.core.nms.anvil.CustomAnvil;
|
||||||
import com.songoda.core.nms.CustomAnvil;
|
|
||||||
import org.bukkit.craftbukkit.v1_13_R1.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_13_R1.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.InventoryHolder;
|
import org.bukkit.inventory.InventoryHolder;
|
||||||
|
|
||||||
public class NMS implements CoreNMS {
|
public class AnvilCore implements com.songoda.core.nms.anvil.AnvilCore {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CustomAnvil createAnvil(Player player) {
|
public CustomAnvil createAnvil(Player player) {
|
@ -1,4 +1,4 @@
|
|||||||
package com.songoda.core.nms.v1_13_R1;
|
package com.songoda.core.nms.v1_13_R1.anvil;
|
||||||
|
|
||||||
import net.minecraft.server.v1_13_R1.ContainerAnvil;
|
import net.minecraft.server.v1_13_R1.ContainerAnvil;
|
||||||
import net.minecraft.server.v1_13_R1.IInventory;
|
import net.minecraft.server.v1_13_R1.IInventory;
|
@ -1,28 +1,23 @@
|
|||||||
package com.songoda.core.nms.v1_13_R1;
|
package com.songoda.core.nms.v1_13_R1.anvil;
|
||||||
|
|
||||||
import com.songoda.core.nms.CustomAnvil;
|
import com.songoda.core.nms.anvil.CustomAnvil;
|
||||||
import com.songoda.core.nms.methods.AnvilTextChange;
|
import com.songoda.core.nms.anvil.methods.AnvilTextChange;
|
||||||
import java.lang.reflect.Field;
|
import net.minecraft.server.v1_13_R1.*;
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
import net.minecraft.server.v1_13_R1.BlockPosition;
|
|
||||||
import net.minecraft.server.v1_13_R1.ChatMessage;
|
|
||||||
import net.minecraft.server.v1_13_R1.ContainerAnvil;
|
|
||||||
import net.minecraft.server.v1_13_R1.EntityHuman;
|
|
||||||
import net.minecraft.server.v1_13_R1.EntityPlayer;
|
|
||||||
import net.minecraft.server.v1_13_R1.IInventory;
|
|
||||||
import net.minecraft.server.v1_13_R1.PacketPlayOutOpenWindow;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.craftbukkit.v1_13_R1.inventory.CraftInventoryView;
|
import org.bukkit.craftbukkit.v1_13_R1.inventory.CraftInventoryView;
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
import org.bukkit.inventory.InventoryHolder;
|
import org.bukkit.inventory.InventoryHolder;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
public class AnvilView extends ContainerAnvil implements CustomAnvil {
|
public class AnvilView extends ContainerAnvil implements CustomAnvil {
|
||||||
|
|
||||||
EntityPlayer entity;
|
private final EntityPlayer entity;
|
||||||
Inventory inventory;
|
private final Inventory inventory;
|
||||||
String title = "Repairing";
|
private String title = "Repairing";
|
||||||
private int cost = -1;
|
private int cost = -1;
|
||||||
private boolean canUse = true;
|
private boolean canUse = true;
|
||||||
private AnvilTextChange textChange = null;
|
private AnvilTextChange textChange = null;
|
||||||
@ -34,21 +29,12 @@ public class AnvilView extends ContainerAnvil implements CustomAnvil {
|
|||||||
|
|
||||||
static {
|
static {
|
||||||
try {
|
try {
|
||||||
mc_ContainerAnvil_bukkitEntity = ContainerAnvil.class.getDeclaredField("bukkitEntity");
|
|
||||||
mc_ContainerAnvil_bukkitEntity.setAccessible(true);
|
|
||||||
mc_ContainerAnvil_repairInventory = ContainerAnvil.class.getDeclaredField("repairInventory");
|
mc_ContainerAnvil_repairInventory = ContainerAnvil.class.getDeclaredField("repairInventory");
|
||||||
mc_ContainerAnvil_repairInventory.setAccessible(true);
|
mc_ContainerAnvil_repairInventory.setAccessible(true);
|
||||||
mc_ContainerAnvil_resultInventory = ContainerAnvil.class.getDeclaredField("resultInventory");
|
mc_ContainerAnvil_resultInventory = ContainerAnvil.class.getDeclaredField("resultInventory");
|
||||||
mc_ContainerAnvil_resultInventory.setAccessible(true);
|
mc_ContainerAnvil_resultInventory.setAccessible(true);
|
||||||
} catch (NoSuchFieldException ignore) {
|
mc_ContainerAnvil_bukkitEntity = ContainerAnvil.class.getDeclaredField("bukkitEntity");
|
||||||
try {
|
mc_ContainerAnvil_bukkitEntity.setAccessible(true);
|
||||||
mc_ContainerAnvil_repairInventory = ContainerAnvil.class.getDeclaredField("h");
|
|
||||||
mc_ContainerAnvil_repairInventory.setAccessible(true);
|
|
||||||
mc_ContainerAnvil_resultInventory = ContainerAnvil.class.getDeclaredField("g");
|
|
||||||
mc_ContainerAnvil_resultInventory.setAccessible(true);
|
|
||||||
} catch (Exception ex) {
|
|
||||||
Logger.getLogger(AnvilView.class.getName()).log(Level.SEVERE, "Anvil Setup Error", ex);
|
|
||||||
}
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Logger.getLogger(AnvilView.class.getName()).log(Level.SEVERE, "Anvil Setup Error", ex);
|
Logger.getLogger(AnvilView.class.getName()).log(Level.SEVERE, "Anvil Setup Error", ex);
|
||||||
}
|
}
|
@ -0,0 +1,65 @@
|
|||||||
|
package com.songoda.core.nms.v1_13_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTCompound;
|
||||||
|
import com.songoda.core.nms.nbt.NBTObject;
|
||||||
|
import net.minecraft.server.v1_13_R1.NBTTagCompound;
|
||||||
|
|
||||||
|
public class NBTCompoundImpl implements NBTCompound {
|
||||||
|
|
||||||
|
protected NBTTagCompound compound;
|
||||||
|
|
||||||
|
protected NBTCompoundImpl(NBTTagCompound compound) {
|
||||||
|
this.compound = compound;
|
||||||
|
}
|
||||||
|
|
||||||
|
public NBTCompoundImpl() {
|
||||||
|
this.compound = new NBTTagCompound();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, String s) {
|
||||||
|
compound.setString(tag, s);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, boolean b) {
|
||||||
|
compound.setBoolean(tag, b);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, int i) {
|
||||||
|
compound.setInt(tag, i);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, long l) {
|
||||||
|
compound.setLong(tag, l);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, short s) {
|
||||||
|
compound.setShort(tag, s);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, byte b) {
|
||||||
|
compound.setByte(tag, b);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean has(String tag) {
|
||||||
|
return compound.hasKey(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTObject getNBTObject(String tag) {
|
||||||
|
return new NBTObjectImpl(compound, tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.songoda.core.nms.v1_13_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTCompound;
|
||||||
|
import com.songoda.core.nms.nbt.NBTCore;
|
||||||
|
import com.songoda.core.nms.nbt.NBTItem;
|
||||||
|
import org.bukkit.craftbukkit.v1_13_R1.inventory.CraftItemStack;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class NBTCoreImpl implements NBTCore {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTItem of(ItemStack item) {
|
||||||
|
return new NBTItemImpl(CraftItemStack.asNMSCopy(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound newCompound() {
|
||||||
|
return new NBTCompoundImpl();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.songoda.core.nms.v1_13_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTItem;
|
||||||
|
import net.minecraft.server.v1_13_R1.NBTTagCompound;
|
||||||
|
import org.bukkit.craftbukkit.v1_13_R1.inventory.CraftItemStack;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class NBTItemImpl extends NBTCompoundImpl implements NBTItem {
|
||||||
|
|
||||||
|
private net.minecraft.server.v1_13_R1.ItemStack nmsItem;
|
||||||
|
|
||||||
|
public NBTItemImpl(net.minecraft.server.v1_13_R1.ItemStack nmsItem) {
|
||||||
|
super(nmsItem.hasTag() ? nmsItem.getTag() : new NBTTagCompound());
|
||||||
|
this.nmsItem = nmsItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack finish() {
|
||||||
|
return CraftItemStack.asBukkitCopy(nmsItem);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.songoda.core.nms.v1_13_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTObject;
|
||||||
|
import net.minecraft.server.v1_13_R1.NBTTagCompound;
|
||||||
|
|
||||||
|
public class NBTObjectImpl implements NBTObject {
|
||||||
|
|
||||||
|
private final NBTTagCompound compound;
|
||||||
|
private final String tag;
|
||||||
|
|
||||||
|
public NBTObjectImpl(NBTTagCompound compound, String tag) {
|
||||||
|
this.compound = compound;
|
||||||
|
this.tag = tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String asString() {
|
||||||
|
return compound.getString(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean asBoolean() {
|
||||||
|
return compound.getBoolean(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int asInt() {
|
||||||
|
return compound.getInt(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long asLong() {
|
||||||
|
return compound.getLong(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public short asShort() {
|
||||||
|
return compound.getShort(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte asByte() {
|
||||||
|
return compound.getByte(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,12 +1,11 @@
|
|||||||
package com.songoda.core.nms.v1_13_R2;
|
package com.songoda.core.nms.v1_13_R2.anvil;
|
||||||
|
|
||||||
import com.songoda.core.nms.CoreNMS;
|
import com.songoda.core.nms.anvil.CustomAnvil;
|
||||||
import com.songoda.core.nms.CustomAnvil;
|
|
||||||
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.InventoryHolder;
|
import org.bukkit.inventory.InventoryHolder;
|
||||||
|
|
||||||
public class NMS implements CoreNMS {
|
public class AnvilCore implements com.songoda.core.nms.anvil.AnvilCore {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CustomAnvil createAnvil(Player player) {
|
public CustomAnvil createAnvil(Player player) {
|
@ -1,4 +1,4 @@
|
|||||||
package com.songoda.core.nms.v1_13_R2;
|
package com.songoda.core.nms.v1_13_R2.anvil;
|
||||||
|
|
||||||
import net.minecraft.server.v1_13_R2.ContainerAnvil;
|
import net.minecraft.server.v1_13_R2.ContainerAnvil;
|
||||||
import net.minecraft.server.v1_13_R2.IInventory;
|
import net.minecraft.server.v1_13_R2.IInventory;
|
@ -1,7 +1,7 @@
|
|||||||
package com.songoda.core.nms.v1_13_R2;
|
package com.songoda.core.nms.v1_13_R2.anvil;
|
||||||
|
|
||||||
import com.songoda.core.nms.CustomAnvil;
|
import com.songoda.core.nms.anvil.CustomAnvil;
|
||||||
import com.songoda.core.nms.methods.AnvilTextChange;
|
import com.songoda.core.nms.anvil.methods.AnvilTextChange;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
@ -0,0 +1,65 @@
|
|||||||
|
package com.songoda.core.nms.v1_13_R2.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTCompound;
|
||||||
|
import com.songoda.core.nms.nbt.NBTObject;
|
||||||
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
|
|
||||||
|
public class NBTCompoundImpl implements NBTCompound {
|
||||||
|
|
||||||
|
protected NBTTagCompound compound;
|
||||||
|
|
||||||
|
protected NBTCompoundImpl(NBTTagCompound compound) {
|
||||||
|
this.compound = compound;
|
||||||
|
}
|
||||||
|
|
||||||
|
public NBTCompoundImpl() {
|
||||||
|
this.compound = new NBTTagCompound();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, String s) {
|
||||||
|
compound.setString(tag, s);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, boolean b) {
|
||||||
|
compound.setBoolean(tag, b);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, int i) {
|
||||||
|
compound.setInt(tag, i);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, long l) {
|
||||||
|
compound.setLong(tag, l);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, short s) {
|
||||||
|
compound.setShort(tag, s);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, byte b) {
|
||||||
|
compound.setByte(tag, b);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean has(String tag) {
|
||||||
|
return compound.hasKey(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTObject getNBTObject(String tag) {
|
||||||
|
return new NBTObjectImpl(compound, tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.songoda.core.nms.v1_13_R2.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTCompound;
|
||||||
|
import com.songoda.core.nms.nbt.NBTCore;
|
||||||
|
import com.songoda.core.nms.nbt.NBTItem;
|
||||||
|
import org.bukkit.craftbukkit.v1_13_R2.inventory.CraftItemStack;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class NBTCoreImpl implements NBTCore {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTItem of(ItemStack item) {
|
||||||
|
return new NBTItemImpl(CraftItemStack.asNMSCopy(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound newCompound() {
|
||||||
|
return new NBTCompoundImpl();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.songoda.core.nms.v1_13_R2.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTItem;
|
||||||
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
|
import org.bukkit.craftbukkit.v1_13_R2.inventory.CraftItemStack;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class NBTItemImpl extends NBTCompoundImpl implements NBTItem {
|
||||||
|
|
||||||
|
private net.minecraft.server.v1_13_R2.ItemStack nmsItem;
|
||||||
|
|
||||||
|
public NBTItemImpl(net.minecraft.server.v1_13_R2.ItemStack nmsItem) {
|
||||||
|
super(nmsItem.hasTag() ? nmsItem.getTag() : new NBTTagCompound());
|
||||||
|
this.nmsItem = nmsItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack finish() {
|
||||||
|
return CraftItemStack.asBukkitCopy(nmsItem);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.songoda.core.nms.v1_13_R2.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTObject;
|
||||||
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
|
|
||||||
|
public class NBTObjectImpl implements NBTObject {
|
||||||
|
|
||||||
|
private final NBTTagCompound compound;
|
||||||
|
private final String tag;
|
||||||
|
|
||||||
|
public NBTObjectImpl(NBTTagCompound compound, String tag) {
|
||||||
|
this.compound = compound;
|
||||||
|
this.tag = tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String asString() {
|
||||||
|
return compound.getString(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean asBoolean() {
|
||||||
|
return compound.getBoolean(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int asInt() {
|
||||||
|
return compound.getInt(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long asLong() {
|
||||||
|
return compound.getLong(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public short asShort() {
|
||||||
|
return compound.getShort(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte asByte() {
|
||||||
|
return compound.getByte(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,13 +1,12 @@
|
|||||||
package com.songoda.core.nms.v1_14_R1;
|
package com.songoda.core.nms.v1_14_R1.anvil;
|
||||||
|
|
||||||
import com.songoda.core.nms.CoreNMS;
|
import com.songoda.core.nms.anvil.CustomAnvil;
|
||||||
import com.songoda.core.nms.CustomAnvil;
|
|
||||||
import net.minecraft.server.v1_14_R1.EntityPlayer;
|
import net.minecraft.server.v1_14_R1.EntityPlayer;
|
||||||
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.InventoryHolder;
|
import org.bukkit.inventory.InventoryHolder;
|
||||||
|
|
||||||
public class NMS implements CoreNMS {
|
public class AnvilCore implements com.songoda.core.nms.anvil.AnvilCore {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CustomAnvil createAnvil(Player player) {
|
public CustomAnvil createAnvil(Player player) {
|
@ -1,4 +1,4 @@
|
|||||||
package com.songoda.core.nms.v1_14_R1;
|
package com.songoda.core.nms.v1_14_R1.anvil;
|
||||||
|
|
||||||
import net.minecraft.server.v1_14_R1.ContainerAnvil;
|
import net.minecraft.server.v1_14_R1.ContainerAnvil;
|
||||||
import net.minecraft.server.v1_14_R1.IInventory;
|
import net.minecraft.server.v1_14_R1.IInventory;
|
@ -1,7 +1,7 @@
|
|||||||
package com.songoda.core.nms.v1_14_R1;
|
package com.songoda.core.nms.v1_14_R1.anvil;
|
||||||
|
|
||||||
import com.songoda.core.nms.CustomAnvil;
|
import com.songoda.core.nms.anvil.CustomAnvil;
|
||||||
import com.songoda.core.nms.methods.AnvilTextChange;
|
import com.songoda.core.nms.anvil.methods.AnvilTextChange;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
@ -0,0 +1,65 @@
|
|||||||
|
package com.songoda.core.nms.v1_14_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTCompound;
|
||||||
|
import com.songoda.core.nms.nbt.NBTObject;
|
||||||
|
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
||||||
|
|
||||||
|
public class NBTCompoundImpl implements NBTCompound {
|
||||||
|
|
||||||
|
protected NBTTagCompound compound;
|
||||||
|
|
||||||
|
protected NBTCompoundImpl(NBTTagCompound compound) {
|
||||||
|
this.compound = compound;
|
||||||
|
}
|
||||||
|
|
||||||
|
public NBTCompoundImpl() {
|
||||||
|
this.compound = new NBTTagCompound();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, String s) {
|
||||||
|
compound.setString(tag, s);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, boolean b) {
|
||||||
|
compound.setBoolean(tag, b);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, int i) {
|
||||||
|
compound.setInt(tag, i);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, long l) {
|
||||||
|
compound.setLong(tag, l);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, short s) {
|
||||||
|
compound.setShort(tag, s);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, byte b) {
|
||||||
|
compound.setByte(tag, b);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean has(String tag) {
|
||||||
|
return compound.hasKey(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTObject getNBTObject(String tag) {
|
||||||
|
return new NBTObjectImpl(compound, tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.songoda.core.nms.v1_14_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTCompound;
|
||||||
|
import com.songoda.core.nms.nbt.NBTCore;
|
||||||
|
import com.songoda.core.nms.nbt.NBTItem;
|
||||||
|
import org.bukkit.craftbukkit.v1_14_R1.inventory.CraftItemStack;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class NBTCoreImpl implements NBTCore {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTItem of(ItemStack item) {
|
||||||
|
return new NBTItemImpl(CraftItemStack.asNMSCopy(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound newCompound() {
|
||||||
|
return new NBTCompoundImpl();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.songoda.core.nms.v1_14_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTItem;
|
||||||
|
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
||||||
|
import org.bukkit.craftbukkit.v1_14_R1.inventory.CraftItemStack;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class NBTItemImpl extends NBTCompoundImpl implements NBTItem {
|
||||||
|
|
||||||
|
private net.minecraft.server.v1_14_R1.ItemStack nmsItem;
|
||||||
|
|
||||||
|
public NBTItemImpl(net.minecraft.server.v1_14_R1.ItemStack nmsItem) {
|
||||||
|
super(nmsItem.hasTag() ? nmsItem.getTag() : new NBTTagCompound());
|
||||||
|
this.nmsItem = nmsItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack finish() {
|
||||||
|
return CraftItemStack.asBukkitCopy(nmsItem);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.songoda.core.nms.v1_14_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTObject;
|
||||||
|
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
||||||
|
|
||||||
|
public class NBTObjectImpl implements NBTObject {
|
||||||
|
|
||||||
|
private final NBTTagCompound compound;
|
||||||
|
private final String tag;
|
||||||
|
|
||||||
|
public NBTObjectImpl(NBTTagCompound compound, String tag) {
|
||||||
|
this.compound = compound;
|
||||||
|
this.tag = tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String asString() {
|
||||||
|
return compound.getString(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean asBoolean() {
|
||||||
|
return compound.getBoolean(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int asInt() {
|
||||||
|
return compound.getInt(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long asLong() {
|
||||||
|
return compound.getLong(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public short asShort() {
|
||||||
|
return compound.getShort(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte asByte() {
|
||||||
|
return compound.getByte(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,13 +1,12 @@
|
|||||||
package com.songoda.core.nms.v1_15_R1;
|
package com.songoda.core.nms.v1_15_R1.anvil;
|
||||||
|
|
||||||
import com.songoda.core.nms.CoreNMS;
|
import com.songoda.core.nms.anvil.CustomAnvil;
|
||||||
import com.songoda.core.nms.CustomAnvil;
|
|
||||||
import net.minecraft.server.v1_15_R1.EntityPlayer;
|
import net.minecraft.server.v1_15_R1.EntityPlayer;
|
||||||
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.InventoryHolder;
|
import org.bukkit.inventory.InventoryHolder;
|
||||||
|
|
||||||
public class NMS implements CoreNMS {
|
public class AnvilCore implements com.songoda.core.nms.anvil.AnvilCore {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CustomAnvil createAnvil(Player player) {
|
public CustomAnvil createAnvil(Player player) {
|
@ -1,4 +1,4 @@
|
|||||||
package com.songoda.core.nms.v1_15_R1;
|
package com.songoda.core.nms.v1_15_R1.anvil;
|
||||||
|
|
||||||
import net.minecraft.server.v1_15_R1.ContainerAnvil;
|
import net.minecraft.server.v1_15_R1.ContainerAnvil;
|
||||||
import net.minecraft.server.v1_15_R1.IInventory;
|
import net.minecraft.server.v1_15_R1.IInventory;
|
@ -1,7 +1,7 @@
|
|||||||
package com.songoda.core.nms.v1_15_R1;
|
package com.songoda.core.nms.v1_15_R1.anvil;
|
||||||
|
|
||||||
import com.songoda.core.nms.CustomAnvil;
|
import com.songoda.core.nms.anvil.CustomAnvil;
|
||||||
import com.songoda.core.nms.methods.AnvilTextChange;
|
import com.songoda.core.nms.anvil.methods.AnvilTextChange;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.lang.reflect.Modifier;
|
import java.lang.reflect.Modifier;
|
@ -0,0 +1,68 @@
|
|||||||
|
package com.songoda.core.nms.v1_15_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTCompound;
|
||||||
|
import com.songoda.core.nms.nbt.NBTObject;
|
||||||
|
import net.minecraft.server.v1_15_R1.NBTTagCompound;
|
||||||
|
import net.minecraft.server.v1_15_R1.NBTTagList;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class NBTCompoundImpl implements NBTCompound {
|
||||||
|
|
||||||
|
protected NBTTagCompound compound;
|
||||||
|
|
||||||
|
protected NBTCompoundImpl(NBTTagCompound compound) {
|
||||||
|
this.compound = compound;
|
||||||
|
}
|
||||||
|
|
||||||
|
public NBTCompoundImpl() {
|
||||||
|
this.compound = new NBTTagCompound();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, String s) {
|
||||||
|
compound.setString(tag, s);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, boolean b) {
|
||||||
|
compound.setBoolean(tag, b);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, int i) {
|
||||||
|
compound.setInt(tag, i);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, long l) {
|
||||||
|
compound.setLong(tag, l);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, short s) {
|
||||||
|
compound.setShort(tag, s);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, byte b) {
|
||||||
|
compound.setByte(tag, b);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean has(String tag) {
|
||||||
|
return compound.hasKey(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTObject getNBTObject(String tag) {
|
||||||
|
return new NBTObjectImpl(compound, tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.songoda.core.nms.v1_15_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTCompound;
|
||||||
|
import com.songoda.core.nms.nbt.NBTCore;
|
||||||
|
import com.songoda.core.nms.nbt.NBTItem;
|
||||||
|
import org.bukkit.craftbukkit.v1_15_R1.inventory.CraftItemStack;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class NBTCoreImpl implements NBTCore {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTItem of(ItemStack item) {
|
||||||
|
return new NBTItemImpl(CraftItemStack.asNMSCopy(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound newCompound() {
|
||||||
|
return new NBTCompoundImpl();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.songoda.core.nms.v1_15_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTItem;
|
||||||
|
import net.minecraft.server.v1_15_R1.NBTTagCompound;
|
||||||
|
import org.bukkit.craftbukkit.v1_15_R1.inventory.CraftItemStack;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class NBTItemImpl extends NBTCompoundImpl implements NBTItem {
|
||||||
|
|
||||||
|
private net.minecraft.server.v1_15_R1.ItemStack nmsItem;
|
||||||
|
|
||||||
|
public NBTItemImpl(net.minecraft.server.v1_15_R1.ItemStack nmsItem) {
|
||||||
|
super(nmsItem.hasTag() ? nmsItem.getTag() : new NBTTagCompound());
|
||||||
|
this.nmsItem = nmsItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack finish() {
|
||||||
|
return CraftItemStack.asBukkitCopy(nmsItem);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.songoda.core.nms.v1_15_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTObject;
|
||||||
|
import net.minecraft.server.v1_15_R1.NBTTagCompound;
|
||||||
|
|
||||||
|
public class NBTObjectImpl implements NBTObject {
|
||||||
|
|
||||||
|
private final NBTTagCompound compound;
|
||||||
|
private final String tag;
|
||||||
|
|
||||||
|
public NBTObjectImpl(NBTTagCompound compound, String tag) {
|
||||||
|
this.compound = compound;
|
||||||
|
this.tag = tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String asString() {
|
||||||
|
return compound.getString(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean asBoolean() {
|
||||||
|
return compound.getBoolean(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int asInt() {
|
||||||
|
return compound.getInt(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long asLong() {
|
||||||
|
return compound.getLong(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public short asShort() {
|
||||||
|
return compound.getShort(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte asByte() {
|
||||||
|
return compound.getByte(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,12 +1,11 @@
|
|||||||
package com.songoda.core.nms.v1_8_R1;
|
package com.songoda.core.nms.v1_8_R1.anvil;
|
||||||
|
|
||||||
import com.songoda.core.nms.CoreNMS;
|
import com.songoda.core.nms.anvil.CustomAnvil;
|
||||||
import com.songoda.core.nms.CustomAnvil;
|
|
||||||
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.InventoryHolder;
|
import org.bukkit.inventory.InventoryHolder;
|
||||||
|
|
||||||
public class NMS implements CoreNMS {
|
public class AnvilCore implements com.songoda.core.nms.anvil.AnvilCore {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CustomAnvil createAnvil(Player player) {
|
public CustomAnvil createAnvil(Player player) {
|
@ -1,4 +1,4 @@
|
|||||||
package com.songoda.core.nms.v1_8_R1;
|
package com.songoda.core.nms.v1_8_R1.anvil;
|
||||||
|
|
||||||
import net.minecraft.server.v1_8_R1.IInventory;
|
import net.minecraft.server.v1_8_R1.IInventory;
|
||||||
import org.bukkit.craftbukkit.v1_8_R1.inventory.CraftInventoryAnvil;
|
import org.bukkit.craftbukkit.v1_8_R1.inventory.CraftInventoryAnvil;
|
@ -1,7 +1,7 @@
|
|||||||
package com.songoda.core.nms.v1_8_R1;
|
package com.songoda.core.nms.v1_8_R1.anvil;
|
||||||
|
|
||||||
import com.songoda.core.nms.CustomAnvil;
|
import com.songoda.core.nms.anvil.CustomAnvil;
|
||||||
import com.songoda.core.nms.methods.AnvilTextChange;
|
import com.songoda.core.nms.anvil.methods.AnvilTextChange;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
@ -0,0 +1,65 @@
|
|||||||
|
package com.songoda.core.nms.v1_8_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTCompound;
|
||||||
|
import com.songoda.core.nms.nbt.NBTObject;
|
||||||
|
import net.minecraft.server.v1_8_R1.NBTTagCompound;
|
||||||
|
|
||||||
|
public class NBTCompoundImpl implements NBTCompound {
|
||||||
|
|
||||||
|
protected NBTTagCompound compound;
|
||||||
|
|
||||||
|
protected NBTCompoundImpl(NBTTagCompound compound) {
|
||||||
|
this.compound = compound;
|
||||||
|
}
|
||||||
|
|
||||||
|
public NBTCompoundImpl() {
|
||||||
|
this.compound = new NBTTagCompound();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, String s) {
|
||||||
|
compound.setString(tag, s);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, boolean b) {
|
||||||
|
compound.setBoolean(tag, b);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, int i) {
|
||||||
|
compound.setInt(tag, i);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, long l) {
|
||||||
|
compound.setLong(tag, l);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, short s) {
|
||||||
|
compound.setShort(tag, s);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, byte b) {
|
||||||
|
compound.setByte(tag, b);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean has(String tag) {
|
||||||
|
return compound.hasKey(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTObject getNBTObject(String tag) {
|
||||||
|
return new NBTObjectImpl(compound, tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.songoda.core.nms.v1_8_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTCompound;
|
||||||
|
import com.songoda.core.nms.nbt.NBTCore;
|
||||||
|
import com.songoda.core.nms.nbt.NBTItem;
|
||||||
|
import org.bukkit.craftbukkit.v1_8_R1.inventory.CraftItemStack;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class NBTCoreImpl implements NBTCore {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTItem of(ItemStack item) {
|
||||||
|
return new NBTItemImpl(CraftItemStack.asNMSCopy(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound newCompound() {
|
||||||
|
return new NBTCompoundImpl();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.songoda.core.nms.v1_8_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTItem;
|
||||||
|
import net.minecraft.server.v1_8_R1.NBTTagCompound;
|
||||||
|
import org.bukkit.craftbukkit.v1_8_R1.inventory.CraftItemStack;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class NBTItemImpl extends NBTCompoundImpl implements NBTItem {
|
||||||
|
|
||||||
|
private net.minecraft.server.v1_8_R1.ItemStack nmsItem;
|
||||||
|
|
||||||
|
public NBTItemImpl(net.minecraft.server.v1_8_R1.ItemStack nmsItem) {
|
||||||
|
super(nmsItem.hasTag() ? nmsItem.getTag() : new NBTTagCompound());
|
||||||
|
this.nmsItem = nmsItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack finish() {
|
||||||
|
return CraftItemStack.asBukkitCopy(nmsItem);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.songoda.core.nms.v1_8_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTObject;
|
||||||
|
import net.minecraft.server.v1_8_R1.NBTTagCompound;
|
||||||
|
|
||||||
|
public class NBTObjectImpl implements NBTObject {
|
||||||
|
|
||||||
|
private final NBTTagCompound compound;
|
||||||
|
private final String tag;
|
||||||
|
|
||||||
|
public NBTObjectImpl(NBTTagCompound compound, String tag) {
|
||||||
|
this.compound = compound;
|
||||||
|
this.tag = tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String asString() {
|
||||||
|
return compound.getString(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean asBoolean() {
|
||||||
|
return compound.getBoolean(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int asInt() {
|
||||||
|
return compound.getInt(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long asLong() {
|
||||||
|
return compound.getLong(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public short asShort() {
|
||||||
|
return compound.getShort(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte asByte() {
|
||||||
|
return compound.getByte(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,12 +1,11 @@
|
|||||||
package com.songoda.core.nms.v1_8_R2;
|
package com.songoda.core.nms.v1_8_R2.anvil;
|
||||||
|
|
||||||
import com.songoda.core.nms.CoreNMS;
|
import com.songoda.core.nms.anvil.CustomAnvil;
|
||||||
import com.songoda.core.nms.CustomAnvil;
|
|
||||||
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.InventoryHolder;
|
import org.bukkit.inventory.InventoryHolder;
|
||||||
|
|
||||||
public class NMS implements CoreNMS {
|
public class AnvilCore implements com.songoda.core.nms.anvil.AnvilCore {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CustomAnvil createAnvil(Player player) {
|
public CustomAnvil createAnvil(Player player) {
|
@ -1,4 +1,4 @@
|
|||||||
package com.songoda.core.nms.v1_8_R2;
|
package com.songoda.core.nms.v1_8_R2.anvil;
|
||||||
|
|
||||||
import net.minecraft.server.v1_8_R2.IInventory;
|
import net.minecraft.server.v1_8_R2.IInventory;
|
||||||
import org.bukkit.craftbukkit.v1_8_R2.inventory.CraftInventoryAnvil;
|
import org.bukkit.craftbukkit.v1_8_R2.inventory.CraftInventoryAnvil;
|
@ -1,7 +1,7 @@
|
|||||||
package com.songoda.core.nms.v1_8_R2;
|
package com.songoda.core.nms.v1_8_R2.anvil;
|
||||||
|
|
||||||
import com.songoda.core.nms.CustomAnvil;
|
import com.songoda.core.nms.anvil.CustomAnvil;
|
||||||
import com.songoda.core.nms.methods.AnvilTextChange;
|
import com.songoda.core.nms.anvil.methods.AnvilTextChange;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
@ -0,0 +1,65 @@
|
|||||||
|
package com.songoda.core.nms.v1_8_R2.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTCompound;
|
||||||
|
import com.songoda.core.nms.nbt.NBTObject;
|
||||||
|
import net.minecraft.server.v1_8_R2.NBTTagCompound;
|
||||||
|
|
||||||
|
public class NBTCompoundImpl implements NBTCompound {
|
||||||
|
|
||||||
|
protected NBTTagCompound compound;
|
||||||
|
|
||||||
|
protected NBTCompoundImpl(NBTTagCompound compound) {
|
||||||
|
this.compound = compound;
|
||||||
|
}
|
||||||
|
|
||||||
|
public NBTCompoundImpl() {
|
||||||
|
this.compound = new NBTTagCompound();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, String s) {
|
||||||
|
compound.setString(tag, s);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, boolean b) {
|
||||||
|
compound.setBoolean(tag, b);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, int i) {
|
||||||
|
compound.setInt(tag, i);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, long l) {
|
||||||
|
compound.setLong(tag, l);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, short s) {
|
||||||
|
compound.setShort(tag, s);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, byte b) {
|
||||||
|
compound.setByte(tag, b);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean has(String tag) {
|
||||||
|
return compound.hasKey(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTObject getNBTObject(String tag) {
|
||||||
|
return new NBTObjectImpl(compound, tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.songoda.core.nms.v1_8_R2.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTCompound;
|
||||||
|
import com.songoda.core.nms.nbt.NBTCore;
|
||||||
|
import com.songoda.core.nms.nbt.NBTItem;
|
||||||
|
import org.bukkit.craftbukkit.v1_8_R2.inventory.CraftItemStack;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class NBTCoreImpl implements NBTCore {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTItem of(ItemStack item) {
|
||||||
|
return new NBTItemImpl(CraftItemStack.asNMSCopy(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound newCompound() {
|
||||||
|
return new NBTCompoundImpl();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.songoda.core.nms.v1_8_R2.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTItem;
|
||||||
|
import net.minecraft.server.v1_8_R2.NBTTagCompound;
|
||||||
|
import org.bukkit.craftbukkit.v1_8_R2.inventory.CraftItemStack;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class NBTItemImpl extends NBTCompoundImpl implements NBTItem {
|
||||||
|
|
||||||
|
private net.minecraft.server.v1_8_R2.ItemStack nmsItem;
|
||||||
|
|
||||||
|
public NBTItemImpl(net.minecraft.server.v1_8_R2.ItemStack nmsItem) {
|
||||||
|
super(nmsItem.hasTag() ? nmsItem.getTag() : new NBTTagCompound());
|
||||||
|
this.nmsItem = nmsItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack finish() {
|
||||||
|
return CraftItemStack.asBukkitCopy(nmsItem);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.songoda.core.nms.v1_8_R2.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTObject;
|
||||||
|
import net.minecraft.server.v1_8_R2.NBTTagCompound;
|
||||||
|
|
||||||
|
public class NBTObjectImpl implements NBTObject {
|
||||||
|
|
||||||
|
private final NBTTagCompound compound;
|
||||||
|
private final String tag;
|
||||||
|
|
||||||
|
public NBTObjectImpl(NBTTagCompound compound, String tag) {
|
||||||
|
this.compound = compound;
|
||||||
|
this.tag = tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String asString() {
|
||||||
|
return compound.getString(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean asBoolean() {
|
||||||
|
return compound.getBoolean(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int asInt() {
|
||||||
|
return compound.getInt(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long asLong() {
|
||||||
|
return compound.getLong(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public short asShort() {
|
||||||
|
return compound.getShort(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte asByte() {
|
||||||
|
return compound.getByte(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,12 +1,11 @@
|
|||||||
package com.songoda.core.nms.v1_8_R3;
|
package com.songoda.core.nms.v1_8_R3.anvil;
|
||||||
|
|
||||||
import com.songoda.core.nms.CoreNMS;
|
import com.songoda.core.nms.anvil.CustomAnvil;
|
||||||
import com.songoda.core.nms.CustomAnvil;
|
|
||||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.InventoryHolder;
|
import org.bukkit.inventory.InventoryHolder;
|
||||||
|
|
||||||
public class NMS implements CoreNMS {
|
public class AnvilCore implements com.songoda.core.nms.anvil.AnvilCore {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CustomAnvil createAnvil(Player player) {
|
public CustomAnvil createAnvil(Player player) {
|
@ -1,4 +1,4 @@
|
|||||||
package com.songoda.core.nms.v1_8_R3;
|
package com.songoda.core.nms.v1_8_R3.anvil;
|
||||||
|
|
||||||
import net.minecraft.server.v1_8_R3.IInventory;
|
import net.minecraft.server.v1_8_R3.IInventory;
|
||||||
import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftInventoryAnvil;
|
import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftInventoryAnvil;
|
@ -1,7 +1,7 @@
|
|||||||
package com.songoda.core.nms.v1_8_R3;
|
package com.songoda.core.nms.v1_8_R3.anvil;
|
||||||
|
|
||||||
import com.songoda.core.nms.CustomAnvil;
|
import com.songoda.core.nms.anvil.CustomAnvil;
|
||||||
import com.songoda.core.nms.methods.AnvilTextChange;
|
import com.songoda.core.nms.anvil.methods.AnvilTextChange;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
@ -0,0 +1,65 @@
|
|||||||
|
package com.songoda.core.nms.v1_8_R3.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTCompound;
|
||||||
|
import com.songoda.core.nms.nbt.NBTObject;
|
||||||
|
import net.minecraft.server.v1_8_R3.NBTTagCompound;
|
||||||
|
|
||||||
|
public class NBTCompoundImpl implements NBTCompound {
|
||||||
|
|
||||||
|
protected NBTTagCompound compound;
|
||||||
|
|
||||||
|
protected NBTCompoundImpl(NBTTagCompound compound) {
|
||||||
|
this.compound = compound;
|
||||||
|
}
|
||||||
|
|
||||||
|
public NBTCompoundImpl() {
|
||||||
|
this.compound = new NBTTagCompound();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, String s) {
|
||||||
|
compound.setString(tag, s);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, boolean b) {
|
||||||
|
compound.setBoolean(tag, b);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, int i) {
|
||||||
|
compound.setInt(tag, i);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, long l) {
|
||||||
|
compound.setLong(tag, l);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, short s) {
|
||||||
|
compound.setShort(tag, s);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, byte b) {
|
||||||
|
compound.setByte(tag, b);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean has(String tag) {
|
||||||
|
return compound.hasKey(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTObject getNBTObject(String tag) {
|
||||||
|
return new NBTObjectImpl(compound, tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.songoda.core.nms.v1_8_R3.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTCompound;
|
||||||
|
import com.songoda.core.nms.nbt.NBTCore;
|
||||||
|
import com.songoda.core.nms.nbt.NBTItem;
|
||||||
|
import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class NBTCoreImpl implements NBTCore {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTItem of(ItemStack item) {
|
||||||
|
return new NBTItemImpl(CraftItemStack.asNMSCopy(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound newCompound() {
|
||||||
|
return new NBTCompoundImpl();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.songoda.core.nms.v1_8_R3.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTItem;
|
||||||
|
import net.minecraft.server.v1_8_R3.NBTTagCompound;
|
||||||
|
import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class NBTItemImpl extends NBTCompoundImpl implements NBTItem {
|
||||||
|
|
||||||
|
private net.minecraft.server.v1_8_R3.ItemStack nmsItem;
|
||||||
|
|
||||||
|
public NBTItemImpl(net.minecraft.server.v1_8_R3.ItemStack nmsItem) {
|
||||||
|
super(nmsItem.hasTag() ? nmsItem.getTag() : new NBTTagCompound());
|
||||||
|
this.nmsItem = nmsItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack finish() {
|
||||||
|
return CraftItemStack.asBukkitCopy(nmsItem);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.songoda.core.nms.v1_8_R3.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTObject;
|
||||||
|
import net.minecraft.server.v1_8_R3.NBTTagCompound;
|
||||||
|
|
||||||
|
public class NBTObjectImpl implements NBTObject {
|
||||||
|
|
||||||
|
private final NBTTagCompound compound;
|
||||||
|
private final String tag;
|
||||||
|
|
||||||
|
public NBTObjectImpl(NBTTagCompound compound, String tag) {
|
||||||
|
this.compound = compound;
|
||||||
|
this.tag = tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String asString() {
|
||||||
|
return compound.getString(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean asBoolean() {
|
||||||
|
return compound.getBoolean(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int asInt() {
|
||||||
|
return compound.getInt(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long asLong() {
|
||||||
|
return compound.getLong(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public short asShort() {
|
||||||
|
return compound.getShort(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte asByte() {
|
||||||
|
return compound.getByte(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,12 +1,11 @@
|
|||||||
package com.songoda.core.nms.v1_9_R1;
|
package com.songoda.core.nms.v1_9_R1.anvil;
|
||||||
|
|
||||||
import com.songoda.core.nms.CoreNMS;
|
import com.songoda.core.nms.anvil.CustomAnvil;
|
||||||
import com.songoda.core.nms.CustomAnvil;
|
|
||||||
import org.bukkit.craftbukkit.v1_9_R1.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_9_R1.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.InventoryHolder;
|
import org.bukkit.inventory.InventoryHolder;
|
||||||
|
|
||||||
public class NMS implements CoreNMS {
|
public class AnvilCore implements com.songoda.core.nms.anvil.AnvilCore {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CustomAnvil createAnvil(Player player) {
|
public CustomAnvil createAnvil(Player player) {
|
@ -1,4 +1,4 @@
|
|||||||
package com.songoda.core.nms.v1_9_R1;
|
package com.songoda.core.nms.v1_9_R1.anvil;
|
||||||
|
|
||||||
import net.minecraft.server.v1_9_R1.IInventory;
|
import net.minecraft.server.v1_9_R1.IInventory;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
@ -1,7 +1,7 @@
|
|||||||
package com.songoda.core.nms.v1_9_R1;
|
package com.songoda.core.nms.v1_9_R1.anvil;
|
||||||
|
|
||||||
import com.songoda.core.nms.CustomAnvil;
|
import com.songoda.core.nms.anvil.CustomAnvil;
|
||||||
import com.songoda.core.nms.methods.AnvilTextChange;
|
import com.songoda.core.nms.anvil.methods.AnvilTextChange;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
@ -0,0 +1,65 @@
|
|||||||
|
package com.songoda.core.nms.v1_9_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTCompound;
|
||||||
|
import com.songoda.core.nms.nbt.NBTObject;
|
||||||
|
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||||
|
|
||||||
|
public class NBTCompoundImpl implements NBTCompound {
|
||||||
|
|
||||||
|
protected NBTTagCompound compound;
|
||||||
|
|
||||||
|
protected NBTCompoundImpl(NBTTagCompound compound) {
|
||||||
|
this.compound = compound;
|
||||||
|
}
|
||||||
|
|
||||||
|
public NBTCompoundImpl() {
|
||||||
|
this.compound = new NBTTagCompound();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, String s) {
|
||||||
|
compound.setString(tag, s);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, boolean b) {
|
||||||
|
compound.setBoolean(tag, b);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, int i) {
|
||||||
|
compound.setInt(tag, i);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, long l) {
|
||||||
|
compound.setLong(tag, l);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, short s) {
|
||||||
|
compound.setShort(tag, s);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, byte b) {
|
||||||
|
compound.setByte(tag, b);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean has(String tag) {
|
||||||
|
return compound.hasKey(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTObject getNBTObject(String tag) {
|
||||||
|
return new NBTObjectImpl(compound, tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.songoda.core.nms.v1_9_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTCompound;
|
||||||
|
import com.songoda.core.nms.nbt.NBTCore;
|
||||||
|
import com.songoda.core.nms.nbt.NBTItem;
|
||||||
|
import org.bukkit.craftbukkit.v1_9_R1.inventory.CraftItemStack;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class NBTCoreImpl implements NBTCore {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTItem of(ItemStack item) {
|
||||||
|
return new NBTItemImpl(CraftItemStack.asNMSCopy(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound newCompound() {
|
||||||
|
return new NBTCompoundImpl();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.songoda.core.nms.v1_9_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTItem;
|
||||||
|
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||||
|
import org.bukkit.craftbukkit.v1_9_R1.inventory.CraftItemStack;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class NBTItemImpl extends NBTCompoundImpl implements NBTItem {
|
||||||
|
|
||||||
|
private net.minecraft.server.v1_9_R1.ItemStack nmsItem;
|
||||||
|
|
||||||
|
public NBTItemImpl(net.minecraft.server.v1_9_R1.ItemStack nmsItem) {
|
||||||
|
super(nmsItem.hasTag() ? nmsItem.getTag() : new NBTTagCompound());
|
||||||
|
this.nmsItem = nmsItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack finish() {
|
||||||
|
return CraftItemStack.asBukkitCopy(nmsItem);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.songoda.core.nms.v1_9_R1.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTObject;
|
||||||
|
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||||
|
|
||||||
|
public class NBTObjectImpl implements NBTObject {
|
||||||
|
|
||||||
|
private final NBTTagCompound compound;
|
||||||
|
private final String tag;
|
||||||
|
|
||||||
|
public NBTObjectImpl(NBTTagCompound compound, String tag) {
|
||||||
|
this.compound = compound;
|
||||||
|
this.tag = tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String asString() {
|
||||||
|
return compound.getString(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean asBoolean() {
|
||||||
|
return compound.getBoolean(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int asInt() {
|
||||||
|
return compound.getInt(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long asLong() {
|
||||||
|
return compound.getLong(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public short asShort() {
|
||||||
|
return compound.getShort(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte asByte() {
|
||||||
|
return compound.getByte(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,12 +1,11 @@
|
|||||||
package com.songoda.core.nms.v1_9_R2;
|
package com.songoda.core.nms.v1_9_R2.anvil;
|
||||||
|
|
||||||
import com.songoda.core.nms.CoreNMS;
|
import com.songoda.core.nms.anvil.CustomAnvil;
|
||||||
import com.songoda.core.nms.CustomAnvil;
|
|
||||||
import org.bukkit.craftbukkit.v1_9_R2.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_9_R2.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.InventoryHolder;
|
import org.bukkit.inventory.InventoryHolder;
|
||||||
|
|
||||||
public class NMS implements CoreNMS {
|
public class AnvilCore implements com.songoda.core.nms.anvil.AnvilCore {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CustomAnvil createAnvil(Player player) {
|
public CustomAnvil createAnvil(Player player) {
|
@ -1,4 +1,4 @@
|
|||||||
package com.songoda.core.nms.v1_9_R2;
|
package com.songoda.core.nms.v1_9_R2.anvil;
|
||||||
|
|
||||||
import net.minecraft.server.v1_9_R2.IInventory;
|
import net.minecraft.server.v1_9_R2.IInventory;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
@ -1,7 +1,7 @@
|
|||||||
package com.songoda.core.nms.v1_9_R2;
|
package com.songoda.core.nms.v1_9_R2.anvil;
|
||||||
|
|
||||||
import com.songoda.core.nms.CustomAnvil;
|
import com.songoda.core.nms.anvil.CustomAnvil;
|
||||||
import com.songoda.core.nms.methods.AnvilTextChange;
|
import com.songoda.core.nms.anvil.methods.AnvilTextChange;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
@ -0,0 +1,65 @@
|
|||||||
|
package com.songoda.core.nms.v1_9_R2.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTCompound;
|
||||||
|
import com.songoda.core.nms.nbt.NBTObject;
|
||||||
|
import net.minecraft.server.v1_9_R2.NBTTagCompound;
|
||||||
|
|
||||||
|
public class NBTCompoundImpl implements NBTCompound {
|
||||||
|
|
||||||
|
protected NBTTagCompound compound;
|
||||||
|
|
||||||
|
protected NBTCompoundImpl(NBTTagCompound compound) {
|
||||||
|
this.compound = compound;
|
||||||
|
}
|
||||||
|
|
||||||
|
public NBTCompoundImpl() {
|
||||||
|
this.compound = new NBTTagCompound();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, String s) {
|
||||||
|
compound.setString(tag, s);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, boolean b) {
|
||||||
|
compound.setBoolean(tag, b);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, int i) {
|
||||||
|
compound.setInt(tag, i);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, long l) {
|
||||||
|
compound.setLong(tag, l);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, short s) {
|
||||||
|
compound.setShort(tag, s);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound set(String tag, byte b) {
|
||||||
|
compound.setByte(tag, b);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean has(String tag) {
|
||||||
|
return compound.hasKey(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTObject getNBTObject(String tag) {
|
||||||
|
return new NBTObjectImpl(compound, tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.songoda.core.nms.v1_9_R2.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTCompound;
|
||||||
|
import com.songoda.core.nms.nbt.NBTCore;
|
||||||
|
import com.songoda.core.nms.nbt.NBTItem;
|
||||||
|
import org.bukkit.craftbukkit.v1_9_R2.inventory.CraftItemStack;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class NBTCoreImpl implements NBTCore {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTItem of(ItemStack item) {
|
||||||
|
return new NBTItemImpl(CraftItemStack.asNMSCopy(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTCompound newCompound() {
|
||||||
|
return new NBTCompoundImpl();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.songoda.core.nms.v1_9_R2.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTItem;
|
||||||
|
import net.minecraft.server.v1_9_R2.NBTTagCompound;
|
||||||
|
import org.bukkit.craftbukkit.v1_9_R2.inventory.CraftItemStack;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class NBTItemImpl extends NBTCompoundImpl implements NBTItem {
|
||||||
|
|
||||||
|
private net.minecraft.server.v1_9_R2.ItemStack nmsItem;
|
||||||
|
|
||||||
|
public NBTItemImpl(net.minecraft.server.v1_9_R2.ItemStack nmsItem) {
|
||||||
|
super(nmsItem.hasTag() ? nmsItem.getTag() : new NBTTagCompound());
|
||||||
|
this.nmsItem = nmsItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack finish() {
|
||||||
|
return CraftItemStack.asBukkitCopy(nmsItem);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.songoda.core.nms.v1_9_R2.nbt;
|
||||||
|
|
||||||
|
import com.songoda.core.nms.nbt.NBTObject;
|
||||||
|
import net.minecraft.server.v1_9_R2.NBTTagCompound;
|
||||||
|
|
||||||
|
public class NBTObjectImpl implements NBTObject {
|
||||||
|
|
||||||
|
private final NBTTagCompound compound;
|
||||||
|
private final String tag;
|
||||||
|
|
||||||
|
public NBTObjectImpl(NBTTagCompound compound, String tag) {
|
||||||
|
this.compound = compound;
|
||||||
|
this.tag = tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String asString() {
|
||||||
|
return compound.getString(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean asBoolean() {
|
||||||
|
return compound.getBoolean(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int asInt() {
|
||||||
|
return compound.getInt(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long asLong() {
|
||||||
|
return compound.getLong(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public short asShort() {
|
||||||
|
return compound.getShort(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte asByte() {
|
||||||
|
return compound.getByte(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user