Skip to content

Commit

Permalink
Use new potion names in config for gapples module
Browse files Browse the repository at this point in the history
  • Loading branch information
kernitus committed Jun 2, 2024
1 parent 68941fc commit 41ad033
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

import org.bukkit.potion.PotionEffectType;

import java.util.Locale;

public enum PotionEffectTypeCompat {
RESISTANCE("DAMAGE_RESISTANCE"),
NAUSEA("CONFUSION"),
Expand Down Expand Up @@ -48,7 +50,7 @@ public PotionEffectType get() {
public static PotionEffectType fromNewName(String newName) {
try {
// See if new name needs mapping to old
return valueOf(newName).get();
return valueOf(newName.toUpperCase(Locale.ROOT)).get();
} catch (IllegalArgumentException e){
// Otherwise just use new name directly
return PotionEffectType.getByName(newName);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ old-golden-apples:
regeneration:
duration: 600
amplifier: 4
damage_resistance:
resistance:
duration: 6000
amplifier: 0
fire_resistance:
Expand Down

0 comments on commit 41ad033

Please sign in to comment.