13
0

Update Particle
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2023-03-27 22:11:14 +02:00
Ursprung 0e103b52f9
Commit bd4dc2ad21

Datei anzeigen

@ -2,7 +2,6 @@ package de.steamwar.lobby.otherparticle;
import de.steamwar.inventory.SWItem;
import de.steamwar.lobby.LobbySystem;
import de.steamwar.sql.SteamwarUser;
import org.bukkit.Material;
import org.bukkit.entity.Player;
@ -10,38 +9,30 @@ import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import java.util.function.Predicate;
public class Particle {
private ParticleItem item;
private Material material;
private String name;
private Set<String> attributes = new LinkedHashSet<>();
private ParticleRequirement requirement;
private static class ParticleItem {
private Material material;
private String name;
private Set<String> attributes = new LinkedHashSet<>();
private String unlockedBy;
public SWItem toSWItem(Player player) {
String translatedName = LobbySystem.getMessage().parse(name, player);
List<String> lore = new ArrayList<>();
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 (!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 -> {});
}
String unlockedBy = requirement.getRequirementName(player);
if (unlockedBy != null) {
lore.add(LobbySystem.getMessage().parse("PARTICLE_UNLOCKED_BY", player));
lore.add(unlockedBy);
lore.add("");
}
lore.add(LobbySystem.getMessage().parse("PARTICLE_SELECT", player));
return new SWItem(material, translatedName, lore, false, clickType -> {});
}
private Predicate<SteamwarUser> unlocked = player -> true;
}