mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-25 20:16:19 +01:00
SPIGOT-4638: Give last registered recipe priority
This commit is contained in:
parent
cb98c6eaef
commit
40cbae42b1
@ -1,5 +1,23 @@
|
|||||||
--- a/net/minecraft/server/CraftingManager.java
|
--- a/net/minecraft/server/CraftingManager.java
|
||||||
+++ b/net/minecraft/server/CraftingManager.java
|
+++ b/net/minecraft/server/CraftingManager.java
|
||||||
|
@@ -20,7 +20,7 @@
|
||||||
|
private static final Logger c = LogManager.getLogger();
|
||||||
|
public static final int a = "recipes/".length();
|
||||||
|
public static final int b = ".json".length();
|
||||||
|
- public Map<MinecraftKey, IRecipe> recipes = Maps.newHashMap();
|
||||||
|
+ public it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap<MinecraftKey, IRecipe> recipes = new it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap<>(); // CraftBukkit
|
||||||
|
private boolean e;
|
||||||
|
|
||||||
|
public CraftingManager() {}
|
||||||
|
@@ -84,7 +84,7 @@
|
||||||
|
if (this.recipes.containsKey(irecipe.getKey())) {
|
||||||
|
throw new IllegalStateException("Duplicate recipe ignored with ID " + irecipe.getKey());
|
||||||
|
} else {
|
||||||
|
- this.recipes.put(irecipe.getKey(), irecipe);
|
||||||
|
+ this.recipes.putAndMoveToFirst(irecipe.getKey(), irecipe); // CraftBukkit - SPIGOT-4638: last recipe gets priority
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -95,12 +95,14 @@
|
@@ -95,12 +95,14 @@
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
Loading…
Reference in New Issue
Block a user