13
0

Fix ParticleListener rename of Villager npcs
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2022-03-26 16:58:11 +01:00
Ursprung 24786d6987
Commit 07187d6e8a

Datei anzeigen

@ -22,13 +22,14 @@ package de.steamwar.lobby.listener;
import de.steamwar.lobby.LobbySystem;
import de.steamwar.lobby.particle.BaseParticle;
import de.steamwar.lobby.particle.ParticleData;
import de.steamwar.lobby.particle.particles.ParticleEnum;
import de.steamwar.lobby.particle.ParticleInventory;
import de.steamwar.lobby.particle.particles.ParticleEnum;
import de.steamwar.lobby.util.LobbyPlayer;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerMoveEvent;
@ -56,6 +57,7 @@ public class ParticleListener extends BasicListener {
public void handlePlayerInteract(PlayerInteractEvent event) {
Player player = event.getPlayer();
if (!PlayerSpawn.PARTICLE.equals(event.getItem())) return;
event.setCancelled(true);
ParticleInventory.openParticleInventory(player);
}
@ -71,4 +73,11 @@ public class ParticleListener extends BasicListener {
if (baseParticle.needsTick()) return;
baseParticle.particle(new ParticleData(player.getWorld(), player, deg));
}
@EventHandler
public void onPlayerInteractEntity(PlayerInteractEntityEvent event) {
if (PlayerSpawn.PARTICLE.equals(event.getPlayer().getInventory().getItemInMainHand())) {
event.setCancelled(true);
}
}
}