2019-06-10 10:52:34 +02:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2021-03-16 08:19:45 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java b/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java
|
2020-05-06 11:48:49 +02:00
|
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
2021-03-16 08:19:45 +01:00
|
|
|
--- a/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java
|
|
|
|
+++ b/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java
|
2021-03-16 16:50:45 +01:00
|
|
|
@@ -0,0 +0,0 @@ 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;
|
2019-06-10 11:11:29 +02:00
|
|
|
@@ -0,0 +0,0 @@ public interface IDispenseBehavior {
|
|
|
|
}
|
2019-06-10 10:52:34 +02:00
|
|
|
}
|
|
|
|
|
2019-06-10 11:11:29 +02:00
|
|
|
+ try { // Paper
|
|
|
|
entitytypes.spawnCreature(isourceblock.getWorld(), itemstack, (EntityHuman) null, isourceblock.getBlockPosition().shift(enumdirection), EnumMobSpawn.DISPENSER, enumdirection != EnumDirection.UP, false);
|
2019-06-10 10:52:34 +02:00
|
|
|
+ // Paper start
|
2019-06-10 11:11:29 +02:00
|
|
|
+ } catch (Exception ex){
|
2020-08-25 04:22:08 +02:00
|
|
|
+ MinecraftServer.LOGGER.warn("An exception occurred dispensing entity at {}[{}]", worldserver.getWorld().getName(), isourceblock.getBlockPosition(), ex);
|
2019-06-10 11:11:29 +02:00
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
2019-06-10 10:52:34 +02:00
|
|
|
// itemstack.subtract(1); // Handled during event processing
|
2019-06-10 11:11:29 +02:00
|
|
|
// CraftBukkit end
|
|
|
|
return itemstack;
|