mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 02:04:44 +02:00
Add more entity categories
This commit is contained in:
@ -37,6 +37,7 @@ import com.github.intellectualsites.plotsquared.plot.util.entity.EntityCategorie
|
||||
import com.github.intellectualsites.plotsquared.plot.util.entity.EntityCategory;
|
||||
import com.sk89q.worldedit.world.entity.EntityType;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.Map;
|
||||
|
||||
@CommandDeclaration(command = "debug",
|
||||
@ -74,6 +75,15 @@ public class Debug extends SubCommand {
|
||||
}
|
||||
player.sendMessage(Captions.PREFIX.getTranslated() + builder.toString());
|
||||
});
|
||||
EntityType.REGISTRY.values().stream()
|
||||
.sorted(Comparator.comparing(EntityType::getId))
|
||||
.forEach(entityType -> {
|
||||
long categoryCount = EntityCategory.REGISTRY.values()
|
||||
.stream()
|
||||
.filter(category -> category.contains(entityType))
|
||||
.count();
|
||||
player.sendMessage(Captions.PREFIX.getTranslated() + entityType.getName() + " is in " + categoryCount + " categories");
|
||||
});
|
||||
return true;
|
||||
}
|
||||
if ((args.length > 0) && args[0].equalsIgnoreCase("msg")) {
|
||||
|
@ -35,6 +35,9 @@ public class EntityCategories {
|
||||
public static final EntityCategory VEHICLE = register("vehicle");
|
||||
public static final EntityCategory HOSTILE = register("hostile");
|
||||
public static final EntityCategory HANGING = register("hanging");
|
||||
public static final EntityCategory VILLAGER = register("villager");
|
||||
public static final EntityCategory PROJECTILE = register("projectile");
|
||||
public static final EntityCategory DECORATION = register("decoration");
|
||||
|
||||
public static EntityCategory register(final String id) {
|
||||
final EntityCategory entityCategory = new EntityCategory(id);
|
||||
|
Reference in New Issue
Block a user