From d1cffafcfd307b98af00a39201545380a1fbbef7 Mon Sep 17 00:00:00 2001 From: YuTian <2953516620@qq.com> Date: Sat, 27 Jul 2024 17:10:03 +0800 Subject: [PATCH] 1.0-fix --- .../io/yutian/elementoriginlib/nbt/INBT.java | 24 +++++++++---------- .../yutian/elementoriginlib/nbt/NBTItem.java | 4 ++-- .../serialize/SerializeHelper.java | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/io/yutian/elementoriginlib/nbt/INBT.java b/src/main/java/com/io/yutian/elementoriginlib/nbt/INBT.java index 489d664..869cdd0 100644 --- a/src/main/java/com/io/yutian/elementoriginlib/nbt/INBT.java +++ b/src/main/java/com/io/yutian/elementoriginlib/nbt/INBT.java @@ -127,32 +127,32 @@ public interface INBT { } static INBT as(net.minecraft.nbt.NBTBase nbtBase) { - byte type = nbtBase.a(); + byte type = nbtBase.b(); switch (type) { case 1: NBTTagByte nbtTagByte = (NBTTagByte) nbtBase; - return new NBTByte(nbtTagByte.h()); + return new NBTByte(nbtTagByte.i()); case 2: NBTTagShort nbtTagShort = (NBTTagShort) nbtBase; - return new NBTShort(nbtTagShort.g()); + return new NBTShort(nbtTagShort.h()); case 3: NBTTagInt nbtTagInt = (NBTTagInt) nbtBase; - return new NBTInt(nbtTagInt.f()); + return new NBTInt(nbtTagInt.g()); case 4: NBTTagLong nbtTagLong = (NBTTagLong) nbtBase; - return new NBTLong(nbtTagLong.e()); + return new NBTLong(nbtTagLong.f()); case 5: NBTTagFloat nbtTagFloat = (NBTTagFloat) nbtBase; - return new NBTFloat(nbtTagFloat.j()); + return new NBTFloat(nbtTagFloat.k()); case 6: NBTTagDouble nbtTagDouble = (NBTTagDouble) nbtBase; - return new NBTDouble(nbtTagDouble.i()); + return new NBTDouble(nbtTagDouble.j()); case 7: NBTTagByteArray tagByteArray = (NBTTagByteArray) nbtBase; - return new NBTByteArray(tagByteArray.d()); + return new NBTByteArray(tagByteArray.e()); case 8: NBTTagString nbtTagString = (NBTTagString) nbtBase; - return new NBTString(nbtTagString.e_()); + return new NBTString(nbtTagString.m_()); case 9: NBTTagList nbtTagList = (NBTTagList) nbtBase; List list = new ArrayList<>(); @@ -163,16 +163,16 @@ public interface INBT { case 10: NBTTagCompound nbtTagCompound = (NBTTagCompound) nbtBase; Map map = new HashMap<>(); - for (String key : nbtTagCompound.d()) { + for (String key : nbtTagCompound.e()) { map.put(key, as(nbtTagCompound.c(key))); } return new NBTCompound(map); case 11: NBTTagIntArray nbtTagIntArray = (NBTTagIntArray) nbtBase; - return new NBTIntArray(nbtTagIntArray.f()); + return new NBTIntArray(nbtTagIntArray.g()); case 12: NBTTagLongArray nbtTagLongArray = (NBTTagLongArray) nbtBase; - return new NBTLongArray(nbtTagLongArray.f()); + return new NBTLongArray(nbtTagLongArray.g()); } return null; } diff --git a/src/main/java/com/io/yutian/elementoriginlib/nbt/NBTItem.java b/src/main/java/com/io/yutian/elementoriginlib/nbt/NBTItem.java index f1672da..bd76d73 100644 --- a/src/main/java/com/io/yutian/elementoriginlib/nbt/NBTItem.java +++ b/src/main/java/com/io/yutian/elementoriginlib/nbt/NBTItem.java @@ -1,7 +1,7 @@ package com.io.yutian.elementoriginlib.nbt; import net.minecraft.nbt.NBTTagCompound; -import org.bukkit.craftbukkit.v1_18_R2.inventory.CraftItemStack; +import org.bukkit.craftbukkit.v1_20_R1.inventory.CraftItemStack; import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; @@ -22,7 +22,7 @@ public class NBTItem { @NotNull public NBTCompound getTag() { - NBTTagCompound tag = nmsItemStack.u(); + NBTTagCompound tag = nmsItemStack.w(); if (tag == null) { tag = new NBTTagCompound(); } diff --git a/src/main/java/com/io/yutian/elementoriginlib/serialize/SerializeHelper.java b/src/main/java/com/io/yutian/elementoriginlib/serialize/SerializeHelper.java index 38236dc..c8577da 100644 --- a/src/main/java/com/io/yutian/elementoriginlib/serialize/SerializeHelper.java +++ b/src/main/java/com/io/yutian/elementoriginlib/serialize/SerializeHelper.java @@ -4,7 +4,7 @@ import com.io.yutian.elementoriginlib.exception.SerializeException; import com.io.yutian.elementoriginlib.serialize.serializers.ItemStackSerializer; import com.io.yutian.elementoriginlib.serialize.serializers.UUIDSerializer; import com.io.yutian.elementoriginlib.util.ReflectionUtil; -import org.bukkit.craftbukkit.v1_18_R2.inventory.CraftItemStack; +import org.bukkit.craftbukkit.v1_20_R1.inventory.CraftItemStack; import org.bukkit.inventory.ItemStack; import org.json.JSONArray; import org.json.JSONObject;