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

25 lines
1.3 KiB
Diff
Raw Normal View History

2022-07-28 03:57:50 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Video <videogamesm12@gmail.com>
Date: Sun, 13 Mar 2022 08:14:44 -0600
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
index 08f027cdcaeeca7b545483cb8c5eb8d13e4933b9..d651acb328b52ac252a6a48c1ceccdca8cfb612a 100644
2022-07-28 03:57:50 +00:00
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
@@ -139,7 +139,11 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme
2022-07-28 03:57:50 +00:00
@Override
public void remove(Entity.RemovalReason reason) {
if (!this.level.isClientSide && reason.shouldDestroy()) {
- Containers.dropContents(this.level, (Entity) this, (Container) this);
+ // 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) {}
2022-07-28 03:57:50 +00:00
+ // Scissors end
}
super.remove(reason);