mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 07:48:53 +01:00
Catch exceptions from dispenser entity spawns
This commit is contained in:
parent
268b076ab2
commit
a0a6ab18b7
1 changed files with 27 additions and 0 deletions
|
@ -0,0 +1,27 @@
|
|||
From 4aaab5e21ab07136668aa409b8e2a2691c4f1c2b 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/DispenserRegistry.java b/src/main/java/net/minecraft/server/DispenserRegistry.java
|
||||
index f9d5489b7b..d564564420 100644
|
||||
--- a/src/main/java/net/minecraft/server/DispenserRegistry.java
|
||||
+++ b/src/main/java/net/minecraft/server/DispenserRegistry.java
|
||||
@@ -143,7 +143,13 @@ public class DispenserRegistry {
|
||||
}
|
||||
|
||||
if (entitytypes != null) {
|
||||
+ try { // Paper
|
||||
entitytypes.a(isourceblock.getWorld(), itemstack, (EntityHuman) null, isourceblock.getBlockPosition().shift(enumdirection), 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
|
||||
--
|
||||
2.21.0
|
||||
|
Loading…
Reference in a new issue