13
0

Fix some stuff and implement rest of EasterParticle's
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2023-04-04 16:57:48 +02:00
Ursprung 438b336535
Commit abda6b652d
14 geänderte Dateien mit 136 neuen und 23 gelöschten Zeilen

Datei anzeigen

@ -30,13 +30,18 @@ PARTICLE_UNLOCKED_BY_EVENT_PARTICIPATION = §f{0}
PARTICLE_UNLOCKED_BY_EASTER_EGG_HUNT_HALF = §fFind 45 Easter Eggs
PARTICLE_UNLOCKED_BY_EASTER_EGG_HUNT_DIFFICULTY = §fFind all Easter Eggs with difficulty {0}
PARTICLE_ATTRIBUTE = §eAttributes§7:
PARTICLE_ATTRIBUTE_CIRCLE = §8-§f Ring
PARTICLE_ATTRIBUTE_BI_CIRCLE = §8-§f Double ring
PARTICLE_ATTRIBUTE_CLOUD = §8-§f Cloud
PARTICLE_ATTRIBUTE_TICK = §8-§f Always active
PARTICLE_ATTRIBUTE_NON_FLOOR = §8-§f in air
PARTICLE_ATTRIBUTE_NON_FLOOR = §8-§f In air
PARTICLE_ATTRIBUTE_FLOOR = §8-§f On ground
PARTICLE_ATTRIBUTE_NON_FLYING = §8-§f Not flying
PARTICLE_ATTRIBUTE_FLYING = §8-§f Flying
PARTICLE_ATTRIBUTE_WING = §8-§f Wings
PARTICLE_ATTRIBUTE = §eAttributes§7:
PARTICLE_ATTRIBUTE_SNEAKING = §8-§f Sneaking
PARTICLE_ATTRIBUTE_SEPARATOR = §f
PARTICLE_SELECT = §eClick to select
PARTICLE_LOCKED = §c§lLocked
@ -85,6 +90,13 @@ PARTICLE_EVENT_RAIN_CLOUD = §fRaincloud
PARTICLE_EVENT_WGS = §fWGS
PARTICLE_EVENT_WARGEARCLASH = §fClash
PARTICLE_EGG_HUNT_EASY = §aGreenery
PARTICLE_EGG_HUNT_MEDIUM = §eHide and Seek
PARTICLE_EGG_HUNT_HARD = §cOrbit
PARTICLE_EGG_HUNT_EXTREME = §5Purple rain
PARTICLE_EGG_HUNT_ADVANCED = §5Lift off
PARTICLE_EGG_HUNT_HALF = §fThe hunt is on
JUMP_AND_RUN_PROGRESS = §e{0}§8/§f{1} §c{2} §7{3}
JUMP_AND_RUN_CANCEL = {0}
JUMP_AND_RUN_TIME = mm:ss SSS

Datei anzeigen

@ -34,8 +34,12 @@ PARTICLE_ATTRIBUTE_CIRCLE = §8-§f Ring
PARTICLE_ATTRIBUTE_BI_CIRCLE = §8-§f Doppelring
PARTICLE_ATTRIBUTE_CLOUD = §8-§f Wolke
PARTICLE_ATTRIBUTE_TICK = §8-§f Immer aktiv
PARTICLE_ATTRIBUTE_NON_FLOOR = §8-§f in Luft
PARTICLE_ATTRIBUTE_NON_FLOOR = §8-§f In der Luft
PARTICLE_ATTRIBUTE_FLOOR = §8-§f Auf dem Boden
PARTICLE_ATTRIBUTE_NON_FLYING = §8-§f Nicht am Fliegen
PARTICLE_ATTRIBUTE_FLYING = §8-§f Am Fliegen
PARTICLE_ATTRIBUTE_WING = §8-§f Flügel
PARTICLE_ATTRIBUTE_SNEAKING = §8-§f Ducken
PARTICLE_ATTRIBUTE = §eAttribute§7:
PARTICLE_SELECT = §eZum Auswählen klicken
@ -85,6 +89,13 @@ PARTICLE_EVENT_RAIN_CLOUD = §fRegenwolke
PARTICLE_EVENT_WGS = §fWGS
PARTICLE_EVENT_WARGEARCLASH = §fClash
PARTICLE_EGG_HUNT_EASY = §aGrünplfanzen
PARTICLE_EGG_HUNT_MEDIUM = §eVersteckspiel
PARTICLE_EGG_HUNT_HARD = §cOrbit
PARTICLE_EGG_HUNT_EXTREME = §5Lila regen
PARTICLE_EGG_HUNT_ADVANCED = §5Abheben
PARTICLE_EGG_HUNT_HALF = §fDie Jagd ist eröffnet
JUMP_AND_RUN_FINISHED = §aBeendet in {0} mit {1} Fails
# Easter Egg Hunt

Datei anzeigen

@ -8,7 +8,6 @@ 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;
@ -16,7 +15,7 @@ public class ParticleData {
private final Material material;
private final String name;
private final Set<String> attributes = new LinkedHashSet<>();
private final List<String> attributes = new ArrayList<>();
@Getter
private final ParticleRequirement requirement;

Datei anzeigen

@ -6,6 +6,7 @@ import de.steamwar.lobby.special.easter.EggHunt;
import de.steamwar.sql.Event;
import de.steamwar.sql.SteamwarUser;
import de.steamwar.sql.Team;
import de.steamwar.sql.UserGroup;
import org.bukkit.entity.Player;
import java.util.HashSet;
@ -28,7 +29,7 @@ public interface ParticleRequirement {
@Override
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
return false;
return user.getUserGroup() != UserGroup.Member;
}
};
@ -162,7 +163,7 @@ public interface ParticleRequirement {
@Override
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
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');
}
};
}

Datei anzeigen

@ -29,6 +29,10 @@ public class Delayed extends DelegatingParticleElement {
public Delayed(ParticleElement particleElement, int interval) {
super(particleElement);
Bukkit.getPluginManager().registerEvents(delayedData, LobbySystem.getPlugin());
this.interval = interval;
if (interval <= 0) {
throw new IllegalArgumentException("Interval must be greater than 0");
}
}
@Override

Datei anzeigen

@ -0,0 +1,23 @@
package de.steamwar.lobby.particle.elements;
import de.steamwar.lobby.particle.ParticleElement;
import de.steamwar.lobby.particle.ParticleTickData;
public class Floor extends DelegatingParticleElement {
public Floor(ParticleElement particleElement) {
super(particleElement);
}
@Override
public String attribute() {
return "PARTICLE_ATTRIBUTE_FLOOR";
}
@Override
public void tick(ParticleTickData particleTickData) {
if (!particleTickData.getWorld().getBlockAt(particleTickData.getPlayer().getLocation().subtract(0, 0.5, 0)).getType().isAir()) {
particleElement.tick(particleTickData);
}
}
}

Datei anzeigen

@ -0,0 +1,24 @@
package de.steamwar.lobby.particle.elements;
import de.steamwar.lobby.particle.ParticleElement;
import de.steamwar.lobby.particle.ParticleTickData;
public class Flying extends DelegatingParticleElement {
public Flying(ParticleElement particleElement) {
super(particleElement);
}
@Override
public String attribute() {
return "PARTICLE_ATTRIBUTE_FLYING";
}
@Override
public void tick(ParticleTickData particleTickData) {
if (!particleTickData.getPlayer().isGliding()) {
return;
}
particleElement.tick(particleTickData);
}
}

Datei anzeigen

@ -1,5 +1,6 @@
package de.steamwar.lobby.particle.elements;
import de.steamwar.lobby.particle.ParticleData;
import de.steamwar.lobby.particle.ParticleElement;
import de.steamwar.lobby.particle.ParticleTickData;
@ -17,6 +18,14 @@ public class Group extends DelegatingParticleElement {
return null;
}
@Override
public void aggregateAttributes(ParticleData particleData) {
particleElement.aggregateAttributes(particleData);
for (ParticleElement particleElement : rest) {
particleElement.aggregateAttributes(particleData);
}
}
@Override
public void tick(ParticleTickData particleTickData) {
particleElement.tick(particleTickData);

Datei anzeigen

@ -11,7 +11,7 @@ public class NonFlying extends DelegatingParticleElement {
@Override
public String attribute() {
return null;
return "PARTICLE_ATTRIBUTE_NON_FLYING";
}
@Override

Datei anzeigen

@ -0,0 +1,18 @@
package de.steamwar.lobby.particle.elements;
import de.steamwar.lobby.particle.ParticleData;
import de.steamwar.lobby.particle.ParticleElement;
import de.steamwar.lobby.particle.ParticleTickData;
public class Separator implements ParticleElement {
@Override
public void aggregateAttributes(ParticleData particleData) {
particleData.add("PARTICLE_ATTRIBUTE_SEPARATOR");
}
@Override
public void tick(ParticleTickData particleTickData) {
// do nothing
}
}

Datei anzeigen

@ -11,7 +11,7 @@ public class Sneaking extends DelegatingParticleElement {
@Override
public String attribute() {
return null; // TODO: Implement this attribute
return "PARTICLE_ATTRIBUTE_SNEAKING";
}
@Override

Datei anzeigen

@ -13,6 +13,7 @@ public class Wing extends DelegatingParticleElement {
public Wing(ParticleElement particleElement, double size, WingDesign wingDesign) {
super(particleElement);
this.size = size;
this.wingDesign = wingDesign;
}

Datei anzeigen

@ -3,34 +3,45 @@ package de.steamwar.lobby.particle.particles;
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 de.steamwar.lobby.particle.elements.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
@AllArgsConstructor
public enum EasterParticle implements ParticleEnum {
EGG_HUNT_EASY(new ParticleData(Material.LIME_CONCRETE_POWDER, "PARTICLE_EGG_HUNT_EASY", ParticleRequirement.EGG_HUNT_EASY,
new Always(new LocationMutator(new SimpleParticle(Particle.FALLING_SPORE_BLOSSOM, 0.2F, 0.1f, 0.2F, 1, 5), 0, 2.2, 0)))
new Always(new LocationMutator(new SimpleParticle(Particle.FALLING_SPORE_BLOSSOM, 0.5F, 0.1f, 0.5F, 1, 1), 0, 2.2, 0)))
),
EGG_HUNT_MEDIUM(new ParticleData(Material.YELLOW_CONCRETE_POWDER, "PARTICLE_EGG_HUNT_MEDIUM", ParticleRequirement.EGG_HUNT_MEDIUM,
new SimpleParticle(Particle.FALLING_SPORE_BLOSSOM))
new Always(new Floor(new Sneaking(new SimpleParticle(Particle.GLOW_SQUID_INK, 0.4F, 0.9F, 0.4F, 0.01)))))
),
EGG_HUNT_HARD(new ParticleData(Material.ORANGE_CONCRETE_POWDER, "PARTICLE_EGG_HUNT_HARD", ParticleRequirement.EGG_HUNT_HARD,
new SimpleParticle(Particle.FALLING_SPORE_BLOSSOM))
EGG_HUNT_HARD(new ParticleData(Material.RED_CONCRETE_POWDER, "PARTICLE_EGG_HUNT_HARD", ParticleRequirement.EGG_HUNT_HARD,
new Always(new LocationMutator(new DoubleCircle(new DustParticle(Particle.REDSTONE, 0, 0, 0, 0.01, 1), new DustParticle(Particle.REDSTONE, 0, 0, 0, 0.01, 1)), 0, 0.5, 0)))
),
EGG_HUNT_EXTREME(new ParticleData(Material.RED_CONCRETE_POWDER, "PARTICLE_EGG_HUNT_EXTREME", ParticleRequirement.EGG_HUNT_EXTREME,
new SimpleParticle(Particle.FALLING_SPORE_BLOSSOM))
EGG_HUNT_EXTREME(new ParticleData(Material.PURPLE_CONCRETE_POWDER, "PARTICLE_EGG_HUNT_EXTREME", ParticleRequirement.EGG_HUNT_EXTREME,
new Always(new LocationMutator(new SimpleParticle(Particle.FALLING_OBSIDIAN_TEAR, 0.5F, 0.1F, 0.5F, 1, 1), 0, 2.2, 0)))
),
EGG_HUNT_ADVANCED(new ParticleData(Material.PURPLE_CONCRETE_POWDER, "PARTICLE_EGG_HUNT_ADVANCED", ParticleRequirement.EGG_HUNT_ADVANCED,
new SimpleParticle(Particle.FALLING_SPORE_BLOSSOM))
EGG_HUNT_ADVANCED(new ParticleData(Material.BLACK_CONCRETE_POWDER, "PARTICLE_EGG_HUNT_ADVANCED", ParticleRequirement.EGG_HUNT_ADVANCED,
new Always(new Sneaking(new LocationMutator(new Group(
new SimpleParticle(Particle.SMOKE_NORMAL, 0.02F, 0, 0.02F, 0.05, 1),
new SimpleParticle(Particle.SMOKE_LARGE, 0.02F, 0, 0.02F, 0.05, 1),
particleTickData -> {
Player player = particleTickData.getPlayer();
player.setVelocity(player.getVelocity().add(new Vector(0, 0.1, 0)));
}
), 0, -0.2, 0))))
),
EGG_HUNT_HALF(new ParticleData(Material.PURPLE_CONCRETE_POWDER, "PARTICLE_EGG_HUNT_HALF", ParticleRequirement.EGG_HUNT_FOUND_HALF,
new SimpleParticle(Particle.FALLING_SPORE_BLOSSOM))
EGG_HUNT_HALF(new ParticleData(Material.EGG, "PARTICLE_EGG_HUNT_HALF", ParticleRequirement.EGG_HUNT_FOUND_HALF,
new Group(
new Always(new Sneaking(new Floor(new LocationMutator(new SimpleParticle(Particle.HEART, 0, 0, 0, 0.01), 0, 1.7, 0)))),
new Separator(),
new Always(new NonFloor(new NonFlying(new LocationMutator(new Cloud(new Circle(new SimpleParticle(Particle.HEART, 0, 0, 0, 0.01))), 0, 0.5, 0))))
))
),
;
public static ParticleEnum[] particles = values();

Datei anzeigen

@ -38,7 +38,7 @@ public enum PlayerParticle implements ParticleEnum {
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))
new DustParticle(Particle.REDSTONE, 0, 0.2F, 0, 0.01, 5))
),
CAMPFIRE(new ParticleData(Material.CAMPFIRE, "PARTICLE_CAMPFIRE",
new SimpleParticle(Particle.CAMPFIRE_COSY_SMOKE, 0, 0.2F ,0, 0.01))