fixed messages
This commit is contained in:
1 parent
5ca22d94e2
commit
7737631774
2 files changed
+7
-5
No files matched your search
@@ -155,12 +155,12 @@ public class SpawnCommand
|
||||
|
||||
private static int recentSpawnsForType(ServerCommandSource source, String mob_type)
|
||||
{
|
||||
if (!Arrays.asList(Arrays.stream(EntityCategory.values()).map(Enum::toString)).contains(mob_type))
|
||||
if (!Arrays.stream(EntityCategory.values()).map(EntityCategory::getName).collect(Collectors.toSet()).contains(mob_type))
|
||||
{
|
||||
Messenger.m(source, "r Wrong mob type: "+mob_type+" should be "+String.join(", ",Arrays.stream(EntityCategory.values()).map(Enum::toString).collect(Collectors.toSet())) );
|
||||
Messenger.m(source, "r Wrong mob type: "+mob_type+" should be "+ Arrays.stream(EntityCategory.values()).map(EntityCategory::getName).collect(Collectors.joining(", ")));
|
||||
return 0;
|
||||
}
|
||||
//Messenger.send(source, SpawnReporter.recent_spawns(source.getWorld(), mob_type));
|
||||
Messenger.send(source, SpawnReporter.recent_spawns(source.getWorld(), EntityCategory.valueOf(mob_type.toUpperCase())));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -159,7 +159,9 @@ public class SpawnReporter
|
||||
lst.add(Messenger.s(String.format("Recent %s spawns:",type_code)));
|
||||
for (Pair<EntityType, BlockPos> pair : spawned_mobs.get(Pair.of(world.getDimension().getType(),creature_type)).keySet())
|
||||
{
|
||||
lst.add( Messenger.c(String.format("w - %s ",pair.getLeft()), Messenger.tp("wb",pair.getRight())));
|
||||
lst.add( Messenger.c(
|
||||
String.format("w - %s ", Registry.ENTITY_TYPE.getId(pair.getLeft()).toString().replaceFirst("minecraft.","")),
|
||||
Messenger.tp("wb",pair.getRight())));
|
||||
}
|
||||
|
||||
if (lst.size()==1)
|
||||
@@ -272,7 +274,7 @@ public class SpawnReporter
|
||||
if (!(entity instanceof MobEntity) || !((MobEntity)entity).isPersistent())
|
||||
{
|
||||
lst.add(Messenger.c("w - ",
|
||||
Messenger.tp("w", entity.x, entity.y, entity.z),"w : "+EntityType.getId(entity.getType())));
|
||||
Messenger.tp("w", entity.x, entity.y, entity.z),"w : "+EntityType.getId(entity.getType()).toString().replaceFirst("minecraft.","")));
|
||||
}
|
||||
}
|
||||
if (lst.size()==1)
|
||||
|
||||
Reference in new issue
Block a user