2020-05-06 09:48:49 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2019-06-10 09:11:29 +00:00
|
|
|
From: Shane Freeder <theboyetronic@gmail.com>
|
|
|
|
Date: Mon, 10 Jun 2019 09:36:40 +0100
|
|
|
|
Subject: [PATCH] Catch exceptions from dispenser entity spawns
|
|
|
|
|
|
|
|
|
2021-03-16 07:19:45 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java b/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java
|
|
|
|
index ffce5baaca6fd5b5e73ed898d12a4fee02c24515..d8a8a57c2228376347d46de8821ae0e8321861e3 100644
|
|
|
|
--- a/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java
|
|
|
|
+++ b/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java
|
|
|
|
@@ -236,7 +236,14 @@ public interface IDispenseBehavior {
|
2019-06-10 09:11:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+ try { // Paper
|
|
|
|
entitytypes.spawnCreature(isourceblock.getWorld(), itemstack, (EntityHuman) null, isourceblock.getBlockPosition().shift(enumdirection), EnumMobSpawn.DISPENSER, enumdirection != EnumDirection.UP, false);
|
|
|
|
+ // Paper start
|
|
|
|
+ } catch (Exception ex){
|
2020-08-25 02:22:08 +00:00
|
|
|
+ MinecraftServer.LOGGER.warn("An exception occurred dispensing entity at {}[{}]", worldserver.getWorld().getName(), isourceblock.getBlockPosition(), ex);
|
2019-06-10 09:11:29 +00:00
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
// itemstack.subtract(1); // Handled during event processing
|
|
|
|
// CraftBukkit end
|
|
|
|
return itemstack;
|