2022-02-23 04:09:15 +01:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
|
|
Date: Thu, 7 Oct 2021 14:34:55 -0700
|
|
|
|
Subject: [PATCH] Custom Potion Mixes
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/io/papermc/paper/potion/PaperPotionMix.java b/src/main/java/io/papermc/paper/potion/PaperPotionMix.java
|
|
|
|
new file mode 100644
|
2023-10-11 01:07:21 +02:00
|
|
|
index 0000000000000000000000000000000000000000..7ea357ac2f3a93db4ebdf24b5072be7d1cad3e33
|
2022-02-23 04:09:15 +01:00
|
|
|
--- /dev/null
|
|
|
|
+++ b/src/main/java/io/papermc/paper/potion/PaperPotionMix.java
|
2023-10-11 01:07:21 +02:00
|
|
|
@@ -0,0 +1,21 @@
|
2022-02-23 04:09:15 +01:00
|
|
|
+package io.papermc.paper.potion;
|
|
|
|
+
|
2023-10-11 01:07:21 +02:00
|
|
|
+import java.util.function.Predicate;
|
2022-02-23 04:09:15 +01:00
|
|
|
+import net.minecraft.world.item.ItemStack;
|
|
|
|
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
|
|
|
+import org.bukkit.craftbukkit.inventory.CraftRecipe;
|
2023-10-11 01:07:21 +02:00
|
|
|
+import org.bukkit.inventory.RecipeChoice;
|
2022-02-23 04:09:15 +01:00
|
|
|
+
|
2023-10-11 01:07:21 +02:00
|
|
|
+public record PaperPotionMix(ItemStack result, Predicate<ItemStack> input, Predicate<ItemStack> ingredient) {
|
2022-02-23 04:09:15 +01:00
|
|
|
+
|
|
|
|
+ public PaperPotionMix(PotionMix potionMix) {
|
2023-10-11 01:07:21 +02:00
|
|
|
+ this(CraftItemStack.asNMSCopy(potionMix.getResult()), convert(potionMix.getInput()), convert(potionMix.getIngredient()));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ static Predicate<ItemStack> convert(final RecipeChoice choice) {
|
|
|
|
+ if (choice instanceof PredicateRecipeChoice predicateRecipeChoice) {
|
|
|
|
+ return stack -> predicateRecipeChoice.test(CraftItemStack.asBukkitCopy(stack));
|
|
|
|
+ }
|
|
|
|
+ return CraftRecipe.toIngredient(choice, true);
|
2022-02-23 04:09:15 +01:00
|
|
|
+ }
|
|
|
|
+}
|
2023-12-06 17:39:37 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
2024-04-23 19:02:08 +02:00
|
|
|
index 041ba5fd85748b3183e12e7a8e10fca77eb35bf5..88821acddee03c30c2630d3d6c39cc93702ed35b 100644
|
2023-12-06 17:39:37 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
2024-01-25 10:54:46 +01:00
|
|
|
@@ -2081,6 +2081,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
2023-12-06 17:39:37 +01:00
|
|
|
|
|
|
|
this.worldData.setDataConfiguration(worlddataconfiguration);
|
|
|
|
this.resources.managers.updateRegistryTags(this.registryAccess());
|
2024-01-18 18:52:00 +01:00
|
|
|
+ net.minecraft.world.item.alchemy.PotionBrewing.reload(); // Paper - Custom Potion Mixes
|
2024-01-23 12:06:27 +01:00
|
|
|
this.getPlayerList().saveAll();
|
|
|
|
this.getPlayerList().reloadResources();
|
|
|
|
this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary());
|
2022-02-23 04:09:15 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/world/inventory/BrewingStandMenu.java b/src/main/java/net/minecraft/world/inventory/BrewingStandMenu.java
|
2024-01-18 18:52:00 +01:00
|
|
|
index ad012400d76c263bf26cfa07e2e24f26dc32276b..054555c6b9c61243b1f14139b5c0eb2579403707 100644
|
2022-02-23 04:09:15 +01:00
|
|
|
--- a/src/main/java/net/minecraft/world/inventory/BrewingStandMenu.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/inventory/BrewingStandMenu.java
|
2023-12-06 17:00:26 +01:00
|
|
|
@@ -169,7 +169,7 @@ public class BrewingStandMenu extends AbstractContainerMenu {
|
2022-02-23 04:09:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public static boolean mayPlaceItem(ItemStack stack) {
|
|
|
|
- return stack.is(Items.POTION) || stack.is(Items.SPLASH_POTION) || stack.is(Items.LINGERING_POTION) || stack.is(Items.GLASS_BOTTLE);
|
2024-01-18 18:52:00 +01:00
|
|
|
+ return stack.is(Items.POTION) || stack.is(Items.SPLASH_POTION) || stack.is(Items.LINGERING_POTION) || stack.is(Items.GLASS_BOTTLE) || PotionBrewing.isCustomInput(stack); // Paper - Custom Potion Mixes
|
2022-02-23 04:09:15 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/item/alchemy/PotionBrewing.java b/src/main/java/net/minecraft/world/item/alchemy/PotionBrewing.java
|
2024-04-12 21:14:06 +02:00
|
|
|
index a37573d06aeaa4ae05d26fa26c888524dd834421..96197185d1cba4a77bd6afd0e57615b45d4dfc85 100644
|
2022-02-23 04:09:15 +01:00
|
|
|
--- a/src/main/java/net/minecraft/world/item/alchemy/PotionBrewing.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/item/alchemy/PotionBrewing.java
|
|
|
|
@@ -14,6 +14,7 @@ public class PotionBrewing {
|
|
|
|
public static final int BREWING_TIME_SECONDS = 20;
|
|
|
|
private static final List<PotionBrewing.Mix<Potion>> POTION_MIXES = Lists.newArrayList();
|
|
|
|
private static final List<PotionBrewing.Mix<Item>> CONTAINER_MIXES = Lists.newArrayList();
|
2024-01-18 18:52:00 +01:00
|
|
|
+ private static final it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap<org.bukkit.NamespacedKey, io.papermc.paper.potion.PaperPotionMix> CUSTOM_MIXES = new it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap<>(); // Paper - Custom Potion Mixes
|
2022-02-23 04:09:15 +01:00
|
|
|
private static final List<Ingredient> ALLOWED_CONTAINERS = Lists.newArrayList();
|
2024-04-12 21:14:06 +02:00
|
|
|
private static final Predicate<ItemStack> ALLOWED_CONTAINER = stack -> {
|
|
|
|
for (Ingredient ingredient : ALLOWED_CONTAINERS) {
|
2022-02-23 04:09:15 +01:00
|
|
|
@@ -26,7 +27,7 @@ public class PotionBrewing {
|
|
|
|
};
|
|
|
|
|
|
|
|
public static boolean isIngredient(ItemStack stack) {
|
|
|
|
- return isContainerIngredient(stack) || isPotionIngredient(stack);
|
2024-01-18 18:52:00 +01:00
|
|
|
+ return isContainerIngredient(stack) || isPotionIngredient(stack) || isCustomIngredient(stack); // Paper - Custom Potion Mixes
|
2022-02-23 04:09:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
protected static boolean isContainerIngredient(ItemStack stack) {
|
2023-09-22 17:08:04 +02:00
|
|
|
@@ -60,6 +61,11 @@ public class PotionBrewing {
|
2022-02-23 04:09:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public static boolean hasMix(ItemStack input, ItemStack ingredient) {
|
2024-01-18 18:52:00 +01:00
|
|
|
+ // Paper start - Custom Potion Mixes
|
2022-02-23 04:09:15 +01:00
|
|
|
+ if (hasCustomMix(input, ingredient)) {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
2024-01-18 18:52:00 +01:00
|
|
|
+ // Paper end - Custom Potion Mixes
|
2024-04-12 21:14:06 +02:00
|
|
|
return ALLOWED_CONTAINER.test(input) && (hasContainerMix(input, ingredient) || hasPotionMix(input, ingredient));
|
|
|
|
}
|
|
|
|
|
|
|
|
@@ -89,6 +95,13 @@ public class PotionBrewing {
|
2022-02-23 04:09:15 +01:00
|
|
|
|
|
|
|
public static ItemStack mix(ItemStack ingredient, ItemStack input) {
|
|
|
|
if (!input.isEmpty()) {
|
2024-01-18 18:52:00 +01:00
|
|
|
+ // Paper start - Custom Potion Mixes
|
2022-02-23 04:09:15 +01:00
|
|
|
+ for (var mix : CUSTOM_MIXES.values()) {
|
|
|
|
+ if (mix.input().test(input) && mix.ingredient().test(ingredient)) {
|
|
|
|
+ return mix.result().copy();
|
|
|
|
+ }
|
|
|
|
+ }
|
2024-01-18 18:52:00 +01:00
|
|
|
+ // Paper end - Custom Potion Mixes
|
2022-02-23 04:09:15 +01:00
|
|
|
Potion potion = PotionUtils.getPotion(input);
|
|
|
|
Item item = input.getItem();
|
2023-09-22 17:08:04 +02:00
|
|
|
|
2024-04-12 21:14:06 +02:00
|
|
|
@@ -108,6 +121,54 @@ public class PotionBrewing {
|
2022-02-23 04:09:15 +01:00
|
|
|
return input;
|
|
|
|
}
|
|
|
|
|
2024-01-18 18:52:00 +01:00
|
|
|
+ // Paper start - Custom Potion Mixes
|
2022-02-23 04:09:15 +01:00
|
|
|
+ public static boolean isCustomIngredient(ItemStack stack) {
|
|
|
|
+ for (var mix : CUSTOM_MIXES.values()) {
|
|
|
|
+ if (mix.ingredient().test(stack)) {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static boolean isCustomInput(ItemStack stack) {
|
|
|
|
+ for (var mix : CUSTOM_MIXES.values()) {
|
|
|
|
+ if (mix.input().test(stack)) {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private static boolean hasCustomMix(ItemStack input, ItemStack ingredient) {
|
|
|
|
+ for (var mix : CUSTOM_MIXES.values()) {
|
|
|
|
+ if (mix.input().test(input) && mix.ingredient().test(ingredient)) {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static void addPotionMix(io.papermc.paper.potion.PotionMix mix) {
|
|
|
|
+ if (CUSTOM_MIXES.containsKey(mix.getKey())) {
|
|
|
|
+ throw new IllegalArgumentException("Duplicate recipe ignored with ID " + mix.getKey());
|
|
|
|
+ }
|
|
|
|
+ CUSTOM_MIXES.putAndMoveToFirst(mix.getKey(), new io.papermc.paper.potion.PaperPotionMix(mix));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static boolean removePotionMix(org.bukkit.NamespacedKey key) {
|
|
|
|
+ return CUSTOM_MIXES.remove(key) != null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static void reload() {
|
|
|
|
+ POTION_MIXES.clear();
|
|
|
|
+ CONTAINER_MIXES.clear();
|
|
|
|
+ ALLOWED_CONTAINERS.clear();
|
|
|
|
+ CUSTOM_MIXES.clear();
|
|
|
|
+ bootStrap();
|
|
|
|
+ }
|
2024-01-18 18:52:00 +01:00
|
|
|
+ // Paper end - Custom Potion Mixes
|
2022-02-23 04:09:15 +01:00
|
|
|
+
|
|
|
|
public static void bootStrap() {
|
|
|
|
addContainer(Items.POTION);
|
|
|
|
addContainer(Items.SPLASH_POTION);
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
Updated Upstream (Bukkit/CraftBukkit) (#10242)
* Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
a6a9d2a4 Remove some old ApiStatus.Experimental annotations
be72314c SPIGOT-7300, PR-829: Add new DamageSource API providing enhanced information about entity damage
b252cf05 SPIGOT-7576, PR-970: Add methods in MushroomCow to change stew effects
b1c689bd PR-902: Add Server#isLoggingIPs to get log-ips configuration
08f86d1c PR-971: Add Player methods for client-side potion effects
2e3024a9 PR-963: Add API for in-world structures
a23292a7 SPIGOT-7530, PR-948: Improve Resource Pack API with new 1.20.3 functionality
1851857b SPIGOT-3071, PR-969: Add entity spawn method with spawn reason
cde4c52a SPIGOT-5553, PR-964: Add EntityKnockbackEvent
CraftBukkit Changes:
38fd4bd50 Fix accidentally renamed internal damage method
80f0ce4be SPIGOT-7300, PR-1180: Add new DamageSource API providing enhanced information about entity damage
7e43f3b16 SPIGOT-7581: Fix typo in BlockMushroom
ea14b7d90 SPIGOT-7576, PR-1347: Add methods in MushroomCow to change stew effects
4c687f243 PR-1259: Add Server#isLoggingIPs to get log-ips configuration
22a541a29 Improve support for per-world game rules
cb7dccce2 PR-1348: Add Player methods for client-side potion effects
b8d6109f0 PR-1335: Add API for in-world structures
4398a1b5b SPIGOT-7577: Make CraftWindCharge#explode discard the entity
e74107678 Fix Crafter maximum stack size
0bb0f4f6a SPIGOT-7530, PR-1314: Improve Resource Pack API with new 1.20.3 functionality
4949f556d SPIGOT-3071, PR-1345: Add entity spawn method with spawn reason
20ac73ca2 PR-1353: Fix Structure#place not working as documented with 0 palette
3c1b77871 SPIGOT-6911, PR-1349: Change max book length in CraftMetaBook
333701839 SPIGOT-7572: Bee nests generated without bees
f48f4174c SPIGOT-5553, PR-1336: Add EntityKnockbackEvent
2024-02-11 22:28:00 +01:00
|
|
|
index b31d7053abf1d2432b4887dab2bd8f8cc5308554..9bb542ce3a8c52e1688bb1f66fc916dd23a5fd10 100644
|
2022-02-23 04:09:15 +01:00
|
|
|
--- a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
2023-03-14 21:55:49 +01:00
|
|
|
@@ -341,7 +341,7 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements
|
2022-02-23 04:09:15 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean canPlaceItem(int slot, ItemStack stack) {
|
|
|
|
- return slot == 3 ? PotionBrewing.isIngredient(stack) : (slot == 4 ? stack.is(Items.BLAZE_POWDER) : (stack.is(Items.POTION) || stack.is(Items.SPLASH_POTION) || stack.is(Items.LINGERING_POTION) || stack.is(Items.GLASS_BOTTLE)) && this.getItem(slot).isEmpty());
|
2024-01-18 18:52:00 +01:00
|
|
|
+ return slot == 3 ? PotionBrewing.isIngredient(stack) : (slot == 4 ? stack.is(Items.BLAZE_POWDER) : (stack.is(Items.POTION) || stack.is(Items.SPLASH_POTION) || stack.is(Items.LINGERING_POTION) || stack.is(Items.GLASS_BOTTLE) || PotionBrewing.isCustomInput(stack)) && this.getItem(slot).isEmpty()); // Paper - Custom Potion Mixes
|
2022-02-23 04:09:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
Updated Upstream (Bukkit/CraftBukkit) (#10242)
* Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
a6a9d2a4 Remove some old ApiStatus.Experimental annotations
be72314c SPIGOT-7300, PR-829: Add new DamageSource API providing enhanced information about entity damage
b252cf05 SPIGOT-7576, PR-970: Add methods in MushroomCow to change stew effects
b1c689bd PR-902: Add Server#isLoggingIPs to get log-ips configuration
08f86d1c PR-971: Add Player methods for client-side potion effects
2e3024a9 PR-963: Add API for in-world structures
a23292a7 SPIGOT-7530, PR-948: Improve Resource Pack API with new 1.20.3 functionality
1851857b SPIGOT-3071, PR-969: Add entity spawn method with spawn reason
cde4c52a SPIGOT-5553, PR-964: Add EntityKnockbackEvent
CraftBukkit Changes:
38fd4bd50 Fix accidentally renamed internal damage method
80f0ce4be SPIGOT-7300, PR-1180: Add new DamageSource API providing enhanced information about entity damage
7e43f3b16 SPIGOT-7581: Fix typo in BlockMushroom
ea14b7d90 SPIGOT-7576, PR-1347: Add methods in MushroomCow to change stew effects
4c687f243 PR-1259: Add Server#isLoggingIPs to get log-ips configuration
22a541a29 Improve support for per-world game rules
cb7dccce2 PR-1348: Add Player methods for client-side potion effects
b8d6109f0 PR-1335: Add API for in-world structures
4398a1b5b SPIGOT-7577: Make CraftWindCharge#explode discard the entity
e74107678 Fix Crafter maximum stack size
0bb0f4f6a SPIGOT-7530, PR-1314: Improve Resource Pack API with new 1.20.3 functionality
4949f556d SPIGOT-3071, PR-1345: Add entity spawn method with spawn reason
20ac73ca2 PR-1353: Fix Structure#place not working as documented with 0 palette
3c1b77871 SPIGOT-6911, PR-1349: Change max book length in CraftMetaBook
333701839 SPIGOT-7572: Bee nests generated without bees
f48f4174c SPIGOT-5553, PR-1336: Add EntityKnockbackEvent
2024-02-11 22:28:00 +01:00
|
|
|
index f629991fa998d4dab89ed5c3d26b1b7a4f85b5cb..d8bec75e7f5c034051839818f51cdae71863608c 100644
|
2022-02-23 04:09:15 +01:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
Updated Upstream (Bukkit/CraftBukkit) (#10242)
* Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
a6a9d2a4 Remove some old ApiStatus.Experimental annotations
be72314c SPIGOT-7300, PR-829: Add new DamageSource API providing enhanced information about entity damage
b252cf05 SPIGOT-7576, PR-970: Add methods in MushroomCow to change stew effects
b1c689bd PR-902: Add Server#isLoggingIPs to get log-ips configuration
08f86d1c PR-971: Add Player methods for client-side potion effects
2e3024a9 PR-963: Add API for in-world structures
a23292a7 SPIGOT-7530, PR-948: Improve Resource Pack API with new 1.20.3 functionality
1851857b SPIGOT-3071, PR-969: Add entity spawn method with spawn reason
cde4c52a SPIGOT-5553, PR-964: Add EntityKnockbackEvent
CraftBukkit Changes:
38fd4bd50 Fix accidentally renamed internal damage method
80f0ce4be SPIGOT-7300, PR-1180: Add new DamageSource API providing enhanced information about entity damage
7e43f3b16 SPIGOT-7581: Fix typo in BlockMushroom
ea14b7d90 SPIGOT-7576, PR-1347: Add methods in MushroomCow to change stew effects
4c687f243 PR-1259: Add Server#isLoggingIPs to get log-ips configuration
22a541a29 Improve support for per-world game rules
cb7dccce2 PR-1348: Add Player methods for client-side potion effects
b8d6109f0 PR-1335: Add API for in-world structures
4398a1b5b SPIGOT-7577: Make CraftWindCharge#explode discard the entity
e74107678 Fix Crafter maximum stack size
0bb0f4f6a SPIGOT-7530, PR-1314: Improve Resource Pack API with new 1.20.3 functionality
4949f556d SPIGOT-3071, PR-1345: Add entity spawn method with spawn reason
20ac73ca2 PR-1353: Fix Structure#place not working as documented with 0 palette
3c1b77871 SPIGOT-6911, PR-1349: Change max book length in CraftMetaBook
333701839 SPIGOT-7572: Bee nests generated without bees
f48f4174c SPIGOT-5553, PR-1336: Add EntityKnockbackEvent
2024-02-11 22:28:00 +01:00
|
|
|
@@ -306,6 +306,7 @@ public final class CraftServer implements Server {
|
2022-02-23 04:09:15 +01:00
|
|
|
private final io.papermc.paper.datapack.PaperDatapackManager datapackManager; // Paper
|
|
|
|
public static Exception excessiveVelEx; // Paper - Velocity warnings
|
|
|
|
private final io.papermc.paper.logging.SysoutCatcher sysoutCatcher = new io.papermc.paper.logging.SysoutCatcher(); // Paper
|
2024-01-18 18:52:00 +01:00
|
|
|
+ private final CraftPotionBrewer potionBrewer = new CraftPotionBrewer(); // Paper - Custom Potion Mixes
|
2022-02-23 04:09:15 +01:00
|
|
|
|
|
|
|
static {
|
|
|
|
ConfigurationSerialization.registerClass(CraftOfflinePlayer.class);
|
Updated Upstream (Bukkit/CraftBukkit) (#10242)
* Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
a6a9d2a4 Remove some old ApiStatus.Experimental annotations
be72314c SPIGOT-7300, PR-829: Add new DamageSource API providing enhanced information about entity damage
b252cf05 SPIGOT-7576, PR-970: Add methods in MushroomCow to change stew effects
b1c689bd PR-902: Add Server#isLoggingIPs to get log-ips configuration
08f86d1c PR-971: Add Player methods for client-side potion effects
2e3024a9 PR-963: Add API for in-world structures
a23292a7 SPIGOT-7530, PR-948: Improve Resource Pack API with new 1.20.3 functionality
1851857b SPIGOT-3071, PR-969: Add entity spawn method with spawn reason
cde4c52a SPIGOT-5553, PR-964: Add EntityKnockbackEvent
CraftBukkit Changes:
38fd4bd50 Fix accidentally renamed internal damage method
80f0ce4be SPIGOT-7300, PR-1180: Add new DamageSource API providing enhanced information about entity damage
7e43f3b16 SPIGOT-7581: Fix typo in BlockMushroom
ea14b7d90 SPIGOT-7576, PR-1347: Add methods in MushroomCow to change stew effects
4c687f243 PR-1259: Add Server#isLoggingIPs to get log-ips configuration
22a541a29 Improve support for per-world game rules
cb7dccce2 PR-1348: Add Player methods for client-side potion effects
b8d6109f0 PR-1335: Add API for in-world structures
4398a1b5b SPIGOT-7577: Make CraftWindCharge#explode discard the entity
e74107678 Fix Crafter maximum stack size
0bb0f4f6a SPIGOT-7530, PR-1314: Improve Resource Pack API with new 1.20.3 functionality
4949f556d SPIGOT-3071, PR-1345: Add entity spawn method with spawn reason
20ac73ca2 PR-1353: Fix Structure#place not working as documented with 0 palette
3c1b77871 SPIGOT-6911, PR-1349: Change max book length in CraftMetaBook
333701839 SPIGOT-7572: Bee nests generated without bees
f48f4174c SPIGOT-5553, PR-1336: Add EntityKnockbackEvent
2024-02-11 22:28:00 +01:00
|
|
|
@@ -332,7 +333,7 @@ public final class CraftServer implements Server {
|
2023-12-06 17:00:26 +01:00
|
|
|
|
|
|
|
CraftRegistry.setMinecraftRegistry(console.registryAccess());
|
2022-02-23 04:09:15 +01:00
|
|
|
|
|
|
|
- Potion.setPotionBrewer(new CraftPotionBrewer());
|
2024-01-18 18:52:00 +01:00
|
|
|
+ Potion.setPotionBrewer(potionBrewer); // Paper - Custom Potion Mixes
|
2022-02-23 04:09:15 +01:00
|
|
|
// Ugly hack :(
|
2023-12-06 17:00:26 +01:00
|
|
|
|
|
|
|
if (!Main.useConsole) {
|
Updated Upstream (Bukkit/CraftBukkit) (#10242)
* Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
a6a9d2a4 Remove some old ApiStatus.Experimental annotations
be72314c SPIGOT-7300, PR-829: Add new DamageSource API providing enhanced information about entity damage
b252cf05 SPIGOT-7576, PR-970: Add methods in MushroomCow to change stew effects
b1c689bd PR-902: Add Server#isLoggingIPs to get log-ips configuration
08f86d1c PR-971: Add Player methods for client-side potion effects
2e3024a9 PR-963: Add API for in-world structures
a23292a7 SPIGOT-7530, PR-948: Improve Resource Pack API with new 1.20.3 functionality
1851857b SPIGOT-3071, PR-969: Add entity spawn method with spawn reason
cde4c52a SPIGOT-5553, PR-964: Add EntityKnockbackEvent
CraftBukkit Changes:
38fd4bd50 Fix accidentally renamed internal damage method
80f0ce4be SPIGOT-7300, PR-1180: Add new DamageSource API providing enhanced information about entity damage
7e43f3b16 SPIGOT-7581: Fix typo in BlockMushroom
ea14b7d90 SPIGOT-7576, PR-1347: Add methods in MushroomCow to change stew effects
4c687f243 PR-1259: Add Server#isLoggingIPs to get log-ips configuration
22a541a29 Improve support for per-world game rules
cb7dccce2 PR-1348: Add Player methods for client-side potion effects
b8d6109f0 PR-1335: Add API for in-world structures
4398a1b5b SPIGOT-7577: Make CraftWindCharge#explode discard the entity
e74107678 Fix Crafter maximum stack size
0bb0f4f6a SPIGOT-7530, PR-1314: Improve Resource Pack API with new 1.20.3 functionality
4949f556d SPIGOT-3071, PR-1345: Add entity spawn method with spawn reason
20ac73ca2 PR-1353: Fix Structure#place not working as documented with 0 palette
3c1b77871 SPIGOT-6911, PR-1349: Change max book length in CraftMetaBook
333701839 SPIGOT-7572: Bee nests generated without bees
f48f4174c SPIGOT-5553, PR-1336: Add EntityKnockbackEvent
2024-02-11 22:28:00 +01:00
|
|
|
@@ -3079,5 +3080,10 @@ public final class CraftServer implements Server {
|
2022-02-23 04:09:15 +01:00
|
|
|
return datapackManager;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public CraftPotionBrewer getPotionBrewer() {
|
|
|
|
+ return this.potionBrewer;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
// Paper end
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java
|
2024-01-14 10:46:04 +01:00
|
|
|
index 139dff90561ac6c51954c6289918a07aeea13a1b..6ba29875d78ede4aa7978ff689e588f7fed11528 100644
|
2022-02-23 04:09:15 +01:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java
|
2024-01-14 10:46:04 +01:00
|
|
|
@@ -15,6 +15,11 @@ public interface CraftRecipe extends Recipe {
|
2022-02-23 04:09:15 +01:00
|
|
|
void addToCraftingManager();
|
|
|
|
|
|
|
|
default Ingredient toNMS(RecipeChoice bukkit, boolean requireNotEmpty) {
|
|
|
|
+ // Paper start
|
|
|
|
+ return toIngredient(bukkit, requireNotEmpty);
|
|
|
|
+ }
|
|
|
|
+ static Ingredient toIngredient(RecipeChoice bukkit, boolean requireNotEmpty) {
|
|
|
|
+ // Paper end
|
|
|
|
Ingredient stack;
|
|
|
|
|
|
|
|
if (bukkit == null) {
|
2023-12-06 17:39:37 +01:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionBrewer.java b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionBrewer.java
|
|
|
|
index 09ac71b6b41c757832792d9ea8ac9288f8a7404f..2909a2736a0c9d863c7ab01e0ec259f7952080cc 100644
|
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionBrewer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionBrewer.java
|
|
|
|
@@ -28,4 +28,21 @@ public class CraftPotionBrewer implements PotionBrewer {
|
|
|
|
public PotionEffect createEffect(PotionEffectType potion, int duration, int amplifier) {
|
|
|
|
return new PotionEffect(potion, potion.isInstant() ? 1 : (int) (duration * potion.getDurationModifier()), amplifier);
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
|
|
|
+ public void addPotionMix(io.papermc.paper.potion.PotionMix potionMix) {
|
|
|
|
+ net.minecraft.world.item.alchemy.PotionBrewing.addPotionMix(potionMix);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void removePotionMix(org.bukkit.NamespacedKey key) {
|
|
|
|
+ net.minecraft.world.item.alchemy.PotionBrewing.removePotionMix(key);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void resetPotionMixes() {
|
|
|
|
+ net.minecraft.world.item.alchemy.PotionBrewing.reload();
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
}
|