mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-10-29 03:41:45 +00:00
Compare commits
2 Commits
175526d3da
...
27a232d03e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
27a232d03e | ||
|
|
ce7461f459 |
@ -1,3 +1,6 @@
|
||||
Version 2.2.038
|
||||
Fix potion match failing for non-english locales
|
||||
|
||||
Version 2.2.037
|
||||
Fixed bug where Alchemy was not matching potions correctly and producing incorrect results (Thanks TheBentoBox)
|
||||
|
||||
|
||||
2
pom.xml
2
pom.xml
@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.gmail.nossr50.mcMMO</groupId>
|
||||
<artifactId>mcMMO</artifactId>
|
||||
<version>2.2.037</version>
|
||||
<version>2.2.038-SNAPSHOT</version>
|
||||
<name>mcMMO</name>
|
||||
<url>https://github.com/mcMMO-Dev/mcMMO</url>
|
||||
<scm>
|
||||
|
||||
@ -44,7 +44,7 @@ public class SalvageConfig extends BukkitConfig {
|
||||
if (mcMMO.getUpgradeManager().shouldUpgrade(UpgradeType.FIX_NETHERITE_SALVAGE_QUANTITIES)) {
|
||||
mcMMO.p.getLogger().log(Level.INFO, "Fixing incorrect Salvage quantities on Netherite gear, this will only run once...");
|
||||
for (String namespacedkey : mcMMO.getMaterialMapStore().getNetheriteArmor()) {
|
||||
config.set("Salvageables." + namespacedkey.toUpperCase() + ".MaximumQuantity", 4); //TODO: Doesn't make sense to default to 4 for everything
|
||||
config.set("Salvageables." + namespacedkey.toUpperCase(Locale.ENGLISH) + ".MaximumQuantity", 4); //TODO: Doesn't make sense to default to 4 for everything
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@ -30,6 +30,7 @@ import java.lang.reflect.Method;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import static java.util.Objects.requireNonNull;
|
||||
@ -111,12 +112,12 @@ public final class ItemUtils {
|
||||
|
||||
// try to match to Material ENUM
|
||||
if (material == null) {
|
||||
material = Material.getMaterial(materialName.toUpperCase());
|
||||
material = Material.getMaterial(materialName.toUpperCase(Locale.ENGLISH));
|
||||
}
|
||||
|
||||
// try to match to Material ENUM with legacy name
|
||||
if (material == null) {
|
||||
material = Material.getMaterial(materialName.toUpperCase(), true);
|
||||
material = Material.getMaterial(materialName.toUpperCase(Locale.ENGLISH), true);
|
||||
}
|
||||
return material;
|
||||
}
|
||||
|
||||
@ -10,10 +10,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
public class PotionUtil {
|
||||
// Some of the old potion types got renamed, our configs can still contain these old names
|
||||
@ -72,15 +69,17 @@ public class PotionUtil {
|
||||
* @return The potion type
|
||||
*/
|
||||
public static PotionType matchPotionType(String partialName, boolean isUpgraded, boolean isExtended) {
|
||||
// updatedName = convertUpgradedOrExtended(updatedName, isUpgraded, isExtended);
|
||||
if (COMPATIBILITY_MODE == PotionCompatibilityType.PRE_1_20_5) {
|
||||
return matchLegacyPotionType(partialName);
|
||||
} else {
|
||||
String updatedName = convertLegacyNames(partialName).toUpperCase();
|
||||
final String updatedName = convertLegacyNames(partialName).toUpperCase(Locale.ENGLISH);
|
||||
return Arrays.stream(PotionType.values())
|
||||
.filter(potionType -> getKeyGetKey(potionType).toUpperCase().contains(updatedName))
|
||||
.filter(potionType -> isUpgraded == potionType.name().toUpperCase().startsWith(STRONG + "_"))
|
||||
.filter(potionType -> isExtended == potionType.name().toUpperCase().startsWith(LONG + "_"))
|
||||
.filter(potionType -> getKeyGetKey(potionType)
|
||||
.toUpperCase(Locale.ENGLISH).contains(updatedName))
|
||||
.filter(potionType -> isUpgraded == potionType.name()
|
||||
.toUpperCase(Locale.ENGLISH).startsWith(STRONG + "_"))
|
||||
.filter(potionType -> isExtended == potionType.name()
|
||||
.toUpperCase(Locale.ENGLISH).startsWith(LONG + "_"))
|
||||
.findAny().orElse(null);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user