9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-28 03:19:21 +00:00

revert "Fix paper's bundle exploit"

This commit is contained in:
hayanesuru
2025-05-04 23:25:21 +08:00
parent 3ae994e707
commit 65489c6f46

View File

@@ -1,21 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Taiyou06 <kaandindar21@gmail.com>
Date: Sun, 4 May 2025 13:49:50 +0200
Subject: [PATCH] Fix paper's bundle exploit
Original log: https://discord.com/channels/1145991395388162119/1368528332605620224/1368531526261932167
diff --git a/net/minecraft/world/item/component/BundleContents.java b/net/minecraft/world/item/component/BundleContents.java
index d6326dcb3700bc69c6c061ca8544b212f909277b..03ef306164c719b5c9b260224e2813ffdad4ea16 100644
--- a/net/minecraft/world/item/component/BundleContents.java
+++ b/net/minecraft/world/item/component/BundleContents.java
@@ -233,7 +233,8 @@ public final class BundleContents implements TooltipComponent {
if (this.items.isEmpty()) {
return null;
} else {
- int i = !indexIsOutsideAllowedBounds(this.selectedItem) ? this.selectedItem : 0; // Paper
+ int i = 0;
+ if (this.selectedItem >= 0 && this.selectedItem < this.items.size()) {i = this.selectedItem;}
ItemStack itemStack = this.items.remove(i).copy();
this.weight = this.weight.subtract(BundleContents.getWeight(itemStack).multiplyBy(Fraction.getFraction(itemStack.getCount(), 1)));
this.toggleSelectedItem(-1);