aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches-Unmapped/0358-Catch-exceptions-from-dispenser-entity-spawns.patch
diff options
context:
space:
mode:
Diffstat (limited to 'Spigot-Server-Patches-Unmapped/0358-Catch-exceptions-from-dispenser-entity-spawns.patch')
-rw-r--r--Spigot-Server-Patches-Unmapped/0358-Catch-exceptions-from-dispenser-entity-spawns.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/Spigot-Server-Patches-Unmapped/0358-Catch-exceptions-from-dispenser-entity-spawns.patch b/Spigot-Server-Patches-Unmapped/0358-Catch-exceptions-from-dispenser-entity-spawns.patch
new file mode 100644
index 0000000000..f724360c49
--- /dev/null
+++ b/Spigot-Server-Patches-Unmapped/0358-Catch-exceptions-from-dispenser-entity-spawns.patch
@@ -0,0 +1,33 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Shane Freeder <[email protected]>
+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/core/dispenser/IDispenseBehavior.java b/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java
+index ffce5baaca6fd5b5e73ed898d12a4fee02c24515..158075319bd49ac78ea994639cdad21aeacdf86f 100644
+--- a/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java
++++ b/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java
+@@ -8,6 +8,7 @@ import net.minecraft.core.BlockPosition;
+ import net.minecraft.core.EnumDirection;
+ import net.minecraft.core.IPosition;
+ import net.minecraft.core.ISourceBlock;
++import net.minecraft.server.MinecraftServer;
+ import net.minecraft.server.level.EntityPlayer;
+ import net.minecraft.server.level.WorldServer;
+ import net.minecraft.sounds.SoundCategory;
+@@ -236,7 +237,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;