Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-20 21:40:06 +01:00
SPIGOT-5472: Spurious warning when using clone command on tile entities
Dieser Commit ist enthalten in:
Ursprung
85106731bf
Commit
75fac431cf
@ -334,15 +334,21 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -604,6 +816,7 @@
|
@@ -606,12 +818,26 @@
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ public Map<BlockPosition, TileEntity> capturedTileEntities = Maps.newHashMap();
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
|
+ // CraftBukkit start
|
||||||
public TileEntity getTileEntity(BlockPosition blockposition) {
|
public TileEntity getTileEntity(BlockPosition blockposition) {
|
||||||
@@ -612,6 +825,12 @@
|
+ return getTileEntity(blockposition, true);
|
||||||
|
+ }
|
||||||
|
+ public Map<BlockPosition, TileEntity> capturedTileEntities = Maps.newHashMap();
|
||||||
|
+
|
||||||
|
+ @Nullable
|
||||||
|
+ protected TileEntity getTileEntity(BlockPosition blockposition, boolean validate) {
|
||||||
|
+ // CraftBukkit end
|
||||||
|
if (isOutsideWorld(blockposition)) {
|
||||||
|
return null;
|
||||||
} else if (!this.isClientSide && Thread.currentThread() != this.serverThread) {
|
} else if (!this.isClientSide && Thread.currentThread() != this.serverThread) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
@ -355,7 +361,7 @@
|
|||||||
TileEntity tileentity = null;
|
TileEntity tileentity = null;
|
||||||
|
|
||||||
if (this.tickingTileEntities) {
|
if (this.tickingTileEntities) {
|
||||||
@@ -646,6 +865,13 @@
|
@@ -646,6 +872,13 @@
|
||||||
public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) {
|
public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) {
|
||||||
if (!isOutsideWorld(blockposition)) {
|
if (!isOutsideWorld(blockposition)) {
|
||||||
if (tileentity != null && !tileentity.isRemoved()) {
|
if (tileentity != null && !tileentity.isRemoved()) {
|
||||||
@ -369,3 +375,12 @@
|
|||||||
if (this.tickingTileEntities) {
|
if (this.tickingTileEntities) {
|
||||||
tileentity.setLocation(this, blockposition);
|
tileentity.setLocation(this, blockposition);
|
||||||
Iterator iterator = this.tileEntityListPending.iterator();
|
Iterator iterator = this.tileEntityListPending.iterator();
|
||||||
|
@@ -670,7 +903,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeTileEntity(BlockPosition blockposition) {
|
||||||
|
- TileEntity tileentity = this.getTileEntity(blockposition);
|
||||||
|
+ TileEntity tileentity = this.getTileEntity(blockposition, false); // CraftBukkit
|
||||||
|
|
||||||
|
if (tileentity != null && this.tickingTileEntities) {
|
||||||
|
tileentity.ab_();
|
||||||
|
@ -62,9 +62,9 @@
|
|||||||
+
|
+
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public TileEntity getTileEntity(BlockPosition pos) {
|
+ protected TileEntity getTileEntity(BlockPosition pos, boolean validate) {
|
||||||
+ TileEntity result = super.getTileEntity(pos);
|
+ TileEntity result = super.getTileEntity(pos, validate);
|
||||||
+ if (Thread.currentThread() != this.serverThread) {
|
+ 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
|
+ // SPIGOT-5378: avoid deadlock, this can be called in loading logic (i.e lighting) but getType() will block on chunk load
|
||||||
+ return result;
|
+ return result;
|
||||||
+ }
|
+ }
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren