Skip to content

Commit 6908171

Browse files
[setSignText] Improve performance for paper (BlockState snapshot)
1 parent 6df9eef commit 6908171

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/org/maxgamer/quickshop/shop/ContainerShop.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,9 @@ public void setSignText(@NotNull List<ComponentPackage> lines) {
876876
}
877877
}
878878
//Due to spigot internal changes, snapshot need to be updated for nbt changes
879-
sign = (Sign) sign.getBlock().getState();
879+
//Such thing not happened to paper (we disable snapshot when getting state),
880+
//for performance improvement, we use paperlib to skip snapshot creating again
881+
sign = (Sign) PaperLib.getBlockState(sign.getBlock(), false);
880882
} catch (Exception e) {
881883
plugin.getLogger().log(Level.WARNING, "NBTAPI support is broken, disable and fallback... (You can safely ignore this)", e);
882884
plugin.disableNBTAPI();

0 commit comments

Comments
 (0)