From c080750a884994ba56d0b176d534a088700142bb Mon Sep 17 00:00:00 2001 From: TheMode Date: Sun, 30 May 2021 16:33:02 +0200 Subject: [PATCH] Fix trade index in VillagerInventory --- .../net/minestom/server/inventory/type/VillagerInventory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/minestom/server/inventory/type/VillagerInventory.java b/src/main/java/net/minestom/server/inventory/type/VillagerInventory.java index 4812fe9e9..91790d0c5 100644 --- a/src/main/java/net/minestom/server/inventory/type/VillagerInventory.java +++ b/src/main/java/net/minestom/server/inventory/type/VillagerInventory.java @@ -23,7 +23,7 @@ public class VillagerInventory extends Inventory { final int length = oldTrades.length + 1; TradeListPacket.Trade[] trades = new TradeListPacket.Trade[length]; System.arraycopy(oldTrades, 0, trades, 0, oldTrades.length); - trades[length] = trade; + trades[length - 1] = trade; this.tradeListPacket.trades = trades; update(); }