Added more enum validation and a util to the gui.
This commit is contained in:
@@ -4,7 +4,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = 'me.trouper'
|
group = 'me.trouper'
|
||||||
version = '1.0-1.21.1-SNAPSHOT'
|
version = '1.0-1.21.5-SNAPSHOT'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
@@ -19,7 +19,7 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly("io.papermc.paper:paper-api:1.21.1-R0.1-SNAPSHOT")
|
compileOnly("io.papermc.paper:paper-api:1.21.5-R0.1-SNAPSHOT")
|
||||||
}
|
}
|
||||||
|
|
||||||
def targetJavaVersion = 21
|
def targetJavaVersion = 21
|
||||||
|
|||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package me.trouper.alias.data.enums;
|
||||||
|
|
||||||
|
import org.bukkit.attribute.Attribute;
|
||||||
|
|
||||||
|
public enum ValidAttribute {
|
||||||
|
MAX_HEALTH(Attribute.MAX_HEALTH),
|
||||||
|
FOLLOW_RANGE(Attribute.FOLLOW_RANGE),
|
||||||
|
KNOCKBACK_RESISTANCE(Attribute.KNOCKBACK_RESISTANCE),
|
||||||
|
MOVEMENT_SPEED(Attribute.MOVEMENT_SPEED),
|
||||||
|
FLYING_SPEED(Attribute.FLYING_SPEED),
|
||||||
|
ATTACK_DAMAGE(Attribute.ATTACK_DAMAGE),
|
||||||
|
ATTACK_KNOCKBACK(Attribute.ATTACK_KNOCKBACK),
|
||||||
|
ATTACK_SPEED(Attribute.ATTACK_SPEED),
|
||||||
|
ARMOR(Attribute.ARMOR),
|
||||||
|
ARMOR_TOUGHNESS(Attribute.ARMOR_TOUGHNESS),
|
||||||
|
FALL_DAMAGE_MULTIPLIER(Attribute.FALL_DAMAGE_MULTIPLIER),
|
||||||
|
LUCK(Attribute.LUCK),
|
||||||
|
MAX_ABSORPTION(Attribute.MAX_ABSORPTION),
|
||||||
|
SAFE_FALL_DISTANCE(Attribute.SAFE_FALL_DISTANCE),
|
||||||
|
SCALE(Attribute.SCALE),
|
||||||
|
STEP_HEIGHT(Attribute.STEP_HEIGHT),
|
||||||
|
GRAVITY(Attribute.GRAVITY),
|
||||||
|
JUMP_STRENGTH(Attribute.JUMP_STRENGTH),
|
||||||
|
BURNING_TIME(Attribute.BURNING_TIME),
|
||||||
|
EXPLOSION_KNOCKBACK_RESISTANCE(Attribute.EXPLOSION_KNOCKBACK_RESISTANCE),
|
||||||
|
MOVEMENT_EFFICIENCY(Attribute.MOVEMENT_EFFICIENCY),
|
||||||
|
OXYGEN_BONUS(Attribute.OXYGEN_BONUS),
|
||||||
|
WATER_MOVEMENT_EFFICIENCY(Attribute.WATER_MOVEMENT_EFFICIENCY),
|
||||||
|
TEMPT_RANGE(Attribute.TEMPT_RANGE),
|
||||||
|
BLOCK_INTERACTION_RANGE(Attribute.BLOCK_INTERACTION_RANGE),
|
||||||
|
ENTITY_INTERACTION_RANGE(Attribute.ENTITY_INTERACTION_RANGE),
|
||||||
|
BLOCK_BREAK_SPEED(Attribute.BLOCK_BREAK_SPEED),
|
||||||
|
MINING_EFFICIENCY(Attribute.MINING_EFFICIENCY),
|
||||||
|
SNEAKING_SPEED(Attribute.SNEAKING_SPEED),
|
||||||
|
SUBMERGED_MINING_SPEED(Attribute.SUBMERGED_MINING_SPEED),
|
||||||
|
SWEEPING_DAMAGE_RATIO(Attribute.SWEEPING_DAMAGE_RATIO),
|
||||||
|
SPAWN_REINFORCEMENTS(Attribute.SPAWN_REINFORCEMENTS);
|
||||||
|
|
||||||
|
private final Attribute canonical;
|
||||||
|
|
||||||
|
ValidAttribute(Attribute canonical) {
|
||||||
|
this.canonical = canonical;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Attribute getCanonical() {
|
||||||
|
return canonical;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ValidAttribute validate(Attribute attribute) {
|
||||||
|
for (ValidAttribute value : ValidAttribute.values()) {
|
||||||
|
if (!value.getCanonical().equals(attribute)) continue;
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Attribute validate(String name) {
|
||||||
|
name = name.toUpperCase();
|
||||||
|
return ValidAttribute.valueOf(name).getCanonical();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
package me.trouper.alias.data.enums;
|
||||||
|
|
||||||
|
import org.bukkit.enchantments.Enchantment;
|
||||||
|
|
||||||
|
public enum ValidEnchantment {
|
||||||
|
PROTECTION(Enchantment.PROTECTION),
|
||||||
|
FIRE_PROTECTION(Enchantment.FIRE_PROTECTION),
|
||||||
|
FEATHER_FALLING(Enchantment.FEATHER_FALLING),
|
||||||
|
BLAST_PROTECTION(Enchantment.BLAST_PROTECTION),
|
||||||
|
PROJECTILE_PROTECTION(Enchantment.PROJECTILE_PROTECTION),
|
||||||
|
RESPIRATION(Enchantment.RESPIRATION),
|
||||||
|
AQUA_AFFINITY(Enchantment.AQUA_AFFINITY),
|
||||||
|
THORNS(Enchantment.THORNS),
|
||||||
|
DEPTH_STRIDER(Enchantment.DEPTH_STRIDER),
|
||||||
|
FROST_WALKER(Enchantment.FROST_WALKER),
|
||||||
|
BINDING_CURSE(Enchantment.BINDING_CURSE),
|
||||||
|
SHARPNESS(Enchantment.SHARPNESS),
|
||||||
|
SMITE(Enchantment.SMITE),
|
||||||
|
BANE_OF_ARTHROPODS(Enchantment.BANE_OF_ARTHROPODS),
|
||||||
|
KNOCKBACK(Enchantment.KNOCKBACK),
|
||||||
|
FIRE_ASPECT(Enchantment.FIRE_ASPECT),
|
||||||
|
LOOTING(Enchantment.LOOTING),
|
||||||
|
SWEEPING_EDGE(Enchantment.SWEEPING_EDGE),
|
||||||
|
EFFICIENCY(Enchantment.EFFICIENCY),
|
||||||
|
SILK_TOUCH(Enchantment.SILK_TOUCH),
|
||||||
|
UNBREAKING(Enchantment.UNBREAKING),
|
||||||
|
FORTUNE(Enchantment.FORTUNE),
|
||||||
|
POWER(Enchantment.POWER),
|
||||||
|
PUNCH(Enchantment.PUNCH),
|
||||||
|
FLAME(Enchantment.FLAME),
|
||||||
|
INFINITY(Enchantment.INFINITY),
|
||||||
|
LUCK_OF_THE_SEA(Enchantment.LUCK_OF_THE_SEA),
|
||||||
|
LURE(Enchantment.LURE),
|
||||||
|
LOYALTY(Enchantment.LOYALTY),
|
||||||
|
IMPALING(Enchantment.IMPALING),
|
||||||
|
RIPTIDE(Enchantment.RIPTIDE),
|
||||||
|
CHANNELING(Enchantment.CHANNELING),
|
||||||
|
MULTISHOT(Enchantment.MULTISHOT),
|
||||||
|
QUICK_CHARGE(Enchantment.QUICK_CHARGE),
|
||||||
|
PIERCING(Enchantment.PIERCING),
|
||||||
|
DENSITY(Enchantment.DENSITY),
|
||||||
|
BREACH(Enchantment.BREACH),
|
||||||
|
WIND_BURST(Enchantment.WIND_BURST),
|
||||||
|
MENDING(Enchantment.MENDING),
|
||||||
|
VANISHING_CURSE(Enchantment.VANISHING_CURSE),
|
||||||
|
SOUL_SPEED(Enchantment.SOUL_SPEED),
|
||||||
|
SWIFT_SNEAK(Enchantment.SWIFT_SNEAK);
|
||||||
|
|
||||||
|
private final Enchantment canonical;
|
||||||
|
|
||||||
|
ValidEnchantment(Enchantment canonical) {
|
||||||
|
this.canonical = canonical;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Enchantment getCanonical() {
|
||||||
|
return canonical;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ValidEnchantment validate(Enchantment enchantment) {
|
||||||
|
for (ValidEnchantment value : ValidEnchantment.values()) {
|
||||||
|
if (!value.getCanonical().equals(enchantment)) continue;
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Enchantment validate(String name) {
|
||||||
|
name = name.toUpperCase();
|
||||||
|
return ValidEnchantment.valueOf(name).getCanonical();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
package me.trouper.alias.data.enums;
|
|
||||||
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.inventory.meta.trim.TrimMaterial;
|
|
||||||
import org.bukkit.inventory.meta.trim.TrimPattern;
|
|
||||||
|
|
||||||
public enum ValidMaterial {
|
|
||||||
AMETHYST(TrimMaterial.AMETHYST),
|
|
||||||
COPPER(TrimMaterial.COPPER),
|
|
||||||
DIAMOND(TrimMaterial.DIAMOND),
|
|
||||||
EMERALD(TrimMaterial.EMERALD),
|
|
||||||
GOLD(TrimMaterial.GOLD),
|
|
||||||
IRON(TrimMaterial.IRON),
|
|
||||||
LAPIS(TrimMaterial.LAPIS),
|
|
||||||
NETHERITE(TrimMaterial.NETHERITE),
|
|
||||||
QUARTZ(TrimMaterial.QUARTZ),
|
|
||||||
REDSTONE(TrimMaterial.REDSTONE);
|
|
||||||
|
|
||||||
private final TrimMaterial canonical;
|
|
||||||
|
|
||||||
ValidMaterial(TrimMaterial canonical) {
|
|
||||||
this.canonical = canonical;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TrimMaterial getCanonical() {
|
|
||||||
return canonical;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ValidMaterial validate(TrimMaterial material) {
|
|
||||||
for (ValidMaterial value : ValidMaterial.values()) {
|
|
||||||
if (!value.getCanonical().equals(material)) continue;
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static TrimMaterial validate(String name) {
|
|
||||||
name = name.toUpperCase();
|
|
||||||
return ValidMaterial.valueOf(name).getCanonical();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
package me.trouper.alias.data.enums;
|
||||||
|
|
||||||
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
|
||||||
|
public enum ValidPotionEffectType {
|
||||||
|
SPEED(PotionEffectType.SPEED),
|
||||||
|
SLOWNESS(PotionEffectType.SLOWNESS),
|
||||||
|
HASTE(PotionEffectType.HASTE),
|
||||||
|
MINING_FATIGUE(PotionEffectType.MINING_FATIGUE),
|
||||||
|
STRENGTH(PotionEffectType.STRENGTH),
|
||||||
|
INSTANT_HEALTH(PotionEffectType.INSTANT_HEALTH),
|
||||||
|
INSTANT_DAMAGE(PotionEffectType.INSTANT_DAMAGE),
|
||||||
|
JUMP_BOOST(PotionEffectType.JUMP_BOOST),
|
||||||
|
NAUSEA(PotionEffectType.NAUSEA),
|
||||||
|
REGENERATION(PotionEffectType.REGENERATION),
|
||||||
|
RESISTANCE(PotionEffectType.RESISTANCE),
|
||||||
|
FIRE_RESISTANCE(PotionEffectType.FIRE_RESISTANCE),
|
||||||
|
WATER_BREATHING(PotionEffectType.WATER_BREATHING),
|
||||||
|
INVISIBILITY(PotionEffectType.INVISIBILITY),
|
||||||
|
BLINDNESS(PotionEffectType.BLINDNESS),
|
||||||
|
NIGHT_VISION(PotionEffectType.NIGHT_VISION),
|
||||||
|
HUNGER(PotionEffectType.HUNGER),
|
||||||
|
WEAKNESS(PotionEffectType.WEAKNESS),
|
||||||
|
POISON(PotionEffectType.POISON),
|
||||||
|
WITHER(PotionEffectType.WITHER),
|
||||||
|
HEALTH_BOOST(PotionEffectType.HEALTH_BOOST),
|
||||||
|
ABSORPTION(PotionEffectType.ABSORPTION),
|
||||||
|
SATURATION(PotionEffectType.SATURATION),
|
||||||
|
GLOWING(PotionEffectType.GLOWING),
|
||||||
|
LEVITATION(PotionEffectType.LEVITATION),
|
||||||
|
LUCK(PotionEffectType.LUCK),
|
||||||
|
UNLUCK(PotionEffectType.UNLUCK),
|
||||||
|
SLOW_FALLING(PotionEffectType.SLOW_FALLING),
|
||||||
|
CONDUIT_POWER(PotionEffectType.CONDUIT_POWER),
|
||||||
|
DOLPHINS_GRACE(PotionEffectType.DOLPHINS_GRACE),
|
||||||
|
BAD_OMEN(PotionEffectType.BAD_OMEN),
|
||||||
|
HERO_OF_THE_VILLAGE(PotionEffectType.HERO_OF_THE_VILLAGE),
|
||||||
|
DARKNESS(PotionEffectType.DARKNESS),
|
||||||
|
TRIAL_OMEN(PotionEffectType.TRIAL_OMEN),
|
||||||
|
RAID_OMEN(PotionEffectType.RAID_OMEN),
|
||||||
|
WIND_CHARGED(PotionEffectType.WIND_CHARGED),
|
||||||
|
WEAVING(PotionEffectType.WEAVING),
|
||||||
|
OOZING(PotionEffectType.OOZING),
|
||||||
|
INFESTED(PotionEffectType.INFESTED);
|
||||||
|
|
||||||
|
private final PotionEffectType canonical;
|
||||||
|
|
||||||
|
ValidPotionEffectType(PotionEffectType canonical) {
|
||||||
|
this.canonical = canonical;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PotionEffectType getCanonical() {
|
||||||
|
return canonical;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ValidPotionEffectType validate(PotionEffectType potionEffectType) {
|
||||||
|
for (ValidPotionEffectType value : ValidPotionEffectType.values()) {
|
||||||
|
if (!value.getCanonical().equals(potionEffectType)) continue;
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static PotionEffectType validate(String name) {
|
||||||
|
name = name.toUpperCase();
|
||||||
|
return ValidPotionEffectType.valueOf(name).getCanonical();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package me.trouper.alias.data.enums;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.inventory.meta.trim.TrimMaterial;
|
||||||
|
|
||||||
|
public enum ValidTrimMaterial {
|
||||||
|
AMETHYST(TrimMaterial.AMETHYST, Material.AMETHYST_SHARD),
|
||||||
|
COPPER(TrimMaterial.COPPER, Material.COPPER_INGOT),
|
||||||
|
DIAMOND(TrimMaterial.DIAMOND, Material.DIAMOND),
|
||||||
|
EMERALD(TrimMaterial.EMERALD, Material.EMERALD),
|
||||||
|
GOLD(TrimMaterial.GOLD, Material.GOLD_INGOT),
|
||||||
|
IRON(TrimMaterial.IRON, Material.IRON_INGOT),
|
||||||
|
LAPIS(TrimMaterial.LAPIS, Material.LAPIS_LAZULI),
|
||||||
|
NETHERITE(TrimMaterial.NETHERITE, Material.NETHERITE_INGOT),
|
||||||
|
QUARTZ(TrimMaterial.QUARTZ, Material.QUARTZ),
|
||||||
|
REDSTONE(TrimMaterial.REDSTONE, Material.REDSTONE),
|
||||||
|
RESIN(TrimMaterial.RESIN, Material.RESIN_BRICK);
|
||||||
|
|
||||||
|
private final TrimMaterial canonical;
|
||||||
|
private final Material material;
|
||||||
|
|
||||||
|
ValidTrimMaterial(TrimMaterial canonical, Material material) {
|
||||||
|
this.canonical = canonical;
|
||||||
|
this.material = material;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TrimMaterial getCanonical() {
|
||||||
|
return canonical;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Material getMaterial() {
|
||||||
|
return material;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ValidTrimMaterial validate(TrimMaterial material) {
|
||||||
|
for (ValidTrimMaterial value : ValidTrimMaterial.values()) {
|
||||||
|
if (!value.getCanonical().equals(material)) continue;
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TrimMaterial validate(String name) {
|
||||||
|
name = name.toUpperCase();
|
||||||
|
return ValidTrimMaterial.valueOf(name).getCanonical();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,7 +3,7 @@ package me.trouper.alias.data.enums;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.inventory.meta.trim.TrimPattern;
|
import org.bukkit.inventory.meta.trim.TrimPattern;
|
||||||
|
|
||||||
public enum ValidPattern {
|
public enum ValidTrimPattern {
|
||||||
BOLT(TrimPattern.BOLT, Material.BOLT_ARMOR_TRIM_SMITHING_TEMPLATE),
|
BOLT(TrimPattern.BOLT, Material.BOLT_ARMOR_TRIM_SMITHING_TEMPLATE),
|
||||||
COAST(TrimPattern.COAST, Material.COAST_ARMOR_TRIM_SMITHING_TEMPLATE),
|
COAST(TrimPattern.COAST, Material.COAST_ARMOR_TRIM_SMITHING_TEMPLATE),
|
||||||
DUNE(TrimPattern.DUNE, Material.DUNE_ARMOR_TRIM_SMITHING_TEMPLATE),
|
DUNE(TrimPattern.DUNE, Material.DUNE_ARMOR_TRIM_SMITHING_TEMPLATE),
|
||||||
@@ -26,7 +26,7 @@ public enum ValidPattern {
|
|||||||
private final TrimPattern canonical;
|
private final TrimPattern canonical;
|
||||||
private final Material material;
|
private final Material material;
|
||||||
|
|
||||||
ValidPattern(TrimPattern canonical, Material material) {
|
ValidTrimPattern(TrimPattern canonical, Material material) {
|
||||||
this.canonical = canonical;
|
this.canonical = canonical;
|
||||||
this.material = material;
|
this.material = material;
|
||||||
}
|
}
|
||||||
@@ -39,8 +39,8 @@ public enum ValidPattern {
|
|||||||
return canonical;
|
return canonical;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ValidPattern validate(TrimPattern pattern) {
|
public static ValidTrimPattern validate(TrimPattern pattern) {
|
||||||
for (ValidPattern value : ValidPattern.values()) {
|
for (ValidTrimPattern value : ValidTrimPattern.values()) {
|
||||||
if (!value.getCanonical().equals(pattern)) continue;
|
if (!value.getCanonical().equals(pattern)) continue;
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
@@ -49,6 +49,6 @@ public enum ValidPattern {
|
|||||||
|
|
||||||
public static TrimPattern validate(String name) {
|
public static TrimPattern validate(String name) {
|
||||||
name = name.toUpperCase();
|
name = name.toUpperCase();
|
||||||
return ValidPattern.valueOf(name).getCanonical();
|
return ValidTrimPattern.valueOf(name).getCanonical();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -150,11 +150,11 @@ public class GuiInputListener implements Listener {
|
|||||||
waitingPlayers.clear();
|
waitingPlayers.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void sendInputInstructions(Player player, String prompt) {
|
public void sendInputInstructions(Player player, String prompt) {
|
||||||
sendInputInstructions(player, prompt, true);
|
sendInputInstructions(player, prompt, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void sendInputInstructions(Player player, String prompt, boolean showCancelOption) {
|
public void sendInputInstructions(Player player, String prompt, boolean showCancelOption) {
|
||||||
player.sendMessage(Component.text("").append(Component.text("▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬", NamedTextColor.GRAY)));
|
player.sendMessage(Component.text("").append(Component.text("▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬", NamedTextColor.GRAY)));
|
||||||
player.sendMessage(MiniMessage.miniMessage().deserialize(prompt));
|
player.sendMessage(MiniMessage.miniMessage().deserialize(prompt));
|
||||||
if (showCancelOption) {
|
if (showCancelOption) {
|
||||||
@@ -162,4 +162,12 @@ public class GuiInputListener implements Listener {
|
|||||||
}
|
}
|
||||||
player.sendMessage(Component.text("▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬", NamedTextColor.GRAY));
|
player.sendMessage(Component.text("▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬", NamedTextColor.GRAY));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void requestChatInput(QuickGui gui, Player player, String callbackId, String prompt) {
|
||||||
|
registerWaitingPlayer(player, gui);
|
||||||
|
|
||||||
|
gui.requestInput(player, callbackId);
|
||||||
|
|
||||||
|
sendInputInstructions(player, prompt);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
12
src/main/java/me/trouper/alias/utils/misc/MapUtils.java
Normal file
12
src/main/java/me/trouper/alias/utils/misc/MapUtils.java
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
package me.trouper.alias.utils.misc;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class MapUtils {
|
||||||
|
public static <K, V extends Comparable<V>> boolean allValuesMatch(Map<K, V> actual, Map<K, V> required) {
|
||||||
|
return required.entrySet().stream().allMatch(entry ->
|
||||||
|
actual.containsKey(entry.getKey()) &&
|
||||||
|
actual.get(entry.getKey()).compareTo(entry.getValue()) >= 0
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user