SPIGOT-5950: Add PrepareSmithingEvent event

This commit is contained in:
jameslfc19
2020-07-22 18:21:45 +10:00
committed by md_5
parent 8b831a9652
commit 5db13eea60
2 changed files with 23 additions and 0 deletions

View File

@@ -18,6 +18,21 @@
public ContainerSmithing(int i, PlayerInventory playerinventory) {
this(i, playerinventory, ContainerAccess.a);
@@ -52,12 +57,12 @@
List<RecipeSmithing> list = this.g.getCraftingManager().b(Recipes.SMITHING, this.repairInventory, this.g);
if (list.isEmpty()) {
- this.resultInventory.setItem(0, ItemStack.b);
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareSmithingEvent(getBukkitView(), ItemStack.b); // CraftBukkit
} else {
this.h = (RecipeSmithing) list.get(0);
ItemStack itemstack = this.h.a(this.repairInventory);
- this.resultInventory.setItem(0, itemstack);
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareSmithingEvent(getBukkitView(), itemstack); // CraftBukkit
}
}
@@ -68,4 +73,18 @@
return recipesmithing.a(itemstack);
});