Merge branch 'master' into 1.16
This commit is contained in:
commit
a4626df004
8 files changed
+31
-5
No files matched your search
@@ -7,6 +7,7 @@ import carpet.utils.PerimeterDiagnostics;
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import net.minecraft.command.suggestion.SuggestionProviders;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.mob.MobEntity;
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
@@ -51,15 +52,17 @@ public class PerimeterInfoCommand
|
||||
if (mobId != null)
|
||||
{
|
||||
nbttagcompound.putString("id", mobId);
|
||||
entityliving = (MobEntity) EntityType.loadEntityWithPassengers(nbttagcompound, source.getWorld(), (entity_1x) -> {
|
||||
Entity baseEntity = EntityType.loadEntityWithPassengers(nbttagcompound, source.getWorld(), (entity_1x) -> {
|
||||
entity_1x.refreshPositionAndAngles(pos.offset(Direction.UP,2), entity_1x.yaw, entity_1x.pitch);
|
||||
return !source.getWorld().tryLoadEntity(entity_1x) ? null : entity_1x;
|
||||
});
|
||||
if (entityliving == null)
|
||||
if (!(baseEntity instanceof MobEntity))
|
||||
{
|
||||
Messenger.m(source, "r Failed to spawn test entity");
|
||||
if (baseEntity != null) baseEntity.remove();
|
||||
return 0;
|
||||
}
|
||||
entityliving = (MobEntity) baseEntity;
|
||||
}
|
||||
PerimeterDiagnostics.Result res = PerimeterDiagnostics.countSpots(source.getWorld(), pos, entityliving);
|
||||
|
||||
|
||||
@@ -246,12 +246,18 @@ public class PlayerCommand
|
||||
}
|
||||
catch (CommandSyntaxException ignored) {}
|
||||
String playerName = StringArgumentType.getString(context, "player");
|
||||
if (playerName.length()>40)
|
||||
{
|
||||
Messenger.m(context.getSource(), "rb Player name: "+playerName+" is too long");
|
||||
return 0;
|
||||
}
|
||||
MinecraftServer server = source.getMinecraftServer();
|
||||
PlayerEntity player = EntityPlayerMPFake.createFake(playerName, server, pos.x, pos.y, pos.z, facing.y, facing.x, dim, mode);
|
||||
if (player == null)
|
||||
{
|
||||
Messenger.m(context.getSource(), "rb Player " + StringArgumentType.getString(context, "player") + " doesn't exist " +
|
||||
"and cannot spawn in online mode. Turn the server offline to spawn non-existing players");
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user