Skip to content

Commit c0f5ada

Browse files
committed
Made some adjustments to work on more modern
It will work on more modern Minecraft, but still some work left.
1 parent d855a79 commit c0f5ada

File tree

7 files changed

+1238
-191
lines changed

7 files changed

+1238
-191
lines changed

Item Creator/src/main/java/org/broken/arrow/library/itemcreator/utility/compound/CompoundTag.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33

44
import org.broken.arrow.library.itemcreator.utility.nms.LegacyNBT;
5+
import org.broken.arrow.library.itemcreator.utility.nms.NBTAdapter;
6+
import org.broken.arrow.library.itemcreator.utility.nms.api.CompoundEditor;
57
import org.broken.arrow.library.logging.Validate;
68

79
import javax.annotation.Nonnull;
@@ -25,7 +27,7 @@
2527
*
2628
*/
2729
public final class CompoundTag {
28-
private final LegacyNBT.CompoundSession compoundSession;
30+
private final CompoundEditor compoundSession;
2931

3032
/**
3133
* Creates a new {@link CompoundTag} for the given NBTTagCompound handle.
@@ -39,7 +41,7 @@ public final class CompoundTag {
3941
*/
4042
public CompoundTag(@Nonnull final Object handle) {
4143
Validate.checkNotNull(handle, "CompoundTag handle cannot be null");
42-
compoundSession = LegacyNBT.compoundSession(handle);
44+
compoundSession = NBTAdapter.compoundSession(handle);
4345
Validate.checkNotNull(compoundSession, "The compound session could not be loaded.");
4446
}
4547

Item Creator/src/main/java/org/broken/arrow/library/itemcreator/utility/compound/NbtData.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33

44
import org.broken.arrow.library.itemcreator.utility.nms.LegacyNBT;
5+
import org.broken.arrow.library.itemcreator.utility.nms.NBTAdapter;
6+
import org.broken.arrow.library.itemcreator.utility.nms.api.NbtEditor;
57
import org.broken.arrow.library.logging.Validate;
68
import org.bukkit.inventory.ItemStack;
79

@@ -19,16 +21,16 @@
1921
* values used only by plugins.</p>
2022
*/
2123
public class NbtData {
22-
LegacyNBT.NmsItemSession session;
24+
private final NbtEditor session;
2325

2426
/**
2527
* Creates a new NbtData wrapper.
2628
*
2729
* @param itemStack the itemStack to alter the NBT tags on.
2830
*/
2931
public NbtData(final ItemStack itemStack) {
30-
this.session = LegacyNBT.session(itemStack);
31-
Validate.checkNotNull(this.session,"The session could not be loaded.");
32+
this.session = NBTAdapter.session(itemStack);
33+
Validate.checkNotNull(this.session,"The underlying NBT session could not be loaded.");
3234
}
3335

3436
/**

0 commit comments

Comments
 (0)