mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-07 11:05:13 +01:00
SPIGOT-6540: Firework rockets not crafting into flight duration 1
By: md_5 <git@md-5.net>
This commit is contained in:
parent
d5a68b79c1
commit
1b34737612
1 changed files with 5 additions and 6 deletions
|
@ -29,21 +29,20 @@
|
||||||
Iterator iterator = map.entrySet().iterator();
|
Iterator iterator = map.entrySet().iterator();
|
||||||
|
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
@@ -57,28 +64,46 @@
|
@@ -57,8 +64,10 @@
|
||||||
try {
|
try {
|
||||||
IRecipe<?> irecipe = a(minecraftkey, ChatDeserializer.m((JsonElement) entry.getValue(), "top element"));
|
IRecipe<?> irecipe = a(minecraftkey, ChatDeserializer.m((JsonElement) entry.getValue(), "top element"));
|
||||||
|
|
||||||
- ((Builder) map1.computeIfAbsent(irecipe.g(), (recipes) -> {
|
- ((Builder) map1.computeIfAbsent(irecipe.g(), (recipes) -> {
|
||||||
- return ImmutableMap.builder();
|
- return ImmutableMap.builder();
|
||||||
- })).put(minecraftkey, irecipe);
|
+ // CraftBukkit start
|
||||||
+ // CraftBukkit start - SPIGOT-4638: last recipe gets priority
|
|
||||||
+ (map1.computeIfAbsent(irecipe.g(), (recipes) -> {
|
+ (map1.computeIfAbsent(irecipe.g(), (recipes) -> {
|
||||||
+ return new Object2ObjectLinkedOpenHashMap<>();
|
+ return new Object2ObjectLinkedOpenHashMap<>();
|
||||||
+ })).putAndMoveToFirst(minecraftkey, irecipe);
|
+ // CraftBukkit end
|
||||||
+ // CraftBukkit end
|
})).put(minecraftkey, irecipe);
|
||||||
} catch (IllegalArgumentException | JsonParseException jsonparseexception) {
|
} catch (IllegalArgumentException | JsonParseException jsonparseexception) {
|
||||||
CraftingManager.LOGGER.error("Parsing error loading recipe {}", minecraftkey, jsonparseexception);
|
CraftingManager.LOGGER.error("Parsing error loading recipe {}", minecraftkey, jsonparseexception);
|
||||||
}
|
@@ -66,19 +75,35 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
this.recipes = (Map) map1.entrySet().stream().collect(ImmutableMap.toImmutableMap(Entry::getKey, (entry1) -> {
|
this.recipes = (Map) map1.entrySet().stream().collect(ImmutableMap.toImmutableMap(Entry::getKey, (entry1) -> {
|
||||||
|
|
Loading…
Reference in a new issue