mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Finalize entity type categorisation
This commit is contained in:
parent
6e536f81ac
commit
658f2a3fc3
@ -60,14 +60,23 @@ import org.bukkit.block.data.Directional;
|
|||||||
import org.bukkit.block.data.type.WallSign;
|
import org.bukkit.block.data.type.WallSign;
|
||||||
import org.bukkit.entity.Ambient;
|
import org.bukkit.entity.Ambient;
|
||||||
import org.bukkit.entity.Animals;
|
import org.bukkit.entity.Animals;
|
||||||
|
import org.bukkit.entity.AreaEffectCloud;
|
||||||
import org.bukkit.entity.ArmorStand;
|
import org.bukkit.entity.ArmorStand;
|
||||||
import org.bukkit.entity.Boss;
|
import org.bukkit.entity.Boss;
|
||||||
import org.bukkit.entity.EnderCrystal;
|
import org.bukkit.entity.EnderCrystal;
|
||||||
|
import org.bukkit.entity.EnderSignal;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.EvokerFangs;
|
||||||
|
import org.bukkit.entity.ExperienceOrb;
|
||||||
|
import org.bukkit.entity.Explosive;
|
||||||
|
import org.bukkit.entity.FallingBlock;
|
||||||
|
import org.bukkit.entity.Firework;
|
||||||
import org.bukkit.entity.Ghast;
|
import org.bukkit.entity.Ghast;
|
||||||
import org.bukkit.entity.Golem;
|
import org.bukkit.entity.Golem;
|
||||||
import org.bukkit.entity.Hanging;
|
import org.bukkit.entity.Hanging;
|
||||||
|
import org.bukkit.entity.Item;
|
||||||
|
import org.bukkit.entity.LightningStrike;
|
||||||
import org.bukkit.entity.Monster;
|
import org.bukkit.entity.Monster;
|
||||||
import org.bukkit.entity.NPC;
|
import org.bukkit.entity.NPC;
|
||||||
import org.bukkit.entity.Phantom;
|
import org.bukkit.entity.Phantom;
|
||||||
@ -594,8 +603,20 @@ public class BukkitUtil extends WorldUtil {
|
|||||||
case "projectile": {
|
case "projectile": {
|
||||||
allowedInterfaces.add(Projectile.class);
|
allowedInterfaces.add(Projectile.class);
|
||||||
} break;
|
} break;
|
||||||
case "decoration": {
|
case "other": {
|
||||||
allowedInterfaces.add(ArmorStand.class);
|
allowedInterfaces.add(ArmorStand.class);
|
||||||
|
allowedInterfaces.add(FallingBlock.class);
|
||||||
|
allowedInterfaces.add(Item.class);
|
||||||
|
allowedInterfaces.add(Explosive.class);
|
||||||
|
allowedInterfaces.add(AreaEffectCloud.class);
|
||||||
|
allowedInterfaces.add(EvokerFangs.class);
|
||||||
|
allowedInterfaces.add(LightningStrike.class);
|
||||||
|
allowedInterfaces.add(ExperienceOrb.class);
|
||||||
|
allowedInterfaces.add(EnderSignal.class);
|
||||||
|
allowedInterfaces.add(Firework.class);
|
||||||
|
} break;
|
||||||
|
case "player": {
|
||||||
|
allowedInterfaces.add(Player.class);
|
||||||
} break;
|
} break;
|
||||||
default: {
|
default: {
|
||||||
PlotSquared.log(Captions.PREFIX + "Unknown entity category requested: " + category);
|
PlotSquared.log(Captions.PREFIX + "Unknown entity category requested: " + category);
|
||||||
|
@ -82,6 +82,9 @@ public class Debug extends SubCommand {
|
|||||||
.stream()
|
.stream()
|
||||||
.filter(category -> category.contains(entityType))
|
.filter(category -> category.contains(entityType))
|
||||||
.count();
|
.count();
|
||||||
|
if (categoryCount > 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
player.sendMessage(Captions.PREFIX.getTranslated() + entityType.getName() + " is in " + categoryCount + " categories");
|
player.sendMessage(Captions.PREFIX.getTranslated() + entityType.getName() + " is in " + categoryCount + " categories");
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
|
@ -30,14 +30,15 @@ package com.github.intellectualsites.plotsquared.plot.util.entity;
|
|||||||
*/
|
*/
|
||||||
public class EntityCategories {
|
public class EntityCategories {
|
||||||
|
|
||||||
public static final EntityCategory ANIMAL = register("animal");
|
public static final EntityCategory ANIMAL = register("animal");
|
||||||
public static final EntityCategory TAMEABLE = register("tameable");
|
public static final EntityCategory TAMEABLE = register("tameable");
|
||||||
public static final EntityCategory VEHICLE = register("vehicle");
|
public static final EntityCategory VEHICLE = register("vehicle");
|
||||||
public static final EntityCategory HOSTILE = register("hostile");
|
public static final EntityCategory HOSTILE = register("hostile");
|
||||||
public static final EntityCategory HANGING = register("hanging");
|
public static final EntityCategory HANGING = register("hanging");
|
||||||
public static final EntityCategory VILLAGER = register("villager");
|
public static final EntityCategory VILLAGER = register("villager");
|
||||||
public static final EntityCategory PROJECTILE = register("projectile");
|
public static final EntityCategory PROJECTILE = register("projectile");
|
||||||
public static final EntityCategory DECORATION = register("decoration");
|
public static final EntityCategory OTHER = register("other");
|
||||||
|
public static final EntityCategory PLAYER = register("player");
|
||||||
|
|
||||||
public static EntityCategory register(final String id) {
|
public static EntityCategory register(final String id) {
|
||||||
final EntityCategory entityCategory = new EntityCategory(id);
|
final EntityCategory entityCategory = new EntityCategory(id);
|
||||||
|
Loading…
Reference in New Issue
Block a user