Fixes pre-1.20 support

This commit is contained in:
Jules 2023-06-20 19:25:52 +02:00
parent 9f9e88ea43
commit 7a1ca884b9
2 changed files with 8 additions and 4 deletions

View File

@ -17,8 +17,6 @@ import org.bukkit.inventory.meta.trim.TrimPattern;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
/**
* @author Jules
*/
@ -26,7 +24,10 @@ public class TrimMaterialStat extends ChooseStat implements GemStoneStat {
public TrimMaterialStat() {
super("TRIM_MATERIAL", Material.LEATHER_CHESTPLATE, "Trim Material", new String[]{"Material to trim your armor with."}, new String[]{"armor"});
if (MythicLib.plugin.getVersion().isBelowOrEqual(1, 19)) disable();
if (MythicLib.plugin.getVersion().isBelowOrEqual(1, 19)) {
disable();
return;
}
for (TrimMaterial mat : Registry.TRIM_MATERIAL)
addChoices(new StatChoice(mat.getKey().getKey()));

View File

@ -24,7 +24,10 @@ public class TrimPatternStat extends ChooseStat implements GemStoneStat {
public TrimPatternStat() {
super("TRIM_PATTERN", Material.LEATHER_CHESTPLATE, "Trim Pattern", new String[]{"Pattern of trimmed armor."}, new String[]{"armor"});
if (MythicLib.plugin.getVersion().isBelowOrEqual(1, 19)) disable();
if (MythicLib.plugin.getVersion().isBelowOrEqual(1, 19)) {
disable();
return;
}
for (TrimPattern mat : Registry.TRIM_PATTERN)
addChoices(new StatChoice(mat.getKey().getKey()));