mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-02-03 22:12:18 +01:00
Properly protect chest_boats as vehicles
This commit is contained in:
parent
6efdb1089e
commit
0d2ed8205f
@ -101,8 +101,20 @@ public static boolean isRiddenOnUse(Entity entity) {
|
||||
* @return true if the type is a vehicle type
|
||||
*/
|
||||
public static boolean isVehicle(EntityType type) {
|
||||
return type == EntityType.BOAT
|
||||
|| isMinecart(type);
|
||||
return isBoat(type) || isMinecart(type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test whether the given entity type is a Boat type.
|
||||
*
|
||||
* @param type the type
|
||||
* @return true if the type is a Boat type
|
||||
*/
|
||||
public static boolean isBoat(EntityType type) {
|
||||
return switch(type) {
|
||||
case BOAT, CHEST_BOAT -> true;
|
||||
default -> false;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
@ -112,13 +124,11 @@ public static boolean isVehicle(EntityType type) {
|
||||
* @return true if the type is a Minecart type
|
||||
*/
|
||||
public static boolean isMinecart(EntityType type) {
|
||||
return type == EntityType.MINECART
|
||||
|| type == EntityType.MINECART_CHEST
|
||||
|| type == EntityType.MINECART_COMMAND
|
||||
|| type == EntityType.MINECART_FURNACE
|
||||
|| type == EntityType.MINECART_HOPPER
|
||||
|| type == EntityType.MINECART_MOB_SPAWNER
|
||||
|| type == EntityType.MINECART_TNT;
|
||||
return switch(type) {
|
||||
case MINECART, MINECART_CHEST, MINECART_COMMAND, MINECART_FURNACE,
|
||||
MINECART_HOPPER, MINECART_MOB_SPAWNER, MINECART_TNT -> true;
|
||||
default -> false;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user