Merge pull request #40 from Esophose/33-gui-icons

Move GUI icon settings to individual effect/style config files
This commit is contained in:
Esophose 2020-04-13 19:47:15 -06:00 committed by GitHub
commit f2a3263b41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 316 additions and 190 deletions

View file

@ -36,7 +36,7 @@ public class GuiInventoryEditEffect extends GuiInventory {
ParticleEffect effect = effectsUserHasPermissionFor.get(i);
GuiActionButton selectButton = new GuiActionButton(
slot,
GuiIcon.EFFECT.get(effect.getInternalName()),
effect.getGuiIconMaterial(),
localeManager.getLocaleMessage("gui-color-icon-name") + ParticleUtils.formatName(effect.getName()),
new String[]{localeManager.getLocaleMessage("gui-color-info") + localeManager.getLocaleMessage("gui-select-effect-description", StringPlaceholders.single("effect", ParticleUtils.formatName(effect.getName())))},
(button, isShiftClick) -> {

View file

@ -36,7 +36,7 @@ public class GuiInventoryEditStyle extends GuiInventory {
ParticleStyle style = stylesUserHasPermissionFor.get(i);
GuiActionButton selectButton = new GuiActionButton(
slot,
GuiIcon.STYLE.get(style.getInternalName()),
style.getGuiIconMaterial(),
localeManager.getLocaleMessage("gui-color-icon-name") + ParticleUtils.formatName(style.getName()),
new String[]{localeManager.getLocaleMessage("gui-color-info") + localeManager.getLocaleMessage("gui-select-style-description", StringPlaceholders.single("style", ParticleUtils.formatName(style.getName())))},
(button, isShiftClick) -> {

View file

@ -68,11 +68,11 @@ public class ConfigurationManager extends Manager {
MYSQL_CONNECTION_POOL_SIZE("mysql-settings.connection-pool-size", 5, "The size of the connection pool to the database", "Not recommended to go below 2 or above 5"),
GUI_ICON("gui-icon", null,
"This configuration option allows you to change any of the GUI",
"icons to whatever block/item you want.",
"This configuration option allows you to change the GUI",
"icons to whatever block/item you want. If you want to change an effect",
"or style icon, use their respective config files.",
"Notes: If any of the block/item names are invalid the icon in the GUI",
"will be the barrier icon to show that it failed to load.",
"Do NOT change the particle/style name",
"You MUST use the Spigot-given name for it to work. You can see",
"all the Spigot-given names at the link below:",
"https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html",
@ -89,106 +89,7 @@ public class ConfigurationManager extends Manager {
GUI_ICON_MISC_EDIT_EFFECT("gui-icon.misc.edit_effect", Arrays.asList("FIREWORK_ROCKET", "FIREWORK")),
GUI_ICON_MISC_EDIT_STYLE("gui-icon.misc.edit_style", Collections.singletonList("NETHER_STAR")),
GUI_ICON_MISC_EDIT_DATA("gui-icon.misc.edit_data", Collections.singletonList("BOOK")),
GUI_ICON_MISC_RESET("gui-icon.misc.reset", Collections.singletonList("BARRIER")),
GUI_ICON_EFFECT("gui-icon.effect", null),
GUI_ICON_EFFECT_AMBIENT_ENTITY_EFFECT("gui-icon.effect.ambient_entity_effect", Collections.singletonList("BEACON")),
GUI_ICON_EFFECT_ANGRY_VILLAGER("gui-icon.effect.angry_villager", Collections.singletonList("IRON_DOOR")),
GUI_ICON_EFFECT_BARRIER("gui-icon.effect.barrier", Collections.singletonList("BARRIER")),
GUI_ICON_EFFECT_BLOCK("gui-icon.effect.block", Collections.singletonList("STONE")),
GUI_ICON_EFFECT_BUBBLE("gui-icon.effect.bubble", Arrays.asList("BUBBLE_CORAL", "GLASS")),
GUI_ICON_EFFECT_BUBBLE_COLUMN_UP("gui-icon.effect.bubble_column_up", Collections.singletonList("MAGMA_BLOCK")),
GUI_ICON_EFFECT_BUBBLE_POP("gui-icon.effect.bubble_pop", Collections.singletonList("BUBBLE_CORAL_FAN")),
GUI_ICON_EFFECT_CAMPFIRE_COSY_SMOKE("gui-icon.effect.campfire_cosy_smoke", Collections.singletonList("CAMPFIRE")),
GUI_ICON_EFFECT_CAMPFIRE_SIGNAL_SMOKE("gui-icon.effect.campfire_signal_smoke", Collections.singletonList("REDSTONE_TORCH")),
GUI_ICON_EFFECT_CLOUD("gui-icon.effect.cloud", Arrays.asList("WHITE_WOOL", "WOOL")),
GUI_ICON_EFFECT_COMPOSTER("gui-icon.effect.composter", Collections.singletonList("COMPOSTER")),
GUI_ICON_EFFECT_CRIT("gui-icon.effect.crit", Collections.singletonList("IRON_SWORD")),
GUI_ICON_EFFECT_CURRENT_DOWN("gui-icon.effect.current_down", Collections.singletonList("SOUL_SAND")),
GUI_ICON_EFFECT_DAMAGE_INDICATOR("gui-icon.effect.damage_indicator", Collections.singletonList("BOW")),
GUI_ICON_EFFECT_DOLPHIN("gui-icon.effect.dolphin", Collections.singletonList("DOLPHIN_SPAWN_EGG")),
GUI_ICON_EFFECT_DRAGON_BREATH("gui-icon.effect.dragon_breath", Arrays.asList("DRAGON_BREATH", "DRAGONS_BREATH")),
GUI_ICON_EFFECT_DRIPPING_HONEY("gui-icon.effect.dripping_honey", Collections.singletonList("BEE_NEST")),
GUI_ICON_EFFECT_DRIPPING_LAVA("gui-icon.effect.dripping_lava", Collections.singletonList("LAVA_BUCKET")),
GUI_ICON_EFFECT_DRIPPING_WATER("gui-icon.effect.dripping_water", Collections.singletonList("WATER_BUCKET")),
GUI_ICON_EFFECT_DUST("gui-icon.effect.dust", Collections.singletonList("REDSTONE")),
GUI_ICON_EFFECT_ELDER_GUARDIAN("gui-icon.effect.elder_guardian", Arrays.asList("ELDER_GUARDIAN_SPAWN_EGG", "PRISMARINE_CRYSTALS")),
GUI_ICON_EFFECT_ENCHANT("gui-icon.effect.enchant", Arrays.asList("ENCHANTING_TABLE", "ENCHANTMENT_TABLE")),
GUI_ICON_EFFECT_ENCHANTED_HIT("gui-icon.effect.enchanted_hit", Collections.singletonList("DIAMOND_SWORD")),
GUI_ICON_EFFECT_END_ROD("gui-icon.effect.end_rod", Collections.singletonList("END_ROD")),
GUI_ICON_EFFECT_ENTITY_EFFECT("gui-icon.effect.entity_effect", Collections.singletonList("GLOWSTONE_DUST")),
GUI_ICON_EFFECT_EXPLOSION("gui-icon.effect.explosion", Arrays.asList("FIRE_CHARGE", "FIREBALL")),
GUI_ICON_EFFECT_EXPLOSION_EMITTER("gui-icon.effect.explosion_emitter", Collections.singletonList("TNT")),
GUI_ICON_EFFECT_FALLING_DUST("gui-icon.effect.falling_dust", Collections.singletonList("SAND")),
GUI_ICON_EFFECT_FALLING_HONEY("gui-icon.effect.falling_honey", Collections.singletonList("HONEY_BOTTLE")),
GUI_ICON_EFFECT_FALLING_LAVA("gui-icon.effect.falling_lava", Collections.singletonList("RED_DYE")),
GUI_ICON_EFFECT_FALLING_NECTAR("gui-icon.effect.falling_nectar", Collections.singletonList("HONEYCOMB")),
GUI_ICON_EFFECT_FALLING_WATER("gui-icon.effect.falling_water", Collections.singletonList("BLUE_DYE")),
GUI_ICON_EFFECT_FIREWORK("gui-icon.effect.firework", Arrays.asList("FIREWORK_ROCKET", "FIREWORK")),
GUI_ICON_EFFECT_FISHING("gui-icon.effect.fishing", Collections.singletonList("FISHING_ROD")),
GUI_ICON_EFFECT_FLAME("gui-icon.effect.flame", Collections.singletonList("BLAZE_POWDER")),
GUI_ICON_EFFECT_FLASH("gui-icon.effect.flash", Collections.singletonList("GOLD_INGOT")),
GUI_ICON_EFFECT_FOOTSTEP("gui-icon.effect.footstep", Collections.singletonList("GRASS")),
GUI_ICON_EFFECT_HAPPY_VILLAGER("gui-icon.effect.happy_villager", Arrays.asList("DARK_OAK_DOOR_ITEM", "DARK_OAK_DOOR")),
GUI_ICON_EFFECT_HEART("gui-icon.effect.heart", Arrays.asList("POPPY", "RED_ROSE")),
GUI_ICON_EFFECT_INSTANT_EFFECT("gui-icon.effect.instant_effect", Arrays.asList("SPLASH_POTION", "POTION")),
GUI_ICON_EFFECT_ITEM("gui-icon.effect.item", Collections.singletonList("ITEM_FRAME")),
GUI_ICON_EFFECT_ITEM_SLIME("gui-icon.effect.item_slime", Collections.singletonList("SLIME_BALL")),
GUI_ICON_EFFECT_ITEM_SNOWBALL("gui-icon.effect.item_snowball", Arrays.asList("SNOWBALL", "SNOW_BALL")),
GUI_ICON_EFFECT_LARGE_SMOKE("gui-icon.effect.large_smoke", Arrays.asList("COBWEB", "WEB")),
GUI_ICON_EFFECT_LANDING_HONEY("gui-icon.effect.landing_honey", Collections.singletonList("HONEY_BLOCK")),
GUI_ICON_EFFECT_LANDING_LAVA("gui-icon.effect.landing_lava", Collections.singletonList("ORANGE_DYE")),
GUI_ICON_EFFECT_LAVA("gui-icon.effect.lava", Collections.singletonList("MAGMA_CREAM")),
GUI_ICON_EFFECT_MYCELIUM("gui-icon.effect.mycelium", Arrays.asList("MYCELIUM", "MYCEL")),
GUI_ICON_EFFECT_NAUTILUS("gui-icon.effect.nautilus", Collections.singletonList("HEART_OF_THE_SEA")),
GUI_ICON_EFFECT_NOTE("gui-icon.effect.note", Collections.singletonList("NOTE_BLOCK")),
GUI_ICON_EFFECT_POOF("gui-icon.effect.poof", Arrays.asList("FIREWORK_STAR", "FIREWORK_CHARGE")),
GUI_ICON_EFFECT_PORTAL("gui-icon.effect.portal", Collections.singletonList("OBSIDIAN")),
GUI_ICON_EFFECT_RAIN("gui-icon.effect.rain", Arrays.asList("PUFFERFISH_BUCKET", "LAPIS_BLOCK")),
GUI_ICON_EFFECT_SMOKE("gui-icon.effect.smoke", Collections.singletonList("TORCH")),
GUI_ICON_EFFECT_SNEEZE("gui-icon.effect.sneeze", Collections.singletonList("BAMBOO")),
GUI_ICON_EFFECT_SPELL("gui-icon.effect.spell", Arrays.asList("POTION", "GLASS_BOTTLE")),
GUI_ICON_EFFECT_SPIT("gui-icon.effect.spit", Arrays.asList("LLAMA_SPAWN_EGG", "PUMPKIN_SEEDS")),
GUI_ICON_EFFECT_SPLASH("gui-icon.effect.splash", Arrays.asList("SALMON", "FISH", "RAW_FISH")),
GUI_ICON_EFFECT_SQUID_INK("gui-icon.effect.squid_ink", Collections.singletonList("INK_SAC")),
GUI_ICON_EFFECT_SWEEP_ATTACK("gui-icon.effect.sweep_attack", Arrays.asList("GOLDEN_SWORD", "GOLD_SWORD")),
GUI_ICON_EFFECT_TOTEM_OF_UNDYING("gui-icon.effect.totem_of_undying", Arrays.asList("TOTEM_OF_UNDYING", "TOTEM")),
GUI_ICON_EFFECT_UNDERWATER("gui-icon.effect.underwater", Arrays.asList("TURTLE_HELMET", "SPONGE")),
GUI_ICON_EFFECT_WITCH("gui-icon.effect.witch", Collections.singletonList("CAULDRON")),
GUI_ICON_STYLE("gui-icon.style", null),
GUI_ICON_STYLE_ARROWS("gui-icon.style.arrows", Collections.singletonList("BOW")),
GUI_ICON_STYLE_BATMAN("gui-icon.style.batman", Arrays.asList("BAT_SPAWN_EGG", "COAL")),
GUI_ICON_STYLE_BEAM("gui-icon.style.beam", Collections.singletonList("POWERED_RAIL")),
GUI_ICON_STYLE_BLOCKBREAK("gui-icon.style.blockbreak", Collections.singletonList("IRON_PICKAXE")),
GUI_ICON_STYLE_BLOCKPLACE("gui-icon.style.blockplace", Arrays.asList("OAK_PLANKS", "WOOD")),
GUI_ICON_STYLE_CELEBRATION("gui-icon.style.celebration", Arrays.asList("FIREWORK_ROCKET", "FIREWORK")),
GUI_ICON_STYLE_CHAINS("gui-icon.style.chains", Collections.singletonList("TRIPWIRE_HOOK")),
GUI_ICON_STYLE_COMPANION("gui-icon.style.companion", Collections.singletonList("NAME_TAG")),
GUI_ICON_STYLE_CUBE("gui-icon.style.cube", Collections.singletonList("STONE")),
GUI_ICON_STYLE_FEET("gui-icon.style.feet", Collections.singletonList("GRASS")),
GUI_ICON_STYLE_HALO("gui-icon.style.halo", Arrays.asList("END_PORTAL_FRAME", "ENDER_PORTAL_FRAME")),
GUI_ICON_STYLE_HURT("gui-icon.style.hurt", Collections.singletonList("CACTUS")),
GUI_ICON_STYLE_INVOCATION("gui-icon.style.invocation", Arrays.asList("ENDER_EYE", "EYE_OF_ENDER")),
GUI_ICON_STYLE_MOVE("gui-icon.style.move", Arrays.asList("PISTON", "PISTON_BASE")),
GUI_ICON_STYLE_NORMAL("gui-icon.style.normal", Collections.singletonList("DIRT")),
GUI_ICON_STYLE_ORBIT("gui-icon.style.orbit", Arrays.asList("ENCHANTING_TABLE", "ENCHANTMENT_TABLE")),
GUI_ICON_STYLE_OVERHEAD("gui-icon.style.overhead", Collections.singletonList("GLOWSTONE")),
GUI_ICON_STYLE_POINT("gui-icon.style.point", Collections.singletonList("STONE_BUTTON")),
GUI_ICON_STYLE_POPPER("gui-icon.style.popper", Arrays.asList("POPPED_CHORUS_FRUIT", "CHORUS_FRUIT_POPPED")),
GUI_ICON_STYLE_PULSE("gui-icon.style.pulse", Arrays.asList("REDSTONE_TORCH", "REDSTONE_TORCH_ON")),
GUI_ICON_STYLE_QUADHELIX("gui-icon.style.quadhelix", Arrays.asList("NAUTILUS_SHELL", "ACTIVATOR_RAIL")),
GUI_ICON_STYLE_RINGS("gui-icon.style.rings", Arrays.asList("LEAD", "LEASH")),
GUI_ICON_STYLE_SPHERE("gui-icon.style.sphere", Arrays.asList("HEART_OF_THE_SEA", "SNOWBALL", "SNOW_BALL")),
GUI_ICON_STYLE_SPIN("gui-icon.style.spin", Collections.singletonList("BEACON")),
GUI_ICON_STYLE_SPIRAL("gui-icon.style.spiral", Collections.singletonList("HOPPER")),
GUI_ICON_STYLE_SWORDS("gui-icon.style.swords", Collections.singletonList("IRON_SWORD")),
GUI_ICON_STYLE_TELEPORT("gui-icon.style.teleport", Collections.singletonList("ENDER_PEARL")),
GUI_ICON_STYLE_THICK("gui-icon.style.thick", Arrays.asList("COBWEB", "WEB")),
GUI_ICON_STYLE_TRAIL("gui-icon.style.trail", Collections.singletonList("GHAST_TEAR")),
GUI_ICON_STYLE_TWINS("gui-icon.style.twins", Arrays.asList("OAK_FENCE", "FENCE")),
GUI_ICON_STYLE_VORTEX("gui-icon.style.vortex", Collections.singletonList("GLOWSTONE_DUST")),
GUI_ICON_STYLE_WHIRL("gui-icon.style.whirl", Collections.singletonList("FEATHER")),
GUI_ICON_STYLE_WHIRLWIND("gui-icon.style.whirlwind", Collections.singletonList("STRING")),
GUI_ICON_STYLE_WINGS("gui-icon.style.wings", Collections.singletonList("ELYTRA"));
GUI_ICON_MISC_RESET("gui-icon.misc.reset", Collections.singletonList("BARRIER"));
private final String key;
private final Object defaultValue;
@ -389,10 +290,7 @@ public class ConfigurationManager extends Manager {
EDIT_EFFECT,
EDIT_STYLE,
EDIT_DATA,
RESET,
EFFECT,
STYLE;
RESET;
private Map<String, Material> materials;
@ -410,17 +308,6 @@ public class ConfigurationManager extends Manager {
return this.getInternal("gui-icon.misc." + this.name().toLowerCase());
}
/**
* Gets the Material for a subsection of this icon in the config.yml
* Tries to get from cache first, otherwise loads it
*
* @param subsection The name of the icon in the section
* @return The Material for this Icon
*/
public Material get(String subsection) {
return this.getInternal("gui-icon." + this.name().toLowerCase() + "." + subsection);
}
/**
* Gets the Material for this icon
* Tries to get from cache first, otherwise loads it

View file

@ -10,6 +10,7 @@ import dev.esophose.playerparticles.util.ParticleUtils;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.stream.Stream;
@ -27,97 +28,102 @@ import org.bukkit.metadata.MetadataValue;
public enum ParticleEffect {
// Ordered and named by their Minecraft 1.13+ internal names
AMBIENT_ENTITY_EFFECT("SPELL_MOB_AMBIENT", ParticleProperty.COLORABLE),
ANGRY_VILLAGER("VILLAGER_ANGRY"),
BARRIER("BARRIER"),
BLOCK("BLOCK_CRACK", ParticleProperty.REQUIRES_MATERIAL_DATA),
BUBBLE("WATER_BUBBLE"),
BUBBLE_COLUMN_UP("BUBBLE_COLUMN_UP"),
BUBBLE_POP("BUBBLE_POP"),
CAMPFIRE_COSY_SMOKE("CAMPFIRE_COSY_SMOKE"),
CAMPFIRE_SIGNAL_SMOKE("CAMPFIRE_SIGNAL_SMOKE"),
CLOUD("CLOUD"),
COMPOSTER("COMPOSTER"),
CRIT("CRIT"),
CURRENT_DOWN("CURRENT_DOWN"),
DAMAGE_INDICATOR("DAMAGE_INDICATOR"),
DOLPHIN("DOLPHIN"),
DRAGON_BREATH("DRAGON_BREATH"),
DRIPPING_HONEY("DRIPPING_HONEY"),
DRIPPING_LAVA("DRIP_LAVA"),
DRIPPING_WATER("DRIP_WATER"),
DUST("REDSTONE", ParticleProperty.COLORABLE),
ELDER_GUARDIAN("MOB_APPEARANCE", false), // No thank you
ENCHANT("ENCHANTMENT_TABLE"),
ENCHANTED_HIT("CRIT_MAGIC"),
END_ROD("END_ROD"),
ENTITY_EFFECT("SPELL_MOB", ParticleProperty.COLORABLE),
EXPLOSION("EXPLOSION_LARGE"),
EXPLOSION_EMITTER("EXPLOSION_HUGE"),
FALLING_DUST("FALLING_DUST", ParticleProperty.REQUIRES_MATERIAL_DATA),
FALLING_HONEY("FALLING_HONEY"),
FALLING_LAVA("FALLING_LAVA"),
FALLING_NECTAR("FALLING_NECTAR"),
FALLING_WATER("FALLING_WATER"),
FIREWORK("FIREWORKS_SPARK"),
FISHING("WATER_WAKE"),
FLAME("FLAME"),
FLASH("FLASH", false), // Also no thank you
FOOTSTEP("FOOTSTEP"), // Removed in Minecraft 1.13 :(
HAPPY_VILLAGER("VILLAGER_HAPPY"),
HEART("HEART"),
INSTANT_EFFECT("SPELL_INSTANT"),
ITEM("ITEM_CRACK", ParticleProperty.REQUIRES_MATERIAL_DATA),
ITEM_SLIME("SLIME"),
ITEM_SNOWBALL("SNOWBALL"),
LANDING_HONEY("LANDING_HONEY"),
LANDING_LAVA("LANDING_LAVA"),
LARGE_SMOKE("SMOKE_LARGE"),
LAVA("LAVA"),
MYCELIUM("TOWN_AURA"),
NAUTILUS("NAUTILUS"),
NOTE("NOTE", ParticleProperty.COLORABLE),
POOF("EXPLOSION_NORMAL"), // The 1.13 combination of explode and showshovel
PORTAL("PORTAL"),
RAIN("WATER_DROP"),
SMOKE("SMOKE_NORMAL"),
SNEEZE("SNEEZE"),
SPELL("SPELL"), // The Minecraft internal name for this is actually "effect", but that's the command name, so it's SPELL for the plugin instead
SPIT("SPIT"),
SPLASH("WATER_SPLASH"),
SQUID_INK("SQUID_INK"),
SWEEP_ATTACK("SWEEP_ATTACK"),
TOTEM_OF_UNDYING("TOTEM"),
UNDERWATER("SUSPENDED_DEPTH"),
WITCH("SPELL_WITCH");
AMBIENT_ENTITY_EFFECT("SPELL_MOB_AMBIENT", Collections.singletonList("BEACON"), ParticleProperty.COLORABLE),
ANGRY_VILLAGER("VILLAGER_ANGRY", Collections.singletonList("IRON_DOOR")),
BARRIER("BARRIER", Collections.singletonList("BARRIER")),
BLOCK("BLOCK_CRACK", Collections.singletonList("STONE"), ParticleProperty.REQUIRES_MATERIAL_DATA),
BUBBLE("WATER_BUBBLE", Arrays.asList("BUBBLE_CORAL", "GLASS")),
BUBBLE_COLUMN_UP("BUBBLE_COLUMN_UP", Collections.singletonList("MAGMA_BLOCK")),
BUBBLE_POP("BUBBLE_POP", Collections.singletonList("BUBBLE_CORAL_FAN")),
CAMPFIRE_COSY_SMOKE("CAMPFIRE_COSY_SMOKE", Collections.singletonList("CAMPFIRE")),
CAMPFIRE_SIGNAL_SMOKE("CAMPFIRE_SIGNAL_SMOKE", Collections.singletonList("REDSTONE_TORCH")),
CLOUD("CLOUD", Arrays.asList("WHITE_WOOL", "WOOL")),
COMPOSTER("COMPOSTER", Collections.singletonList("COMPOSTER")),
CRIT("CRIT", Collections.singletonList("IRON_SWORD")),
CURRENT_DOWN("CURRENT_DOWN", Collections.singletonList("SOUL_SAND")),
DAMAGE_INDICATOR("DAMAGE_INDICATOR", Collections.singletonList("BOW")),
DOLPHIN("DOLPHIN", Collections.singletonList("DOLPHIN_SPAWN_EGG")),
DRAGON_BREATH("DRAGON_BREATH", Arrays.asList("DRAGON_BREATH", "DRAGONS_BREATH")),
DRIPPING_HONEY("DRIPPING_HONEY", Collections.singletonList("BEE_NEST")),
DRIPPING_LAVA("DRIP_LAVA", Collections.singletonList("LAVA_BUCKET")),
DRIPPING_WATER("DRIP_WATER", Collections.singletonList("WATER_BUCKET")),
DUST("REDSTONE", Collections.singletonList("REDSTONE"), ParticleProperty.COLORABLE),
ELDER_GUARDIAN("MOB_APPEARANCE", Arrays.asList("ELDER_GUARDIAN_SPAWN_EGG", "PRISMARINE_CRYSTALS"), false), // No thank you
ENCHANT("ENCHANTMENT_TABLE", Arrays.asList("ENCHANTING_TABLE", "ENCHANTMENT_TABLE")),
ENCHANTED_HIT("CRIT_MAGIC", Collections.singletonList("DIAMOND_SWORD")),
END_ROD("END_ROD", Collections.singletonList("END_ROD")),
ENTITY_EFFECT("SPELL_MOB", Collections.singletonList("GLOWSTONE_DUST"), ParticleProperty.COLORABLE),
EXPLOSION("EXPLOSION_LARGE", Arrays.asList("FIRE_CHARGE", "FIREBALL")),
EXPLOSION_EMITTER("EXPLOSION_HUGE", Collections.singletonList("TNT")),
FALLING_DUST("FALLING_DUST", Collections.singletonList("SAND"), ParticleProperty.REQUIRES_MATERIAL_DATA),
FALLING_HONEY("FALLING_HONEY", Collections.singletonList("HONEY_BOTTLE")),
FALLING_LAVA("FALLING_LAVA", Collections.singletonList("RED_DYE")),
FALLING_NECTAR("FALLING_NECTAR", Collections.singletonList("HONEYCOMB")),
FALLING_WATER("FALLING_WATER", Collections.singletonList("BLUE_DYE")),
FIREWORK("FIREWORKS_SPARK", Arrays.asList("FIREWORK_ROCKET", "FIREWORK")),
FISHING("WATER_WAKE", Collections.singletonList("FISHING_ROD")),
FLAME("FLAME", Collections.singletonList("BLAZE_POWDER")),
FLASH("FLASH", Collections.singletonList("GOLD_INGOT"), false), // Also no thank you
FOOTSTEP("FOOTSTEP", Collections.singletonList("GRASS")), // Removed in Minecraft 1.13 :(
HAPPY_VILLAGER("VILLAGER_HAPPY", Arrays.asList("DARK_OAK_DOOR_ITEM", "DARK_OAK_DOOR")),
HEART("HEART", Arrays.asList("POPPY", "RED_ROSE")),
INSTANT_EFFECT("SPELL_INSTANT", Arrays.asList("SPLASH_POTION", "POTION")),
ITEM("ITEM_CRACK", Collections.singletonList("ITEM_FRAME"), ParticleProperty.REQUIRES_MATERIAL_DATA),
ITEM_SLIME("SLIME", Collections.singletonList("SLIME_BALL")),
ITEM_SNOWBALL("SNOWBALL", Arrays.asList("SNOWBALL", "SNOW_BALL")),
LANDING_HONEY("LANDING_HONEY", Collections.singletonList("HONEY_BLOCK")),
LANDING_LAVA("LANDING_LAVA", Collections.singletonList("ORANGE_DYE")),
LARGE_SMOKE("SMOKE_LARGE", Arrays.asList("COBWEB", "WEB")),
LAVA("LAVA", Collections.singletonList("MAGMA_CREAM")),
MYCELIUM("TOWN_AURA", Arrays.asList("MYCELIUM", "MYCEL")),
NAUTILUS("NAUTILUS", Collections.singletonList("HEART_OF_THE_SEA")),
NOTE("NOTE", Collections.singletonList("NOTE_BLOCK"), ParticleProperty.COLORABLE),
POOF("EXPLOSION_NORMAL", Arrays.asList("FIREWORK_STAR", "FIREWORK_CHARGE")), // The 1.13 combination of explode and showshovel
PORTAL("PORTAL", Collections.singletonList("OBSIDIAN")),
RAIN("WATER_DROP", Arrays.asList("PUFFERFISH_BUCKET", "LAPIS_BLOCK")),
SMOKE("SMOKE_NORMAL", Collections.singletonList("TORCH")),
SNEEZE("SNEEZE", Collections.singletonList("BAMBOO")),
SPELL("SPELL", Arrays.asList("POTION", "GLASS_BOTTLE")), // The Minecraft internal name for this is actually "effect", but that's the command name, so it's SPELL for the plugin instead
SPIT("SPIT", Arrays.asList("LLAMA_SPAWN_EGG", "PUMPKIN_SEEDS")),
SPLASH("WATER_SPLASH", Arrays.asList("SALMON", "FISH", "RAW_FISH")),
SQUID_INK("SQUID_INK", Collections.singletonList("INK_SAC")),
SWEEP_ATTACK("SWEEP_ATTACK", Arrays.asList("GOLDEN_SWORD", "GOLD_SWORD")),
TOTEM_OF_UNDYING("TOTEM", Arrays.asList("TOTEM_OF_UNDYING", "TOTEM")),
UNDERWATER("SUSPENDED_DEPTH", Arrays.asList("TURTLE_HELMET", "SPONGE")),
WITCH("SPELL_WITCH", Collections.singletonList("CAULDRON"));
private Particle internalEnum;
private List<ParticleProperty> properties;
private CommentedFileConfiguration config;
private boolean enabledByDefault;
private List<String> defaultIconMaterialNames;
private String effectName;
private boolean enabled;
private Material guiIconMaterial;
/**
* Construct a new particle effect
*
* @param enumName Name of the Particle Enum when the server version is greater than or equal to 1.13
* @param enumName Name of the Spigot Particle enum
* @param defaultIconMaterialNames The names of the Materials to display as GUI icons
* @param properties Properties of this particle effect
*/
ParticleEffect(String enumName, ParticleProperty... properties) {
this(enumName, true, properties);
ParticleEffect(String enumName, List<String> defaultIconMaterialNames, ParticleProperty... properties) {
this(enumName, defaultIconMaterialNames, true, properties);
}
/**
* Construct a new particle effect
*
* @param enumName Name of the Particle Enum when the server version is greater than or equal to 1.13
* @param enumName Name of the Spigot Particle enum
* @param defaultIconMaterialNames The names of the Materials to display as GUI icons
* @param enabledByDefault If the particle type is enabled by default
* @param properties Properties of this particle effect
*/
ParticleEffect(String enumName, boolean enabledByDefault, ParticleProperty... properties) {
ParticleEffect(String enumName, List<String> defaultIconMaterialNames, boolean enabledByDefault, ParticleProperty... properties) {
this.defaultIconMaterialNames = defaultIconMaterialNames;
this.enabledByDefault = enabledByDefault;
this.properties = Arrays.asList(properties);
@ -143,6 +149,7 @@ public enum ParticleEffect {
boolean changed = this.setIfNotExists("effect-name", this.getInternalName(), "The name the effect will display as");
changed |= this.setIfNotExists("enabled", this.enabledByDefault, "If the effect is enabled or not");
changed |= this.setIfNotExists("gui-icon-material", this.defaultIconMaterialNames);
if (changed)
this.config.save();
@ -162,6 +169,7 @@ public enum ParticleEffect {
this.effectName = this.config.getString("effect-name");
this.enabled = this.config.getBoolean("enabled");
this.guiIconMaterial = ParticleUtils.closestMatchWithFallback(true, this.config.getStringList("gui-icon-material").toArray(new String[0]));
}
/**
@ -209,6 +217,13 @@ public enum ParticleEffect {
return this.effectName;
}
/**
* @return The Material icon that represents this style in the GUI
*/
public Material getGuiIconMaterial() {
return this.guiIconMaterial;
}
/**
* Determine if this particle effect has a specific property
*

View file

@ -5,6 +5,8 @@ import dev.esophose.playerparticles.PlayerParticles;
import dev.esophose.playerparticles.config.CommentedFileConfiguration;
import dev.esophose.playerparticles.util.ParticleUtils;
import java.io.File;
import java.util.List;
import org.bukkit.Material;
public abstract class DefaultParticleStyle implements ParticleStyle {
@ -22,6 +24,7 @@ public abstract class DefaultParticleStyle implements ParticleStyle {
private boolean canBeFixed;
private boolean canToggleWithMovement;
private double fixedEffectOffset;
private Material guiIconMaterial;
public DefaultParticleStyle(String internalStyleName, boolean canBeFixedByDefault, boolean canToggleWithMovementByDefault, double fixedEffectOffsetByDefault) {
this.internalStyleName = internalStyleName;
@ -50,6 +53,7 @@ public abstract class DefaultParticleStyle implements ParticleStyle {
this.setIfNotExists("can-be-fixed", this.canBeFixedByDefault, "If the style can be used in /pp fixed");
this.setIfNotExists("can-toggle-with-movement", this.canToggleWithMovementByDefault, "If the style will only be shown at the player's feet while moving");
this.setIfNotExists("fixed-effect-offset", this.fixedEffectOffsetByDefault, "How far vertically to offset the style position for fixed effects");
this.setIfNotExists("gui-icon-material", this.getGuiIconMaterialNames(), "The material of the icon to display in the GUI");
this.setDefaultSettings(this.config);
@ -71,6 +75,7 @@ public abstract class DefaultParticleStyle implements ParticleStyle {
this.canBeFixed = this.config.getBoolean("can-be-fixed");
this.canToggleWithMovement = this.config.getBoolean("can-toggle-with-movement");
this.fixedEffectOffset = this.config.getDouble("fixed-effect-offset");
this.guiIconMaterial = ParticleUtils.closestMatchWithFallback(true, this.config.getStringList("gui-icon-material").toArray(new String[0]));
this.loadSettings(this.config);
}
@ -102,14 +107,19 @@ public abstract class DefaultParticleStyle implements ParticleStyle {
return this.enabled;
}
@Override
public final String getInternalName() {
return this.internalStyleName;
}
@Override
public final String getName() {
return this.styleName;
}
@Override
public final String getInternalName() {
return this.internalStyleName;
public final Material getGuiIconMaterial() {
return this.guiIconMaterial;
}
@Override
@ -127,6 +137,11 @@ public abstract class DefaultParticleStyle implements ParticleStyle {
return this.fixedEffectOffset;
}
/**
* @return A list of Strings to try to turn into Materials
*/
protected abstract List<String> getGuiIconMaterialNames();
/**
* Sets the default settings for this style
*

View file

@ -4,8 +4,10 @@ import dev.esophose.playerparticles.PlayerParticles;
import dev.esophose.playerparticles.manager.ParticleStyleManager;
import dev.esophose.playerparticles.particles.PParticle;
import dev.esophose.playerparticles.particles.ParticlePair;
import java.util.Collections;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.Material;
public interface ParticleStyle {
@ -42,6 +44,13 @@ public interface ParticleStyle {
return this.getInternalName();
}
/**
* @return The Material icon that represents this style in the GUI
*/
default Material getGuiIconMaterial() {
return Material.BARRIER;
}
/**
* Gets if the style can be used in a FixedParticleEffect
*

View file

@ -64,6 +64,11 @@ public class ParticleStyleArrows extends DefaultParticleStyle implements Listene
}
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Collections.singletonList("BOW");
}
@Override
public boolean hasLongRangeVisibility() {
return true;

View file

@ -5,6 +5,7 @@ import dev.esophose.playerparticles.particles.PParticle;
import dev.esophose.playerparticles.particles.ParticlePair;
import dev.esophose.playerparticles.util.VectorUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.util.Vector;
@ -120,6 +121,11 @@ public class ParticleStyleBatman extends DefaultParticleStyle {
this.step = (this.step + 1) % this.spawnDelay; // Only spawn once per second
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Arrays.asList("BAT_SPAWN_EGG", "COAL");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("spawn-delay", 20, "The number of ticks to wait between particle spawns");

View file

@ -5,6 +5,7 @@ import dev.esophose.playerparticles.particles.PParticle;
import dev.esophose.playerparticles.particles.ParticlePair;
import dev.esophose.playerparticles.util.MathL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.bukkit.Location;
@ -46,6 +47,11 @@ public class ParticleStyleBeam extends DefaultParticleStyle {
}
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Collections.singletonList("POWERED_RAIL");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("points", 16, "The number of points in the circle");

View file

@ -8,6 +8,7 @@ import dev.esophose.playerparticles.particles.PParticle;
import dev.esophose.playerparticles.particles.PPlayer;
import dev.esophose.playerparticles.particles.ParticlePair;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.entity.Player;
@ -43,6 +44,11 @@ public class ParticleStyleBlockBreak extends DefaultParticleStyle implements Lis
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Collections.singletonList("IRON_PICKAXE");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("particle-amount", 10, "The number of particles to spawn");

View file

@ -8,6 +8,7 @@ import dev.esophose.playerparticles.particles.PParticle;
import dev.esophose.playerparticles.particles.PPlayer;
import dev.esophose.playerparticles.particles.ParticlePair;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.entity.Player;
@ -43,6 +44,11 @@ public class ParticleStyleBlockPlace extends DefaultParticleStyle implements Lis
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Arrays.asList("OAK_PLANKS", "WOOD");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("particle-amount", 10, "The number of particles to spawn");

View file

@ -11,6 +11,7 @@ import dev.esophose.playerparticles.particles.ParticleEffect;
import dev.esophose.playerparticles.particles.ParticlePair;
import dev.esophose.playerparticles.util.MathL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Random;
@ -71,6 +72,11 @@ public class ParticleStyleCelebration extends DefaultParticleStyle {
}
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Arrays.asList("FIREWORK_ROCKET", "FIREWORK");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("spawn-frequency", 15, "How many ticks to wait between spawns");

View file

@ -4,6 +4,7 @@ import dev.esophose.playerparticles.config.CommentedFileConfiguration;
import dev.esophose.playerparticles.particles.PParticle;
import dev.esophose.playerparticles.particles.ParticlePair;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.bukkit.Location;
@ -34,6 +35,11 @@ public class ParticleStyleChains extends DefaultParticleStyle {
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Collections.singletonList("TRIPWIRE_HOOK");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("chain-particle-amount", 8, "The number of particles per chain");

View file

@ -28,6 +28,7 @@ import dev.esophose.playerparticles.particles.PParticle;
import dev.esophose.playerparticles.particles.ParticlePair;
import dev.esophose.playerparticles.util.MathL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.util.Vector;
@ -71,6 +72,11 @@ public class ParticleStyleCompanion extends DefaultParticleStyle {
this.step++;
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Collections.singletonList("NAME_TAG");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("particle-amount", 150, "The number of total particles in the animation cycle");

View file

@ -28,6 +28,7 @@ import dev.esophose.playerparticles.particles.PParticle;
import dev.esophose.playerparticles.particles.ParticlePair;
import dev.esophose.playerparticles.util.VectorUtils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.util.Vector;
@ -96,6 +97,11 @@ public class ParticleStyleCube extends DefaultParticleStyle {
this.step++;
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Collections.singletonList("STONE");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("edge-length", 2.0, "The length (in blocks) of the edges of the cube");

View file

@ -4,6 +4,7 @@ import dev.esophose.playerparticles.config.CommentedFileConfiguration;
import dev.esophose.playerparticles.particles.PParticle;
import dev.esophose.playerparticles.particles.ParticlePair;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.bukkit.Location;
@ -31,6 +32,11 @@ public class ParticleStyleFeet extends DefaultParticleStyle {
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Collections.singletonList("GRASS");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("feet-offset", -0.95, "How far to offset the player location vertically");

View file

@ -5,6 +5,7 @@ import dev.esophose.playerparticles.particles.PParticle;
import dev.esophose.playerparticles.particles.ParticlePair;
import dev.esophose.playerparticles.util.MathL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.bukkit.Location;
@ -43,6 +44,11 @@ public class ParticleStyleHalo extends DefaultParticleStyle {
this.skipNextSpawn = !this.skipNextSpawn;
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Arrays.asList("END_PORTAL_FRAME", "ENDER_PORTAL_FRAME");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("particle-amount", 16, "The number of points in the halo");

View file

@ -8,6 +8,8 @@ import dev.esophose.playerparticles.particles.PParticle;
import dev.esophose.playerparticles.particles.PPlayer;
import dev.esophose.playerparticles.particles.ParticlePair;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.entity.Player;
@ -39,6 +41,11 @@ public class ParticleStyleHurt extends DefaultParticleStyle implements Listener
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Collections.singletonList("CACTUS");
}
@EventHandler(priority = EventPriority.MONITOR)
public void onEntityDamage(EntityDamageEvent event) {
ParticleManager particleManager = PlayerParticles.getInstance().getManager(ParticleManager.class);

View file

@ -6,6 +6,7 @@ import dev.esophose.playerparticles.particles.ParticleEffect;
import dev.esophose.playerparticles.particles.ParticlePair;
import dev.esophose.playerparticles.util.MathL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.bukkit.Location;
@ -97,6 +98,11 @@ public class ParticleStyleInvocation extends DefaultParticleStyle {
this.circleStep = (this.circleStep + 1) % this.numSteps;
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Arrays.asList("ENDER_EYE", "EYE_OF_ENDER");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("spinning-points", 6, "The number of points that spin around the circle in each direction");

View file

@ -8,6 +8,7 @@ import dev.esophose.playerparticles.particles.PParticle;
import dev.esophose.playerparticles.particles.PPlayer;
import dev.esophose.playerparticles.particles.ParticlePair;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.entity.Player;
@ -39,6 +40,11 @@ public class ParticleStyleMove extends DefaultParticleStyle implements Listener
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Arrays.asList("PISTON", "PISTON_BASE");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("multiplier", 1, "The multiplier for the number of particles to spawn", "This style uses the same spawning as the 'normal' style");

View file

@ -135,6 +135,11 @@ public class ParticleStyleNormal extends DefaultParticleStyle {
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Collections.singletonList("DIRT");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {

View file

@ -5,6 +5,7 @@ import dev.esophose.playerparticles.particles.PParticle;
import dev.esophose.playerparticles.particles.ParticlePair;
import dev.esophose.playerparticles.util.MathL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.bukkit.Location;
@ -36,6 +37,11 @@ public class ParticleStyleOrbit extends DefaultParticleStyle {
this.step = (this.step + 1) % this.numSteps;
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Arrays.asList("ENCHANTING_TABLE", "ENCHANTMENT_TABLE");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("orbs", 3, "The number of orbs that orbit the player");

View file

@ -4,6 +4,7 @@ import dev.esophose.playerparticles.config.CommentedFileConfiguration;
import dev.esophose.playerparticles.particles.PParticle;
import dev.esophose.playerparticles.particles.ParticlePair;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.bukkit.Location;
@ -33,6 +34,11 @@ public class ParticleStyleOverhead extends DefaultParticleStyle {
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Collections.singletonList("GLOWSTONE");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("head-offset", 1.75, "How far to offset the player location vertically");

View file

@ -25,6 +25,11 @@ public class ParticleStylePoint extends DefaultParticleStyle {
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Collections.singletonList("STONE_BUTTON");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("player-offset", 1.5, "How far to offset the player location vertically");

View file

@ -5,6 +5,7 @@ import dev.esophose.playerparticles.particles.PParticle;
import dev.esophose.playerparticles.particles.ParticlePair;
import dev.esophose.playerparticles.util.MathL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.util.Vector;
@ -51,6 +52,11 @@ public class ParticleStylePopper extends DefaultParticleStyle {
this.step = (this.step + 1) % this.maxStep;
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Arrays.asList("POPPED_CHORUS_FRUIT", "CHORUS_FRUIT_POPPED");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("radius", 1.0, "The radius at the bottom of the vortex");

View file

@ -6,6 +6,7 @@ import dev.esophose.playerparticles.particles.ParticleEffect;
import dev.esophose.playerparticles.particles.ParticlePair;
import dev.esophose.playerparticles.util.MathL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.bukkit.Location;
@ -77,6 +78,11 @@ public class ParticleStylePulse extends DefaultParticleStyle {
this.step = (this.step + 1) % this.numSteps;
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Arrays.asList("REDSTONE_TORCH", "REDSTONE_TORCH_ON");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("points", 50, "The number of points to spawn in the pulse circle");

View file

@ -5,6 +5,7 @@ import dev.esophose.playerparticles.particles.PParticle;
import dev.esophose.playerparticles.particles.ParticlePair;
import dev.esophose.playerparticles.util.MathL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.bukkit.Location;
@ -51,6 +52,11 @@ public class ParticleStyleQuadhelix extends DefaultParticleStyle {
}
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Arrays.asList("NAUTILUS_SHELL", "ACTIVATOR_RAIL");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("orbs", 4, "The number of orbs to spawn");

View file

@ -5,6 +5,7 @@ import dev.esophose.playerparticles.particles.PParticle;
import dev.esophose.playerparticles.particles.ParticlePair;
import dev.esophose.playerparticles.util.MathL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.bukkit.Location;
@ -38,6 +39,11 @@ public class ParticleStyleRings extends DefaultParticleStyle {
this.step = (this.step + 1) % this.maxStep;
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Arrays.asList("LEAD", "LEASH");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("particles-per-ring", 32, "The number of particles that will spawn for each ring");

View file

@ -5,6 +5,7 @@ import dev.esophose.playerparticles.particles.PParticle;
import dev.esophose.playerparticles.particles.ParticlePair;
import dev.esophose.playerparticles.util.MathL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.bukkit.Location;
@ -40,6 +41,11 @@ public class ParticleStyleSphere extends DefaultParticleStyle {
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Arrays.asList("HEART_OF_THE_SEA", "SNOWBALL", "SNOW_BALL");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("density", 15, "The number of particles to spawn per tick");

View file

@ -35,6 +35,11 @@ public class ParticleStyleSpin extends DefaultParticleStyle {
this.step = (this.step + 1) % this.maxSteps;
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Collections.singletonList("BEACON");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("particles-per-rotation", 30, "The number of particles to spawn per rotation");

View file

@ -5,6 +5,7 @@ import dev.esophose.playerparticles.particles.PParticle;
import dev.esophose.playerparticles.particles.ParticlePair;
import dev.esophose.playerparticles.util.MathL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.bukkit.Location;
@ -37,6 +38,11 @@ public class ParticleStyleSpiral extends DefaultParticleStyle {
this.stepX++;
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Collections.singletonList("HOPPER");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("particles", 12, "The number of particles to spawn around the player");

View file

@ -9,6 +9,7 @@ import dev.esophose.playerparticles.particles.PPlayer;
import dev.esophose.playerparticles.particles.ParticlePair;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.entity.LivingEntity;
@ -48,6 +49,11 @@ public class ParticleStyleSwords extends DefaultParticleStyle implements Listene
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Collections.singletonList("IRON_SWORD");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("multiplier", 15, "The multiplier for the number of particles to spawn", "This style uses the same spawning as the 'normal' style");

View file

@ -8,6 +8,7 @@ import dev.esophose.playerparticles.particles.PParticle;
import dev.esophose.playerparticles.particles.PPlayer;
import dev.esophose.playerparticles.particles.ParticlePair;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.Location;
@ -46,6 +47,11 @@ public class ParticleStyleTeleport extends DefaultParticleStyle implements Liste
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Collections.singletonList("ENDER_PEARL");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("before", true, "Spawn the particles at the teleporting position");

View file

@ -4,6 +4,7 @@ import dev.esophose.playerparticles.config.CommentedFileConfiguration;
import dev.esophose.playerparticles.particles.PParticle;
import dev.esophose.playerparticles.particles.ParticlePair;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.bukkit.Location;
@ -30,6 +31,11 @@ public class ParticleStyleThick extends DefaultParticleStyle {
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Arrays.asList("COBWEB", "WEB");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("multiplier", 1, "The multiplier for the number of particles to spawn", "This style uses the same spawning as the 'normal' style");

View file

@ -36,6 +36,11 @@ public class ParticleStyleTrail extends DefaultParticleStyle implements Listener
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Collections.singletonList("GHAST_TEAR");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("player-offset", 0.0, "How far to offset the player location vertically");

View file

@ -5,6 +5,7 @@ import dev.esophose.playerparticles.particles.PParticle;
import dev.esophose.playerparticles.particles.ParticlePair;
import dev.esophose.playerparticles.util.MathL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.bukkit.Location;
@ -56,6 +57,11 @@ public class ParticleStyleTwins extends DefaultParticleStyle {
}
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Arrays.asList("OAK_FENCE", "FENCE");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("orbs", 2, "The number of particle orbs to spawn");

View file

@ -28,6 +28,7 @@ import dev.esophose.playerparticles.particles.PParticle;
import dev.esophose.playerparticles.particles.ParticlePair;
import dev.esophose.playerparticles.util.MathL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.util.Vector;
@ -66,6 +67,11 @@ public class ParticleStyleVortex extends DefaultParticleStyle {
this.step = (this.step + 1) % this.maxStep;
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Collections.singletonList("GLOWSTONE_DUST");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("radius", 2.0, "The bottom radius of the vortex");

View file

@ -6,6 +6,7 @@ import dev.esophose.playerparticles.particles.ParticleEffect;
import dev.esophose.playerparticles.particles.ParticlePair;
import dev.esophose.playerparticles.util.MathL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.bukkit.Location;
@ -74,6 +75,11 @@ public class ParticleStyleWhirl extends DefaultParticleStyle {
this.step = (this.step + Math.PI * 2 / this.numSteps) % this.numSteps;
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Collections.singletonList("FEATHER");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("rays", 2, "The number of rays to spawn");

View file

@ -6,6 +6,7 @@ import dev.esophose.playerparticles.particles.ParticleEffect;
import dev.esophose.playerparticles.particles.ParticlePair;
import dev.esophose.playerparticles.util.MathL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.bukkit.Location;
@ -75,6 +76,11 @@ public class ParticleStyleWhirlwind extends DefaultParticleStyle {
this.step = (this.step + Math.PI * 2 / this.numSteps) % this.numSteps;
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Collections.singletonList("STRING");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("rays", 3, "The number of rays to spawn");

View file

@ -6,6 +6,7 @@ import dev.esophose.playerparticles.particles.ParticlePair;
import dev.esophose.playerparticles.util.MathL;
import dev.esophose.playerparticles.util.VectorUtils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.util.Vector;
@ -41,6 +42,11 @@ public class ParticleStyleWings extends DefaultParticleStyle {
this.spawnTimer %= this.spawnDelay;
}
@Override
protected List<String> getGuiIconMaterialNames() {
return Collections.singletonList("ELYTRA");
}
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("spawn-delay", 3, "The number of ticks to wait between particle spawns");