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

42 lines
2.2 KiB
Diff
Raw Normal View History

2015-10-03 03:58:02 +00:00
From 82203f5b964a9ebb9a3cf4d62381a7d4512b4753 Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
2015-10-03 03:58:02 +00:00
Date: Sun, 8 Mar 2015 22:55:25 -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 022ba31..7242d45 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
2015-03-23 19:23:25 +00:00
@@ -784,6 +784,11 @@ public class Chunk {
2015-03-08 01:16:09 +00:00
tileentity.D();
this.tileEntities.put(blockposition, tileentity);
// CraftBukkit start
+ // PaperSpigot start - Remove invalid mob spawner tile entities
+ } else if (this.world.paperSpigotConfig.removeInvalidMobSpawnerTEs && tileentity instanceof TileEntityMobSpawner &&
2015-03-08 01:16:09 +00:00
+ org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(getType(blockposition)) != org.bukkit.Material.MOB_SPAWNER) {
2014-11-28 01:17:45 +00:00
+ this.tileEntities.remove(blockposition);
+ // PaperSpigot end
} else {
2014-11-28 01:17:45 +00:00
System.out.println("Attempted to place a tile entity (" + tileentity + ") at " + tileentity.position.getX() + "," + tileentity.position.getY() + "," + tileentity.position.getZ()
2015-03-08 01:16:09 +00:00
+ " (" + org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(getType(blockposition)) + ") where there was no entity tile!");
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
index d0a97b6..5aa368f 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -205,4 +205,11 @@ public class PaperSpigotWorldConfig
waterOverLavaFlowSpeed = getInt( "water-over-lava-flow-speed", 5 );
2014-11-28 01:17:45 +00:00
log( "Water over lava flow speed: " + waterOverLavaFlowSpeed );
}
+
+ public boolean removeInvalidMobSpawnerTEs;
+ private void removeInvalidMobSpawnerTEs()
+ {
2014-10-25 03:28:29 +00:00
+ removeInvalidMobSpawnerTEs = getBoolean( "remove-invalid-mob-spawner-tile-entities", true );
+ log( "Remove invalid mob spawner tile entities: " + removeInvalidMobSpawnerTEs );
+ }
}
--
2015-10-03 03:58:02 +00:00
2.6.0