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

25 lines
1.5 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
2022-07-28 03:57:50 +00:00
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-02-24 22:32:31 +00:00
index 756d0434472921992c9d84597d7c9c824e93614c..77e9e106c522712a484d01bf7e7434c380de3621 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
2024-02-24 22:32:31 +00:00
@@ -147,7 +147,11 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme
public void remove(Entity.RemovalReason entity_removalreason, EntityRemoveEvent.Cause cause) {
// CraftBukkit end
if (!this.level().isClientSide && entity_removalreason.shouldDestroy()) {
2023-06-09 00:58:46 +00:00
- Containers.dropContents(this.level(), (Entity) this, (Container) this);
2022-07-28 03:57:50 +00:00
+ // Scissors start - Ignore errors thrown when trying to remove minecart entities with content in them
+ try {
2023-06-09 00:58:46 +00:00
+ Containers.dropContents(this.level(), (Entity) this, (Container) this);
+ } catch (Exception ignored) {}
2022-07-28 03:57:50 +00:00
+ // Scissors end
}
2024-02-24 22:32:31 +00:00
super.remove(entity_removalreason, cause); // CraftBukkit - add Bukkit remove cause