testserver/Spigot-Server-Patches/0019-Remove-invalid-mob-spa...

25 lines
1.3 KiB
Diff

From 729ed20118acbca8d55fbfb71d3d02ef0a27314b Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Tue, 1 Mar 2016 15:08:03 -0600
Subject: [PATCH] Remove invalid mob spawner tile entities
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 9970a58ed..da2548603 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -798,6 +798,10 @@ public class Chunk implements IChunkAccess {
tileentity.z();
this.tileEntities.put(blockposition.h(), tileentity);
// CraftBukkit start
+ // Paper start - Remove invalid mob spawner tile entities
+ } else if (tileentity instanceof TileEntityMobSpawner && !(getBlockData(blockposition.getX(), blockposition.getY(), blockposition.getZ()).getBlock() instanceof BlockMobSpawner)) {
+ this.tileEntities.remove(blockposition);
+ // Paper end
} else {
System.out.println("Attempted to place a tile entity (" + tileentity + ") at " + tileentity.position.getX() + "," + tileentity.position.getY() + "," + tileentity.position.getZ()
+ " (" + getType(blockposition) + ") where there was no entity tile!");
--
2.20.0