aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0150-Implement-furnace-cook-speed-multiplier-API.patch
diff options
context:
space:
mode:
authorShane Freeder <[email protected]>2024-05-09 14:51:33 +0100
committerShane Freeder <[email protected]>2024-05-09 14:51:33 +0100
commit3693bbdc6b65e68db10375d3eeab70f06708b729 (patch)
tree4a71a5e6e5f50b3e2937053a5d4b4196ef67665b /patches/api/0150-Implement-furnace-cook-speed-multiplier-API.patch
parentf2512b12385961f8ca1f69efebe5ed0e00c0caa8 (diff)
downloadPaper-timings/use-internals.tar.gz
Paper-timings/use-internals.zip
Use internals for getting block/entity countstimings/use-internals
For a long time I've been meaning to move some of this logic internally as this would allow us to avoid hitting systems like block state snapshots which can create issues as many of the spigot implementations of this stuff are increasingly broken, leading to unexpected crashes during ticking, even if the API cannot properly interact with these such states/items, it's generally more preferable to not crash the server in the course, and just let those interactions fail more gracefully.
Diffstat (limited to 'patches/api/0150-Implement-furnace-cook-speed-multiplier-API.patch')
-rw-r--r--patches/api/0150-Implement-furnace-cook-speed-multiplier-API.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/patches/api/0150-Implement-furnace-cook-speed-multiplier-API.patch b/patches/api/0150-Implement-furnace-cook-speed-multiplier-API.patch
new file mode 100644
index 0000000000..6e836a844d
--- /dev/null
+++ b/patches/api/0150-Implement-furnace-cook-speed-multiplier-API.patch
@@ -0,0 +1,61 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Tassu <[email protected]>
+Date: Thu, 13 Sep 2018 08:45:01 +0300
+Subject: [PATCH] Implement furnace cook speed multiplier API
+
+Signed-off-by: Tassu <[email protected]>
+
+diff --git a/src/main/java/org/bukkit/block/Furnace.java b/src/main/java/org/bukkit/block/Furnace.java
+index ac3b24c5c99eeb1435d785efade728dd40947da5..dbdf3dbe9517b09a7965cf9d65cae1edd87af67d 100644
+--- a/src/main/java/org/bukkit/block/Furnace.java
++++ b/src/main/java/org/bukkit/block/Furnace.java
+@@ -74,6 +74,26 @@ public interface Furnace extends Container {
+ @NotNull
+ public Map<CookingRecipe<?>, Integer> getRecipesUsed();
+
++ // Paper start
++ /**
++ * Gets the cook speed multiplier that this {@link Furnace} will cook
++ * compared to vanilla.
++ *
++ * @return the multiplier, a value between 0 and 200
++ */
++ public double getCookSpeedMultiplier();
++
++ /**
++ * Sets the speed multiplier that this {@link Furnace} will cook
++ * compared to vanilla.
++ *
++ * @param multiplier the multiplier to set, a value between 0 and 200
++ * @throws IllegalArgumentException if value is less than 0
++ * @throws IllegalArgumentException if value is more than 200
++ */
++ public void setCookSpeedMultiplier(double multiplier);
++ // Paper end
++
+ @NotNull
+ @Override
+ public FurnaceInventory getInventory();
+diff --git a/src/main/java/org/bukkit/event/inventory/FurnaceStartSmeltEvent.java b/src/main/java/org/bukkit/event/inventory/FurnaceStartSmeltEvent.java
+index 0808e7aeffb69160913344de5b5e21d5e857f1d6..d386ab5dd46cc6706ace61fe6b646713ffd50cb7 100644
+--- a/src/main/java/org/bukkit/event/inventory/FurnaceStartSmeltEvent.java
++++ b/src/main/java/org/bukkit/event/inventory/FurnaceStartSmeltEvent.java
+@@ -18,10 +18,17 @@ public class FurnaceStartSmeltEvent extends InventoryBlockStartEvent {
+ private final CookingRecipe<?> recipe;
+ private int totalCookTime;
+
++ @Deprecated // Paper - furnace cook speed multiplier
+ public FurnaceStartSmeltEvent(@NotNull final Block furnace, @NotNull ItemStack source, @NotNull final CookingRecipe<?> recipe) {
++ // Paper start
++ this(furnace, source, recipe, recipe.getCookingTime());
++ }
++
++ public FurnaceStartSmeltEvent(final @NotNull Block furnace, final @NotNull ItemStack source, final @NotNull CookingRecipe<?> recipe, final int cookingTime) {
++ // Paper end
+ super(furnace, source);
+ this.recipe = recipe;
+- this.totalCookTime = recipe.getCookingTime();
++ this.totalCookTime = cookingTime; // Paper - furnace cook speed multiplier
+ }
+
+ /**