mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-02 11:22:01 +01:00
SPIGOT-7931: Fix sync in Anvil View when result item is taken
By: Doc <nachito94@msn.com>
This commit is contained in:
parent
8fc0f462c0
commit
d27615dcaf
@ -92,13 +92,12 @@
|
||||
itemstack1 = ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
@@ -285,11 +294,12 @@
|
||||
@@ -285,12 +294,13 @@
|
||||
EnchantmentManager.setEnchantments(itemstack1, itemenchantments_a.toImmutable());
|
||||
}
|
||||
|
||||
- this.resultSlots.setItem(0, itemstack1);
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), itemstack1); // CraftBukkit
|
||||
+ sendAllDataToRemote(); // CraftBukkit - SPIGOT-6686: Always send completed inventory to stay in sync with client
|
||||
this.broadcastChanges();
|
||||
} else {
|
||||
- this.resultSlots.setItem(0, ItemStack.EMPTY);
|
||||
@ -106,8 +105,10 @@
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), ItemStack.EMPTY); // CraftBukkit
|
||||
+ this.cost.set(DEFAULT_DENIED_COST); // CraftBukkit - use a variable for set a cost for denied item
|
||||
}
|
||||
+ sendAllDataToRemote(); // CraftBukkit - SPIGOT-6686, SPIGOT-7931: Always send completed inventory to stay in sync with client
|
||||
}
|
||||
|
||||
public static int calculateIncreasedRepairCost(int i) {
|
||||
@@ -329,4 +339,19 @@
|
||||
public int getCost() {
|
||||
return this.cost.get();
|
||||
|
Loading…
Reference in New Issue
Block a user