spigot/CraftBukkit-Patches/0010-Handle-Null-Tile-Entities.patch
2021-06-11 15:00:00 +10:00

27 lines
1 KiB
Diff

From 2f5316b89422af116c83a86ab3f8dbaed2c627ef Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 3 Feb 2013 09:20:19 +1100
Subject: [PATCH] Handle Null Tile Entities
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index ac94242c6..65c306529 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -641,6 +641,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
while (iterator.hasNext()) {
TickingBlockEntity tickingblockentity = (TickingBlockEntity) iterator.next();
+ // Spigot start
+ if (tickingblockentity == null) {
+ getServer().getLogger().severe("Spigot has detected a null entity and has removed it, preventing a crash");
+ iterator.remove();
+ continue;
+ }
+ // Spigot end
if (tickingblockentity.b()) {
iterator.remove();
--
2.25.1