EasterEggHunt #27
@ -18,7 +18,6 @@ PORTAL_NO_WORLDEDIT_SELECTION = §cNo WorldEdit selection
|
|||||||
# Particle
|
# Particle
|
||||||
PARTICLE_INVENTORY = §6Particle
|
PARTICLE_INVENTORY = §6Particle
|
||||||
PARTICLE_DESELECT = §8No particle
|
PARTICLE_DESELECT = §8No particle
|
||||||
PARTICLE_LOCKED = {0} §8- §c§lLocked
|
|
||||||
|
|
||||||
PARTICLE_UNLOCKED_BY = §eUnlocked by
|
PARTICLE_UNLOCKED_BY = §eUnlocked by
|
||||||
PARTICLE_UNLOCKED_BY_TEAM = §fJoin a team
|
PARTICLE_UNLOCKED_BY_TEAM = §fJoin a team
|
||||||
@ -40,6 +39,7 @@ PARTICLE_ATTRIBUTE_WING = §8-§f Wings
|
|||||||
PARTICLE_ATTRIBUTE = §eAttributes§7:
|
PARTICLE_ATTRIBUTE = §eAttributes§7:
|
||||||
|
|
||||||
PARTICLE_SELECT = §eClick to select
|
PARTICLE_SELECT = §eClick to select
|
||||||
|
PARTICLE_LOCKED = §c§lLocked
|
||||||
|
|
||||||
PARTICLE_SNEEZE = §aSneeze
|
PARTICLE_SNEEZE = §aSneeze
|
||||||
PARTICLE_SMOKE = §7Smoke
|
PARTICLE_SMOKE = §7Smoke
|
||||||
|
@ -18,7 +18,6 @@ PORTAL_NO_WORLDEDIT_SELECTION = §cKeine WorldEdit Selection
|
|||||||
# Particle
|
# Particle
|
||||||
PARTICLE_INVENTORY = §6Partikel
|
PARTICLE_INVENTORY = §6Partikel
|
||||||
PARTICLE_DESELECT = §8Keine Partikel
|
PARTICLE_DESELECT = §8Keine Partikel
|
||||||
PARTICLE_LOCKED = {0} §8- §c§lGesperrt
|
|
||||||
|
|
||||||
PARTICLE_UNLOCKED_BY = §eFreigeschaltet durch
|
PARTICLE_UNLOCKED_BY = §eFreigeschaltet durch
|
||||||
PARTICLE_UNLOCKED_BY_TEAM = §fTeambeitritt
|
PARTICLE_UNLOCKED_BY_TEAM = §fTeambeitritt
|
||||||
@ -40,6 +39,7 @@ PARTICLE_ATTRIBUTE_WING = §8-§f Flügel
|
|||||||
PARTICLE_ATTRIBUTE = §eAttribute§7:
|
PARTICLE_ATTRIBUTE = §eAttribute§7:
|
||||||
|
|
||||||
PARTICLE_SELECT = §eZum Auswählen klicken
|
PARTICLE_SELECT = §eZum Auswählen klicken
|
||||||
|
PARTICLE_LOCKED = §c§lGesperrt
|
||||||
|
|
||||||
PARTICLE_SNEEZE = §aSneeze
|
PARTICLE_SNEEZE = §aSneeze
|
||||||
PARTICLE_SMOKE = §7Rauch
|
PARTICLE_SMOKE = §7Rauch
|
||||||
|
@ -2,6 +2,9 @@ package de.steamwar.lobby.otherparticle;
|
|||||||
|
|
||||||
import de.steamwar.inventory.SWItem;
|
import de.steamwar.inventory.SWItem;
|
||||||
import de.steamwar.lobby.LobbySystem;
|
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.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@ -15,7 +18,11 @@ public class ParticleData {
|
|||||||
private final Material material;
|
private final Material material;
|
||||||
private final String name;
|
private final String name;
|
||||||
private final Set<String> attributes = new LinkedHashSet<>();
|
private final Set<String> attributes = new LinkedHashSet<>();
|
||||||
|
|
||||||
|
@Getter
|
||||||
private final ParticleRequirement requirement;
|
private final ParticleRequirement requirement;
|
||||||
|
|
||||||
|
@Getter
|
||||||
private final ParticleElement particleElement;
|
private final ParticleElement particleElement;
|
||||||
|
|
||||||
public ParticleData(Material material, String name, ParticleElement particleElement) {
|
public ParticleData(Material material, String name, ParticleElement particleElement) {
|
||||||
@ -23,6 +30,7 @@ public class ParticleData {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
this.requirement = ParticleRequirement.NO_REQUIRMENT;
|
this.requirement = ParticleRequirement.NO_REQUIRMENT;
|
||||||
this.particleElement = particleElement;
|
this.particleElement = particleElement;
|
||||||
|
particleElement.aggregateAttributes(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ParticleData(Material material, String name, ParticleRequirement requirement, ParticleElement particleElement) {
|
public ParticleData(Material material, String name, ParticleRequirement requirement, ParticleElement particleElement) {
|
||||||
@ -30,6 +38,7 @@ public class ParticleData {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
this.requirement = requirement;
|
this.requirement = requirement;
|
||||||
this.particleElement = particleElement;
|
this.particleElement = particleElement;
|
||||||
|
particleElement.aggregateAttributes(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ParticleData add(String attribute) {
|
public ParticleData add(String attribute) {
|
||||||
@ -37,7 +46,7 @@ public class ParticleData {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SWItem toSWItem(Player player) {
|
public SWItem toSWItem(Player player, SteamwarUser user, Set<Integer> eventTeilnahme, String eggHuntConfig) {
|
||||||
String translatedName = LobbySystem.getMessage().parse(name, player);
|
String translatedName = LobbySystem.getMessage().parse(name, player);
|
||||||
List<String> lore = new ArrayList<>();
|
List<String> lore = new ArrayList<>();
|
||||||
lore.add("");
|
lore.add("");
|
||||||
@ -46,13 +55,21 @@ public class ParticleData {
|
|||||||
attributes.forEach(attribute -> lore.add(LobbySystem.getMessage().parse(attribute, player)));
|
attributes.forEach(attribute -> lore.add(LobbySystem.getMessage().parse(attribute, player)));
|
||||||
lore.add("");
|
lore.add("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean selectable = requirement.getRequirement().test(user, eventTeilnahme, eggHuntConfig);
|
||||||
|
selectable |= user.getUserGroup() != UserGroup.Member;
|
||||||
|
|
||||||
String unlockedBy = requirement.getRequirementName(player);
|
String unlockedBy = requirement.getRequirementName(player);
|
||||||
if (unlockedBy != null) {
|
if (unlockedBy != null) {
|
||||||
lore.add(LobbySystem.getMessage().parse("PARTICLE_UNLOCKED_BY", player));
|
lore.add(LobbySystem.getMessage().parse("PARTICLE_UNLOCKED_BY", player));
|
||||||
lore.add(unlockedBy);
|
lore.add(unlockedBy);
|
||||||
lore.add("");
|
lore.add("");
|
||||||
}
|
}
|
||||||
lore.add(LobbySystem.getMessage().parse("PARTICLE_SELECT", player));
|
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 -> {});
|
return new SWItem(material, translatedName, lore, false, clickType -> {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
97
src/de/steamwar/lobby/otherparticle/ParticleInventory.java
Normale Datei
97
src/de/steamwar/lobby/otherparticle/ParticleInventory.java
Normale Datei
@ -0,0 +1,97 @@
|
|||||||
|
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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -6,7 +6,6 @@ import de.steamwar.lobby.special.easter.EggHunt;
|
|||||||
import de.steamwar.sql.Event;
|
import de.steamwar.sql.Event;
|
||||||
import de.steamwar.sql.SteamwarUser;
|
import de.steamwar.sql.SteamwarUser;
|
||||||
import de.steamwar.sql.Team;
|
import de.steamwar.sql.Team;
|
||||||
import de.steamwar.sql.UserGroup;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@ -19,7 +18,7 @@ import java.util.stream.Collectors;
|
|||||||
public interface ParticleRequirement {
|
public interface ParticleRequirement {
|
||||||
|
|
||||||
String getRequirementName(Player player);
|
String getRequirementName(Player player);
|
||||||
ParticleRequirementPredicate getRequirement();
|
boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig);
|
||||||
|
|
||||||
ParticleRequirement NO_REQUIRMENT = new ParticleRequirement() {
|
ParticleRequirement NO_REQUIRMENT = new ParticleRequirement() {
|
||||||
@Override
|
@Override
|
||||||
@ -28,8 +27,8 @@ public interface ParticleRequirement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ParticleRequirementPredicate getRequirement() {
|
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
|
||||||
return (player, eventTeilname, eggHuntConfig) -> true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
ParticleRequirement HAS_TEAM = new ParticleRequirement() {
|
ParticleRequirement HAS_TEAM = new ParticleRequirement() {
|
||||||
@ -39,8 +38,8 @@ public interface ParticleRequirement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ParticleRequirementPredicate getRequirement() {
|
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
|
||||||
return (steamwarUser, eventTeilname, eggHuntConfig) -> steamwarUser.getTeam() != 0 || steamwarUser.getUserGroup() != UserGroup.Member;
|
return user.getTeam() != 0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
ParticleRequirement EVENT_PARTICIPATION = new ParticleRequirement() {
|
ParticleRequirement EVENT_PARTICIPATION = new ParticleRequirement() {
|
||||||
@ -50,8 +49,8 @@ public interface ParticleRequirement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ParticleRequirementPredicate getRequirement() {
|
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
|
||||||
return (steamwarUser, eventTeilname, eggHuntConfig) -> !eventTeilname.isEmpty();
|
return !eventTeilname.isEmpty();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
ParticleRequirement SERVER_TEAM = new ParticleRequirement() {
|
ParticleRequirement SERVER_TEAM = new ParticleRequirement() {
|
||||||
@ -61,8 +60,8 @@ public interface ParticleRequirement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ParticleRequirementPredicate getRequirement() {
|
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
|
||||||
return (steamwarUser, eventTeilname, eggHuntConfig) -> false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
ParticleRequirement EGG_HUNT_EASY = _easterEggHuntDifficulty(EggDifficulty.EASY);
|
ParticleRequirement EGG_HUNT_EASY = _easterEggHuntDifficulty(EggDifficulty.EASY);
|
||||||
@ -77,17 +76,15 @@ public interface ParticleRequirement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ParticleRequirementPredicate getRequirement() {
|
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
|
||||||
return (user, eventTeilname, eggHuntConfig) -> {
|
if (eggHuntConfig == null) return false;
|
||||||
if (eggHuntConfig == null) return false;
|
int count = 0;
|
||||||
int count = 0;
|
for (int i = 0; i < eggHuntConfig.length(); i++) {
|
||||||
for (int i = 0; i < eggHuntConfig.length(); i++) {
|
if (eggHuntConfig.charAt(i) == '1') {
|
||||||
if (eggHuntConfig.charAt(i) == '1') {
|
count++;
|
||||||
count++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return count >= EggHunt.getEggList().size() / 2;
|
}
|
||||||
};
|
return count >= EggHunt.getEggList().size() / 2;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -101,8 +98,8 @@ public interface ParticleRequirement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ParticleRequirementPredicate getRequirement() {
|
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
|
||||||
return (steamwarUser, eventTeilname, eggHuntConfig) -> steamwarUser.getTeam() == teamId;
|
return user.getTeam() == teamId;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -116,8 +113,8 @@ public interface ParticleRequirement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ParticleRequirementPredicate getRequirement() {
|
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
|
||||||
return (steamwarUser, eventTeilname, eggHuntConfig) -> eventTeilname.contains(eventId);
|
return eventTeilname.contains(eventId);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -133,11 +130,9 @@ public interface ParticleRequirement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ParticleRequirementPredicate getRequirement() {
|
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
|
||||||
return (steamwarUser, eventTeilname, eggHuntConfig) -> {
|
if (!eventTeilname.contains(eventId)) return false;
|
||||||
if (!eventTeilname.contains(eventId)) return false;
|
return teams.contains(user.getTeam());
|
||||||
return teams.contains(steamwarUser.getTeam());
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -164,11 +159,9 @@ public interface ParticleRequirement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ParticleRequirementPredicate getRequirement() {
|
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
|
||||||
return (steamwarUser, integers, eggHuntConfig) -> {
|
if (eggHuntConfig == null) return false;
|
||||||
if (eggHuntConfig == null) return false;
|
return eggs.stream().allMatch(id -> eggHuntConfig.length() >= id && eggHuntConfig.charAt(id) == '1');
|
||||||
return eggs.stream().allMatch(id -> eggHuntConfig.length() >= id && eggHuntConfig.charAt(id) == '1');
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -182,8 +175,8 @@ public interface ParticleRequirement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ParticleRequirementPredicate getRequirement() {
|
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
|
||||||
return (steamwarUser, integers, eggHuntConfig) -> steamwarUser.getId() == userId;
|
return user.getId() == userId;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ public class SimpleParticle implements ParticleElement {
|
|||||||
private float vx;
|
private float vx;
|
||||||
private float vy;
|
private float vy;
|
||||||
private float vz;
|
private float vz;
|
||||||
private double time = 0.01;
|
private double time = 1;
|
||||||
private int count = 5;
|
private int count = 5;
|
||||||
|
|
||||||
public SimpleParticle(Particle particle) {
|
public SimpleParticle(Particle particle) {
|
||||||
|
@ -3,6 +3,7 @@ package de.steamwar.lobby.otherparticle.particles;
|
|||||||
import de.steamwar.lobby.otherparticle.ParticleData;
|
import de.steamwar.lobby.otherparticle.ParticleData;
|
||||||
import de.steamwar.lobby.otherparticle.ParticleEnum;
|
import de.steamwar.lobby.otherparticle.ParticleEnum;
|
||||||
import de.steamwar.lobby.otherparticle.ParticleRequirement;
|
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.LocationMutator;
|
||||||
import de.steamwar.lobby.otherparticle.elements.SimpleParticle;
|
import de.steamwar.lobby.otherparticle.elements.SimpleParticle;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@ -14,7 +15,7 @@ import org.bukkit.Particle;
|
|||||||
public enum EasterParticle implements ParticleEnum {
|
public enum EasterParticle implements ParticleEnum {
|
||||||
|
|
||||||
EGG_HUNT_EASY(new ParticleData(Material.LIME_CONCRETE_POWDER, "PARTICLE_EGG_HUNT_EASY", ParticleRequirement.EGG_HUNT_EASY,
|
EGG_HUNT_EASY(new ParticleData(Material.LIME_CONCRETE_POWDER, "PARTICLE_EGG_HUNT_EASY", ParticleRequirement.EGG_HUNT_EASY,
|
||||||
new LocationMutator(new SimpleParticle(Particle.FALLING_SPORE_BLOSSOM), 0, 2.2, 0))
|
new Always(new LocationMutator(new SimpleParticle(Particle.FALLING_SPORE_BLOSSOM, 0.2F, 0.1f, 0.2F, 1, 5), 0, 2.2, 0)))
|
||||||
),
|
),
|
||||||
EGG_HUNT_MEDIUM(new ParticleData(Material.YELLOW_CONCRETE_POWDER, "PARTICLE_EGG_HUNT_MEDIUM", ParticleRequirement.EGG_HUNT_MEDIUM,
|
EGG_HUNT_MEDIUM(new ParticleData(Material.YELLOW_CONCRETE_POWDER, "PARTICLE_EGG_HUNT_MEDIUM", ParticleRequirement.EGG_HUNT_MEDIUM,
|
||||||
new SimpleParticle(Particle.FALLING_SPORE_BLOSSOM))
|
new SimpleParticle(Particle.FALLING_SPORE_BLOSSOM))
|
||||||
|
@ -0,0 +1,99 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -1,4 +1,16 @@
|
|||||||
package de.steamwar.lobby.otherparticle.particles.custom;
|
package de.steamwar.lobby.otherparticle.particles.custom;
|
||||||
|
|
||||||
public enum CustomEasterParticle {
|
import de.steamwar.lobby.otherparticle.ParticleData;
|
||||||
|
import de.steamwar.lobby.otherparticle.ParticleEnum;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum CustomEasterParticle implements ParticleEnum {
|
||||||
|
|
||||||
|
;
|
||||||
|
public static ParticleEnum[] particles = values();
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
private ParticleData particle;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
package de.steamwar.lobby.otherparticle.particles.custom;
|
||||||
|
|
||||||
|
import de.steamwar.lobby.otherparticle.ParticleData;
|
||||||
|
import de.steamwar.lobby.otherparticle.ParticleEnum;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum CustomPlayerParticle implements ParticleEnum {
|
||||||
|
|
||||||
|
;
|
||||||
|
public static ParticleEnum[] particles = values();
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
private ParticleData particle;
|
||||||
|
}
|
@ -37,7 +37,7 @@ public class EggClickListener extends BasicListener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
String found = UserConfig.getConfig(player.getUniqueId(), "egghunt");
|
String found = UserConfig.getConfig(player.getUniqueId(), EggHunt.EGG_HUNT_CONFIG_KEY);
|
||||||
if (found == null) {
|
if (found == null) {
|
||||||
found = "";
|
found = "";
|
||||||
}
|
}
|
||||||
@ -59,6 +59,6 @@ public class EggClickListener extends BasicListener {
|
|||||||
player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 0.25f, 1.0f);
|
player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 0.25f, 1.0f);
|
||||||
|
|
||||||
builder.setCharAt(index, '1');
|
builder.setCharAt(index, '1');
|
||||||
UserConfig.updatePlayerConfig(player.getUniqueId(), "egghunt", builder.toString());
|
UserConfig.updatePlayerConfig(player.getUniqueId(), EggHunt.EGG_HUNT_CONFIG_KEY, builder.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,8 @@ public class EggHunt {
|
|||||||
|
|
||||||
private static List<Egg> eggList = new ArrayList<>();
|
private static List<Egg> eggList = new ArrayList<>();
|
||||||
|
|
||||||
|
public static final String EGG_HUNT_CONFIG_KEY = "egghunt2022";
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ public class EggHuntCommand extends SWCommand {
|
|||||||
@Register
|
@Register
|
||||||
public void genericCommand(Player player, @OptionalValue("ALL") Selection selection) {
|
public void genericCommand(Player player, @OptionalValue("ALL") Selection selection) {
|
||||||
AtomicInteger atomicInteger = new AtomicInteger();
|
AtomicInteger atomicInteger = new AtomicInteger();
|
||||||
String found = UserConfig.getConfig(player.getUniqueId(), "egghunt");
|
String found = UserConfig.getConfig(player.getUniqueId(), EggHunt.EGG_HUNT_CONFIG_KEY);
|
||||||
List<SWListInv.SWListEntry<Egg>> entries = EggHunt.getEggList().stream()
|
List<SWListInv.SWListEntry<Egg>> entries = EggHunt.getEggList().stream()
|
||||||
.map(egg -> {
|
.map(egg -> {
|
||||||
int index = atomicInteger.getAndIncrement();
|
int index = atomicInteger.getAndIncrement();
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren