Update Particle and add new ParticleRequirment
Dieser Commit ist enthalten in:
Ursprung
bd4dc2ad21
Commit
f22cd77464
@ -23,6 +23,7 @@ PARTICLE_LOCKED = {0} §8- §c§lLocked
|
||||
PARTICLE_UNLOCKED_BY = §eUnlocked by
|
||||
PARTICLE_UNLOCKED_BY_TEAM = §fJoin a team
|
||||
PARTICLE_UNLOCKED_BY_SPECIFIC_TEAM = §fTeam {0}
|
||||
PARTICLE_UNLOCKED_BY_SPECIFIC_USER = §fUser {0}
|
||||
PARTICLE_UNLOCKED_BY_EVENT = §fEvent participation
|
||||
PARTICLE_UNLOCKED_BY_SERVER_TEAM = §fServer Team
|
||||
PARTICLE_UNLOCKED_BY_EVENT_PLACEMENT = §f{0} 1., 2. or 3. Place
|
||||
|
@ -23,6 +23,7 @@ PARTICLE_LOCKED = {0} §8- §c§lGesperrt
|
||||
PARTICLE_UNLOCKED_BY = §eFreigeschaltet durch
|
||||
PARTICLE_UNLOCKED_BY_TEAM = §fTeambeitritt
|
||||
PARTICLE_UNLOCKED_BY_SPECIFIC_TEAM = §fTeam {0}
|
||||
PARTICLE_UNLOCKED_BY_SPECIFIC_USER = §fUser {0}
|
||||
PARTICLE_UNLOCKED_BY_EVENT = §fEventteilnahme
|
||||
PARTICLE_UNLOCKED_BY_SERVER_TEAM = §fServerteam
|
||||
PARTICLE_UNLOCKED_BY_EVENT_PLACEMENT = §f{0} 1., 2. oder 3. Platz
|
||||
|
@ -12,10 +12,27 @@ import java.util.Set;
|
||||
|
||||
public class Particle {
|
||||
|
||||
private Material material;
|
||||
private String name;
|
||||
private Set<String> attributes = new LinkedHashSet<>();
|
||||
private ParticleRequirement requirement;
|
||||
private final Material material;
|
||||
private final String name;
|
||||
private final Set<String> attributes = new LinkedHashSet<>();
|
||||
private final ParticleRequirement requirement;
|
||||
|
||||
public Particle(Material material, String name) {
|
||||
this.material = material;
|
||||
this.name = name;
|
||||
this.requirement = ParticleRequirement.NO_REQUIRMENT;
|
||||
}
|
||||
|
||||
public Particle(Material material, String name, ParticleRequirement requirement) {
|
||||
this.material = material;
|
||||
this.name = name;
|
||||
this.requirement = requirement;
|
||||
}
|
||||
|
||||
public Particle add(String attribute) {
|
||||
attributes.add(attribute);
|
||||
return this;
|
||||
}
|
||||
|
||||
public SWItem toSWItem(Player player) {
|
||||
String translatedName = LobbySystem.getMessage().parse(name, player);
|
||||
|
5
src/de/steamwar/lobby/otherparticle/ParticleEnum.java
Normale Datei
5
src/de/steamwar/lobby/otherparticle/ParticleEnum.java
Normale Datei
@ -0,0 +1,5 @@
|
||||
package de.steamwar.lobby.otherparticle;
|
||||
|
||||
public interface ParticleEnum {
|
||||
Particle getParticle();
|
||||
}
|
@ -173,6 +173,21 @@ public interface ParticleRequirement {
|
||||
};
|
||||
}
|
||||
|
||||
static ParticleRequirement specificPlayer(int userId) {
|
||||
String userName = SteamwarUser.get(userId).getUserName();
|
||||
return new ParticleRequirement() {
|
||||
@Override
|
||||
public String getRequirementName(Player player) {
|
||||
return LobbySystem.getMessage().parse("PARTICLE_UNLOCKED_BY_SPECIFIC_USER", player, userName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ParticleRequirementPredicate getRequirement() {
|
||||
return (steamwarUser, integers, eggHuntConfig) -> steamwarUser.getId() == userId;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
interface ParticleRequirementPredicate {
|
||||
boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig);
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren