13
0

Update some stuff

Dieser Commit ist enthalten in:
yoyosource 2022-03-24 10:09:03 +01:00
Ursprung 65f6789c95
Commit fa9a359270
3 geänderte Dateien mit 42 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -38,6 +38,12 @@ public class ParticleListener extends BasicListener {
Bukkit.getScheduler().runTaskTimer(LobbySystem.getPlugin(), () -> {
deg += 0.1;
if (deg > 360) deg = 0;
Bukkit.getOnlinePlayers().forEach(player -> {
LobbyPlayer lobbyPlayer = LobbyPlayer.getLobbyPlayer(player.getUniqueId());
SpecialParticle particle = lobbyPlayer.getParticle();
if (particle == null) return;
particle.execute(player.getWorld(), player, deg);
});
}, 0, 1);
}
@ -58,6 +64,4 @@ public class ParticleListener extends BasicListener {
if (particle == null) return;
particle.execute(player.getWorld(), player, deg);
}
}

Datei anzeigen

@ -0,0 +1,36 @@
package de.steamwar.lobby.particle;
import de.steamwar.inventory.SWItem;
import org.bukkit.Color;
import org.bukkit.Particle;
import org.bukkit.World;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public interface BaseParticle {
List<String> EMPTY_LORE = new ArrayList<>();
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());
}
SWItem getItem();
default boolean tickable() {
return false;
}
void particle(World world, Player player, double deg);
}

Datei anzeigen

@ -80,5 +80,4 @@ public abstract class SpecialParticle {
}
public abstract void particle(World world, Player player, double deg);
}