Scissors/patches/server/0005-Ignore-errors-thrown-when-trying-to-remove-minecart-.patch

29 lines
1.6 KiB
Diff
Raw Normal View History

2024-05-05 17:47:44 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Telesphoreo <me@telesphoreo.me>
Date: Sun, 5 May 2024 12:32:55 -0500
Subject: [PATCH] Ignore errors thrown when trying to remove minecart entities
with content in them
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
2024-06-14 23:02:52 +00:00
index 9549eee0d92f322bd5232abd7e695213660c2e22..94a689e1adf24f6385dc97eb5cc3790c8e14da97 100644
2024-05-05 17:47:44 +00:00
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
2024-06-14 23:02:52 +00:00
@@ -142,8 +142,14 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme
2024-05-05 17:47:44 +00:00
@Override
public void remove(Entity.RemovalReason entity_removalreason, EntityRemoveEvent.Cause cause) {
// CraftBukkit end
- if (!this.level().isClientSide && entity_removalreason.shouldDestroy()) {
- Containers.dropContents(this.level(), (Entity) this, (Container) this);
+ if (!this.level().isClientSide && entity_removalreason.shouldDestroy())
+ {
+ // Scissors start - Ignore errors thrown when trying to remove Minecart entities with content in them
+ try {
+ Containers.dropContents(this.level(), (Entity) this, (Container) this);
+ } catch (Exception ignored)
+ {}
+ // Scissors end
}
super.remove(entity_removalreason, cause); // CraftBukkit - add Bukkit remove cause