Archiviert
13
0

Particle #21

Manuell gemergt
YoyoNow hat 12 Commits von Particle nach master 2021-02-23 17:47:54 +01:00 zusammengeführt
Nur Änderungen aus Commit 256e59be69 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -30,7 +30,6 @@ import org.bukkit.Particle;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class ParticleInventory {
@ -38,8 +37,6 @@ public class ParticleInventory {
private ParticleInventory() {
}
private static final List<String> lore = Arrays.asList("§aKlicken zum Auswählen");
private static final List<SpecialParticle> playerParticles = new ArrayList<>();
private static final List<SpecialParticle> teamParticles = new ArrayList<>();
private static final List<SpecialParticle> serverteamParticles = new ArrayList<>();
@ -49,59 +46,67 @@ public class ParticleInventory {
private static final List<SWListInv.SWListEntry<SpecialParticle>> serverteamParticlesEntries = new ArrayList<>();
static {
playerParticles.add(new SimpleParticle(Material.SLIME_BLOCK, "§aSneeze", lore, Particle.SNEEZE, 0.2F, 0.2F, 0.2F, 0.01));
playerParticles.add(new SimpleParticle(Material.COBWEB, "§7Smoke", lore, Particle.SMOKE_NORMAL, 0.2F, 0.2F, 0.2F, 0.01));
playerParticles.add(new SimpleParticle(Material.LAVA_BUCKET, "§cFeuer", lore, Particle.DRIP_LAVA));
playerParticles.add(new SimpleParticle(Material.WATER_BUCKET, "§bWasser", lore, Particle.DRIP_WATER));
playerParticles.add(new FunctionalParticle(Material.RED_DYE, "§cHerzen", lore, (world, player, integer) -> world.spawnParticle(Particle.HEART, player.getLocation().add(0, 2.2, 0), 5)));
playerParticles.add(new FunctionalParticle(Material.NOTE_BLOCK, "§eNoten", lore, (world, player, integer) -> world.spawnParticle(Particle.NOTE, player.getLocation().add(0, 2.2, 0), 5)));
playerParticles.add(new SimpleParticle(Material.NAUTILUS_SHELL, "§aNautilis", lore, Particle.NAUTILUS, 0.2F, 0F, 0.2F, 0.01));
playerParticles.add(new SimpleParticle(Material.SNOWBALL, "§fSnowball", lore, Particle.SNOWBALL, 0.2F, 0F, 0.2F, 0.01));
playerParticles.add(new SimpleParticle(Material.GLASS_BOTTLE, "§5Effekt", lore, Particle.REDSTONE, 0F, 0.2F, 0F, 0.01));
playerParticles.add(new SimpleParticle(Material.CAMPFIRE, "§7Rauch", lore, Particle.CAMPFIRE_COSY_SMOKE, 0.0F, 0.2F, 0F, 0.01));
playerParticles.add(new SimpleParticle(Material.CAULDRON, "§5Magie", lore, Particle.CRIT_MAGIC, 0.2F, 0.2F, 0.2F, 0.01));
playerParticles.add(new SimpleParticle(Material.REDSTONE_BLOCK, "§4Wut", lore, Particle.VILLAGER_ANGRY, 0.2F, 0.02F, 0.2F, 0.01));
playerParticles.add(new SimpleParticle(Material.SLIME_BALL, "§aSchleim", lore, Particle.SLIME));
playerParticles.add(new SimpleParticle(Material.ZOMBIE_HEAD, "§7Mob", lore, Particle.SPELL_MOB));
List<String> defaultLore = loreBuilder(null, null);
List<String> teamLore = loreBuilder(null, "Team beitritt");
List<String> serverTeamLore = loreBuilder(null, "Serverteam");
List<String> serverTeamLore_C = loreBuilder(new String[]{"Wolke"}, "Serverteam");
List<String> serverTeamLore_R = loreBuilder(new String[]{"Ring"}, "Serverteam");
List<String> serverTeamLore_2R = loreBuilder(new String[]{"doppel Ring"}, "Serverteam");
List<String> serverTeamLore_CR = loreBuilder(new String[]{"Wolke", "Ring"}, "Serverteam");
playerParticles.add(new SimpleParticle(Material.SLIME_BLOCK, "§aSneeze", defaultLore, Particle.SNEEZE, 0.2F, 0.2F, 0.2F, 0.01));
playerParticles.add(new SimpleParticle(Material.COBWEB, "§7Smoke", defaultLore, Particle.SMOKE_NORMAL, 0.2F, 0.2F, 0.2F, 0.01));
playerParticles.add(new SimpleParticle(Material.LAVA_BUCKET, "§cFeuer", defaultLore, Particle.DRIP_LAVA));
playerParticles.add(new SimpleParticle(Material.WATER_BUCKET, "§bWasser", defaultLore, Particle.DRIP_WATER));
playerParticles.add(new FunctionalParticle(Material.RED_DYE, "§cHerzen", defaultLore, (world, player, integer) -> world.spawnParticle(Particle.HEART, player.getLocation().add(0, 2.2, 0), 5)));
playerParticles.add(new FunctionalParticle(Material.NOTE_BLOCK, "§eNoten", defaultLore, (world, player, integer) -> world.spawnParticle(Particle.NOTE, player.getLocation().add(0, 2.2, 0), 5)));
playerParticles.add(new SimpleParticle(Material.NAUTILUS_SHELL, "§aNautilis", defaultLore, Particle.NAUTILUS, 0.2F, 0F, 0.2F, 0.01));
playerParticles.add(new SimpleParticle(Material.SNOWBALL, "§fSnowball", defaultLore, Particle.SNOWBALL, 0.2F, 0F, 0.2F, 0.01));
playerParticles.add(new SimpleParticle(Material.GLASS_BOTTLE, "§5Effekt", defaultLore, Particle.REDSTONE, 0F, 0.2F, 0F, 0.01));
playerParticles.add(new SimpleParticle(Material.CAMPFIRE, "§7Rauch", defaultLore, Particle.CAMPFIRE_COSY_SMOKE, 0.0F, 0.2F, 0F, 0.01));
playerParticles.add(new SimpleParticle(Material.CAULDRON, "§5Magie", defaultLore, Particle.CRIT_MAGIC, 0.2F, 0.2F, 0.2F, 0.01));
playerParticles.add(new SimpleParticle(Material.REDSTONE_BLOCK, "§4Wut", defaultLore, Particle.VILLAGER_ANGRY, 0.2F, 0.02F, 0.2F, 0.01));
playerParticles.add(new SimpleParticle(Material.SLIME_BALL, "§aSchleim", defaultLore, Particle.SLIME));
playerParticles.add(new SimpleParticle(Material.ZOMBIE_HEAD, "§7Mob", defaultLore, Particle.SPELL_MOB));
teamParticles.addAll(playerParticles);
teamParticles.add(new SimpleParticle(Material.INK_SAC, "§8Squid", lore, Particle.SQUID_INK, 0.2F, 0.2F, 0.2F, 0.01));
teamParticles.add(new SimpleParticle(Material.TUBE_CORAL, "§aBubble", lore, Particle.BUBBLE_POP, 0.2F, 0.2F, 0.2F, 0.01));
teamParticles.add(new SimpleParticle(Material.HONEY_BOTTLE, "§6Honey", lore, Particle.DRIPPING_HONEY, 0.2F, 0.2F, 0.2F, 1));
teamParticles.add(new SimpleParticle(Material.HONEYCOMB, "§6Nectar", lore, Particle.FALLING_NECTAR, 0.2F, 0.2F, 0.2F, 1));
teamParticles.add(new FunctionalParticle(Material.FIRE_CHARGE, "§7Firework", lore, (world, player, time) -> {
teamParticles.add(new SimpleParticle(Material.INK_SAC, "§8Squid", teamLore, Particle.SQUID_INK, 0.2F, 0.2F, 0.2F, 0.01));
teamParticles.add(new SimpleParticle(Material.TUBE_CORAL, "§aBubble", teamLore, Particle.BUBBLE_POP, 0.2F, 0.2F, 0.2F, 0.01));
teamParticles.add(new SimpleParticle(Material.HONEY_BOTTLE, "§6Honey", teamLore, Particle.DRIPPING_HONEY, 0.2F, 0.2F, 0.2F, 1));
teamParticles.add(new SimpleParticle(Material.HONEYCOMB, "§6Nectar", teamLore, Particle.FALLING_NECTAR, 0.2F, 0.2F, 0.2F, 1));
teamParticles.add(new FunctionalParticle(Material.FIRE_CHARGE, "§7Firework", loreBuilder(new String[]{"in Luft"}, "Team beitritt"), (world, player, time) -> {
if (world.getBlockAt(player.getLocation().subtract(0, 1, 0)).getType() == Material.AIR) {
world.spawnParticle(Particle.FIREWORKS_SPARK, player.getLocation().subtract(0, -0.2, 0), 2, 0.1F, 0.1F, 0.1F, 0.2);
}
}));
teamParticles.add(new SimpleParticle(Material.DRAGON_BREATH, "§5Dragon Breath", lore, Particle.DRAGON_BREATH, 1F, 0.02F, 1F, 0.01));
teamParticles.add(new SimpleParticle(Material.SPIDER_EYE, "§5Damage", lore, Particle.DAMAGE_INDICATOR, 0.2F, 0F, 0.2F, 0.01));
teamParticles.add(new SimpleParticle(Material.BLUE_DYE, "§dDolphin", lore, Particle.DOLPHIN, 0.2F, 0F, 0.2F, 0.01));
teamParticles.add(new CircleParticle(Material.RED_CONCRETE, "§cHerzen Ring", lore, Particle.HEART, location -> location.add(0, 2.2, 0)));
teamParticles.add(new SimpleParticle(Material.DRAGON_BREATH, "§5Dragon Breath", teamLore, Particle.DRAGON_BREATH, 1F, 0.02F, 1F, 0.01));
teamParticles.add(new SimpleParticle(Material.SPIDER_EYE, "§5Damage", teamLore, Particle.DAMAGE_INDICATOR, 0.2F, 0F, 0.2F, 0.01));
teamParticles.add(new SimpleParticle(Material.BLUE_DYE, "§dDolphin", teamLore, Particle.DOLPHIN, 0.2F, 0F, 0.2F, 0.01));
teamParticles.add(new CircleParticle(Material.RED_CONCRETE, "§cHerzen", loreBuilder(new String[]{"Ring"}, "Team beitritt"), Particle.HEART, location -> location.add(0, 2.2, 0)));
serverteamParticles.addAll(teamParticles);
serverteamParticles.add(new SimpleParticle(Material.EXPERIENCE_BOTTLE, "§5Hexe", lore, Particle.SPELL_WITCH));
serverteamParticles.add(new SimpleParticle(Material.ENCHANTING_TABLE, "§eZauber", lore, Particle.ENCHANTMENT_TABLE));
serverteamParticles.add(new SimpleParticle(Material.EMERALD_BLOCK, "§2Freude", lore, Particle.VILLAGER_HAPPY, 0.2F, 0.2F, 0.2F, 0.01));
serverteamParticles.add(new SimpleParticle(Material.FLINT_AND_STEEL, "§7Flammen", lore, Particle.FLAME, 0F, 0.2F, 0F, 0.01));
serverteamParticles.add(new SimpleParticle(Material.END_ROD, "§fEnd Rod", lore, Particle.END_ROD, 0.2F, 0.2F, 0.2F, 0.01));
serverteamParticles.add(new CloudParticle(Material.WHITE_WOOL, "§fCloud", lore, Particle.CLOUD));
serverteamParticles.add(new CloudParticle(Material.TOTEM_OF_UNDYING, "§aTotem Wolke", lore, Particle.TOTEM));
serverteamParticles.add(new CloudParticle(Material.WHITE_DYE, "§eZauber Wolke", lore, Particle.ENCHANTMENT_TABLE));
serverteamParticles.add(new CloudParticle(Material.FIRE_CORAL_BLOCK, "§cFlammen Wolke", lore, Particle.FLAME));
serverteamParticles.add(new CloudParticle(Material.LIME_SHULKER_BOX, "§aSneeze Wolke", lore, Particle.SNEEZE));
serverteamParticles.add(new CloudParticle(Material.GREEN_SHULKER_BOX, "§aSchleim Wolke", lore, Particle.SLIME));
serverteamParticles.add(new CloudParticle(Material.DEAD_BRAIN_CORAL_BLOCK, "§8Smoke Wolke", lore, Particle.CAMPFIRE_COSY_SMOKE));
serverteamParticles.add(new CloudParticle(Material.FIREWORK_STAR, "§5Town Wolke", lore, Particle.TOWN_AURA));
serverteamParticles.add(new CircleParticle(Material.MAGMA_BLOCK, "§cFlammen Ring", lore, Particle.FLAME, location -> location.add(0, 1.1, 0), 0F, 0.0F, 0F, 0.01));
serverteamParticles.add(new CircleParticle(Material.ENCHANTED_BOOK, "§fEnchanted Ring", lore, Particle.ENCHANTMENT_TABLE, location -> location.add(0, 1.1, 0), 0.0F, 0.0F, 0.0F, 0.01));
serverteamParticles.add(new CircleParticle(Material.NOTE_BLOCK, "§eNoten Ring", lore, Particle.NOTE, location -> location.add(0, 2.2, 0), 0.0F, 0.0F, 0.0F, 0.01));
serverteamParticles.add(new DoubleCircleParticle(Material.GUARDIAN_SPAWN_EGG, "§bWater§7/§cFire Double Ring", lore, Particle.DRIP_WATER, Particle.DRIP_LAVA, location -> location.add(0, 1.1, 0), 0.0F, 0.0F, 0.0F, 0.01));
serverteamParticles.add(new DoubleCircleParticle(Material.DIAMOND_SWORD, "§5Magic§7/§eZauber Double Ring", lore, Particle.CRIT_MAGIC, Particle.ENCHANTMENT_TABLE, location -> location.add(0, 1.1, 0), 0.0F, 0.0F, 0.0F, 0.01));
serverteamParticles.add(new CloudCircleParticle(Material.GLOWSTONE_DUST, "§5Magic Ring Wolke", lore, Particle.CRIT_MAGIC, location -> location.add(0, 1.1, 0)));
serverteamParticles.add(new CloudCircleParticle(Material.FIRE_CORAL, "§cFlammen Ring Wolke", lore, Particle.FLAME, location -> location.add(0, 1.1, 0)));
serverteamParticles.add(new CloudCircleParticle(Material.FIREWORK_ROCKET, "§7Firework Ring Wolke", lore, Particle.FIREWORKS_SPARK, location -> location.add(0, 1.1, 0)));
serverteamParticles.add(new CloudCircleParticle(Material.CYAN_DYE, "§aWater Ring Wolke", lore, Particle.WATER_WAKE, location -> location.add(0, 1.1, 0)));
serverteamParticles.add(new SimpleParticle(Material.EXPERIENCE_BOTTLE, "§5Hexe", serverTeamLore, Particle.SPELL_WITCH));
serverteamParticles.add(new SimpleParticle(Material.ENCHANTING_TABLE, "§eZauber", serverTeamLore, Particle.ENCHANTMENT_TABLE));
serverteamParticles.add(new SimpleParticle(Material.EMERALD_BLOCK, "§2Freude", serverTeamLore, Particle.VILLAGER_HAPPY, 0.2F, 0.2F, 0.2F, 0.01));
serverteamParticles.add(new SimpleParticle(Material.FLINT_AND_STEEL, "§7Flammen", serverTeamLore, Particle.FLAME, 0F, 0.2F, 0F, 0.01));
serverteamParticles.add(new SimpleParticle(Material.END_ROD, "§fEnd Rod", serverTeamLore, Particle.END_ROD, 0.2F, 0.2F, 0.2F, 0.01));
serverteamParticles.add(new CloudParticle(Material.WHITE_WOOL, "§fCloud", serverTeamLore_C, Particle.CLOUD));
serverteamParticles.add(new CloudParticle(Material.TOTEM_OF_UNDYING, "§aTotem", serverTeamLore_C, Particle.TOTEM));
serverteamParticles.add(new CloudParticle(Material.WHITE_DYE, "§eZauber", serverTeamLore_C, Particle.ENCHANTMENT_TABLE));
serverteamParticles.add(new CloudParticle(Material.FIRE_CORAL_BLOCK, "§cFlammen", serverTeamLore_C, Particle.FLAME));
serverteamParticles.add(new CloudParticle(Material.LIME_SHULKER_BOX, "§aSneeze", serverTeamLore_C, Particle.SNEEZE));
serverteamParticles.add(new CloudParticle(Material.GREEN_SHULKER_BOX, "§aSchleim", serverTeamLore_C, Particle.SLIME));
serverteamParticles.add(new CloudParticle(Material.DEAD_BRAIN_CORAL_BLOCK, "§8Smoke", serverTeamLore_C, Particle.CAMPFIRE_COSY_SMOKE));
serverteamParticles.add(new CloudParticle(Material.FIREWORK_STAR, "§5Town", serverTeamLore_C, Particle.TOWN_AURA));
serverteamParticles.add(new CircleParticle(Material.MAGMA_BLOCK, "§cFlammen", serverTeamLore_R, Particle.FLAME, location -> location.add(0, 1.1, 0), 0F, 0.0F, 0F, 0.01));
serverteamParticles.add(new CircleParticle(Material.ENCHANTED_BOOK, "§fEnchanted", serverTeamLore_R, Particle.ENCHANTMENT_TABLE, location -> location.add(0, 1.1, 0), 0.0F, 0.0F, 0.0F, 0.01));
serverteamParticles.add(new CircleParticle(Material.NOTE_BLOCK, "§eNoten", serverTeamLore_R, Particle.NOTE, location -> location.add(0, 2.2, 0), 0.0F, 0.0F, 0.0F, 0.01));
serverteamParticles.add(new DoubleCircleParticle(Material.GUARDIAN_SPAWN_EGG, "§bWater§7/§cFire", serverTeamLore_2R, Particle.DRIP_WATER, Particle.DRIP_LAVA, location -> location.add(0, 1.1, 0), 0.0F, 0.0F, 0.0F, 0.01));
serverteamParticles.add(new DoubleCircleParticle(Material.DIAMOND_SWORD, "§5Magic§7/§eZauber", serverTeamLore_2R, Particle.CRIT_MAGIC, Particle.ENCHANTMENT_TABLE, location -> location.add(0, 1.1, 0), 0.0F, 0.0F, 0.0F, 0.01));
serverteamParticles.add(new CloudCircleParticle(Material.GLOWSTONE_DUST, "§5Magic", serverTeamLore_CR, Particle.CRIT_MAGIC, location -> location.add(0, 1.1, 0)));
serverteamParticles.add(new CloudCircleParticle(Material.FIRE_CORAL, "§cFlammen", serverTeamLore_CR, Particle.FLAME, location -> location.add(0, 1.1, 0)));
serverteamParticles.add(new CloudCircleParticle(Material.FIREWORK_ROCKET, "§7Firework", serverTeamLore_CR, Particle.FIREWORKS_SPARK, location -> location.add(0, 1.1, 0)));
serverteamParticles.add(new CloudCircleParticle(Material.CYAN_DYE, "§aWater", serverTeamLore_CR, Particle.WATER_WAKE, location -> location.add(0, 1.1, 0)));
playerParticles.forEach(specialParticle -> playerParticlesEntries.add(new SWListInv.SWListEntry<>(specialParticle.getItem(), specialParticle)));
teamParticles.forEach(specialParticle -> teamParticlesEntries.add(new SWListInv.SWListEntry<>(specialParticle.getItem(), specialParticle)));
@ -123,7 +128,7 @@ public class ParticleInventory {
} else {
particleSWListInv = new SWListInv<>(player, "§6Partikel", false, serverteamParticlesEntries, (clickType, particle) -> lobbyPlayer.setParticle(particle));
}
particleSWListInv.setItem(49, Material.BARRIER, "§8Keine Partikel", lore, false, clickType -> {
particleSWListInv.setItem(49, Material.BARRIER, "§8Keine Partikel", new ArrayList<>(), false, clickType -> {
lobbyPlayer.setParticle(null);
});
@ -134,5 +139,23 @@ public class ParticleInventory {
createInventory(player).open();
}
private static List<String> loreBuilder(String[] attribute, String unlocked) {
List<String> lore = new ArrayList<>();
lore.add("");
if (attribute != null && attribute.length > 0) {
lore.add("§eAttribute§7:");
for (String s : attribute) {
lore.add("§7- §f" + s);
}
lore.add("");
}
if (unlocked != null) {
lore.add("§eFreigeschaltet durch");
lore.add("§f" + unlocked);
lore.add("");
}
lore.add("§eKlicken zum auswählen");
return lore;
}
}