13
0

Remove old particle system
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2023-04-04 14:54:38 +02:00
Ursprung 29474ebfaf
Commit 438b336535
57 geänderte Dateien mit 489 neuen und 1882 gelöschten Zeilen

Datei anzeigen

@ -1,75 +0,0 @@
package de.steamwar.lobby.otherparticle;
import de.steamwar.inventory.SWItem;
import de.steamwar.lobby.LobbySystem;
import de.steamwar.sql.SteamwarUser;
import de.steamwar.sql.UserGroup;
import lombok.Getter;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
public class ParticleData {
private final Material material;
private final String name;
private final Set<String> attributes = new LinkedHashSet<>();
@Getter
private final ParticleRequirement requirement;
@Getter
private final ParticleElement particleElement;
public ParticleData(Material material, String name, ParticleElement particleElement) {
this.material = material;
this.name = name;
this.requirement = ParticleRequirement.NO_REQUIRMENT;
this.particleElement = particleElement;
particleElement.aggregateAttributes(this);
}
public ParticleData(Material material, String name, ParticleRequirement requirement, ParticleElement particleElement) {
this.material = material;
this.name = name;
this.requirement = requirement;
this.particleElement = particleElement;
particleElement.aggregateAttributes(this);
}
public ParticleData add(String attribute) {
attributes.add(attribute);
return this;
}
public SWItem toSWItem(Player player, SteamwarUser user, Set<Integer> eventTeilnahme, String eggHuntConfig) {
String translatedName = LobbySystem.getMessage().parse(name, player);
List<String> lore = new ArrayList<>();
lore.add("");
if (!attributes.isEmpty()) {
lore.add(LobbySystem.getMessage().parse("PARTICLE_ATTRIBUTE", player));
attributes.forEach(attribute -> lore.add(LobbySystem.getMessage().parse(attribute, player)));
lore.add("");
}
boolean selectable = requirement.getRequirement().test(user, eventTeilnahme, eggHuntConfig);
selectable |= user.getUserGroup() != UserGroup.Member;
String unlockedBy = requirement.getRequirementName(player);
if (unlockedBy != null) {
lore.add(LobbySystem.getMessage().parse("PARTICLE_UNLOCKED_BY", player));
lore.add(unlockedBy);
lore.add("");
}
if (selectable) {
lore.add(LobbySystem.getMessage().parse("PARTICLE_SELECT", player));
} else {
lore.add(LobbySystem.getMessage().parse("PARTICLE_LOCKED", player));
}
return new SWItem(material, translatedName, lore, false, clickType -> {});
}
}

Datei anzeigen

@ -1,97 +0,0 @@
package de.steamwar.lobby.otherparticle;
import de.steamwar.inventory.SWItem;
import de.steamwar.inventory.SWListInv;
import de.steamwar.lobby.LobbySystem;
import de.steamwar.lobby.otherparticle.particles.*;
import de.steamwar.lobby.otherparticle.particles.custom.CustomEasterParticle;
import de.steamwar.lobby.otherparticle.particles.custom.CustomPlayerParticle;
import de.steamwar.lobby.otherparticle.particles.custom.CustomTeamParticle;
import de.steamwar.lobby.special.easter.EggHunt;
import de.steamwar.lobby.util.LobbyPlayer;
import de.steamwar.sql.*;
import lombok.experimental.UtilityClass;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
@UtilityClass
public class ParticleInventory {
private final Class<?>[] PARTICLES = {
PlayerParticle.class,
CustomPlayerParticle.class,
TeamParticle.class,
CustomTeamParticle.class,
ServerTeamParticle.class,
EventParticle.class,
EventParticlePlacement.class,
EventParticleParticipation.class,
EasterParticle.class,
CustomEasterParticle.class,
};
public String convertToString(ParticleEnum particleEnum) {
return particleEnum.getClass().getSimpleName() + "@" + ((Enum<?>)particleEnum).name();
}
public ParticleEnum convertFromString(String string) {
String[] split = string.split("@");
Class<?> clazz = null;
for (Class<?> aClass : PARTICLES) {
if (aClass.getSimpleName().equals(split[0])) {
clazz = aClass;
break;
}
}
if (clazz != null) {
try {
return (ParticleEnum) Enum.valueOf((Class<? extends Enum>) clazz, split[1]);
} catch (Exception e) {
return null;
}
}
// TODO: Add conversion from last version
return null;
}
public void openInventory(Player player) {
LobbyPlayer lobbyPlayer = LobbyPlayer.getLobbyPlayer(player.getUniqueId());
SteamwarUser user = SteamwarUser.get(player.getUniqueId());
Set<Integer> events = user.getTeam() == 0 ? new HashSet<>() : TeamTeilnahme.getEvents(user.getTeam()).stream().map(Event::getEventID).collect(Collectors.toSet());
String eggHuntConfig = UserConfig.getConfig(user.getId(), EggHunt.EGG_HUNT_CONFIG_KEY);
List<SWListInv.SWListEntry<ParticleEnum>> particleList = new ArrayList<>();
for (Class<?> clazz : PARTICLES) {
addParticles(particleList, (ParticleEnum[]) clazz.getEnumConstants(), player, user, events, eggHuntConfig);
}
SWListInv<ParticleEnum> particleSWListInv = new SWListInv<>(player, LobbySystem.getMessage().parse("PARTICLE_INVENTORY", player), false, particleList, (clickType, particle) -> {
if (particle == null) return;
// lobbyPlayer.setParticle(particle); // TODO: Update this
player.closeInventory();
});
particleSWListInv.setItem(49, Material.BARRIER, LobbySystem.getMessage().parse("PARTICLE_DESELECT", player), new ArrayList<>(), false, clickType -> {
lobbyPlayer.setParticle(null);
});
particleSWListInv.open();
}
private void addParticles(List<SWListInv.SWListEntry<ParticleEnum>> particleList, ParticleEnum[] particleEnums, Player player, SteamwarUser user, Set<Integer> events, String eggHuntConfig) {
for (ParticleEnum particle : particleEnums) {
ParticleData particleData = particle.getParticle();
SWItem swItem = particleData.toSWItem(player, user, events, eggHuntConfig);
if (particleData.getRequirement().test(user, events, eggHuntConfig) || user.getUserGroup() != UserGroup.Member) {
particleList.add(new SWListInv.SWListEntry<>(swItem, particle));
} else {
particleList.add(new SWListInv.SWListEntry<>(swItem, null));
}
}
}
}

Datei anzeigen

@ -1,29 +0,0 @@
package de.steamwar.lobby.otherparticle.particles;
import de.steamwar.lobby.otherparticle.ParticleData;
import de.steamwar.lobby.otherparticle.ParticleEnum;
import de.steamwar.lobby.otherparticle.ParticleRequirement;
import de.steamwar.lobby.otherparticle.elements.Always;
import de.steamwar.lobby.otherparticle.elements.Circle;
import de.steamwar.lobby.otherparticle.elements.LocationMutator;
import de.steamwar.lobby.otherparticle.elements.SimpleParticle;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.bukkit.Material;
import org.bukkit.Particle;
@AllArgsConstructor
public enum EventParticle implements ParticleEnum {
WATER(new ParticleData(Material.WATER_BUCKET, "PARTICLE_WATER", ParticleRequirement.EVENT_PARTICIPATION,
new Always(new Circle(new LocationMutator(new SimpleParticle(Particle.DRIP_WATER), 0, 1.1, 0))))
),
LAVA(new ParticleData(Material.LAVA_BUCKET, "PARTICLE_FIRE", ParticleRequirement.EVENT_PARTICIPATION,
new Always(new Circle(new LocationMutator(new SimpleParticle(Particle.DRIP_LAVA), 0, 1.1, 0))))
),
;
public static ParticleEnum[] particles = values();
@Getter
private ParticleData particle;
}

Datei anzeigen

@ -1,45 +0,0 @@
package de.steamwar.lobby.otherparticle.particles;
import de.steamwar.lobby.otherparticle.ParticleData;
import de.steamwar.lobby.otherparticle.ParticleEnum;
import de.steamwar.lobby.otherparticle.ParticleRequirement;
import de.steamwar.lobby.otherparticle.WingDesign;
import de.steamwar.lobby.otherparticle.elements.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.bukkit.Material;
import org.bukkit.Particle;
@AllArgsConstructor
public enum EventParticleParticipation implements ParticleEnum {
WarGearSeason(new ParticleData(Material.BOOK, "PARTICLE_EVENT_ENCHANTING", ParticleRequirement.eventParticipation(22),
new SimpleParticle(Particle.ENCHANTMENT_TABLE))
),
AirshipEvent(new ParticleData(Material.SNOW_BLOCK, "PARTICLE_EVENT_CLOUD", ParticleRequirement.eventParticipation(26),
new SimpleParticle(Particle.CLOUD))
),
HellsBellsWs(new ParticleData(Material.TNT, "PARTICLE_EVENT_SMOKE", ParticleRequirement.eventParticipation(28),
new Circle(new SimpleParticle(Particle.CAMPFIRE_COSY_SMOKE, 0, 0, 0, 0.01)))
),
Underwater(new ParticleData(Material.PRISMARINE_BRICKS, "PARTICLE_EVENT_WATER", ParticleRequirement.eventParticipation(31),
new SimpleParticle(Particle.DRIP_WATER))
),
AdventWarShip(new ParticleData(Material.PRISMARINE_WALL, "PARTICLE_EVENT_WATER", ParticleRequirement.eventParticipation(32),
new Group(new SimpleParticle(Particle.DRIP_WATER), new SimpleParticle(Particle.WATER_WAKE, 0.2F, 0.2F, 0.2F, 0.01)))
),
MiniWarGearLiga(new ParticleData(Material.PRISMARINE_SLAB, "PARTICLE_EVENT_WATER", ParticleRequirement.eventParticipation(33),
new Circle(new SimpleParticle(Particle.WATER_WAKE, 0, 0, 0, 0)))
),
UnderwaterMWG(new ParticleData(Material.BLUE_CARPET, "PARTICLE_EVENT_RAIN_CLOUD", ParticleRequirement.eventParticipation(35),
new Always(new LocationMutator(new Group(new SimpleParticle(Particle.CLOUD, 0.3F, 0.1F, 0.3F, 0.01), new SimpleParticle(Particle.WATER_WAKE, 0.3F, 0.1F, 0.3F, 0.01), new LocationMutator(new SimpleParticle(Particle.DRIP_WATER, 0.3F, 0.0F, 0.3F, 0.01), 0, 0.2, 0)), 0, 2.2, 0)))
),
WarGearSeason2022(new ParticleData(Material.DIAMOND_SWORD, "PARTICLE_EVENT_WINGS", ParticleRequirement.eventParticipation(37),
new Always(new Delayed(new NonFlying(new Wing(new SimpleParticle(Particle.DRAGON_BREATH, 0, 0, 0, 0, 1), 0.15, WingDesign.COMPLEX)), 20)))
),
;
public static ParticleEnum[] particles = values();
@Getter
private ParticleData particle;
}

Datei anzeigen

@ -1,51 +0,0 @@
package de.steamwar.lobby.otherparticle.particles;
import de.steamwar.lobby.otherparticle.ParticleData;
import de.steamwar.lobby.otherparticle.ParticleEnum;
import de.steamwar.lobby.otherparticle.ParticleRequirement;
import de.steamwar.lobby.otherparticle.WingDesign;
import de.steamwar.lobby.otherparticle.elements.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.bukkit.Material;
import org.bukkit.Particle;
@AllArgsConstructor
public enum EventParticlePlacement implements ParticleEnum {
WarGearSeason(new ParticleData(Material.ENCHANTING_TABLE, "PARTICLE_EVENT_ENCHANTING", ParticleRequirement.eventPlacement(22, 12, 285, 54),
new Cloud(new Circle(new LocationMutator(new SimpleParticle(Particle.ENCHANTMENT_TABLE, 0, 0, 0, 0.01), 0, 1.1, 0)))
)),
AirshipEvent(new ParticleData(Material.SNOWBALL, "PARTICLE_EVENT_CLOUD", ParticleRequirement.eventPlacement(26, 205, 9, 54, 120, 292),
new Circle(new LocationMutator(new SimpleParticle(Particle.CLOUD, 0, 0, 0, 0.01), 0, 2.2, 0))
)),
HellsBellsWs(new ParticleData(Material.TNT_MINECART, "PARTICLE_EVENT_SMOKE", ParticleRequirement.eventPlacement(28, 205, 9, 11),
new Cloud(new Circle(new LocationMutator(new SimpleParticle(Particle.CAMPFIRE_COSY_SMOKE, 0, 0, 0, 0.01), 0, 2.2, 0)))
)),
Underwater(new ParticleData(Material.PRISMARINE_SHARD, "PARTICLE_EVENT_WATER", ParticleRequirement.eventPlacement(31, 9, 210, 520),
new Cloud(new SimpleParticle(Particle.DRIP_WATER)))
),
AdventWarShip(new ParticleData(Material.PRISMARINE_CRYSTALS, "PARTICLE_EVENT_WATER", ParticleRequirement.eventPlacement(31, 9, 205, 210),
new Always(new LocationMutator(new Circle(new Group(new SimpleParticle(Particle.DRIP_WATER), new SimpleParticle(Particle.WATER_WAKE, 0.2F, 0.2F, 0.2F, 0.01))), 0, 1.1, 0)))
),
MiniWarGearLiga(new ParticleData(Material.IRON_SWORD, "PARTICLE_EVENT_WINGS", ParticleRequirement.eventPlacement(33, 9, 34, 205),
new Always(new Delayed(new NonFlying(new Wing(new SimpleParticle(Particle.WATER_WAKE, 0, 0, 0, 0, 1), 0.15, WingDesign.MWGL)), 20)))
),
Absturz(new ParticleData(Material.FEATHER, "PARTICLE_EVENT_WINGS", ParticleRequirement.eventPlacement(34, 210, 205, 527, 286),
new Always(new Delayed(new NonFlying(new Wing(new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0, 1), 0.15, WingDesign.SIMPLE)), 20)))
),
UnderwaterMWG(new ParticleData(Material.CYAN_CARPET, "PARTICLE_EVENT_RAIN_CLOUD", ParticleRequirement.eventPlacement(35, 9, 210),
new Always(new Delayed(new NonFlying(new Wing(new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0, 1), 0.15, WingDesign.SW)), 20)))
),
WarGearSeason2022(new ParticleData(Material.DIAMOND_HELMET, "PARTICLE_EVENT_WGS", ParticleRequirement.eventPlacement(37, 285, 210, 122),
new Always(new Delayed(new NonFlying(new Wing(new SimpleParticle(Particle.FIREWORKS_SPARK, 0, 0, 0, 0, 1), 0.15, WingDesign.WGS)), 20)))
),
WargearClash(new ParticleData(Material.GOLDEN_SWORD, "PARTICLE_EVENT_WARGEARCLASH", ParticleRequirement.eventPlacement(38, 210, 158, 167, 286),
new Always(new Delayed(new NonFlying(new Wing(new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0, 1), 0.1, WingDesign.SWORD_CROSSED)), 20)))
),
;
public static ParticleEnum[] particles = values();
@Getter
private ParticleData particle;
}

Datei anzeigen

@ -1,63 +0,0 @@
package de.steamwar.lobby.otherparticle.particles;
import de.steamwar.lobby.otherparticle.ParticleData;
import de.steamwar.lobby.otherparticle.ParticleEnum;
import de.steamwar.lobby.otherparticle.elements.DustParticle;
import de.steamwar.lobby.otherparticle.elements.LocationMutator;
import de.steamwar.lobby.otherparticle.elements.SimpleParticle;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.bukkit.Material;
import org.bukkit.Particle;
@AllArgsConstructor
public enum PlayerParticle implements ParticleEnum {
SNEEZE(new ParticleData(Material.SLIME_BLOCK, "PARTICLE_SNEEZE",
new SimpleParticle(Particle.SNEEZE, 0.2F, 0.2F, 0.2F, 0.01))
),
SMOKE(new ParticleData(Material.COBWEB, "PARTICLE_SMOKE",
new SimpleParticle(Particle.SMOKE_NORMAL, 0.2F, 0.2F, 0.2F, 0.01))
),
FIRE(new ParticleData(Material.LAVA_BUCKET, "PARTICLE_FIRE",
new SimpleParticle(Particle.DRIP_LAVA))
),
WATER(new ParticleData(Material.WATER_BUCKET, "PARTICLE_WATER",
new SimpleParticle(Particle.DRIP_WATER))
),
HEARTH(new ParticleData(Material.RED_DYE, "PARTICLE_HEART",
new LocationMutator(new SimpleParticle(Particle.HEART), 0, 2.2, 0))
),
NOTES(new ParticleData(Material.NOTE_BLOCK, "PARTICLE_NOTES",
new LocationMutator(new SimpleParticle(Particle.NOTE), 0, 2.2, 0))
),
NAUTILUS(new ParticleData(Material.NAUTILUS_SHELL, "PARTICLE_NAUTILUS",
new SimpleParticle(Particle.NAUTILUS, 0.2F, 0.2F ,0.2F, 0.01))
),
SNOWBALL(new ParticleData(Material.SNOWBALL, "PARTICLE_SNOWBALL",
new SimpleParticle(Particle.SNOWBALL, 0.2F, 0.2F ,0.2F, 0.01))
),
EFFECT(new ParticleData(Material.GLASS_BOTTLE, "PARTICLE_EFFECT",
new DustParticle(Particle.REDSTONE, 0, 0.2F, 02F, 0.01, 5))
),
CAMPFIRE(new ParticleData(Material.CAMPFIRE, "PARTICLE_CAMPFIRE",
new SimpleParticle(Particle.CAMPFIRE_COSY_SMOKE, 0, 0.2F ,0, 0.01))
),
MAGIC(new ParticleData(Material.CAULDRON, "PARTICLE_MAGIC",
new SimpleParticle(Particle.CRIT_MAGIC, 0.2F, 0.2F, 0.2F, 0.01))
),
ANGRY(new ParticleData(Material.REDSTONE_BLOCK, "PARTICLE_ANGRY",
new SimpleParticle(Particle.VILLAGER_ANGRY, 0.2F, 0.2F, 0.2F, 0.01))
),
SLIME(new ParticleData(Material.SLIME_BALL, "PARTICLE_SLIME",
new SimpleParticle(Particle.SLIME))
),
MOB(new ParticleData(Material.ZOMBIE_HEAD, "PARTICLE_MOB",
new SimpleParticle(Particle.SPELL_MOB))
),
;
public static ParticleEnum[] particles = values();
@Getter
private ParticleData particle;
}

Datei anzeigen

@ -1,99 +0,0 @@
package de.steamwar.lobby.otherparticle.particles;
import de.steamwar.lobby.otherparticle.ParticleData;
import de.steamwar.lobby.otherparticle.ParticleEnum;
import de.steamwar.lobby.otherparticle.ParticleRequirement;
import de.steamwar.lobby.otherparticle.WingDesign;
import de.steamwar.lobby.otherparticle.elements.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.bukkit.Material;
import org.bukkit.Particle;
@AllArgsConstructor
public enum ServerTeamParticle implements ParticleEnum {
WITCH(new ParticleData(Material.EXPERIENCE_BOTTLE, "PARTICLE_WITCH", ParticleRequirement.SERVER_TEAM,
new SimpleParticle(Particle.SPELL_WITCH))
),
ENCHANTING(new ParticleData(Material.ENCHANTING_TABLE, "PARTICLE_ENCHANTING", ParticleRequirement.SERVER_TEAM,
new SimpleParticle(Particle.ENCHANTMENT_TABLE))
),
HAPPY(new ParticleData(Material.EMERALD_BLOCK, "PARTICLE_HAPPY", ParticleRequirement.SERVER_TEAM,
new SimpleParticle(Particle.HEART, 0.2F, 0.2F, 0.2F, 0.01))
),
FLAME(new ParticleData(Material.FLINT_AND_STEEL, "PARTICLE_FLAME", ParticleRequirement.SERVER_TEAM,
new SimpleParticle(Particle.FLAME, 0, 0.2F, 0, 0.01))
),
END_ROD(new ParticleData(Material.END_ROD, "PARTICLE_END_ROD", ParticleRequirement.SERVER_TEAM,
new SimpleParticle(Particle.END_ROD, 0.2F, 0.2F, 0.2F, 0.01))
),
CLOUD(new ParticleData(Material.WHITE_WOOL, "PARTICLE_CLOUD", ParticleRequirement.SERVER_TEAM,
new Cloud(new SimpleParticle(Particle.CLOUD)))
),
TOTEM(new ParticleData(Material.TOTEM_OF_UNDYING, "PARTICLE_TOTEM", ParticleRequirement.SERVER_TEAM,
new Cloud(new SimpleParticle(Particle.TOTEM, 0.2F, 0.2F, 0.2F, 0.01)))
),
ENCHANTING_CLOUD(new ParticleData(Material.WHITE_DYE, "PARTICLE_ENCHANTING", ParticleRequirement.SERVER_TEAM,
new Cloud(new SimpleParticle(Particle.ENCHANTMENT_TABLE)))
),
FLAME_CLOUD(new ParticleData(Material.FIRE_CORAL_BLOCK, "PARTICLE_FLAME", ParticleRequirement.SERVER_TEAM,
new Cloud(new SimpleParticle(Particle.FLAME)))
),
SNEEZE_CLOUD(new ParticleData(Material.LIME_SHULKER_BOX, "PARTICLE_SNEEZE", ParticleRequirement.SERVER_TEAM,
new Cloud(new SimpleParticle(Particle.SNEEZE)))
),
SLIME_CLOUD(new ParticleData(Material.GREEN_SHULKER_BOX, "PARTICLE_SLIME", ParticleRequirement.SERVER_TEAM,
new Cloud(new SimpleParticle(Particle.SLIME)))
),
SMOKE_CLOUD(new ParticleData(Material.DEAD_BRAIN_CORAL_BLOCK, "PARTICLE_SMOKE", ParticleRequirement.SERVER_TEAM,
new Cloud(new SimpleParticle(Particle.CAMPFIRE_COSY_SMOKE, 0.2F, 0.2F, 0.2F, 0.01)))
),
TOWN_CLOUD(new ParticleData(Material.FIREWORK_STAR, "PARTICLE_TOWN", ParticleRequirement.SERVER_TEAM,
new Cloud(new SimpleParticle(Particle.TOWN_AURA)))
),
FLAME_CIRCLE(new ParticleData(Material.MAGMA_BLOCK, "PARTICLE_FLAME", ParticleRequirement.SERVER_TEAM,
new Circle(new LocationMutator(new SimpleParticle(Particle.FLAME, 0, 0, 0, 0.01), 0, 1.1, 0)))
),
ENCHANTING_CIRCLE(new ParticleData(Material.WHITE_DYE, "PARTICLE_ENCHANTING_CIRCLE", ParticleRequirement.SERVER_TEAM,
new Circle(new LocationMutator(new SimpleParticle(Particle.ENCHANTMENT_TABLE, 0.2F, 0.2F, 0.2F, 0.01), 0, 1.1, 0)))
),
NOTES_CIRCLE(new ParticleData(Material.NOTE_BLOCK, "PARTICLE_NOTES", ParticleRequirement.SERVER_TEAM,
new Circle(new LocationMutator(new SimpleParticle(Particle.NOTE, 0, 0, 0, 0.01), 0, 2.2, 0)))
),
WATER_FIRE(new ParticleData(Material.GUARDIAN_SPAWN_EGG, "PARTICLE_WATER_FIRE", ParticleRequirement.SERVER_TEAM,
new LocationMutator(new DoubleCircle(new SimpleParticle(Particle.DRIP_WATER, 0, 0, 0, 0.01), new SimpleParticle(Particle.DRIP_LAVA, 0, 0, 0, 0.01)), 0, 1.1, 0))
),
WATER_FIRE_ALWAYS(new ParticleData(Material.GUARDIAN_SPAWN_EGG, "PARTICLE_WATER_FIRE", ParticleRequirement.SERVER_TEAM,
new Always(new LocationMutator(new DoubleCircle(new SimpleParticle(Particle.DRIP_WATER, 0, 0, 0, 0.01), new SimpleParticle(Particle.DRIP_LAVA, 0, 0, 0, 0.01)), 0, 1.1, 0)))
),
MAGIC_ENCHANTING(new ParticleData(Material.DIAMOND_SWORD, "PARTICLE_MAGIC_ENCHANTING", ParticleRequirement.SERVER_TEAM,
new LocationMutator(new DoubleCircle(new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0.01), new SimpleParticle(Particle.ENCHANTMENT_TABLE, 0, 0, 0, 0.01)), 0, 1.1, 0))
),
MAGIC_ENCHANTING_ALWAYS(new ParticleData(Material.WOODEN_SWORD, "PARTICLE_MAGIC_ENCHANTING", ParticleRequirement.SERVER_TEAM,
new Always(new LocationMutator(new DoubleCircle(new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0.01), new SimpleParticle(Particle.ENCHANTMENT_TABLE, 0, 0, 0, 0.01)), 0, 1.1, 0)))
),
MAGIC_CLOUD_CIRCLE(new ParticleData(Material.GLOWSTONE_DUST, "PARTICLE_MAGIC", ParticleRequirement.SERVER_TEAM,
new Cloud(new Circle(new LocationMutator(new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0.01), 0, 1.1, 0))))
),
FLAME_CLOUD_CIRCLE(new ParticleData(Material.FIRE_CORAL, "PARTICLE_FLAME", ParticleRequirement.SERVER_TEAM,
new Cloud(new Circle(new LocationMutator(new SimpleParticle(Particle.FLAME, 0, 0, 0, 0.01), 0, 1.1, 0))))
),
FIREWORK_CLOUD_CIRCLE(new ParticleData(Material.FIREWORK_ROCKET, "PARTICLE_FIREWORK", ParticleRequirement.SERVER_TEAM,
new Cloud(new Circle(new LocationMutator(new SimpleParticle(Particle.FIREWORKS_SPARK, 0, 0, 0, 0.01), 0, 1.1, 0))))
),
WATER_CLOUD_CIRCLE(new ParticleData(Material.CYAN_DYE, "PARTICLE_WATER_FIRE", ParticleRequirement.SERVER_TEAM,
new Cloud(new Circle(new LocationMutator(new SimpleParticle(Particle.WATER_WAKE, 0, 0, 0, 0.01), 0, 1.1, 0))))
),
ENCHANTING_DOUBLE_CIRCLE(new ParticleData(Material.BUBBLE_CORAL_BLOCK, "PARTICLE_ENCHANTING", ParticleRequirement.SERVER_TEAM,
new Always(new LocationMutator(new DoubleCircle(new SimpleParticle(Particle.ENCHANTMENT_TABLE, 0, 0, 0, 0.01), new SimpleParticle(Particle.ENCHANTMENT_TABLE, 0, 0, 0, 0.01)), 0, 2.2, 0)))
),
EVIL_WINGS(new ParticleData(Material.PURPUR_SLAB, "PARTICLE_WINGS_EVIL", ParticleRequirement.SERVER_TEAM,
new Always(new Delayed(new NonFlying(new Wing(new SimpleParticle(Particle.SPELL_WITCH, 0, 0, 0, 0, 1), 0.15, WingDesign.SIMPLE)), 20)))
),
;
public static ParticleEnum[] particles = values();
@Getter
private ParticleData particle;
}

Datei anzeigen

@ -1,50 +0,0 @@
package de.steamwar.lobby.otherparticle.particles;
import de.steamwar.lobby.otherparticle.ParticleData;
import de.steamwar.lobby.otherparticle.ParticleEnum;
import de.steamwar.lobby.otherparticle.ParticleRequirement;
import de.steamwar.lobby.otherparticle.elements.Circle;
import de.steamwar.lobby.otherparticle.elements.LocationMutator;
import de.steamwar.lobby.otherparticle.elements.NonFloor;
import de.steamwar.lobby.otherparticle.elements.SimpleParticle;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.bukkit.Material;
import org.bukkit.Particle;
@AllArgsConstructor
public enum TeamParticle implements ParticleEnum {
SQUID(new ParticleData(Material.INK_SAC, "PARTICLE_SQUID", ParticleRequirement.HAS_TEAM,
new SimpleParticle(Particle.SQUID_INK, 0.2F, 0.2F, 0.2F, 0.01))
),
BUBBLE(new ParticleData(Material.TUBE_CORAL, "PARTICLE_BUBBLE", ParticleRequirement.HAS_TEAM,
new SimpleParticle(Particle.BUBBLE_POP, 0.2F, 0.2F, 0.2F, 0.01))
),
HONEY(new ParticleData(Material.HONEY_BOTTLE, "PARTICLE_HONEY", ParticleRequirement.HAS_TEAM,
new SimpleParticle(Particle.DRIPPING_HONEY, 0.2F, 0.2F, 0.2F, 1))
),
NECTAR(new ParticleData(Material.HONEYCOMB, "PARTICLE_NECTAR", ParticleRequirement.HAS_TEAM,
new SimpleParticle(Particle.FALLING_NECTAR, 0.2F, 0.2F, 0.2F, 1))
),
FIREWORK(new ParticleData(Material.FIRE_CHARGE, "PARTICLE_FIREWORK", ParticleRequirement.HAS_TEAM,
new LocationMutator(new NonFloor(new SimpleParticle(Particle.FIREWORKS_SPARK, 0.1F, 0.1F, 0.1F, 0.2, 2)), 0, -0.2, 0))
),
DRAGON_BREATH(new ParticleData(Material.DRAGON_BREATH, "PARTICLE_DRAGON_BREATH", ParticleRequirement.HAS_TEAM,
new SimpleParticle(Particle.DRAGON_BREATH, 1F, 0.2F, 1F, 0.01))
),
DAMAGE(new ParticleData(Material.SPIDER_EYE, "PARTICLE_DAMAGE", ParticleRequirement.HAS_TEAM,
new SimpleParticle(Particle.DAMAGE_INDICATOR, 0.2F, 0, 0.2F, 0.01))
),
DOLPHIN(new ParticleData(Material.BLUE_DYE, "PARTICLE_DOLPHIN", ParticleRequirement.HAS_TEAM,
new SimpleParticle(Particle.DOLPHIN, 0.2F, 0, 0.2F, 0.01))
),
HEART(new ParticleData(Material.RED_CONCRETE, "PARTICLE_HEART", ParticleRequirement.HAS_TEAM,
new Circle(new LocationMutator(new SimpleParticle(Particle.HEART), 0, 2.2, 0)))
),
;
public static ParticleEnum[] particles = values();
@Getter
private ParticleData particle;
}

Datei anzeigen

@ -1,49 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2022 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.lobby.particle;
import org.bukkit.Color;
import org.bukkit.Particle;
import java.util.Random;
public interface BaseParticle {
Random RANDOM = new Random();
default Color randomColor() {
return Color.fromRGB(RANDOM.nextInt(256), RANDOM.nextInt(256), RANDOM.nextInt(256));
}
default float randomSize() {
return RANDOM.nextFloat() / 2 + 1;
}
default Particle.DustOptions getParticleDust() {
return new Particle.DustOptions(randomColor(), randomSize());
}
ParticleItem getItem();
default boolean needsTick() {
return false;
}
void particle(ParticleData particleData);
}

Datei anzeigen

@ -1,60 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2022 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.lobby.particle;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Particle;
public class DustSimpleParticle implements BaseParticle {
private final ParticleItem particleItem;
private final Particle particle;
private float vx;
private float vy;
private float vz;
private double time = 1;
private int count = 5;
public DustSimpleParticle(ParticleItem particleItem, Particle particle, float vx, float vy, float vz, double time) {
this.particleItem = particleItem;
this.particle = particle;
this.vx = vx;
this.vy = vy;
this.vz = vz;
this.time = time;
}
@Override
public ParticleItem getItem() {
return particleItem;
}
@Override
public void particle(ParticleData particleData) {
Location location = particleData.getLocation().add(0.0, 0.2, 0.0);
Bukkit.getOnlinePlayers().forEach(player -> {
int viewDistance = player.getClientViewDistance() * 16;
if (location.distanceSquared(player.getLocation()) <= viewDistance * viewDistance) {
player.spawnParticle(particle, location, count, vx, vy, vz, time, getParticleDust());
}
});
}
}

Datei anzeigen

@ -1,74 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2022 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.lobby.particle;
import de.steamwar.inventory.SWItem;
import de.steamwar.lobby.LobbySystem;
import de.steamwar.sql.Event;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
public class EventParticleItem extends ParticleItem {
public static EventParticleItem participation(Material material, String name, int eventId) {
return new EventParticleItem(material, name, "PARTICLE_UNLOCKED_BY_EVENT_PARTICIPATION", eventId);
}
public static EventParticleItem placement(Material material, String name, int eventId) {
return new EventParticleItem(material, name, "PARTICLE_UNLOCKED_BY_EVENT_PLACEMENT", eventId);
}
private final String eventName;
public EventParticleItem(Material material, String name, int eventId) {
this(material, name, null, eventId);
}
public EventParticleItem(Material material, String name, String unlockedBy, int eventId) {
super(material, name, unlockedBy);
eventName = Event.get(eventId).getEventName();
}
public EventParticleItem addAttribute(String attribute) {
super.addAttribute(attribute);
return this;
}
public SWItem toSWItem(Player player) {
String translatedName = LobbySystem.getMessage().parse(name, player);
List<String> lore = new ArrayList<>();
lore.add("");
if (!attributes.isEmpty()) {
lore.add(LobbySystem.getMessage().parse("PARTICLE_ATTRIBUTE", player));
attributes.forEach(attribute -> lore.add(LobbySystem.getMessage().parse(attribute, player)));
lore.add("");
}
if (unlockedBy != null) {
lore.add(LobbySystem.getMessage().parse("PARTICLE_UNLOCKED_BY", player));
lore.add(LobbySystem.getMessage().parse(unlockedBy, player, eventName));
lore.add("");
}
lore.add(LobbySystem.getMessage().parse("PARTICLE_SELECT", player));
return new SWItem(material, translatedName, lore, false, clickType -> {});
}
}

Datei anzeigen

@ -1,15 +0,0 @@
package de.steamwar.lobby.particle;
public class ParticleBuilder {
public ParticleBuilder() {
}
public void cloud() {}
public void offset() {}
public void rotated() {}
public void build() {}
}

Datei anzeigen

@ -1,54 +1,77 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2022 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.lobby.particle;
import lombok.AllArgsConstructor;
import de.steamwar.inventory.SWItem;
import de.steamwar.lobby.LobbySystem;
import de.steamwar.sql.SteamwarUser;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.Material;
import org.bukkit.entity.Player;
@RequiredArgsConstructor
@AllArgsConstructor
@Getter
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
public class ParticleData {
private final World world;
private final Player player;
private Location location;
private final double deg;
public ParticleData withLocation(Location location) {
ParticleData particleData = copy();
particleData.location = location;
return particleData;
private final Material material;
private final String name;
private final Set<String> attributes = new LinkedHashSet<>();
@Getter
private final ParticleRequirement requirement;
@Getter
private final ParticleElement particleElement;
public ParticleData(Material material, String name, ParticleElement particleElement) {
this.material = material;
this.name = name;
this.requirement = ParticleRequirement.NO_REQUIRMENT;
this.particleElement = particleElement;
particleElement.aggregateAttributes(this);
}
public Location getLocation() {
if (location == null) {
return player.getLocation();
public ParticleData(Material material, String name, ParticleRequirement requirement, ParticleElement particleElement) {
this.material = material;
this.name = name;
this.requirement = requirement;
this.particleElement = particleElement;
particleElement.aggregateAttributes(this);
}
public ParticleData add(String attribute) {
attributes.add(attribute);
return this;
}
public SWItem toSWItem(Player player, SteamwarUser user, Set<Integer> eventTeilnahme, String eggHuntConfig) {
String translatedName;
try {
translatedName = LobbySystem.getMessage().parse(name, player);
} catch (Exception e) {
translatedName = name;
}
return location;
}
public ParticleData copy() {
return new ParticleData(world, player, location, deg);
List<String> lore = new ArrayList<>();
lore.add("");
if (!attributes.isEmpty()) {
lore.add(LobbySystem.getMessage().parse("PARTICLE_ATTRIBUTE", player));
attributes.forEach(attribute -> lore.add(LobbySystem.getMessage().parse(attribute, player)));
lore.add("");
}
String unlockedBy = requirement.getRequirementName(player);
if (unlockedBy != null) {
lore.add(LobbySystem.getMessage().parse("PARTICLE_UNLOCKED_BY", player));
lore.add(unlockedBy);
lore.add("");
}
if (requirement.test(user, eventTeilnahme, eggHuntConfig)) {
lore.add(LobbySystem.getMessage().parse("PARTICLE_SELECT", player));
} else {
lore.add(LobbySystem.getMessage().parse("PARTICLE_LOCKED", player));
}
return new SWItem(material, translatedName, lore, false, clickType -> {});
}
}

Datei anzeigen

@ -1,4 +1,4 @@
package de.steamwar.lobby.otherparticle;
package de.steamwar.lobby.particle;
import org.bukkit.Bukkit;
import org.bukkit.Color;

Datei anzeigen

@ -1,4 +1,4 @@
package de.steamwar.lobby.otherparticle;
package de.steamwar.lobby.particle;
public interface ParticleEnum {
ParticleData getParticle();

Datei anzeigen

@ -1,34 +1,19 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2021 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.lobby.particle;
import de.steamwar.inventory.SWInventory;
import de.steamwar.inventory.SWItem;
import de.steamwar.inventory.SWListInv;
import de.steamwar.lobby.LobbySystem;
import de.steamwar.lobby.particle.particles.*;
import de.steamwar.lobby.particle.particles.custom.CustomEasterParticle;
import de.steamwar.lobby.particle.particles.custom.CustomPlayerParticle;
import de.steamwar.lobby.particle.particles.custom.CustomTeamParticle;
import de.steamwar.lobby.special.easter.EggHunt;
import de.steamwar.lobby.util.LobbyPlayer;
import de.steamwar.sql.Event;
import de.steamwar.sql.SteamwarUser;
import de.steamwar.sql.TeamTeilnahme;
import de.steamwar.sql.UserGroup;
import de.steamwar.sql.UserConfig;
import lombok.experimental.UtilityClass;
import org.bukkit.Material;
import org.bukkit.entity.Player;
@ -38,49 +23,56 @@ import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
@UtilityClass
public class ParticleInventory {
private ParticleInventory() {
private final Class<?>[] PARTICLES = {
PlayerParticle.class,
CustomPlayerParticle.class,
TeamParticle.class,
CustomTeamParticle.class,
ServerTeamParticle.class,
EventParticle.class,
EventParticlePlacement.class,
EventParticleParticipation.class,
EasterParticle.class,
CustomEasterParticle.class,
};
public String convertToString(ParticleEnum particleEnum) {
return particleEnum.getClass().getSimpleName() + "@" + ((Enum<?>)particleEnum).name();
}
private static void calculateParticles(ParticleEnum[] particles, Player player, List<SWListInv.SWListEntry<ParticleEnum>> particleList) {
for (ParticleEnum particle : particles) {
particleList.add(new SWListInv.SWListEntry<>(particle.getParticle().getItem().toSWItem(player), particle));
public ParticleEnum convertFromString(String string) {
String[] split = string.split("@");
Class<?> clazz = null;
for (Class<?> aClass : PARTICLES) {
if (aClass.getSimpleName().equals(split[0])) {
clazz = aClass;
break;
}
}
if (clazz != null) {
try {
return (ParticleEnum) Enum.valueOf((Class<? extends Enum>) clazz, split[1]);
} catch (Exception e) {
return null;
}
}
// TODO: Add conversion from last version
return null;
}
private static SWInventory createInventory(Player player) {
public void openInventory(Player player) {
LobbyPlayer lobbyPlayer = LobbyPlayer.getLobbyPlayer(player.getUniqueId());
SteamwarUser steamwarUser = SteamwarUser.get(player.getUniqueId());
UserGroup userGroup = steamwarUser.getUserGroup();
SteamwarUser user = SteamwarUser.get(player.getUniqueId());
Set<Integer> events = user.getTeam() == 0 ? new HashSet<>() : TeamTeilnahme.getEvents(user.getTeam()).stream().map(Event::getEventID).collect(Collectors.toSet());
String eggHuntConfig = UserConfig.getConfig(user.getId(), EggHunt.EGG_HUNT_CONFIG_KEY);
List<SWListInv.SWListEntry<ParticleEnum>> particleList = new ArrayList<>();
calculateParticles(PlayerParticle.particles, player, particleList);
if (steamwarUser.getTeam() != 0 || userGroup != UserGroup.Member) {
calculateParticles(TeamParticle.particles, player, particleList);
}
if (userGroup != UserGroup.Member) {
calculateParticles(ServerTeamParticle.particles, player, particleList);
}
Set<Integer> events = steamwarUser.getTeam() == 0 ? new HashSet<>() : TeamTeilnahme.getEvents(steamwarUser.getTeam()).stream().map(Event::getEventID).collect(Collectors.toSet());
if (!events.isEmpty()) {
calculateParticles(EventParticle.particles, player, particleList);
}
for (EventParticlePlacement particle : EventParticlePlacement.particles) {
boolean clickable = userGroup.isTeamGroup();
clickable |= (steamwarUser.getTeam() != 0 && contains(particle.getPlacementTeams(), steamwarUser.getTeam()));
addParticle(particleList, particle, clickable, player);
}
for (EventParticleParticipation particle : EventParticleParticipation.particles) {
boolean clickable = userGroup.isTeamGroup();
clickable |= events.contains(particle.getEvent());
addParticle(particleList, particle, clickable, player);
}
for (SpecialTeamParticle particle : SpecialTeamParticle.particles) {
if (particle.getTeamId() == 0 || steamwarUser.getTeam() == particle.getTeamId() || steamwarUser.getUserGroup() != UserGroup.Member) {
addParticle(particleList, particle, true, player);
}
for (Class<?> clazz : PARTICLES) {
addParticles(particleList, (ParticleEnum[]) clazz.getEnumConstants(), player, user, events, eggHuntConfig);
}
SWListInv<ParticleEnum> particleSWListInv = new SWListInv<>(player, LobbySystem.getMessage().parse("PARTICLE_INVENTORY", player), false, particleList, (clickType, particle) -> {
@ -91,29 +83,18 @@ public class ParticleInventory {
particleSWListInv.setItem(49, Material.BARRIER, LobbySystem.getMessage().parse("PARTICLE_DESELECT", player), new ArrayList<>(), false, clickType -> {
lobbyPlayer.setParticle(null);
});
return particleSWListInv;
particleSWListInv.open();
}
private static void addParticle(List<SWListInv.SWListEntry<ParticleEnum>> particleList, ParticleEnum particle, boolean clickable, Player player) {
if (clickable) {
particleList.add(new SWListInv.SWListEntry<>(particle.getParticle().getItem().toSWItem(player), particle));
} else {
SWItem swItem = particle.getParticle().getItem().toSWItem(player);
swItem.setName(LobbySystem.getMessage().parse("PARTICLE_LOCKED", player, swItem.getItemMeta().getDisplayName()));
particleList.add(new SWListInv.SWListEntry<>(swItem, null));
private void addParticles(List<SWListInv.SWListEntry<ParticleEnum>> particleList, ParticleEnum[] particleEnums, Player player, SteamwarUser user, Set<Integer> events, String eggHuntConfig) {
for (ParticleEnum particle : particleEnums) {
ParticleData particleData = particle.getParticle();
SWItem swItem = particleData.toSWItem(player, user, events, eggHuntConfig);
if (particleData.getRequirement().test(user, events, eggHuntConfig)) {
particleList.add(new SWListInv.SWListEntry<>(swItem, particle));
} else {
particleList.add(new SWListInv.SWListEntry<>(swItem, null));
}
}
}
private static boolean contains(int[] ints, int element) {
for (int i : ints) {
if (i == element) return true;
}
return false;
}
public static void openParticleInventory(Player player) {
createInventory(player).open();
}
}

Datei anzeigen

@ -1,69 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2022 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.lobby.particle;
import de.steamwar.inventory.SWItem;
import de.steamwar.lobby.LobbySystem;
import lombok.RequiredArgsConstructor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
@RequiredArgsConstructor
public class ParticleItem {
protected final Material material;
protected final String name;
protected final Set<String> attributes = new LinkedHashSet<>();
protected String unlockedBy;
public ParticleItem(Material material, String name, String unlockedBy) {
this.material = material;
this.name = name;
this.unlockedBy = unlockedBy;
}
public ParticleItem addAttribute(String attribute) {
this.attributes.add(attribute);
return this;
}
public SWItem toSWItem(Player player) {
String translatedName = LobbySystem.getMessage().parse(name, player);
List<String> lore = new ArrayList<>();
lore.add("");
if (!attributes.isEmpty()) {
lore.add(LobbySystem.getMessage().parse("PARTICLE_ATTRIBUTE", player));
attributes.forEach(attribute -> lore.add(LobbySystem.getMessage().parse(attribute, player)));
lore.add("");
}
if (unlockedBy != null) {
lore.add(LobbySystem.getMessage().parse("PARTICLE_UNLOCKED_BY", player));
lore.add(LobbySystem.getMessage().parse(unlockedBy, player));
lore.add("");
}
lore.add(LobbySystem.getMessage().parse("PARTICLE_SELECT", player));
return new SWItem(material, translatedName, lore, false, clickType -> {});
}
}

Datei anzeigen

@ -23,7 +23,6 @@ import de.steamwar.lobby.LobbySystem;
import de.steamwar.lobby.jumpandrun.JumpAndRun;
import de.steamwar.lobby.listener.BasicListener;
import de.steamwar.lobby.listener.PlayerSpawn;
import de.steamwar.lobby.particle.particles.ParticleEnum;
import de.steamwar.lobby.util.LobbyPlayer;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
@ -49,9 +48,10 @@ public class ParticleListener extends BasicListener {
LobbyPlayer lobbyPlayer = LobbyPlayer.getLobbyPlayer(player.getUniqueId());
ParticleEnum particle = lobbyPlayer.getParticle();
if (particle == null) return;
BaseParticle baseParticle = particle.getParticle();
if (baseParticle.needsTick()) {
baseParticle.particle(new ParticleData(player.getWorld(), player, deg));
ParticleData particleData = particle.getParticle();
ParticleElement particleElement = particleData.getParticleElement();
if (particleElement.tickType() == ParticleTickType.ALWAYS) {
particleElement.tick(new ParticleTickData(player.getWorld(), player, deg));
}
});
}, 0, 1);
@ -65,7 +65,7 @@ public class ParticleListener extends BasicListener {
if (!PlayerSpawn.PARTICLE.equals(event.getItem())) return;
event.setCancelled(true);
ParticleInventory.openParticleInventory(player);
ParticleInventory.openInventory(player);
}
@EventHandler
@ -77,9 +77,11 @@ public class ParticleListener extends BasicListener {
ParticleEnum particle = lobbyPlayer.getParticle();
if (particle == null) return;
BaseParticle baseParticle = particle.getParticle();
if (baseParticle.needsTick()) return;
baseParticle.particle(new ParticleData(player.getWorld(), player, deg));
ParticleData particleData = particle.getParticle();
ParticleElement particleElement = particleData.getParticleElement();
if (particleElement.tickType() == ParticleTickType.MOVE) {
particleElement.tick(new ParticleTickData(player.getWorld(), player, deg));
}
}
@EventHandler

Datei anzeigen

@ -1,4 +1,4 @@
package de.steamwar.lobby.otherparticle;
package de.steamwar.lobby.particle;
import de.steamwar.lobby.LobbySystem;
import de.steamwar.lobby.special.easter.EggDifficulty;
@ -20,6 +20,18 @@ public interface ParticleRequirement {
String getRequirementName(Player player);
boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig);
ParticleRequirement SERVER_TEAM = new ParticleRequirement() {
@Override
public String getRequirementName(Player player) {
return LobbySystem.getMessage().parse("PARTICLE_UNLOCKED_BY_SERVER_TEAM", player);
}
@Override
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
return false;
}
};
ParticleRequirement NO_REQUIRMENT = new ParticleRequirement() {
@Override
public String getRequirementName(Player player) {
@ -41,7 +53,7 @@ public interface ParticleRequirement {
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
return user.getTeam() != 0;
}
};
}.or(SERVER_TEAM);
ParticleRequirement EVENT_PARTICIPATION = new ParticleRequirement() {
@Override
public String getRequirementName(Player player) {
@ -52,18 +64,7 @@ public interface ParticleRequirement {
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
return !eventTeilname.isEmpty();
}
};
ParticleRequirement SERVER_TEAM = new ParticleRequirement() {
@Override
public String getRequirementName(Player player) {
return LobbySystem.getMessage().parse("PARTICLE_UNLOCKED_BY_SERVER_TEAM", player);
}
@Override
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
return false;
}
};
}.or(SERVER_TEAM);
ParticleRequirement EGG_HUNT_EASY = _easterEggHuntDifficulty(EggDifficulty.EASY);
ParticleRequirement EGG_HUNT_MEDIUM = _easterEggHuntDifficulty(EggDifficulty.MEDIUM);
ParticleRequirement EGG_HUNT_HARD = _easterEggHuntDifficulty(EggDifficulty.HARD);
@ -101,7 +102,7 @@ public interface ParticleRequirement {
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
return user.getTeam() == teamId;
}
};
}.or(SERVER_TEAM);
}
static ParticleRequirement eventParticipation(int eventId) {
@ -116,7 +117,7 @@ public interface ParticleRequirement {
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
return eventTeilname.contains(eventId);
}
};
}.or(SERVER_TEAM);
}
static ParticleRequirement eventPlacement(int eventId, int... placementTeams) {
@ -134,7 +135,7 @@ public interface ParticleRequirement {
if (!eventTeilname.contains(eventId)) return false;
return teams.contains(user.getTeam());
}
};
}.or(SERVER_TEAM);
}
static ParticleRequirement _easterEggHuntDifficulty(EggDifficulty difficulty) {
@ -178,10 +179,20 @@ public interface ParticleRequirement {
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
return user.getId() == userId;
}
};
}.or(SERVER_TEAM);
}
interface ParticleRequirementPredicate {
boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig);
default ParticleRequirement or(ParticleRequirement particleRequirement) {
return new ParticleRequirement() {
@Override
public String getRequirementName(Player player) {
return ParticleRequirement.this.getRequirementName(player);
}
@Override
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
return ParticleRequirement.this.test(user, eventTeilname, eggHuntConfig) || particleRequirement.test(user, eventTeilname, eggHuntConfig);
}
};
}
}

Datei anzeigen

@ -1,4 +1,4 @@
package de.steamwar.lobby.otherparticle;
package de.steamwar.lobby.particle;
import lombok.AllArgsConstructor;
import lombok.Getter;

Datei anzeigen

@ -1,9 +1,8 @@
package de.steamwar.lobby.otherparticle;
package de.steamwar.lobby.particle;
public enum ParticleTickType {
ALWAYS,
MOVE,
SNEAK,
;
}

Datei anzeigen

@ -1,82 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2022 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.lobby.particle;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Particle;
public class SimpleParticle implements BaseParticle {
private final ParticleItem particleItem;
private final Particle particle;
private boolean customVelocity = false;
private float vx;
private float vy;
private float vz;
private double time = 1;
private int count = 5;
public SimpleParticle(ParticleItem particleItem, Particle particle) {
this.particleItem = particleItem;
this.particle = particle;
}
public SimpleParticle(ParticleItem particleItem, Particle particle, float vx, float vy, float vz, double time) {
this.particleItem = particleItem;
this.particle = particle;
this.customVelocity = true;
this.vx = vx;
this.vy = vy;
this.vz = vz;
this.time = time;
}
public SimpleParticle(ParticleItem particleItem, Particle particle, float vx, float vy, float vz, double time, int count) {
this.particleItem = particleItem;
this.particle = particle;
this.customVelocity = true;
this.vx = vx;
this.vy = vy;
this.vz = vz;
this.time = time;
this.count = count;
}
@Override
public ParticleItem getItem() {
return particleItem;
}
@Override
public void particle(ParticleData particleData) {
Location location = particleData.getLocation().add(0.0, 0.2, 0.0);
Bukkit.getOnlinePlayers().forEach(player -> {
int viewDistance = player.getClientViewDistance() * 16;
if (location.distanceSquared(player.getLocation()) <= viewDistance * viewDistance) {
if (customVelocity) {
player.spawnParticle(particle, location, count, vx, vy, vz, time);
} else {
player.spawnParticle(particle, location, count);
}
}
});
}
}

Datei anzeigen

@ -1,6 +1,5 @@
package de.steamwar.lobby.otherparticle;
package de.steamwar.lobby.particle;
import de.steamwar.lobby.particle.decorator.WingParticle;
import lombok.SneakyThrows;
import org.bukkit.util.Vector;
@ -15,7 +14,7 @@ public interface WingDesign {
@SneakyThrows
static Vector[] create(String resource) {
List<Vector> vectors = new ArrayList<>();
BufferedImage bufferedImage = ImageIO.read(WingParticle.class.getResourceAsStream(resource));
BufferedImage bufferedImage = ImageIO.read(WingDesign.class.getResourceAsStream(resource));
for (int x = 0; x < bufferedImage.getWidth(); x++) {
for (int y = 0; y < bufferedImage.getHeight(); y++) {
int rgb = bufferedImage.getRGB(x, y);

Datei anzeigen

@ -1,75 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2022 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.lobby.particle.decorator;
import de.steamwar.lobby.particle.BaseParticle;
import de.steamwar.lobby.particle.ParticleData;
import de.steamwar.lobby.particle.ParticleItem;
import org.bukkit.Location;
import org.bukkit.util.Vector;
public class CircleParticle implements BaseParticle {
private ParticleItem particleItem = null;
private BaseParticle particle;
private BaseParticle particle2;
public CircleParticle(BaseParticle particle) {
this.particle = particle;
}
public CircleParticle(ParticleItem particleItem, BaseParticle particle, BaseParticle particle2) {
this.particleItem = particleItem;
this.particle = particle;
this.particle2 = particle2;
}
@Override
public ParticleItem getItem() {
if (particleItem != null) {
return particleItem.addAttribute("PARTICLE_ATTRIBUTE_BI_CIRCLE");
}
return particle.getItem().addAttribute("PARTICLE_ATTRIBUTE_CIRCLE");
}
@Override
public boolean needsTick() {
return particle.needsTick() || (particle2 != null && particle2.needsTick());
}
@Override
public void particle(ParticleData particleData) {
Location location = particleData.getLocation();
Vector vector = new Vector(1, 0, 0);
vector.rotateAroundY(particleData.getDeg());
ParticleData nData = particleData.withLocation(location.clone().add(vector));
particle.particle(nData);
if (particle2 == null) {
return;
}
vector.setX(-vector.getX());
vector.setZ(-vector.getZ());
nData = particleData.withLocation(location.clone().add(vector));
particle2.particle(nData);
}
}

Datei anzeigen

@ -1,59 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2022 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.lobby.particle.decorator;
import de.steamwar.lobby.particle.BaseParticle;
import de.steamwar.lobby.particle.ParticleData;
import de.steamwar.lobby.particle.ParticleItem;
import lombok.NonNull;
import org.bukkit.Material;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
public class CloudParticle implements BaseParticle {
private BaseParticle particle;
public CloudParticle(@NonNull BaseParticle particle) {
this.particle = particle;
}
@Override
public ParticleItem getItem() {
return particle.getItem().addAttribute("PARTICLE_ATTRIBUTE_CLOUD");
}
@Override
public boolean needsTick() {
return particle.needsTick();
}
@Override
public void particle(ParticleData particleData) {
if (particleData.getWorld().getBlockAt(particleData.getPlayer().getLocation().subtract(0, 0.5, 0)).getType() == Material.AIR) {
particleData.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.SLOW_FALLING, 5, 2, false, false, false));
} else {
particleData.getPlayer().removePotionEffect(PotionEffectType.SLOW_FALLING);
return;
}
ParticleData nData = particleData.withLocation(particleData.getLocation().subtract(0, -0.2, 0));
particle.particle(nData);
}
}

Datei anzeigen

@ -1,46 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2022 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.lobby.particle.decorator;
import de.steamwar.lobby.particle.BaseParticle;
import de.steamwar.lobby.particle.ParticleData;
import de.steamwar.lobby.particle.ParticleItem;
import org.bukkit.Material;
public class NonFloorParticle implements BaseParticle {
private BaseParticle particle;
public NonFloorParticle(BaseParticle particle) {
this.particle = particle;
}
@Override
public ParticleItem getItem() {
return particle.getItem().addAttribute("PARTICLE_ATTRIBUTE_NON_FLOOR");
}
@Override
public void particle(ParticleData particleData) {
if (particleData.getWorld().getBlockAt(particleData.getPlayer().getLocation().subtract(0, 0.5, 0)).getType() == Material.AIR) {
particle.particle(particleData);
}
}
}

Datei anzeigen

@ -1,49 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2022 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.lobby.particle.decorator;
import de.steamwar.lobby.particle.BaseParticle;
import de.steamwar.lobby.particle.ParticleData;
import de.steamwar.lobby.particle.ParticleItem;
import lombok.NonNull;
public class TickParticle implements BaseParticle {
private BaseParticle particle;
public TickParticle(@NonNull BaseParticle particle) {
this.particle = particle;
}
@Override
public ParticleItem getItem() {
return particle.getItem().addAttribute("PARTICLE_ATTRIBUTE_TICK");
}
@Override
public boolean needsTick() {
return true;
}
@Override
public void particle(ParticleData particleData) {
particle.particle(particleData);
}
}

Datei anzeigen

@ -1,116 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2022 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.lobby.particle.decorator;
import de.steamwar.lobby.LobbySystem;
import de.steamwar.lobby.particle.BaseParticle;
import de.steamwar.lobby.particle.ParticleData;
import de.steamwar.lobby.particle.ParticleItem;
import lombok.SneakyThrows;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.util.Vector;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class WingParticle implements BaseParticle, Listener {
private Map<Player, Integer> playerMap = new HashMap<>();
@EventHandler
public void onPlayerQuit(PlayerQuitEvent event) {
playerMap.remove(event.getPlayer());
}
public enum WingDesign {
SIMPLE("WingSimple4.png"),
COMPLEX("WingSimple2.png"),
SWORD("WingSword.png"),
SW("WingSW.png"),
WGS("WingWGS.png"),
SWORD_CROSSED("WingSwordCrossed.png"),
MWGL("MWGL.png"),
ECLIPSE("ECLIPSE-Logo.png"),
;
private List<Vector> vectors = new ArrayList<>();
@SneakyThrows
WingDesign(String wingResource) {
BufferedImage bufferedImage = ImageIO.read(WingParticle.class.getResourceAsStream(wingResource));
for (int x = 0; x < bufferedImage.getWidth(); x++) {
for (int y = 0; y < bufferedImage.getHeight(); y++) {
int rgb = bufferedImage.getRGB(x, y);
if (Color.WHITE.getRGB() != rgb) {
vectors.add(new Vector(x - bufferedImage.getWidth() / 2.0, bufferedImage.getHeight() - y - 1.0, 0));
}
}
}
}
}
private BaseParticle particle;
private double size;
private WingDesign wingDesign;
public WingParticle(BaseParticle particle, double size, WingDesign wingDesign) {
this.particle = particle;
this.size = size;
this.wingDesign = wingDesign;
Bukkit.getPluginManager().registerEvents(this, LobbySystem.getPlugin());
}
@Override
public ParticleItem getItem() {
return particle.getItem().addAttribute("PARTICLE_ATTRIBUTE_WING");
}
@Override
public void particle(ParticleData particleData) {
int currentNumber = playerMap.getOrDefault(particleData.getPlayer(), 0) % 20;
playerMap.put(particleData.getPlayer(), currentNumber + 1);
if (currentNumber != 0) {
return;
}
if (particleData.getPlayer().isGliding()) {
return;
}
wingDesign.vectors.forEach(dVector -> {
Vector vector = new Vector(dVector.getX() * size, 0.6 + dVector.getY() * size - (particleData.getPlayer().isSneaking() ? 0.5 : 0) , 0.5);
vector.rotateAroundY(Math.toRadians(particleData.getPlayer().getLocation().getYaw() * -1));
vector.setX(-vector.getX());
vector.setZ(-vector.getZ());
Location location = particleData.getPlayer().getLocation().clone().add(vector);
ParticleData current = particleData.withLocation(location);
particle.particle(current);
});
}
}

Datei anzeigen

@ -1,8 +1,8 @@
package de.steamwar.lobby.otherparticle.elements;
package de.steamwar.lobby.particle.elements;
import de.steamwar.lobby.otherparticle.ParticleElement;
import de.steamwar.lobby.otherparticle.ParticleTickData;
import de.steamwar.lobby.otherparticle.ParticleTickType;
import de.steamwar.lobby.particle.ParticleElement;
import de.steamwar.lobby.particle.ParticleTickData;
import de.steamwar.lobby.particle.ParticleTickType;
public class Always extends DelegatingParticleElement {

Datei anzeigen

@ -1,7 +1,7 @@
package de.steamwar.lobby.otherparticle.elements;
package de.steamwar.lobby.particle.elements;
import de.steamwar.lobby.otherparticle.ParticleElement;
import de.steamwar.lobby.otherparticle.ParticleTickData;
import de.steamwar.lobby.particle.ParticleElement;
import de.steamwar.lobby.particle.ParticleTickData;
import org.bukkit.Location;
import org.bukkit.util.Vector;

Datei anzeigen

@ -1,7 +1,7 @@
package de.steamwar.lobby.otherparticle.elements;
package de.steamwar.lobby.particle.elements;
import de.steamwar.lobby.otherparticle.ParticleElement;
import de.steamwar.lobby.otherparticle.ParticleTickData;
import de.steamwar.lobby.particle.ParticleElement;
import de.steamwar.lobby.particle.ParticleTickData;
import org.bukkit.Material;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;

Datei anzeigen

@ -1,8 +1,8 @@
package de.steamwar.lobby.otherparticle.elements;
package de.steamwar.lobby.particle.elements;
import de.steamwar.lobby.LobbySystem;
import de.steamwar.lobby.otherparticle.ParticleElement;
import de.steamwar.lobby.otherparticle.ParticleTickData;
import de.steamwar.lobby.particle.ParticleElement;
import de.steamwar.lobby.particle.ParticleTickData;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;

Datei anzeigen

@ -1,8 +1,8 @@
package de.steamwar.lobby.otherparticle.elements;
package de.steamwar.lobby.particle.elements;
import de.steamwar.lobby.otherparticle.ParticleData;
import de.steamwar.lobby.otherparticle.ParticleElement;
import de.steamwar.lobby.otherparticle.ParticleTickType;
import de.steamwar.lobby.particle.ParticleData;
import de.steamwar.lobby.particle.ParticleElement;
import de.steamwar.lobby.particle.ParticleTickType;
public abstract class DelegatingParticleElement implements ParticleElement {

Datei anzeigen

@ -1,8 +1,8 @@
package de.steamwar.lobby.otherparticle.elements;
package de.steamwar.lobby.particle.elements;
import de.steamwar.lobby.otherparticle.ParticleElement;
import de.steamwar.lobby.otherparticle.ParticleTickData;
import de.steamwar.lobby.otherparticle.ParticleTickType;
import de.steamwar.lobby.particle.ParticleElement;
import de.steamwar.lobby.particle.ParticleTickData;
import de.steamwar.lobby.particle.ParticleTickType;
import org.bukkit.Location;
import org.bukkit.util.Vector;

Datei anzeigen

@ -1,7 +1,7 @@
package de.steamwar.lobby.otherparticle.elements;
package de.steamwar.lobby.particle.elements;
import de.steamwar.lobby.otherparticle.ParticleElement;
import de.steamwar.lobby.otherparticle.ParticleTickData;
import de.steamwar.lobby.particle.ParticleElement;
import de.steamwar.lobby.particle.ParticleTickData;
import org.bukkit.Location;
import org.bukkit.Particle;

Datei anzeigen

@ -1,7 +1,7 @@
package de.steamwar.lobby.otherparticle.elements;
package de.steamwar.lobby.particle.elements;
import de.steamwar.lobby.otherparticle.ParticleElement;
import de.steamwar.lobby.otherparticle.ParticleTickData;
import de.steamwar.lobby.particle.ParticleElement;
import de.steamwar.lobby.particle.ParticleTickData;
public class Group extends DelegatingParticleElement {

Datei anzeigen

@ -1,7 +1,7 @@
package de.steamwar.lobby.otherparticle.elements;
package de.steamwar.lobby.particle.elements;
import de.steamwar.lobby.otherparticle.ParticleElement;
import de.steamwar.lobby.otherparticle.ParticleTickData;
import de.steamwar.lobby.particle.ParticleElement;
import de.steamwar.lobby.particle.ParticleTickData;
import org.bukkit.Location;
import java.util.function.UnaryOperator;

Datei anzeigen

@ -1,7 +1,7 @@
package de.steamwar.lobby.otherparticle.elements;
package de.steamwar.lobby.particle.elements;
import de.steamwar.lobby.otherparticle.ParticleElement;
import de.steamwar.lobby.otherparticle.ParticleTickData;
import de.steamwar.lobby.particle.ParticleElement;
import de.steamwar.lobby.particle.ParticleTickData;
public class NonFloor extends DelegatingParticleElement {

Datei anzeigen

@ -1,7 +1,7 @@
package de.steamwar.lobby.otherparticle.elements;
package de.steamwar.lobby.particle.elements;
import de.steamwar.lobby.otherparticle.ParticleElement;
import de.steamwar.lobby.otherparticle.ParticleTickData;
import de.steamwar.lobby.particle.ParticleElement;
import de.steamwar.lobby.particle.ParticleTickData;
public class NonFlying extends DelegatingParticleElement {

Datei anzeigen

@ -1,7 +1,7 @@
package de.steamwar.lobby.otherparticle.elements;
package de.steamwar.lobby.particle.elements;
import de.steamwar.lobby.otherparticle.ParticleElement;
import de.steamwar.lobby.otherparticle.ParticleTickData;
import de.steamwar.lobby.particle.ParticleElement;
import de.steamwar.lobby.particle.ParticleTickData;
import org.bukkit.Location;
import org.bukkit.Particle;

Datei anzeigen

@ -1,8 +1,7 @@
package de.steamwar.lobby.otherparticle.elements;
package de.steamwar.lobby.particle.elements;
import de.steamwar.lobby.otherparticle.ParticleElement;
import de.steamwar.lobby.otherparticle.ParticleTickData;
import de.steamwar.lobby.otherparticle.ParticleTickType;
import de.steamwar.lobby.particle.ParticleElement;
import de.steamwar.lobby.particle.ParticleTickData;
public class Sneaking extends DelegatingParticleElement {
@ -10,11 +9,6 @@ public class Sneaking extends DelegatingParticleElement {
super(particleElement);
}
@Override
public ParticleTickType tickType() {
return ParticleTickType.SNEAK;
}
@Override
public String attribute() {
return null; // TODO: Implement this attribute

Datei anzeigen

@ -1,8 +1,8 @@
package de.steamwar.lobby.otherparticle.elements;
package de.steamwar.lobby.particle.elements;
import de.steamwar.lobby.otherparticle.ParticleElement;
import de.steamwar.lobby.otherparticle.ParticleTickData;
import de.steamwar.lobby.otherparticle.WingDesign;
import de.steamwar.lobby.particle.ParticleElement;
import de.steamwar.lobby.particle.ParticleTickData;
import de.steamwar.lobby.particle.WingDesign;
import org.bukkit.Location;
import org.bukkit.util.Vector;

Datei anzeigen

@ -1,47 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2022 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.lobby.particle.group;
import de.steamwar.lobby.particle.BaseParticle;
import de.steamwar.lobby.particle.ParticleData;
import de.steamwar.lobby.particle.ParticleItem;
public class ParticleGroup implements BaseParticle {
private ParticleItem particleItem;
private BaseParticle[] particles;
public ParticleGroup(ParticleItem particleItem, BaseParticle... particles) {
this.particleItem = particleItem;
this.particles = particles;
}
@Override
public ParticleItem getItem() {
return particleItem;
}
@Override
public void particle(ParticleData particleData) {
for (BaseParticle particle : particles) {
particle.particle(particleData.copy());
}
}
}

Datei anzeigen

@ -1,54 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2022 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.lobby.particle.mutator;
import de.steamwar.lobby.particle.BaseParticle;
import de.steamwar.lobby.particle.ParticleData;
import de.steamwar.lobby.particle.ParticleItem;
import org.bukkit.Location;
import java.util.function.UnaryOperator;
public class LocationParticleMutator implements BaseParticle {
private BaseParticle particle;
private UnaryOperator<Location> mutator;
public LocationParticleMutator(BaseParticle particle, UnaryOperator<Location> mutator) {
this.particle = particle;
this.mutator = mutator;
}
@Override
public ParticleItem getItem() {
return particle.getItem();
}
@Override
public boolean needsTick() {
return particle.needsTick();
}
@Override
public void particle(ParticleData particleData) {
ParticleData nData = particleData.withLocation(mutator.apply(particleData.getLocation()));
particle.particle(nData);
}
}

Datei anzeigen

@ -1,11 +1,11 @@
package de.steamwar.lobby.otherparticle.particles;
package de.steamwar.lobby.particle.particles;
import de.steamwar.lobby.otherparticle.ParticleData;
import de.steamwar.lobby.otherparticle.ParticleEnum;
import de.steamwar.lobby.otherparticle.ParticleRequirement;
import de.steamwar.lobby.otherparticle.elements.Always;
import de.steamwar.lobby.otherparticle.elements.LocationMutator;
import de.steamwar.lobby.otherparticle.elements.SimpleParticle;
import de.steamwar.lobby.particle.ParticleData;
import de.steamwar.lobby.particle.ParticleEnum;
import de.steamwar.lobby.particle.ParticleRequirement;
import de.steamwar.lobby.particle.elements.Always;
import de.steamwar.lobby.particle.elements.LocationMutator;
import de.steamwar.lobby.particle.elements.SimpleParticle;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.bukkit.Material;

Datei anzeigen

@ -1,46 +1,29 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2022 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.lobby.particle.particles;
import de.steamwar.lobby.particle.BaseParticle;
import de.steamwar.lobby.particle.ParticleItem;
import de.steamwar.lobby.particle.SimpleParticle;
import de.steamwar.lobby.particle.decorator.CircleParticle;
import de.steamwar.lobby.particle.decorator.NonFloorParticle;
import de.steamwar.lobby.particle.decorator.TickParticle;
import de.steamwar.lobby.particle.mutator.LocationParticleMutator;
import de.steamwar.lobby.particle.ParticleData;
import de.steamwar.lobby.particle.ParticleEnum;
import de.steamwar.lobby.particle.ParticleRequirement;
import de.steamwar.lobby.particle.elements.Always;
import de.steamwar.lobby.particle.elements.Circle;
import de.steamwar.lobby.particle.elements.LocationMutator;
import de.steamwar.lobby.particle.elements.SimpleParticle;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.bukkit.Material;
import org.bukkit.Particle;
import static org.bukkit.Material.*;
@AllArgsConstructor
public enum EventParticle implements ParticleEnum {
WATER(new TickParticle(new CircleParticle(new LocationParticleMutator(new SimpleParticle(new ParticleItem(WATER_BUCKET, "PARTICLE_WATER", "PARTICLE_UNLOCKED_BY_EVENT"), Particle.DRIP_WATER), location -> location.add(0, 1.1, 0))))),
LAVA(new TickParticle(new CircleParticle(new LocationParticleMutator(new SimpleParticle(new ParticleItem(LAVA_BUCKET, "PARTICLE_FIRE", "PARTICLE_UNLOCKED_BY_EVENT"), Particle.DRIP_LAVA), location -> location.add(0, 1.1, 0))))),
WATER(new ParticleData(Material.WATER_BUCKET, "PARTICLE_WATER", ParticleRequirement.EVENT_PARTICIPATION,
new Always(new Circle(new LocationMutator(new SimpleParticle(Particle.DRIP_WATER), 0, 1.1, 0))))
),
LAVA(new ParticleData(Material.LAVA_BUCKET, "PARTICLE_FIRE", ParticleRequirement.EVENT_PARTICIPATION,
new Always(new Circle(new LocationMutator(new SimpleParticle(Particle.DRIP_LAVA), 0, 1.1, 0))))
),
;
public static ParticleEnum[] particles = values();
@Getter
private BaseParticle particle;
private ParticleData particle;
}

Datei anzeigen

@ -1,56 +1,45 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2022 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.lobby.particle.particles;
import de.steamwar.lobby.particle.BaseParticle;
import de.steamwar.lobby.particle.EventParticleItem;
import de.steamwar.lobby.particle.ParticleItem;
import de.steamwar.lobby.particle.SimpleParticle;
import de.steamwar.lobby.particle.decorator.CircleParticle;
import de.steamwar.lobby.particle.decorator.TickParticle;
import de.steamwar.lobby.particle.decorator.WingParticle;
import de.steamwar.lobby.particle.group.ParticleGroup;
import de.steamwar.lobby.particle.mutator.LocationParticleMutator;
import de.steamwar.lobby.particle.ParticleData;
import de.steamwar.lobby.particle.ParticleEnum;
import de.steamwar.lobby.particle.ParticleRequirement;
import de.steamwar.lobby.particle.WingDesign;
import de.steamwar.lobby.particle.elements.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.bukkit.Material;
import org.bukkit.Particle;
import static org.bukkit.Material.*;
@AllArgsConstructor
@Getter
public enum EventParticleParticipation implements ParticleEnum {
WarGearSeason(22, new SimpleParticle(EventParticleItem.participation(BOOK, "PARTICLE_EVENT_ENCHANTING", 22), Particle.ENCHANTMENT_TABLE)),
AirshipEvent(26, new SimpleParticle(EventParticleItem.participation(SNOW_BLOCK, "PARTICLE_EVENT_CLOUD", 26), Particle.CLOUD)),
HellsBellsWs(28, new CircleParticle(new SimpleParticle(EventParticleItem.participation(TNT, "PARTICLE_EVENT_SMOKE", 28), Particle.CAMPFIRE_COSY_SMOKE, 0, 0, 0, 0.01))),
Underwater(31, new SimpleParticle(EventParticleItem.participation(PRISMARINE_BRICKS, "PARTICLE_EVENT_WATER", 31), Particle.DRIP_WATER)),
AdventWarShip(32, new ParticleGroup(EventParticleItem.participation(PRISMARINE_WALL, "PARTICLE_EVENT_WATER", 32), new SimpleParticle(null, Particle.DRIP_WATER), new SimpleParticle(null, Particle.WATER_WAKE, 0.2F, 0.2F, 0.2F, 0.01))),
MiniWarGearLiga(33, new CircleParticle(new SimpleParticle(EventParticleItem.participation(PRISMARINE_SLAB, "PARTICLE_EVENT_WATER", 33), Particle.WATER_WAKE, 0, 0, 0, 0))),
// Absturz(34, null),
UnderwaterMWG(35, new TickParticle(new LocationParticleMutator(new ParticleGroup(EventParticleItem.participation(BLUE_CARPET, "PARTICLE_EVENT_RAIN_CLOUD", 35), new SimpleParticle(null, Particle.CLOUD, 0.3F, 0.1F, 0.3F, 0.01), new SimpleParticle(null, Particle.WATER_WAKE, 0.3F, 0.1F, 0.3F, 0.01), new LocationParticleMutator(new SimpleParticle(null, Particle.DRIP_WATER, 0.3F, 0.0F, 0.3F, 0.01), location -> location.subtract(0, 0.2, 0))), location -> location.add(0, 2.2, 0)))),
WarGearSeason2022(37, new TickParticle(new WingParticle(new SimpleParticle(EventParticleItem.participation(DIAMOND_SWORD, "PARTICLE_EVENT_WINGS", 37), Particle.DRAGON_BREATH, 0, 0, 0, 0, 1), 0.15, WingParticle.WingDesign.COMPLEX))),
// WargearClash(38, null),
WarGearSeason(new ParticleData(Material.BOOK, "PARTICLE_EVENT_ENCHANTING", ParticleRequirement.eventParticipation(22),
new SimpleParticle(Particle.ENCHANTMENT_TABLE))
),
AirshipEvent(new ParticleData(Material.SNOW_BLOCK, "PARTICLE_EVENT_CLOUD", ParticleRequirement.eventParticipation(26),
new SimpleParticle(Particle.CLOUD))
),
HellsBellsWs(new ParticleData(Material.TNT, "PARTICLE_EVENT_SMOKE", ParticleRequirement.eventParticipation(28),
new Circle(new SimpleParticle(Particle.CAMPFIRE_COSY_SMOKE, 0, 0, 0, 0.01)))
),
Underwater(new ParticleData(Material.PRISMARINE_BRICKS, "PARTICLE_EVENT_WATER", ParticleRequirement.eventParticipation(31),
new SimpleParticle(Particle.DRIP_WATER))
),
AdventWarShip(new ParticleData(Material.PRISMARINE_WALL, "PARTICLE_EVENT_WATER", ParticleRequirement.eventParticipation(32),
new Group(new SimpleParticle(Particle.DRIP_WATER), new SimpleParticle(Particle.WATER_WAKE, 0.2F, 0.2F, 0.2F, 0.01)))
),
MiniWarGearLiga(new ParticleData(Material.PRISMARINE_SLAB, "PARTICLE_EVENT_WATER", ParticleRequirement.eventParticipation(33),
new Circle(new SimpleParticle(Particle.WATER_WAKE, 0, 0, 0, 0)))
),
UnderwaterMWG(new ParticleData(Material.BLUE_CARPET, "PARTICLE_EVENT_RAIN_CLOUD", ParticleRequirement.eventParticipation(35),
new Always(new LocationMutator(new Group(new SimpleParticle(Particle.CLOUD, 0.3F, 0.1F, 0.3F, 0.01), new SimpleParticle(Particle.WATER_WAKE, 0.3F, 0.1F, 0.3F, 0.01), new LocationMutator(new SimpleParticle(Particle.DRIP_WATER, 0.3F, 0.0F, 0.3F, 0.01), 0, 0.2, 0)), 0, 2.2, 0)))
),
WarGearSeason2022(new ParticleData(Material.DIAMOND_SWORD, "PARTICLE_EVENT_WINGS", ParticleRequirement.eventParticipation(37),
new Always(new Delayed(new NonFlying(new Wing(new SimpleParticle(Particle.DRAGON_BREATH, 0, 0, 0, 0, 1), 0.15, WingDesign.COMPLEX)), 20)))
),
;
public static EventParticleParticipation[] particles = values();
public static ParticleEnum[] particles = values();
private int event;
private BaseParticle particle;
@Getter
private ParticleData particle;
}

Datei anzeigen

@ -1,57 +1,51 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2022 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.lobby.particle.particles;
import de.steamwar.lobby.particle.BaseParticle;
import de.steamwar.lobby.particle.EventParticleItem;
import de.steamwar.lobby.particle.SimpleParticle;
import de.steamwar.lobby.particle.decorator.CircleParticle;
import de.steamwar.lobby.particle.decorator.CloudParticle;
import de.steamwar.lobby.particle.decorator.TickParticle;
import de.steamwar.lobby.particle.decorator.WingParticle;
import de.steamwar.lobby.particle.group.ParticleGroup;
import de.steamwar.lobby.particle.mutator.LocationParticleMutator;
import de.steamwar.lobby.particle.ParticleData;
import de.steamwar.lobby.particle.ParticleEnum;
import de.steamwar.lobby.particle.ParticleRequirement;
import de.steamwar.lobby.particle.WingDesign;
import de.steamwar.lobby.particle.elements.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.bukkit.Material;
import org.bukkit.Particle;
import static org.bukkit.Material.*;
@AllArgsConstructor
@Getter
public enum EventParticlePlacement implements ParticleEnum {
WarGearSeason(22, new int[]{12, 285, 54}, new CloudParticle(new CircleParticle(new LocationParticleMutator(new SimpleParticle(EventParticleItem.placement(ENCHANTING_TABLE, "PARTICLE_EVENT_ENCHANTING", 22), Particle.ENCHANTMENT_TABLE, 0, 0, 0, 0.01), location -> location.add(0, 1.1, 0))))),
AirshipEvent(26, new int[]{205, 9, 54, 120, 292}, new CircleParticle(new LocationParticleMutator(new SimpleParticle(EventParticleItem.placement(SNOWBALL, "PARTICLE_EVENT_CLOUD", 26), Particle.CLOUD, 0, 0, 0, 0.01), location -> location.add(0, 2.2, 0)))),
HellsBellsWs(28, new int[]{205, 9, 11}, new CloudParticle(new CircleParticle(new LocationParticleMutator(new SimpleParticle(EventParticleItem.placement(TNT_MINECART, "PARTICLE_EVENT_SMOKE", 28), Particle.CAMPFIRE_COSY_SMOKE, 0, 0, 0, 0.01), location -> location.add(0, 2.2, 0))))),
Underwater(31, new int[]{9, 210, 520}, new CloudParticle(new SimpleParticle(EventParticleItem.placement(PRISMARINE_SHARD, "PARTICLE_EVENT_WATER", 31), Particle.DRIP_WATER))),
AdventWarShip(32, new int[]{9, 205, 210}, new TickParticle(new LocationParticleMutator(new CircleParticle(new ParticleGroup(EventParticleItem.placement(PRISMARINE_CRYSTALS, "PARTICLE_EVENT_WATER", 32), new SimpleParticle(null, Particle.DRIP_WATER), new SimpleParticle(null, Particle.WATER_WAKE, 0.2F, 0.2F, 0.2F, 0.01))), location -> location.add(0, 1.1, 0)))),
MiniWarGearLiga(33, new int[]{9, 34, 205}, new TickParticle(new WingParticle(new SimpleParticle(EventParticleItem.placement(IRON_SWORD, "PARTICLE_EVENT_WINGS", 33), Particle.WATER_WAKE, 0, 0, 0, 0, 1), 0.15, WingParticle.WingDesign.MWGL))),
Absturz(34, new int[]{210, 205, 527, 286}, new TickParticle(new WingParticle(new SimpleParticle(EventParticleItem.placement(FEATHER, "PARTICLE_EVENT_WINGS", 34), Particle.CRIT_MAGIC, 0, 0, 0, 0, 1), 0.15, WingParticle.WingDesign.SIMPLE))),
UnderwaterMWG(35, new int[]{9, 210}, new TickParticle(new WingParticle(new SimpleParticle(EventParticleItem.placement(CYAN_CARPET, "PARTICLE_EVENT_RAIN_CLOUD", 35), Particle.CRIT_MAGIC, 0, 0, 0, 0, 1), 0.15, WingParticle.WingDesign.SW))),
WarGearSeason2022(37, new int[]{285, 210, 122}, new TickParticle(new WingParticle(new SimpleParticle(EventParticleItem.placement(DIAMOND_HELMET, "PARTICLE_EVENT_WGS", 37), Particle.FIREWORKS_SPARK, 0, 0, 0, 0, 1), 0.15, WingParticle.WingDesign.WGS))),
WargearClash(38, new int[]{210, 158, 167, 286}, new TickParticle(new WingParticle(new SimpleParticle(EventParticleItem.placement(GOLDEN_SWORD, "PARTICLE_EVENT_WARGEARCLASH", 38), Particle.CRIT_MAGIC, 0, 0, 0, 0, 1), 0.1, WingParticle.WingDesign.SWORD_CROSSED))),
WarGearSeason(new ParticleData(Material.ENCHANTING_TABLE, "PARTICLE_EVENT_ENCHANTING", ParticleRequirement.eventPlacement(22, 12, 285, 54),
new Cloud(new Circle(new LocationMutator(new SimpleParticle(Particle.ENCHANTMENT_TABLE, 0, 0, 0, 0.01), 0, 1.1, 0)))
)),
AirshipEvent(new ParticleData(Material.SNOWBALL, "PARTICLE_EVENT_CLOUD", ParticleRequirement.eventPlacement(26, 205, 9, 54, 120, 292),
new Circle(new LocationMutator(new SimpleParticle(Particle.CLOUD, 0, 0, 0, 0.01), 0, 2.2, 0))
)),
HellsBellsWs(new ParticleData(Material.TNT_MINECART, "PARTICLE_EVENT_SMOKE", ParticleRequirement.eventPlacement(28, 205, 9, 11),
new Cloud(new Circle(new LocationMutator(new SimpleParticle(Particle.CAMPFIRE_COSY_SMOKE, 0, 0, 0, 0.01), 0, 2.2, 0)))
)),
Underwater(new ParticleData(Material.PRISMARINE_SHARD, "PARTICLE_EVENT_WATER", ParticleRequirement.eventPlacement(31, 9, 210, 520),
new Cloud(new SimpleParticle(Particle.DRIP_WATER)))
),
AdventWarShip(new ParticleData(Material.PRISMARINE_CRYSTALS, "PARTICLE_EVENT_WATER", ParticleRequirement.eventPlacement(31, 9, 205, 210),
new Always(new LocationMutator(new Circle(new Group(new SimpleParticle(Particle.DRIP_WATER), new SimpleParticle(Particle.WATER_WAKE, 0.2F, 0.2F, 0.2F, 0.01))), 0, 1.1, 0)))
),
MiniWarGearLiga(new ParticleData(Material.IRON_SWORD, "PARTICLE_EVENT_WINGS", ParticleRequirement.eventPlacement(33, 9, 34, 205),
new Always(new Delayed(new NonFlying(new Wing(new SimpleParticle(Particle.WATER_WAKE, 0, 0, 0, 0, 1), 0.15, WingDesign.MWGL)), 20)))
),
Absturz(new ParticleData(Material.FEATHER, "PARTICLE_EVENT_WINGS", ParticleRequirement.eventPlacement(34, 210, 205, 527, 286),
new Always(new Delayed(new NonFlying(new Wing(new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0, 1), 0.15, WingDesign.SIMPLE)), 20)))
),
UnderwaterMWG(new ParticleData(Material.CYAN_CARPET, "PARTICLE_EVENT_RAIN_CLOUD", ParticleRequirement.eventPlacement(35, 9, 210),
new Always(new Delayed(new NonFlying(new Wing(new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0, 1), 0.15, WingDesign.SW)), 20)))
),
WarGearSeason2022(new ParticleData(Material.DIAMOND_HELMET, "PARTICLE_EVENT_WGS", ParticleRequirement.eventPlacement(37, 285, 210, 122),
new Always(new Delayed(new NonFlying(new Wing(new SimpleParticle(Particle.FIREWORKS_SPARK, 0, 0, 0, 0, 1), 0.15, WingDesign.WGS)), 20)))
),
WargearClash(new ParticleData(Material.GOLDEN_SWORD, "PARTICLE_EVENT_WARGEARCLASH", ParticleRequirement.eventPlacement(38, 210, 158, 167, 286),
new Always(new Delayed(new NonFlying(new Wing(new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0, 1), 0.1, WingDesign.SWORD_CROSSED)), 20)))
),
;
public static EventParticlePlacement[] particles = values();
public static ParticleEnum[] particles = values();
private int event;
private int[] placementTeams;
private BaseParticle particle;
@Getter
private ParticleData particle;
}

Datei anzeigen

@ -1,26 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2022 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.lobby.particle.particles;
import de.steamwar.lobby.particle.BaseParticle;
public interface ParticleEnum {
BaseParticle getParticle();
}

Datei anzeigen

@ -1,56 +1,63 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2022 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.lobby.particle.particles;
import de.steamwar.lobby.particle.BaseParticle;
import de.steamwar.lobby.particle.DustSimpleParticle;
import de.steamwar.lobby.particle.ParticleItem;
import de.steamwar.lobby.particle.SimpleParticle;
import de.steamwar.lobby.particle.mutator.LocationParticleMutator;
import de.steamwar.lobby.particle.ParticleData;
import de.steamwar.lobby.particle.ParticleEnum;
import de.steamwar.lobby.particle.elements.DustParticle;
import de.steamwar.lobby.particle.elements.LocationMutator;
import de.steamwar.lobby.particle.elements.SimpleParticle;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.bukkit.Material;
import org.bukkit.Particle;
import static org.bukkit.Material.*;
@AllArgsConstructor
public enum PlayerParticle implements ParticleEnum {
SNEEZE(new SimpleParticle(new ParticleItem(SLIME_BLOCK, "PARTICLE_SNEEZE"), Particle.SNEEZE, 0.2F, 0.2F, 0.2F, 0.01)),
SMOKE(new SimpleParticle(new ParticleItem(COBWEB, "PARTICLE_SMOKE"), Particle.SMOKE_NORMAL, 0.2F, 0.2F, 0.2F, 0.01)),
FIRE(new SimpleParticle(new ParticleItem(LAVA_BUCKET, "PARTICLE_FIRE"), Particle.DRIP_LAVA)),
WATER(new SimpleParticle(new ParticleItem(WATER_BUCKET, "PARTICLE_WATER"), Particle.DRIP_WATER)),
HEART(new LocationParticleMutator(new SimpleParticle(new ParticleItem(RED_DYE, "PARTICLE_HEART"), Particle.HEART), location -> location.add(0, 2.2, 0))),
NOTES(new LocationParticleMutator(new SimpleParticle(new ParticleItem(NOTE_BLOCK, "PARTICLE_NOTES"), Particle.NOTE), location -> location.add(0, 2.2, 0))),
NAUTILUS(new SimpleParticle(new ParticleItem(NAUTILUS_SHELL, "PARTICLE_NAUTILUS"), Particle.NAUTILUS, 0.2F, 0.2F, 0.2F, 0.01)),
SNOWBALL(new SimpleParticle(new ParticleItem(Material.SNOWBALL, "PARTICLE_SNOWBALL"), Particle.SNOWBALL, 0.2F, 0.2F, 0.2F, 0.01)),
EFFECT(new DustSimpleParticle(new ParticleItem(GLASS_BOTTLE, "PARTICLE_EFFECT"), Particle.REDSTONE, 0F, 0.2F, 0F, 0.01)),
CAMPFIRE(new SimpleParticle(new ParticleItem(Material.CAMPFIRE, "PARTICLE_CAMPFIRE"), Particle.CAMPFIRE_COSY_SMOKE, 0F, 0.2F, 0F, 0.01)),
MAGIC(new SimpleParticle(new ParticleItem(CAULDRON, "PARTICLE_MAGIC"), Particle.CRIT_MAGIC, 0.2F, 0.2F, 0.2F, 0.01)),
ANGRY(new SimpleParticle(new ParticleItem(REDSTONE_BLOCK, "PARTICLE_ANGRY"), Particle.VILLAGER_ANGRY, 0.2F, 0.2F, 0.2F, 0.01)),
SLIME(new SimpleParticle(new ParticleItem(SLIME_BALL, "PARTICLE_SLIME"), Particle.SLIME)),
MOB(new SimpleParticle(new ParticleItem(ZOMBIE_HEAD, "PARTICLE_MOB"), Particle.SPELL_MOB)),
SNEEZE(new ParticleData(Material.SLIME_BLOCK, "PARTICLE_SNEEZE",
new SimpleParticle(Particle.SNEEZE, 0.2F, 0.2F, 0.2F, 0.01))
),
SMOKE(new ParticleData(Material.COBWEB, "PARTICLE_SMOKE",
new SimpleParticle(Particle.SMOKE_NORMAL, 0.2F, 0.2F, 0.2F, 0.01))
),
FIRE(new ParticleData(Material.LAVA_BUCKET, "PARTICLE_FIRE",
new SimpleParticle(Particle.DRIP_LAVA))
),
WATER(new ParticleData(Material.WATER_BUCKET, "PARTICLE_WATER",
new SimpleParticle(Particle.DRIP_WATER))
),
HEARTH(new ParticleData(Material.RED_DYE, "PARTICLE_HEART",
new LocationMutator(new SimpleParticle(Particle.HEART), 0, 2.2, 0))
),
NOTES(new ParticleData(Material.NOTE_BLOCK, "PARTICLE_NOTES",
new LocationMutator(new SimpleParticle(Particle.NOTE), 0, 2.2, 0))
),
NAUTILUS(new ParticleData(Material.NAUTILUS_SHELL, "PARTICLE_NAUTILUS",
new SimpleParticle(Particle.NAUTILUS, 0.2F, 0.2F ,0.2F, 0.01))
),
SNOWBALL(new ParticleData(Material.SNOWBALL, "PARTICLE_SNOWBALL",
new SimpleParticle(Particle.SNOWBALL, 0.2F, 0.2F ,0.2F, 0.01))
),
EFFECT(new ParticleData(Material.GLASS_BOTTLE, "PARTICLE_EFFECT",
new DustParticle(Particle.REDSTONE, 0, 0.2F, 02F, 0.01, 5))
),
CAMPFIRE(new ParticleData(Material.CAMPFIRE, "PARTICLE_CAMPFIRE",
new SimpleParticle(Particle.CAMPFIRE_COSY_SMOKE, 0, 0.2F ,0, 0.01))
),
MAGIC(new ParticleData(Material.CAULDRON, "PARTICLE_MAGIC",
new SimpleParticle(Particle.CRIT_MAGIC, 0.2F, 0.2F, 0.2F, 0.01))
),
ANGRY(new ParticleData(Material.REDSTONE_BLOCK, "PARTICLE_ANGRY",
new SimpleParticle(Particle.VILLAGER_ANGRY, 0.2F, 0.2F, 0.2F, 0.01))
),
SLIME(new ParticleData(Material.SLIME_BALL, "PARTICLE_SLIME",
new SimpleParticle(Particle.SLIME))
),
MOB(new ParticleData(Material.ZOMBIE_HEAD, "PARTICLE_MOB",
new SimpleParticle(Particle.SPELL_MOB))
),
;
public static ParticleEnum[] particles = values();
@Getter
private BaseParticle particle;
private ParticleData particle;
}

Datei anzeigen

@ -1,71 +1,99 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2022 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.lobby.particle.particles;
import de.steamwar.lobby.particle.BaseParticle;
import de.steamwar.lobby.particle.ParticleItem;
import de.steamwar.lobby.particle.SimpleParticle;
import de.steamwar.lobby.particle.decorator.CircleParticle;
import de.steamwar.lobby.particle.decorator.CloudParticle;
import de.steamwar.lobby.particle.decorator.TickParticle;
import de.steamwar.lobby.particle.decorator.WingParticle;
import de.steamwar.lobby.particle.mutator.LocationParticleMutator;
import de.steamwar.lobby.particle.ParticleData;
import de.steamwar.lobby.particle.ParticleEnum;
import de.steamwar.lobby.particle.ParticleRequirement;
import de.steamwar.lobby.particle.WingDesign;
import de.steamwar.lobby.particle.elements.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.bukkit.Material;
import org.bukkit.Particle;
import static org.bukkit.Material.*;
@AllArgsConstructor
public enum ServerTeamParticle implements ParticleEnum {
WITCH(new SimpleParticle(new ParticleItem(EXPERIENCE_BOTTLE, "PARTICLE_WITCH", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.SPELL_WITCH)),
ENCHANTING(new SimpleParticle(new ParticleItem(ENCHANTING_TABLE, "PARTICLE_ENCHANTING", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.ENCHANTMENT_TABLE)),
HAPPY(new SimpleParticle(new ParticleItem(EMERALD_BLOCK, "PARTICLE_HAPPY", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.VILLAGER_HAPPY, 0.2F, 0.2F, 0.2F, 0.01)),
FLAME(new SimpleParticle(new ParticleItem(FLINT_AND_STEEL, "PARTICLE_FLAME", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.FLAME, 0F, 0.2F, 0F, 0.01)),
END_ROD(new SimpleParticle(new ParticleItem(Material.END_ROD, "PARTICLE_END_ROD", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.END_ROD, 0.2F, 0.2F, 0.2F, 0.01)),
CLOUD(new CloudParticle(new SimpleParticle(new ParticleItem(WHITE_WOOL, "PARTICLE_CLOUD", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.CLOUD))),
TOTEM(new CloudParticle(new SimpleParticle(new ParticleItem(TOTEM_OF_UNDYING, "PARTICLE_TOTEM", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.TOTEM, 0.2F, 0.2F, 0.2F, 0.01))),
ENCHANTING_CLOUD(new CloudParticle(new SimpleParticle(new ParticleItem(WHITE_DYE, "PARTICLE_ENCHANTING", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.ENCHANTMENT_TABLE))),
FLAME_CLOUD(new CloudParticle(new SimpleParticle(new ParticleItem(FIRE_CORAL_BLOCK, "PARTICLE_FLAME", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.FLAME))),
SNEEZE_CLOUD(new CloudParticle(new SimpleParticle(new ParticleItem(LIME_SHULKER_BOX, "PARTICLE_SNEEZE", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.SNEEZE))),
SLIME_CLOUD(new CloudParticle(new SimpleParticle(new ParticleItem(GREEN_SHULKER_BOX, "PARTICLE_SLIME", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.SLIME))),
SMOKE_CLOUD(new CloudParticle(new SimpleParticle(new ParticleItem(DEAD_BRAIN_CORAL_BLOCK, "PARTICLE_SMOKE", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.CAMPFIRE_COSY_SMOKE, 0.2F, 0.2F, 0.2F, 0.01))),
TOWN_CLOUD(new CloudParticle(new SimpleParticle(new ParticleItem(FIREWORK_STAR, "PARTICLE_TOWN", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.TOWN_AURA))),
FLAME_CIRCLE(new CircleParticle(new LocationParticleMutator(new SimpleParticle(new ParticleItem(MAGMA_BLOCK, "PARTICLE_FLAME", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.FLAME, 0F, 0F, 0F, 0.01), location -> location.add(0, 1.1, 0)))),
ENCHANTING_CIRCLE(new CircleParticle(new LocationParticleMutator(new SimpleParticle(new ParticleItem(WHITE_DYE, "PARTICLE_ENCHANTING_CIRCLE", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.ENCHANTMENT_TABLE, 0.2F, 0.2F, 0.2F, 0.01), location -> location.add(0, 1.1, 0)))),
NOTES_CIRCLE(new CircleParticle(new LocationParticleMutator(new SimpleParticle(new ParticleItem(NOTE_BLOCK, "PARTICLE_NOTES", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.NOTE, 0F, 0F, 0F, 0.01), location -> location.add(0, 2.2, 0)))),
WATER_FIRE(new LocationParticleMutator(new CircleParticle(new ParticleItem(GUARDIAN_SPAWN_EGG, "PARTICLE_WATER_FIRE", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), new SimpleParticle(null, Particle.DRIP_WATER, 0.0F, 0.0F, 0.0F, 0.01), new SimpleParticle(null, Particle.DRIP_LAVA, 0.0F, 0.0F, 0.0F, 0.01)), location -> location.add(0, 1.1, 0))),
WATER_FIRE_ALWAYS(new TickParticle(new LocationParticleMutator(new CircleParticle(new ParticleItem(MAGMA_CUBE_SPAWN_EGG, "PARTICLE_WATER_FIRE", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), new SimpleParticle(null,Particle.DRIP_WATER, 0.0F, 0.0F, 0.0F, 0.01), new SimpleParticle(null,Particle.DRIP_LAVA, 0.0F, 0.0F, 0.0F, 0.01)), location -> location.add(0, 1.1, 0)))),
MAGIC_ENCHANTING(new LocationParticleMutator(new CircleParticle(new ParticleItem(DIAMOND_SWORD, "PARTICLE_MAGIC_ENCHANTING", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), new SimpleParticle(null, Particle.CRIT_MAGIC, 0.0F, 0.0F, 0.0F, 0.01), new SimpleParticle(null, Particle.ENCHANTMENT_TABLE, 0.0F, 0.0F, 0.0F, 0.01)), location -> location.add(0, 1.1, 0))),
MAGIC_ENCHANTING_ALWAYS(new TickParticle(new LocationParticleMutator(new CircleParticle(new ParticleItem(WOODEN_SWORD, "PARTICLE_MAGIC_ENCHANTING", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), new SimpleParticle(null, Particle.CRIT_MAGIC, 0.0F, 0.0F, 0.0F, 0.01), new SimpleParticle(null, Particle.ENCHANTMENT_TABLE, 0.0F, 0.0F, 0.0F, 0.01)), location -> location.add(0, 1.1, 0)))),
MAGIC_CLOUD_CIRCLE(new CloudParticle(new CircleParticle(new LocationParticleMutator(new SimpleParticle(new ParticleItem(GLOWSTONE_DUST, "PARTICLE_MAGIC", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.CRIT_MAGIC, 0.0F, 0.0F, 0.0F, 0.01), location -> location.add(0, 1.1, 0))))),
FLAME_CLOUD_CIRCLE(new CloudParticle(new CircleParticle(new LocationParticleMutator(new SimpleParticle(new ParticleItem(FIRE_CORAL, "PARTICLE_FLAME", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.FLAME, 0.0F, 0.0F, 0.0F, 0.01), location -> location.add(0, 1.1, 0))))),
FIREWORK_CLOUD_CIRCLE(new CloudParticle(new CircleParticle(new LocationParticleMutator(new SimpleParticle(new ParticleItem(FIREWORK_ROCKET, "PARTICLE_FIREWORK", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.FIREWORKS_SPARK, 0.0F, 0.0F, 0.0F, 0.01), location -> location.add(0, 1.1, 0))))),
WATER_CLOUD_CIRCLE(new CloudParticle(new CircleParticle(new LocationParticleMutator(new SimpleParticle(new ParticleItem(CYAN_DYE, "PARTICLE_WATER", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.WATER_WAKE, 0.0F, 0.0F, 0.0F, 0.01), location -> location.add(0, 1.1, 0))))),
ENCHANTING_DOUBLE_CIRCLE(new TickParticle(new LocationParticleMutator(new CircleParticle(new ParticleItem(BUBBLE_CORAL_BLOCK, "PARTICLE_ENCHANTING", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), new SimpleParticle(null, Particle.ENCHANTMENT_TABLE, 0.0F, 0.0F, 0.0F, 0.01), new SimpleParticle(null, Particle.ENCHANTMENT_TABLE, 0.0F, 0.0F, 0.0F, 0.01)), location -> location.add(0, 2.2, 0)))),
EVIL_WINGS(new TickParticle(new WingParticle(new SimpleParticle(new ParticleItem(PURPUR_SLAB, "PARTICLE_WINGS_EVIL", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.SPELL_WITCH, 0, 0, 0, 0, 1), 0.15, WingParticle.WingDesign.SIMPLE))),
WITCH(new ParticleData(Material.EXPERIENCE_BOTTLE, "PARTICLE_WITCH", ParticleRequirement.SERVER_TEAM,
new SimpleParticle(Particle.SPELL_WITCH))
),
ENCHANTING(new ParticleData(Material.ENCHANTING_TABLE, "PARTICLE_ENCHANTING", ParticleRequirement.SERVER_TEAM,
new SimpleParticle(Particle.ENCHANTMENT_TABLE))
),
HAPPY(new ParticleData(Material.EMERALD_BLOCK, "PARTICLE_HAPPY", ParticleRequirement.SERVER_TEAM,
new SimpleParticle(Particle.HEART, 0.2F, 0.2F, 0.2F, 0.01))
),
FLAME(new ParticleData(Material.FLINT_AND_STEEL, "PARTICLE_FLAME", ParticleRequirement.SERVER_TEAM,
new SimpleParticle(Particle.FLAME, 0, 0.2F, 0, 0.01))
),
END_ROD(new ParticleData(Material.END_ROD, "PARTICLE_END_ROD", ParticleRequirement.SERVER_TEAM,
new SimpleParticle(Particle.END_ROD, 0.2F, 0.2F, 0.2F, 0.01))
),
CLOUD(new ParticleData(Material.WHITE_WOOL, "PARTICLE_CLOUD", ParticleRequirement.SERVER_TEAM,
new Cloud(new SimpleParticle(Particle.CLOUD)))
),
TOTEM(new ParticleData(Material.TOTEM_OF_UNDYING, "PARTICLE_TOTEM", ParticleRequirement.SERVER_TEAM,
new Cloud(new SimpleParticle(Particle.TOTEM, 0.2F, 0.2F, 0.2F, 0.01)))
),
ENCHANTING_CLOUD(new ParticleData(Material.WHITE_DYE, "PARTICLE_ENCHANTING", ParticleRequirement.SERVER_TEAM,
new Cloud(new SimpleParticle(Particle.ENCHANTMENT_TABLE)))
),
FLAME_CLOUD(new ParticleData(Material.FIRE_CORAL_BLOCK, "PARTICLE_FLAME", ParticleRequirement.SERVER_TEAM,
new Cloud(new SimpleParticle(Particle.FLAME)))
),
SNEEZE_CLOUD(new ParticleData(Material.LIME_SHULKER_BOX, "PARTICLE_SNEEZE", ParticleRequirement.SERVER_TEAM,
new Cloud(new SimpleParticle(Particle.SNEEZE)))
),
SLIME_CLOUD(new ParticleData(Material.GREEN_SHULKER_BOX, "PARTICLE_SLIME", ParticleRequirement.SERVER_TEAM,
new Cloud(new SimpleParticle(Particle.SLIME)))
),
SMOKE_CLOUD(new ParticleData(Material.DEAD_BRAIN_CORAL_BLOCK, "PARTICLE_SMOKE", ParticleRequirement.SERVER_TEAM,
new Cloud(new SimpleParticle(Particle.CAMPFIRE_COSY_SMOKE, 0.2F, 0.2F, 0.2F, 0.01)))
),
TOWN_CLOUD(new ParticleData(Material.FIREWORK_STAR, "PARTICLE_TOWN", ParticleRequirement.SERVER_TEAM,
new Cloud(new SimpleParticle(Particle.TOWN_AURA)))
),
FLAME_CIRCLE(new ParticleData(Material.MAGMA_BLOCK, "PARTICLE_FLAME", ParticleRequirement.SERVER_TEAM,
new Circle(new LocationMutator(new SimpleParticle(Particle.FLAME, 0, 0, 0, 0.01), 0, 1.1, 0)))
),
ENCHANTING_CIRCLE(new ParticleData(Material.WHITE_DYE, "PARTICLE_ENCHANTING_CIRCLE", ParticleRequirement.SERVER_TEAM,
new Circle(new LocationMutator(new SimpleParticle(Particle.ENCHANTMENT_TABLE, 0.2F, 0.2F, 0.2F, 0.01), 0, 1.1, 0)))
),
NOTES_CIRCLE(new ParticleData(Material.NOTE_BLOCK, "PARTICLE_NOTES", ParticleRequirement.SERVER_TEAM,
new Circle(new LocationMutator(new SimpleParticle(Particle.NOTE, 0, 0, 0, 0.01), 0, 2.2, 0)))
),
WATER_FIRE(new ParticleData(Material.GUARDIAN_SPAWN_EGG, "PARTICLE_WATER_FIRE", ParticleRequirement.SERVER_TEAM,
new LocationMutator(new DoubleCircle(new SimpleParticle(Particle.DRIP_WATER, 0, 0, 0, 0.01), new SimpleParticle(Particle.DRIP_LAVA, 0, 0, 0, 0.01)), 0, 1.1, 0))
),
WATER_FIRE_ALWAYS(new ParticleData(Material.GUARDIAN_SPAWN_EGG, "PARTICLE_WATER_FIRE", ParticleRequirement.SERVER_TEAM,
new Always(new LocationMutator(new DoubleCircle(new SimpleParticle(Particle.DRIP_WATER, 0, 0, 0, 0.01), new SimpleParticle(Particle.DRIP_LAVA, 0, 0, 0, 0.01)), 0, 1.1, 0)))
),
MAGIC_ENCHANTING(new ParticleData(Material.DIAMOND_SWORD, "PARTICLE_MAGIC_ENCHANTING", ParticleRequirement.SERVER_TEAM,
new LocationMutator(new DoubleCircle(new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0.01), new SimpleParticle(Particle.ENCHANTMENT_TABLE, 0, 0, 0, 0.01)), 0, 1.1, 0))
),
MAGIC_ENCHANTING_ALWAYS(new ParticleData(Material.WOODEN_SWORD, "PARTICLE_MAGIC_ENCHANTING", ParticleRequirement.SERVER_TEAM,
new Always(new LocationMutator(new DoubleCircle(new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0.01), new SimpleParticle(Particle.ENCHANTMENT_TABLE, 0, 0, 0, 0.01)), 0, 1.1, 0)))
),
MAGIC_CLOUD_CIRCLE(new ParticleData(Material.GLOWSTONE_DUST, "PARTICLE_MAGIC", ParticleRequirement.SERVER_TEAM,
new Cloud(new Circle(new LocationMutator(new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0.01), 0, 1.1, 0))))
),
FLAME_CLOUD_CIRCLE(new ParticleData(Material.FIRE_CORAL, "PARTICLE_FLAME", ParticleRequirement.SERVER_TEAM,
new Cloud(new Circle(new LocationMutator(new SimpleParticle(Particle.FLAME, 0, 0, 0, 0.01), 0, 1.1, 0))))
),
FIREWORK_CLOUD_CIRCLE(new ParticleData(Material.FIREWORK_ROCKET, "PARTICLE_FIREWORK", ParticleRequirement.SERVER_TEAM,
new Cloud(new Circle(new LocationMutator(new SimpleParticle(Particle.FIREWORKS_SPARK, 0, 0, 0, 0.01), 0, 1.1, 0))))
),
WATER_CLOUD_CIRCLE(new ParticleData(Material.CYAN_DYE, "PARTICLE_WATER_FIRE", ParticleRequirement.SERVER_TEAM,
new Cloud(new Circle(new LocationMutator(new SimpleParticle(Particle.WATER_WAKE, 0, 0, 0, 0.01), 0, 1.1, 0))))
),
ENCHANTING_DOUBLE_CIRCLE(new ParticleData(Material.BUBBLE_CORAL_BLOCK, "PARTICLE_ENCHANTING", ParticleRequirement.SERVER_TEAM,
new Always(new LocationMutator(new DoubleCircle(new SimpleParticle(Particle.ENCHANTMENT_TABLE, 0, 0, 0, 0.01), new SimpleParticle(Particle.ENCHANTMENT_TABLE, 0, 0, 0, 0.01)), 0, 2.2, 0)))
),
EVIL_WINGS(new ParticleData(Material.PURPUR_SLAB, "PARTICLE_WINGS_EVIL", ParticleRequirement.SERVER_TEAM,
new Always(new Delayed(new NonFlying(new Wing(new SimpleParticle(Particle.SPELL_WITCH, 0, 0, 0, 0, 1), 0.15, WingDesign.SIMPLE)), 20)))
),
;
public static ParticleEnum[] particles = values();
@Getter
private BaseParticle particle;
private ParticleData particle;
}

Datei anzeigen

@ -1,43 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2022 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.lobby.particle.particles;
import de.steamwar.lobby.particle.BaseParticle;
import de.steamwar.lobby.particle.ParticleItem;
import de.steamwar.lobby.particle.SimpleParticle;
import de.steamwar.lobby.particle.decorator.TickParticle;
import de.steamwar.lobby.particle.decorator.WingParticle;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.bukkit.Particle;
import static org.bukkit.Material.ENDER_CHEST;
@Getter
@AllArgsConstructor
public enum SpecialTeamParticle implements ParticleEnum {
Eclipse(34, new TickParticle(new WingParticle(new SimpleParticle(new ParticleItem(ENDER_CHEST, "PARTICLE_EVENT_ENCHANTING"), Particle.PORTAL, 0.0F, 0.0F, 0.0F, 0.01), 0.15, WingParticle.WingDesign.ECLIPSE))),
;
public static SpecialTeamParticle[] particles = values();
private int teamId;
private BaseParticle particle;
}

Datei anzeigen

@ -1,52 +1,50 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2022 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.lobby.particle.particles;
import de.steamwar.lobby.particle.BaseParticle;
import de.steamwar.lobby.particle.ParticleItem;
import de.steamwar.lobby.particle.SimpleParticle;
import de.steamwar.lobby.particle.decorator.CircleParticle;
import de.steamwar.lobby.particle.decorator.NonFloorParticle;
import de.steamwar.lobby.particle.mutator.LocationParticleMutator;
import de.steamwar.lobby.particle.ParticleData;
import de.steamwar.lobby.particle.ParticleEnum;
import de.steamwar.lobby.particle.ParticleRequirement;
import de.steamwar.lobby.particle.elements.Circle;
import de.steamwar.lobby.particle.elements.LocationMutator;
import de.steamwar.lobby.particle.elements.NonFloor;
import de.steamwar.lobby.particle.elements.SimpleParticle;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.bukkit.Material;
import org.bukkit.Particle;
import static org.bukkit.Material.*;
@AllArgsConstructor
public enum TeamParticle implements ParticleEnum {
SQUID(new SimpleParticle(new ParticleItem(INK_SAC, "PARTICLE_SQUID", "PARTICLE_UNLOCKED_BY_TEAM"), Particle.SQUID_INK, 0.2F, 0.2F, 0.2F, 0.01)),
BUBBLE(new SimpleParticle(new ParticleItem(TUBE_CORAL, "PARTICLE_BUBBLE", "PARTICLE_UNLOCKED_BY_TEAM"), Particle.BUBBLE_POP, 0.2F, 0.2F, 0.2F, 0.01)),
HONEY(new SimpleParticle(new ParticleItem(HONEY_BOTTLE, "PARTICLE_HONEY", "PARTICLE_UNLOCKED_BY_TEAM"), Particle.DRIPPING_HONEY, 0.2F, 0.2F, 0.2F, 1)),
NECTAR(new SimpleParticle(new ParticleItem(HONEYCOMB, "PARTICLE_NECTAR", "PARTICLE_UNLOCKED_BY_TEAM"), Particle.FALLING_NECTAR, 0.2F, 0.2F, 0.2F, 1)),
FIREWORK(new LocationParticleMutator(new NonFloorParticle(new SimpleParticle(new ParticleItem(FIRE_CHARGE, "PARTICLE_FIREWORK", "PARTICLE_UNLOCKED_BY_TEAM"), Particle.FIREWORKS_SPARK, 0.1F, 0.1F, 0.1F, 0.2, 2)), location -> location.subtract(0, -0.2, 0))),
DRAGON_BREATH(new SimpleParticle(new ParticleItem(Material.DRAGON_BREATH, "PARTICLE_DRAGON_BREATH", "PARTICLE_UNLOCKED_BY_TEAM"), Particle.DRAGON_BREATH, 1F, 0.2F, 1F, 0.01)),
DAMAGE(new SimpleParticle(new ParticleItem(SPIDER_EYE, "PARTICLE_DAMAGE", "PARTICLE_UNLOCKED_BY_TEAM"), Particle.DAMAGE_INDICATOR, 0.2F, 0F, 0.2F, 0.01)),
DOLPHIN(new SimpleParticle(new ParticleItem(BLUE_DYE, "PARTICLE_DOLPHIN", "PARTICLE_UNLOCKED_BY_TEAM"), Particle.DOLPHIN, 0.2F, 0F, 0.2F, 0.01)),
HEART(new CircleParticle(new LocationParticleMutator(new SimpleParticle(new ParticleItem(RED_CONCRETE, "PARTICLE_HEART", "PARTICLE_UNLOCKED_BY_TEAM"), Particle.HEART), location -> location.add(0, 2.2, 0)))),
SQUID(new ParticleData(Material.INK_SAC, "PARTICLE_SQUID", ParticleRequirement.HAS_TEAM,
new SimpleParticle(Particle.SQUID_INK, 0.2F, 0.2F, 0.2F, 0.01))
),
BUBBLE(new ParticleData(Material.TUBE_CORAL, "PARTICLE_BUBBLE", ParticleRequirement.HAS_TEAM,
new SimpleParticle(Particle.BUBBLE_POP, 0.2F, 0.2F, 0.2F, 0.01))
),
HONEY(new ParticleData(Material.HONEY_BOTTLE, "PARTICLE_HONEY", ParticleRequirement.HAS_TEAM,
new SimpleParticle(Particle.DRIPPING_HONEY, 0.2F, 0.2F, 0.2F, 1))
),
NECTAR(new ParticleData(Material.HONEYCOMB, "PARTICLE_NECTAR", ParticleRequirement.HAS_TEAM,
new SimpleParticle(Particle.FALLING_NECTAR, 0.2F, 0.2F, 0.2F, 1))
),
FIREWORK(new ParticleData(Material.FIRE_CHARGE, "PARTICLE_FIREWORK", ParticleRequirement.HAS_TEAM,
new LocationMutator(new NonFloor(new SimpleParticle(Particle.FIREWORKS_SPARK, 0.1F, 0.1F, 0.1F, 0.2, 2)), 0, -0.2, 0))
),
DRAGON_BREATH(new ParticleData(Material.DRAGON_BREATH, "PARTICLE_DRAGON_BREATH", ParticleRequirement.HAS_TEAM,
new SimpleParticle(Particle.DRAGON_BREATH, 1F, 0.2F, 1F, 0.01))
),
DAMAGE(new ParticleData(Material.SPIDER_EYE, "PARTICLE_DAMAGE", ParticleRequirement.HAS_TEAM,
new SimpleParticle(Particle.DAMAGE_INDICATOR, 0.2F, 0, 0.2F, 0.01))
),
DOLPHIN(new ParticleData(Material.BLUE_DYE, "PARTICLE_DOLPHIN", ParticleRequirement.HAS_TEAM,
new SimpleParticle(Particle.DOLPHIN, 0.2F, 0, 0.2F, 0.01))
),
HEART(new ParticleData(Material.RED_CONCRETE, "PARTICLE_HEART", ParticleRequirement.HAS_TEAM,
new Circle(new LocationMutator(new SimpleParticle(Particle.HEART), 0, 2.2, 0)))
),
;
public static ParticleEnum[] particles = values();
@Getter
private BaseParticle particle;
private ParticleData particle;
}

Datei anzeigen

@ -1,7 +1,7 @@
package de.steamwar.lobby.otherparticle.particles.custom;
package de.steamwar.lobby.particle.particles.custom;
import de.steamwar.lobby.otherparticle.ParticleData;
import de.steamwar.lobby.otherparticle.ParticleEnum;
import de.steamwar.lobby.particle.ParticleData;
import de.steamwar.lobby.particle.ParticleEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

Datei anzeigen

@ -1,7 +1,7 @@
package de.steamwar.lobby.otherparticle.particles.custom;
package de.steamwar.lobby.particle.particles.custom;
import de.steamwar.lobby.otherparticle.ParticleData;
import de.steamwar.lobby.otherparticle.ParticleEnum;
import de.steamwar.lobby.particle.ParticleData;
import de.steamwar.lobby.particle.ParticleEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

Datei anzeigen

@ -1,10 +1,10 @@
package de.steamwar.lobby.otherparticle.particles.custom;
package de.steamwar.lobby.particle.particles.custom;
import de.steamwar.lobby.otherparticle.ParticleData;
import de.steamwar.lobby.otherparticle.ParticleEnum;
import de.steamwar.lobby.otherparticle.ParticleRequirement;
import de.steamwar.lobby.otherparticle.WingDesign;
import de.steamwar.lobby.otherparticle.elements.*;
import de.steamwar.lobby.particle.ParticleData;
import de.steamwar.lobby.particle.ParticleEnum;
import de.steamwar.lobby.particle.ParticleRequirement;
import de.steamwar.lobby.particle.WingDesign;
import de.steamwar.lobby.particle.elements.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.bukkit.Material;

Datei anzeigen

@ -19,7 +19,8 @@
package de.steamwar.lobby.util;
import de.steamwar.lobby.particle.particles.*;
import de.steamwar.lobby.particle.ParticleEnum;
import de.steamwar.lobby.particle.ParticleInventory;
import de.steamwar.sql.SteamwarUser;
import de.steamwar.sql.UserConfig;
import org.bukkit.entity.Player;
@ -43,36 +44,7 @@ public class LobbyPlayer {
particle = null;
String saved = UserConfig.getConfig(userId, "lobby-particle");
if (saved != null) {
try {
String[] strings = saved.split("@");
switch (strings[0]) {
case "PlayerParticle":
particle = PlayerParticle.valueOf(strings[1]);
break;
case "TeamParticle":
particle = TeamParticle.valueOf(strings[1]);
break;
case "ServerTeamParticle":
particle = ServerTeamParticle.valueOf(strings[1]);
break;
case "EventParticle":
particle = EventParticle.valueOf(strings[1]);
break;
case "EventParticleParticipation":
particle = EventParticleParticipation.valueOf(strings[1]);
break;
case "EventParticlePlacement":
particle = EventParticlePlacement.valueOf(strings[1]);
break;
case "SpecialParticle":
particle = SpecialTeamParticle.valueOf(strings[1]);
break;
default:
break;
}
} catch (Exception e) {
setParticle(null);
}
particle = ParticleInventory.convertFromString(saved);
}
}
@ -92,7 +64,7 @@ public class LobbyPlayer {
if (particle == null) {
UserConfig.removePlayerConfig(userId, "lobby-particle");
} else {
String saved = particle.getClass().getSimpleName() + "@" + ((Enum<?>) particle).name();
String saved = ParticleInventory.convertToString(particle);
UserConfig.updatePlayerConfig(userId, "lobby-particle", saved);
}
this.particle = particle;