Add 1.15 compat
This commit is contained in:
parent
88ab61812b
commit
dfd43a63a0
@ -266,23 +266,51 @@ public class NMSImpl extends NMS {
|
|||||||
private Object toNBTBase(io.izzel.taboolib.module.nms.nbt.NBTBase base) {
|
private Object toNBTBase(io.izzel.taboolib.module.nms.nbt.NBTBase base) {
|
||||||
switch (base.getType().getId()) {
|
switch (base.getType().getId()) {
|
||||||
case 1:
|
case 1:
|
||||||
|
if (Version.isAfter(Version.v1_15)) {
|
||||||
|
return net.minecraft.server.v1_15_R1.NBTTagByte.a(base.asByte());
|
||||||
|
} else {
|
||||||
return new NBTTagByte(base.asByte());
|
return new NBTTagByte(base.asByte());
|
||||||
|
}
|
||||||
case 2:
|
case 2:
|
||||||
|
if (Version.isAfter(Version.v1_15)) {
|
||||||
|
return net.minecraft.server.v1_15_R1.NBTTagShort.a(base.asShort());
|
||||||
|
} else {
|
||||||
return new NBTTagShort(base.asShort());
|
return new NBTTagShort(base.asShort());
|
||||||
|
}
|
||||||
case 3:
|
case 3:
|
||||||
|
if (Version.isAfter(Version.v1_15)) {
|
||||||
|
return net.minecraft.server.v1_15_R1.NBTTagInt.a(base.asInt());
|
||||||
|
} else {
|
||||||
return new NBTTagInt(base.asInt());
|
return new NBTTagInt(base.asInt());
|
||||||
|
}
|
||||||
case 4:
|
case 4:
|
||||||
|
if (Version.isAfter(Version.v1_15)) {
|
||||||
|
return net.minecraft.server.v1_15_R1.NBTTagLong.a(base.asLong());
|
||||||
|
} else {
|
||||||
return new NBTTagLong(base.asLong());
|
return new NBTTagLong(base.asLong());
|
||||||
|
}
|
||||||
case 5:
|
case 5:
|
||||||
|
if (Version.isAfter(Version.v1_15)) {
|
||||||
|
return net.minecraft.server.v1_15_R1.NBTTagFloat.a(base.asFloat());
|
||||||
|
} else {
|
||||||
return new NBTTagFloat(base.asFloat());
|
return new NBTTagFloat(base.asFloat());
|
||||||
|
}
|
||||||
case 6:
|
case 6:
|
||||||
|
if (Version.isAfter(Version.v1_15)) {
|
||||||
|
return net.minecraft.server.v1_15_R1.NBTTagDouble.a(base.asDouble());
|
||||||
|
} else {
|
||||||
return new NBTTagDouble(base.asDouble());
|
return new NBTTagDouble(base.asDouble());
|
||||||
|
}
|
||||||
case 7:
|
case 7:
|
||||||
return new NBTTagByteArray(base.asByteArray());
|
return new NBTTagByteArray(base.asByteArray());
|
||||||
case 11:
|
case 11:
|
||||||
return new NBTTagIntArray(base.asIntArray());
|
return new NBTTagIntArray(base.asIntArray());
|
||||||
case 8:
|
case 8:
|
||||||
|
if (Version.isAfter(Version.v1_15)) {
|
||||||
|
return net.minecraft.server.v1_15_R1.NBTTagString.a(base.asString());
|
||||||
|
} else {
|
||||||
return new NBTTagString(base.asString());
|
return new NBTTagString(base.asString());
|
||||||
|
}
|
||||||
case 9:
|
case 9:
|
||||||
Object nmsList = new NBTTagList();
|
Object nmsList = new NBTTagList();
|
||||||
for (io.izzel.taboolib.module.nms.nbt.NBTBase value : base.asList()) {
|
for (io.izzel.taboolib.module.nms.nbt.NBTBase value : base.asList()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user