Fix Non Working Particle
Dieser Commit ist enthalten in:
Ursprung
e044f2ff9e
Commit
87e3056e25
@ -40,7 +40,7 @@ public class ParticleInventory {
|
|||||||
add(swInventory, Material.GLASS_BOTTLE, "§5Effekt", lore, Particle.SPELL, 20, player, lobbyPlayer);
|
add(swInventory, Material.GLASS_BOTTLE, "§5Effekt", lore, Particle.SPELL, 20, player, lobbyPlayer);
|
||||||
add(swInventory, Material.CAMPFIRE, "§7Rauch", lore, Particle.CAMPFIRE_COSY_SMOKE, 21, player, lobbyPlayer, true, 0F, 0.2F, 0F, 0.01);
|
add(swInventory, Material.CAMPFIRE, "§7Rauch", lore, Particle.CAMPFIRE_COSY_SMOKE, 21, player, lobbyPlayer, true, 0F, 0.2F, 0F, 0.01);
|
||||||
add(swInventory, Material.CAULDRON, "§5Magie", lore, Particle.CRIT_MAGIC, 22, player, lobbyPlayer, true, 0.2F, 0.2F, 0.2F, 0.01);
|
add(swInventory, Material.CAULDRON, "§5Magie", lore, Particle.CRIT_MAGIC, 22, player, lobbyPlayer, true, 0.2F, 0.2F, 0.2F, 0.01);
|
||||||
add(swInventory, Material.REDSTONE_BLOCK, "§4Wut", lore, Particle.VILLAGER_ANGRY, 23, player, lobbyPlayer, true, 0.2F, 0.2F, 0.2F, 0.01);
|
add(swInventory, Material.REDSTONE_BLOCK, "§4Wut", lore, Particle.VILLAGER_ANGRY, 23, player, lobbyPlayer, true, 0.2F, 0.02F, 0.2F, 0.01);
|
||||||
add(swInventory, Material.SLIME_BALL, "§aSchleim", lore, Particle.SLIME, 24, player, lobbyPlayer);
|
add(swInventory, Material.SLIME_BALL, "§aSchleim", lore, Particle.SLIME, 24, player, lobbyPlayer);
|
||||||
|
|
||||||
if (userGroup == UserGroup.Member) {
|
if (userGroup == UserGroup.Member) {
|
||||||
|
@ -3,6 +3,7 @@ package de.steamwar.lobby.listener;
|
|||||||
import de.steamwar.lobby.inventories.LobbyInventory;
|
import de.steamwar.lobby.inventories.LobbyInventory;
|
||||||
import de.steamwar.lobby.inventories.ParticleInventory;
|
import de.steamwar.lobby.inventories.ParticleInventory;
|
||||||
import de.steamwar.lobby.utils.LobbyPlayer;
|
import de.steamwar.lobby.utils.LobbyPlayer;
|
||||||
|
import org.bukkit.Color;
|
||||||
import org.bukkit.Particle;
|
import org.bukkit.Particle;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -11,8 +12,12 @@ import org.bukkit.event.Listener;
|
|||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class ParticleListener implements Listener {
|
public class ParticleListener implements Listener {
|
||||||
|
|
||||||
|
private static Random random = new Random();
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.NORMAL)
|
@EventHandler(priority = EventPriority.NORMAL)
|
||||||
public void handlePlayerInteract(PlayerInteractEvent event) {
|
public void handlePlayerInteract(PlayerInteractEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
@ -29,10 +34,16 @@ public class ParticleListener implements Listener {
|
|||||||
Particle particle = lobbyPlayer.getParticle();
|
Particle particle = lobbyPlayer.getParticle();
|
||||||
if (particle == null) return;
|
if (particle == null) return;
|
||||||
|
|
||||||
|
if (particle == Particle.SPELL) {
|
||||||
|
Particle.DustOptions dust = new Particle.DustOptions(Color.fromRGB(random.nextInt(256), random.nextInt(256), random.nextInt(256)), random.nextFloat() / 2 + 1);
|
||||||
|
player.getWorld().spawnParticle(particle, player.getLocation().add(0.0D, 0.2D, 0.0D), 5, dust);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (lobbyPlayer.isCustomVelocity()) {
|
if (lobbyPlayer.isCustomVelocity()) {
|
||||||
player.getWorld().spawnParticle(lobbyPlayer.getParticle(), player.getLocation().add(0.0D, 0.2D, 0.0D), 5, lobbyPlayer.getParticle_vx(), lobbyPlayer.getParticle_vy(), lobbyPlayer.getParticle_vz(), lobbyPlayer.getParticle_time());
|
player.getWorld().spawnParticle(particle, player.getLocation().add(0.0D, 0.2D, 0.0D), 5, lobbyPlayer.getParticle_vx(), lobbyPlayer.getParticle_vy(), lobbyPlayer.getParticle_vz(), lobbyPlayer.getParticle_time());
|
||||||
} else {
|
} else {
|
||||||
player.getWorld().spawnParticle(lobbyPlayer.getParticle(), player.getLocation().add(0.0D, 0.2D, 0.0D), 5);
|
player.getWorld().spawnParticle(particle, player.getLocation().add(0.0D, 0.2D, 0.0D), 5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren