Merge branch 'master' into 1.16

This commit is contained in:
gnembon committed 2020-04-01 13:22:16 -03:00
commit a4626df004
8 files changed
+31 -5

No files matched your search

+1 -1
View File
@@ -35,7 +35,7 @@ import static carpet.settings.RuleCategory.CLIENT;
@SuppressWarnings("CanBeFinal")
public class CarpetSettings
{
public static final String carpetVersion = "1.3.16+v200325";
public static final String carpetVersion = "1.3.17+v200401";
public static final Logger LOG = LogManager.getLogger();
public static boolean skipGenerationChecks = false;
public static boolean impendingFillSkipUpdates = false;
@@ -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;
}
@@ -331,6 +331,15 @@ public class EntityValue extends Value
return Value.NULL;
});
put("ping", (e, a) -> {
if (e instanceof ServerPlayerEntity)
{
ServerPlayerEntity spe = (ServerPlayerEntity) e;
return new NumericValue(spe.pingMilliseconds);
}
return Value.NULL;
});
//spectating_entity
// isGlowing
put("effect", (e, a) ->