#1123: Add PrepareGrindstoneEvent
By: FreeSoccerHDX <freesoccerhdx@gmail.com>
This commit is contained in:
@@ -53,6 +53,49 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -145,7 +175,7 @@
|
||||
boolean flag2 = !itemstack.isEmpty() && !itemstack.is(Items.ENCHANTED_BOOK) && !itemstack.isEnchanted() || !itemstack1.isEmpty() && !itemstack1.is(Items.ENCHANTED_BOOK) && !itemstack1.isEnchanted();
|
||||
|
||||
if (itemstack.getCount() > 1 || itemstack1.getCount() > 1 || !flag1 && flag2) {
|
||||
- this.resultSlots.setItem(0, ItemStack.EMPTY);
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareGrindstoneEvent(getBukkitView(), ItemStack.EMPTY); // CraftBukkit
|
||||
this.broadcastChanges();
|
||||
return;
|
||||
}
|
||||
@@ -156,7 +186,7 @@
|
||||
|
||||
if (flag1) {
|
||||
if (!itemstack.is(itemstack1.getItem())) {
|
||||
- this.resultSlots.setItem(0, ItemStack.EMPTY);
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareGrindstoneEvent(getBukkitView(), ItemStack.EMPTY); // CraftBukkit
|
||||
this.broadcastChanges();
|
||||
return;
|
||||
}
|
||||
@@ -170,7 +200,7 @@
|
||||
itemstack2 = this.mergeEnchants(itemstack, itemstack1);
|
||||
if (!itemstack2.isDamageableItem()) {
|
||||
if (!ItemStack.matches(itemstack, itemstack1)) {
|
||||
- this.resultSlots.setItem(0, ItemStack.EMPTY);
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareGrindstoneEvent(getBukkitView(), ItemStack.EMPTY); // CraftBukkit
|
||||
this.broadcastChanges();
|
||||
return;
|
||||
}
|
||||
@@ -183,12 +213,12 @@
|
||||
i = flag3 ? itemstack.getDamageValue() : itemstack1.getDamageValue();
|
||||
itemstack2 = flag3 ? itemstack : itemstack1;
|
||||
}
|
||||
-
|
||||
- this.resultSlots.setItem(0, this.removeNonCurses(itemstack2, i, b0));
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareGrindstoneEvent(getBukkitView(), this.removeNonCurses(itemstack2, i, b0)); // CraftBukkit
|
||||
} else {
|
||||
- this.resultSlots.setItem(0, ItemStack.EMPTY);
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareGrindstoneEvent(getBukkitView(), ItemStack.EMPTY); // CraftBukkit
|
||||
}
|
||||
|
||||
+ sendAllDataToRemote(); // CraftBukkit - SPIGOT-6686: Always send completed inventory to stay in sync with client
|
||||
this.broadcastChanges();
|
||||
}
|
||||
|
||||
@@ -251,6 +281,7 @@
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user