SPIGOT-5561: Warning in logs when changing a Mob Spawner to Air on chunk load

By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
CraftBukkit/Spigot 2021-07-13 19:22:27 +10:00
parent e797fdd58a
commit a061943cac

View file

@ -104,7 +104,20 @@
} }
} }
@@ -541,6 +576,50 @@ @@ -494,6 +529,12 @@
if (this.E()) {
TileEntity tileentity = (TileEntity) this.blockEntities.remove(blockposition);
+ // CraftBukkit start - SPIGOT-5561: Also remove from pending map
+ if (!pendingBlockEntities.isEmpty()) {
+ pendingBlockEntities.remove(blockposition);
+ }
+ // CraftBukkit end
+
if (tileentity != null) {
this.c(tileentity);
tileentity.aa_();
@@ -541,6 +582,50 @@
} }
@ -155,7 +168,7 @@
public void markDirty() { public void markDirty() {
this.unsaved = true; this.unsaved = true;
} }
@@ -664,7 +743,7 @@ @@ -664,7 +749,7 @@
@Override @Override
public boolean isNeedsSaving() { public boolean isNeedsSaving() {
@ -164,7 +177,7 @@
} }
@Nullable @Nullable
@@ -795,7 +874,7 @@ @@ -795,7 +880,7 @@
public void B() { public void B() {
if (this.blockTicks instanceof ProtoChunkTickList) { if (this.blockTicks instanceof ProtoChunkTickList) {
@ -173,7 +186,7 @@
return this.getType(blockposition).getBlock(); return this.getType(blockposition).getBlock();
}); });
this.blockTicks = TickListEmpty.b(); this.blockTicks = TickListEmpty.b();
@@ -805,7 +884,7 @@ @@ -805,7 +890,7 @@
} }
if (this.liquidTicks instanceof ProtoChunkTickList) { if (this.liquidTicks instanceof ProtoChunkTickList) {
@ -182,7 +195,7 @@
return this.getFluid(blockposition).getType(); return this.getFluid(blockposition).getType();
}); });
this.liquidTicks = TickListEmpty.b(); this.liquidTicks = TickListEmpty.b();
@@ -819,14 +898,14 @@ @@ -819,14 +904,14 @@
public void a(WorldServer worldserver) { public void a(WorldServer worldserver) {
RegistryBlocks registryblocks; RegistryBlocks registryblocks;
@ -199,7 +212,7 @@
registryblocks = IRegistry.FLUID; registryblocks = IRegistry.FLUID;
Objects.requireNonNull(registryblocks); Objects.requireNonNull(registryblocks);
this.liquidTicks = new TickListChunk<>(registryblocks::getKey, worldserver.getFluidTickList().a(this.chunkPos, true, false), worldserver.getTime()); this.liquidTicks = new TickListChunk<>(registryblocks::getKey, worldserver.getFluidTickList().a(this.chunkPos, true, false), worldserver.getTime());
@@ -899,7 +978,7 @@ @@ -899,7 +984,7 @@
private <T extends TileEntity> void f(T t0) { private <T extends TileEntity> void f(T t0) {
IBlockData iblockdata = t0.getBlock(); IBlockData iblockdata = t0.getBlock();
@ -208,7 +221,7 @@
if (blockentityticker == null) { if (blockentityticker == null) {
this.l(t0.getPosition()); this.l(t0.getPosition());
@@ -978,7 +1057,7 @@ @@ -978,7 +1063,7 @@
private boolean loggedInvalidBlockState; private boolean loggedInvalidBlockState;
a(TileEntity tileentity, BlockEntityTicker blockentityticker) { a(TileEntity tileentity, BlockEntityTicker blockentityticker) {
@ -217,7 +230,7 @@
this.ticker = blockentityticker; this.ticker = blockentityticker;
} }
@@ -1001,7 +1080,7 @@ @@ -1001,7 +1086,7 @@
this.loggedInvalidBlockState = true; this.loggedInvalidBlockState = true;
Chunk.LOGGER.warn("Block entity {} @ {} state {} invalid for ticking:", new org.apache.logging.log4j.util.Supplier[]{this::d, this::c, () -> { Chunk.LOGGER.warn("Block entity {} @ {} state {} invalid for ticking:", new org.apache.logging.log4j.util.Supplier[]{this::d, this::c, () -> {
return iblockdata; return iblockdata;