Correctly order getArmorContents
Mojangs EQUIPMENT_SLOT_MAPPING uses an Int2ObjectArrayMap and hence technically does provide iteration stability, however it is filled from a MapN, which destroys the well order of the entries. To iterate from smallest to largest inventory index correctly, this commit introduces a sorted array based on the EQUIPMENT_SLOT_MAPPING.
This commit is contained in:
@@ -204,10 +204,10 @@ index 6d3e3ec045d5b15a435f7217369968b33e082724..b7a3758af337270737041f84d10eb437
|
||||
int i = this.inventory.findSlotMatchingCraftingIngredient(item, item1);
|
||||
if (i == -1) {
|
||||
diff --git a/net/minecraft/world/entity/player/Inventory.java b/net/minecraft/world/entity/player/Inventory.java
|
||||
index 24d32c0163d27a7886bd4048d508591b89f714a4..dd406c5becacbc2d05b062726a8af88a1d6faba9 100644
|
||||
index e25e0bd410f8822cb9a1118b39a786f44aabef7b..d9cb4f0ed0c4f63362c837aeef3c4194911455c9 100644
|
||||
--- a/net/minecraft/world/entity/player/Inventory.java
|
||||
+++ b/net/minecraft/world/entity/player/Inventory.java
|
||||
@@ -230,12 +230,12 @@ public class Inventory implements Container, Nameable {
|
||||
@@ -234,12 +234,12 @@ public class Inventory implements Container, Nameable {
|
||||
return !stack.isDamaged() && !stack.isEnchanted() && !stack.has(DataComponents.CUSTOM_NAME);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user