Add '/paper mobcaps' and '/paper playermobcaps'

Add commands to get the mobcaps for a world, as well as the mobcaps for
each player when per-player mob spawning is enabled.

Also has a hover text on each mob category listing what entity types are
in said category
This commit is contained in:
Jason Penilla
2021-08-16 01:31:54 -05:00
parent c593e8510e
commit b67ec825d2
6 changed files with 289 additions and 10 deletions

View File

@@ -0,0 +1,22 @@
package io.papermc.paper.command.subcommands;
import java.util.HashSet;
import java.util.Set;
import net.minecraft.world.entity.MobCategory;
import org.bukkit.support.environment.Normal;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
@Normal
public class MobcapsCommandTest {
@Test
public void testMobCategoryColors() {
final Set<String> missing = new HashSet<>();
for (final MobCategory value : MobCategory.values()) {
if (!MobcapsCommand.MOB_CATEGORY_COLORS.containsKey(value)) {
missing.add(value.getName());
}
}
Assertions.assertTrue(missing.isEmpty(), "MobcapsCommand.MOB_CATEGORY_COLORS map missing TextColors for [" + String.join(", ", missing + "]"));
}
}