mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
Fix crash relating to bad recipes in furnace-like tile entities
This commit is contained in:
parent
71e08c0a8d
commit
b436c07ec7
1 changed files with 4 additions and 3 deletions
|
@ -176,11 +176,11 @@
|
|||
+ ItemStack itemstack = (ItemStack) nonnulllist.get(0);
|
||||
+ ItemStack itemstack1 = ((AbstractCookingRecipe) recipeholder.value()).assemble(singlerecipeinput, iregistrycustom);
|
||||
+ ItemStack itemstack2 = (ItemStack) nonnulllist.get(2);
|
||||
|
||||
+
|
||||
+ // CraftBukkit start - fire FurnaceSmeltEvent
|
||||
+ CraftItemStack source = CraftItemStack.asCraftMirror(itemstack);
|
||||
+ org.bukkit.inventory.ItemStack result = CraftItemStack.asBukkitCopy(itemstack1);
|
||||
+
|
||||
|
||||
+ FurnaceSmeltEvent furnaceSmeltEvent = new FurnaceSmeltEvent(CraftBlock.at(world, blockposition), source, result, (org.bukkit.inventory.CookingRecipe<?>) recipeholder.toBukkitRecipe()); // Paper - Add recipe to cook events
|
||||
+ world.getCraftServer().getPluginManager().callEvent(furnaceSmeltEvent);
|
||||
+
|
||||
|
@ -276,7 +276,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
@@ -378,41 +481,55 @@
|
||||
@@ -378,41 +481,56 @@
|
||||
}
|
||||
|
||||
public List<RecipeHolder<?>> getRecipesToAwardAndPopExperience(ServerLevel world, Vec3 pos) {
|
||||
|
@ -294,6 +294,7 @@
|
|||
|
||||
- world.recipeAccess().byKey((ResourceKey) entry.getKey()).ifPresent((recipeholder) -> {
|
||||
+ worldserver.recipeAccess().byKey(entry.getKey()).ifPresent((recipeholder) -> { // CraftBukkit - decompile error
|
||||
+ if (!(recipeholder.value() instanceof AbstractCookingRecipe)) return; // Paper - don't process non-cooking recipes
|
||||
list.add(recipeholder);
|
||||
- AbstractFurnaceBlockEntity.createExperience(world, pos, entry.getIntValue(), ((AbstractCookingRecipe) recipeholder.value()).experience());
|
||||
+ AbstractFurnaceBlockEntity.createExperience(worldserver, vec3d, entry.getIntValue(), ((AbstractCookingRecipe) recipeholder.value()).experience(), blockposition, entityplayer, itemstack, amount); // CraftBukkit
|
||||
|
|
Loading…
Reference in a new issue