Skip to content

Commit

Permalink
Fix wrong farmer stack
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreeam-qwq committed Dec 13, 2024
1 parent 2f4ceb5 commit cbc2b46
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions patches/server/0082-Optimize-villager-data-storage.patch
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ index 5db5ba026462ca642dcee718af732f80fadabef5..cd380ceb40d38acc7eef289ded112593
for (int i = 0; i < this.getContainerSize(); ++i) {
ItemStack itemstack = this.getItem(i);
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/TradeWithVillager.java b/src/main/java/net/minecraft/world/entity/ai/behavior/TradeWithVillager.java
index 8508ac7de8cda3127b73e11ff4aee62502e65ead..73e20e1f7d2bb1cd3d08e6bdca50efac22c9d958 100644
index 8508ac7de8cda3127b73e11ff4aee62502e65ead..90ae43979e05839d676ab51feb489955ecbee50e 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/TradeWithVillager.java
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/TradeWithVillager.java
@@ -17,7 +17,10 @@ import net.minecraft.world.item.ItemStack;
Expand All @@ -58,7 +58,7 @@ index 8508ac7de8cda3127b73e11ff4aee62502e65ead..73e20e1f7d2bb1cd3d08e6bdca50efac
if (villager.getVillagerData().getProfession() == VillagerProfession.FARMER
&& entity.getInventory().countItem(Items.WHEAT) > Items.WHEAT.getDefaultMaxStackSize() / 2) {
- throwHalfStack(entity, ImmutableSet.of(Items.WHEAT), villager);
+ throwHalfStack(entity, Villager.FOOD_POINTS_KEY_ARRAY, villager); // Gale - optimize villager data storage
+ throwHalfStack(entity, WHEAT_SINGLETON_ARRAY, villager); // Gale - optimize villager data storage
}

- if (!this.trades.isEmpty() && entity.getInventory().hasAnyOf(this.trades)) {
Expand Down

0 comments on commit cbc2b46

Please sign in to comment.