SPIGOT-5472: Spurious warning when using clone command on tile entities

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2019-12-23 11:59:51 +11:00
parent ef9f6da935
commit 6f41e1d3c2
2 changed files with 24 additions and 9 deletions

View File

@@ -62,9 +62,9 @@
+
+ // CraftBukkit start
+ @Override
+ public TileEntity getTileEntity(BlockPosition pos) {
+ TileEntity result = super.getTileEntity(pos);
+ if (Thread.currentThread() != this.serverThread) {
+ protected TileEntity getTileEntity(BlockPosition pos, boolean validate) {
+ TileEntity result = super.getTileEntity(pos, validate);
+ if (!validate || Thread.currentThread() != this.serverThread) {
+ // SPIGOT-5378: avoid deadlock, this can be called in loading logic (i.e lighting) but getType() will block on chunk load
+ return result;
+ }