mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-17 10:41:41 +01:00
Fix null tile entity worlds crashing the server
This commit is contained in:
parent
7ad4a59952
commit
9bb4978a15
24 changed files with 19 additions and 40 deletions
CraftBukkit-Patches
0003-Allow-undead-horse-types-to-be-leashed.patch0003-Prevent-null-hopper-owners-crashing-the-server.patch0004-Teleport-passenger-vehicle-with-player.patch0005-Invisible-players-don-t-have-rights.patch0006-Configurable-squid-spawn-ranges.patch0007-Configurable-damage-multiplier-for-PvP-blocking.patch0008-Configurable-cactus-and-reed-natural-growth-heights.patch0009-Configurable-baby-zombie-movement-speed.patch0010-Make-destroyed-boats-drop-the-boat-item.patch0011-Inverted-Daylight-Detector-Toggle.patch0012-Add-1.8-recipes-for-stone-variants.patch0013-Ability-to-disable-asynccatcher.patch0014-Fix-redstone-lag-issues.patch0015-Do-not-remove-player-in-world-change.patch0016-Fix-directional-TNT-bias.patch0017-Fix-zombie-sieges-and-their-spawn-mechanics.patch0018-Configurable-fishing-time-ranges.patch0019-Allow-nerfed-mobs-to-jump.patch0020-Configurable-interaction-limit-restriction.patch0021-Player-Exhaustion-Multipliers.patch0022-Add-configurable-despawn-distances-for-living-entiti.patch0023-Don-t-tick-chests.patch0024-Allow-disabling-of-spawn-chunks-always-being-loaded.patch0025-Fix-Null-Tile-Entity-Worlds.patch
|
@ -1,40 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Suddenly <suddenly@suddenly.coffee>
|
||||
Date: Tue, 27 May 2014 14:00:41 +0100
|
||||
Subject: [PATCH] Prevent null hopper owners crashing the server
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntityHopper.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntityHopper.java
|
||||
@@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntity implements IHopper {
|
||||
if (!this.j() && BlockHopper.c(this.p())) {
|
||||
boolean flag = false;
|
||||
|
||||
- if (!this.k()) {
|
||||
- flag = this.x();
|
||||
+ try { // PaperSpigot Start (Try/catch to prevent null owner crash)
|
||||
+ if (!this.k()) {
|
||||
+ flag = this.x();
|
||||
+ }
|
||||
+ } catch (NullPointerException e) {
|
||||
+ this.getWorld().setAir(this.x, this.y, this.z);
|
||||
+ org.bukkit.Bukkit.getLogger().log(java.util.logging.Level.WARNING, "Null owner found for hopper, removing hopper at {0} {1}, {2}, {3}", new Object[]{this.getWorld().getWorld().getName(), this.x, this.y, this.z});
|
||||
}
|
||||
|
||||
- if (!this.l()) {
|
||||
- flag = suckInItems(this) || flag;
|
||||
- }
|
||||
+ try {
|
||||
+ if (!this.l()) {
|
||||
+ flag = suckInItems(this) || flag;
|
||||
+ }
|
||||
+ } catch (NullPointerException e) {
|
||||
+ this.getWorld().setAir(this.x, this.y, this.z);
|
||||
+ org.bukkit.Bukkit.getLogger().log(java.util.logging.Level.WARNING, "Null owner found for hopper, removing hopper at {0} {1}, {2}, {3}", new Object[]{this.getWorld().getWorld().getName(), this.x, this.y, this.z});
|
||||
+ } // PaperSpigot End
|
||||
|
||||
if (flag) {
|
||||
this.c(world.spigotConfig.hopperTransfer); // Spigot
|
||||
--
|
19
CraftBukkit-Patches/0025-Fix-Null-Tile-Entity-Worlds.patch
Normal file
19
CraftBukkit-Patches/0025-Fix-Null-Tile-Entity-Worlds.patch
Normal file
|
@ -0,0 +1,19 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: "Evan A. Haskell" <eah2119@gmail.com>
|
||||
Date: Thu, 26 Jun 2014 18:37:29 -0400
|
||||
Subject: [PATCH] Fix Null Tile Entity Worlds
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
|
||||
}
|
||||
}
|
||||
|
||||
+ tileentity.a(this); // PaperSpigot - No null worlds
|
||||
this.a.add(tileentity);
|
||||
} else {
|
||||
this.tileEntityList.add(tileentity);
|
||||
--
|
Loading…
Add table
Reference in a new issue