mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 10:36:10 +01:00
Make VehicleEnterEvent check horse-type agnostic
This commit is contained in:
parent
ef0bc3d4e7
commit
fc43e6aa12
@ -12,6 +12,7 @@ import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.FishHook;
|
||||
import org.bukkit.entity.Horse;
|
||||
import org.bukkit.entity.Minecart;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -503,7 +504,7 @@ public class EventListen implements Listener {
|
||||
if (!npcRegistry.isNPC(event.getEntered()))
|
||||
return;
|
||||
NPC npc = npcRegistry.getNPC(event.getEntered());
|
||||
if ((npc.getEntity().getType() == EntityType.HORSE || npc.getEntity().getType() == EntityType.BOAT
|
||||
if ((npc.getEntity() instanceof Horse || npc.getEntity().getType() == EntityType.BOAT
|
||||
|| npc.getEntity() instanceof Minecart) && !npc.getTrait(Controllable.class).isEnabled()) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user