mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-01-08 01:17:49 +01:00
Only check ride flag for pigs with saddles.
This commit is contained in:
parent
fe4f0cfc49
commit
ff7209a58b
@ -32,6 +32,7 @@
|
|||||||
import org.bukkit.entity.Minecart;
|
import org.bukkit.entity.Minecart;
|
||||||
import org.bukkit.entity.Monster;
|
import org.bukkit.entity.Monster;
|
||||||
import org.bukkit.entity.NPC;
|
import org.bukkit.entity.NPC;
|
||||||
|
import org.bukkit.entity.Pig;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.Projectile;
|
import org.bukkit.entity.Projectile;
|
||||||
import org.bukkit.entity.Shulker;
|
import org.bukkit.entity.Shulker;
|
||||||
@ -41,7 +42,6 @@
|
|||||||
import org.bukkit.entity.Tameable;
|
import org.bukkit.entity.Tameable;
|
||||||
import org.bukkit.entity.TippedArrow;
|
import org.bukkit.entity.TippedArrow;
|
||||||
import org.bukkit.entity.Vehicle;
|
import org.bukkit.entity.Vehicle;
|
||||||
import org.bukkit.entity.WaterMob;
|
|
||||||
import org.bukkit.entity.minecart.ExplosiveMinecart;
|
import org.bukkit.entity.minecart.ExplosiveMinecart;
|
||||||
import org.bukkit.inventory.InventoryHolder;
|
import org.bukkit.inventory.InventoryHolder;
|
||||||
import org.bukkit.projectiles.ProjectileSource;
|
import org.bukkit.projectiles.ProjectileSource;
|
||||||
@ -91,7 +91,7 @@ public static boolean isFireball(EntityType type) {
|
|||||||
* @return true if the entity can be ridden
|
* @return true if the entity can be ridden
|
||||||
*/
|
*/
|
||||||
public static boolean isRiddenOnUse(Entity entity) {
|
public static boolean isRiddenOnUse(Entity entity) {
|
||||||
return entity instanceof Vehicle;
|
return entity instanceof Pig ? ((Pig) entity).hasSaddle() : entity instanceof Vehicle;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -163,8 +163,7 @@ public static boolean isHostile(Entity entity) {
|
|||||||
* @return true if non-hostile
|
* @return true if non-hostile
|
||||||
*/
|
*/
|
||||||
public static boolean isNonHostile(Entity entity) {
|
public static boolean isNonHostile(Entity entity) {
|
||||||
return !isHostile(entity)
|
return !isHostile(entity) && entity instanceof Creature;
|
||||||
&& (entity instanceof Creature || entity instanceof WaterMob);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user