2019-07-17 00:09:32 +02:00
|
|
|
From 8de38ed0e2f97ee19ed4a95c79c9fe3814189cd2 Mon Sep 17 00:00:00 2001
|
2019-06-10 11:11:29 +02:00
|
|
|
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
|
2019-07-17 00:09:32 +02:00
|
|
|
index 60442e4b8..1874b5d25 100644
|
2019-06-10 11:11:29 +02:00
|
|
|
--- 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 {}[{}]", world.getWorld().getName(), isourceblock.getBlockPosition(), ex);
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
// itemstack.subtract(1); // Handled during event processing
|
|
|
|
// CraftBukkit end
|
|
|
|
return itemstack;
|
|
|
|
--
|
2019-06-25 06:14:30 +02:00
|
|
|
2.22.0
|
2019-06-10 11:11:29 +02:00
|
|
|
|