Paper/Spigot-Server-Patches/0024-Remove-invalid-mob-spawner-tile-entities.patch

42 Zeilen
2.2 KiB
Diff

2015-03-08 02:16:09 +01:00
From 5b559214f1d5f55103d9e166d05e8e19abe6c3f7 Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
2015-03-08 02:16:09 +01:00
Date: Sun, 8 Mar 2015 01:06:14 -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
2015-03-08 02:16:09 +01:00
index 5794345..76b0e65 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
2015-03-08 02:16:09 +01:00
@@ -776,6 +776,11 @@ public class Chunk {
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 02:16:09 +01:00
+ org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(getType(blockposition)) != org.bukkit.Material.MOB_SPAWNER) {
2014-11-28 02:17:45 +01:00
+ this.tileEntities.remove(blockposition);
+ // PaperSpigot end
} else {
2014-11-28 02:17:45 +01:00
System.out.println("Attempted to place a tile entity (" + tileentity + ") at " + tileentity.position.getX() + "," + tileentity.position.getY() + "," + tileentity.position.getZ()
2015-03-08 02:16:09 +01: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
2015-03-08 02:16:09 +01:00
index 41a80da..31dedce 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
2015-03-08 02:16:09 +01:00
@@ -163,4 +163,11 @@ public class PaperSpigotWorldConfig
waterOverLavaFlowSpeed = getInt( "water-over-lava-flow-speed", 5 );
2014-11-28 02:17:45 +01:00
log( "Water over lava flow speed: " + waterOverLavaFlowSpeed );
}
+
+ public boolean removeInvalidMobSpawnerTEs;
+ private void removeInvalidMobSpawnerTEs()
+ {
2014-10-25 05:28:29 +02:00
+ removeInvalidMobSpawnerTEs = getBoolean( "remove-invalid-mob-spawner-tile-entities", true );
+ log( "Remove invalid mob spawner tile entities: " + removeInvalidMobSpawnerTEs );
+ }
}
--
2015-03-08 02:16:09 +01:00
1.9.1