SPIGOT-6078: Add SmithItemEvent and expand SmithingInventory API
By: Julian van den Berkmortel <julianvdberkmortel@outlook.com>
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
|
||||
public ContainerSmithing(int i, PlayerInventory playerinventory) {
|
||||
this(i, playerinventory, ContainerAccess.a);
|
||||
@@ -63,13 +68,13 @@
|
||||
@@ -63,13 +68,16 @@
|
||||
List<RecipeSmithing> list = this.g.getCraftingManager().b(Recipes.SMITHING, this.repairInventory, this.g);
|
||||
|
||||
if (list.isEmpty()) {
|
||||
@@ -30,11 +30,14 @@
|
||||
|
||||
this.resultInventory.a((IRecipe) this.h);
|
||||
- this.resultInventory.setItem(0, itemstack);
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareSmithingEvent(getBukkitView(), itemstack); // CraftBukkit
|
||||
+ // CraftBukkit start
|
||||
+ this.repairInventory.setCurrentRecipe(this.h);
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareSmithingEvent(getBukkitView(), itemstack);
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
}
|
||||
@@ -85,4 +90,18 @@
|
||||
@@ -85,4 +93,18 @@
|
||||
public boolean a(ItemStack itemstack, Slot slot) {
|
||||
return slot.inventory != this.resultInventory && super.a(itemstack, slot);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user