Skip to content

Commit

Permalink
NBTApi - fix an issue with block NBT throwing console error if not a …
Browse files Browse the repository at this point in the history
…tile entity
  • Loading branch information
ShaneBeee committed Jul 29, 2020
1 parent 9f2b375 commit 15f6b6a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/tk/shanebee/bee/api/NBTApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ public void setNBT(Block block, String newValue) {
public void addNBT(Block block, String newValue) {
if (!validateNBT(newValue)) return;
NBTTileEntity tile = new NBTTileEntity(block.getState());
tile.mergeCompound(new NBTContainer(newValue));
try {
tile.mergeCompound(new NBTContainer(newValue));
} catch (NbtApiException ignore) {}
}

public String getNBT(Block block) {
Expand Down

0 comments on commit 15f6b6a

Please sign in to comment.