Update some stuff
Dieser Commit ist enthalten in:
Ursprung
65f6789c95
Commit
fa9a359270
@ -38,6 +38,12 @@ public class ParticleListener extends BasicListener {
|
|||||||
Bukkit.getScheduler().runTaskTimer(LobbySystem.getPlugin(), () -> {
|
Bukkit.getScheduler().runTaskTimer(LobbySystem.getPlugin(), () -> {
|
||||||
deg += 0.1;
|
deg += 0.1;
|
||||||
if (deg > 360) deg = 0;
|
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);
|
}, 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,6 +64,4 @@ public class ParticleListener extends BasicListener {
|
|||||||
if (particle == null) return;
|
if (particle == null) return;
|
||||||
particle.execute(player.getWorld(), player, deg);
|
particle.execute(player.getWorld(), player, deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
36
src/de/steamwar/lobby/particle/BaseParticle.java
Normale Datei
36
src/de/steamwar/lobby/particle/BaseParticle.java
Normale Datei
@ -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);
|
||||||
|
}
|
@ -80,5 +80,4 @@ public abstract class SpecialParticle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public abstract void particle(World world, Player player, double deg);
|
public abstract void particle(World world, Player player, double deg);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren