Skip to content

Commit

Permalink
Fix mistake on ItemStackSave's NBT
Browse files Browse the repository at this point in the history
Add default function for NMSUtils hasNBTTAgCompound
  • Loading branch information
EverNife committed May 26, 2022
1 parent 0d69191 commit 0ca9672
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ public static <O> SmartLoadSave<O> addLoadableSalvable(Class<O> clazz){
Iterables.toArray(
Splitter
.fixedLength(100)
.split(FCNBTUtil.getFrom(itemStack).toString()),
.split(nbtString),
String.class
)
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package br.com.finalcraft.evernifecore.nms.util;

import br.com.finalcraft.evernifecore.util.FCNBTUtil;
import org.apache.commons.lang.NotImplementedException;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
Expand Down Expand Up @@ -82,7 +83,9 @@ public default void clearNBT(ItemStack itemStack){

public void autoRespawnOnDeath(Player player);

public boolean hasNBTTagCompound(ItemStack itemStack);
public default boolean hasNBTTagCompound(ItemStack itemStack){
return FCNBTUtil.getFrom(itemStack).isEmpty();
}

@Deprecated
public default void setNBTString(ItemStack itemStack, String key, String value){
Expand Down

0 comments on commit 0ca9672

Please sign in to comment.