merge upstream 26.2
This commit is contained in:
264 files changed
+4991
-4042
No files matched your search
@@ -15,6 +15,8 @@ import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.EntitySpawnReason;
|
||||
import net.minecraft.world.entity.EntitySpawnRequest;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.Mob;
|
||||
|
||||
@@ -39,11 +41,11 @@ public class PerimeterInfoCommand
|
||||
BlockPosArgument.getSpawnablePos(c, "center position"),
|
||||
null)).
|
||||
then(argument("mob", resource(commandBuildContext, Registries.ENTITY_TYPE)).
|
||||
suggests(SuggestionProviders.SUMMONABLE_ENTITIES).
|
||||
suggests(SuggestionProviders.cast(SuggestionProviders.SUMMONABLE_ENTITIES)).
|
||||
executes( (c) -> perimeterDiagnose(
|
||||
c.getSource(),
|
||||
BlockPosArgument.getSpawnablePos(c, "center position"),
|
||||
getSummonableEntityType(c, "mob").key().location().toString()
|
||||
getSummonableEntityType(c, "mob").key().identifier().toString()
|
||||
))));
|
||||
dispatcher.register(command);
|
||||
}
|
||||
@@ -55,8 +57,8 @@ public class PerimeterInfoCommand
|
||||
if (mobId != null)
|
||||
{
|
||||
nbttagcompound.putString("id", mobId);
|
||||
Entity baseEntity = EntityType.loadEntityRecursive(nbttagcompound, source.getLevel(), (entity_1x) -> {
|
||||
entity_1x.moveTo(new BlockPos(pos.getX(), source.getLevel().getMinBuildHeight()-10, pos.getZ()), entity_1x.getYRot(), entity_1x. getXRot());
|
||||
Entity baseEntity = EntityType.loadEntityRecursive(nbttagcompound, source.getLevel(), new EntitySpawnRequest(EntitySpawnReason.COMMAND, true), (entity_1x) -> {
|
||||
entity_1x.snapTo(new BlockPos(pos.getX(), source.getLevel().getMinY()-10, pos.getZ()), entity_1x.getYRot(), entity_1x. getXRot());
|
||||
return !source.getLevel().addWithUUID(entity_1x) ? null : entity_1x;
|
||||
});
|
||||
if (!(baseEntity instanceof Mob))
|
||||
|
||||
Reference in new issue
Block a user