PaperMC/Spigot-Server-Patches/0358-Catch-exceptions-from-dispenser-entity-spawns.patch
Riley Park 4e958e229f
We're going on an Adventure! (#4842)
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: zml <zml@stellardrift.ca>
Co-authored-by: Mariell Hoversholm <proximyst@proximyst.com>
2021-02-21 20:45:33 +01:00

25 lines
1.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Mon, 10 Jun 2019 09:36:40 +0100
Subject: [PATCH] Catch exceptions from dispenser entity spawns
diff --git a/src/main/java/net/minecraft/server/IDispenseBehavior.java b/src/main/java/net/minecraft/server/IDispenseBehavior.java
index e41d64a9cdf6e8c58a6909b672df43e6738e3c31..ce7ab95c95eba7f1c49096a88d9a1b2110ae473b 100644
--- a/src/main/java/net/minecraft/server/IDispenseBehavior.java
+++ b/src/main/java/net/minecraft/server/IDispenseBehavior.java
@@ -163,7 +163,14 @@ public interface IDispenseBehavior {
}
}
+ try { // Paper
entitytypes.spawnCreature(isourceblock.getWorld(), itemstack, (EntityHuman) null, isourceblock.getBlockPosition().shift(enumdirection), EnumMobSpawn.DISPENSER, enumdirection != EnumDirection.UP, false);
+ // Paper start
+ } catch (Exception ex){
+ MinecraftServer.LOGGER.warn("An exception occurred dispensing entity at {}[{}]", worldserver.getWorld().getName(), isourceblock.getBlockPosition(), ex);
+ }
+ // Paper end
+
// itemstack.subtract(1); // Handled during event processing
// CraftBukkit end
return itemstack;