25w20a
This commit is contained in:
1 parent
74e8a8d2ec
commit
52cf8c027a
11 files changed
+38
-38
No files matched your search
@@ -162,7 +162,7 @@ public abstract class CommandArgument
|
||||
(c, p) -> StringValue.of(EntityAnchorArgument.getAnchor(c, p).name()), false
|
||||
),
|
||||
new VanillaUnconfigurableArgument("entitytype", c -> ResourceArgument.resource(c, Registries.ENTITY_TYPE),
|
||||
(c, p) -> ValueConversions.of(ResourceArgument.getSummonableEntityType(c, p).key()), SuggestionProviders.SUMMONABLE_ENTITIES
|
||||
(c, p) -> ValueConversions.of(ResourceArgument.getSummonableEntityType(c, p).key()), SuggestionProviders.cast(SuggestionProviders.SUMMONABLE_ENTITIES)
|
||||
),
|
||||
new VanillaUnconfigurableArgument("floatrange", RangeArgument::floatRange,
|
||||
(c, p) -> ValueConversions.of(c.getArgument(p, MinMaxBounds.Doubles.class)), true
|
||||
@@ -205,12 +205,8 @@ public abstract class CommandArgument
|
||||
|
||||
new VanillaUnconfigurableArgument("recipe", Registries.RECIPE),
|
||||
new VanillaUnconfigurableArgument("advancement", Registries.ADVANCEMENT),
|
||||
new VanillaUnconfigurableArgument("lootcondition", ResourceLocationArgument::id,
|
||||
(c, p) -> ValueConversions.of(ResourceLocationArgument.getId(c, p)), (ctx, builder) -> SharedSuggestionProvider.suggestResource(ctx.getSource().getServer().reloadableRegistries().getKeys(Registries.LOOT_CONDITION_TYPE), builder)
|
||||
),
|
||||
new VanillaUnconfigurableArgument("loottable", ResourceLocationArgument::id,
|
||||
(c, p) -> ValueConversions.of(ResourceLocationArgument.getId(c, p)), LootCommand.SUGGEST_LOOT_TABLE
|
||||
),
|
||||
new VanillaUnconfigurableArgument("lootcondition", Registries.LOOT_CONDITION_TYPE),
|
||||
new VanillaUnconfigurableArgument("loottable", Registries.LOOT_TABLE),
|
||||
new VanillaUnconfigurableArgument("attribute", Registries.ATTRIBUTE),
|
||||
|
||||
new VanillaUnconfigurableArgument("boss", ResourceLocationArgument::id,
|
||||
@@ -233,7 +229,7 @@ public abstract class CommandArgument
|
||||
}, (ctx, builder) -> SharedSuggestionProvider.suggestResource(ctx.getSource().getServer().registryAccess().lookupOrThrow(Registries.BIOME).keySet(), builder)
|
||||
),
|
||||
new VanillaUnconfigurableArgument("sound", ResourceLocationArgument::id,
|
||||
(c, p) -> ValueConversions.of(ResourceLocationArgument.getId(c, p)), SuggestionProviders.AVAILABLE_SOUNDS
|
||||
(c, p) -> ValueConversions.of(ResourceLocationArgument.getId(c, p)), SuggestionProviders.cast(SuggestionProviders.AVAILABLE_SOUNDS)
|
||||
),
|
||||
new VanillaUnconfigurableArgument("storekey", ResourceLocationArgument::id,
|
||||
(c, p) -> ValueConversions.of(ResourceLocationArgument.getId(c, p)), (ctx, builder) -> SharedSuggestionProvider.suggestResource(ctx.getSource().getServer().getCommandStorage().keys(), builder)
|
||||
|
||||
@@ -573,7 +573,7 @@ public class EntityValue extends Value
|
||||
{
|
||||
return Value.NULL;
|
||||
}
|
||||
return ValueConversions.fromPath((ServerLevel) e.getCommandSenderWorld(), path);
|
||||
return ValueConversions.fromPath((ServerLevel) e.level(), path);
|
||||
}
|
||||
return Value.NULL;
|
||||
});
|
||||
@@ -624,7 +624,7 @@ public class EntityValue extends Value
|
||||
{
|
||||
return StringValue.of(moddedType);
|
||||
}
|
||||
MinecraftServer server = p.getCommandSenderWorld().getServer();
|
||||
MinecraftServer server = p.level().getServer();
|
||||
if (server.isDedicatedServer())
|
||||
{
|
||||
return new StringValue("multiplayer");
|
||||
@@ -829,7 +829,7 @@ public class EntityValue extends Value
|
||||
case MISS:
|
||||
return Value.NULL;
|
||||
case BLOCK:
|
||||
return new BlockValue((ServerLevel) e.getCommandSenderWorld(), ((BlockHitResult) hitres).getBlockPos());
|
||||
return new BlockValue((ServerLevel) e.level(), ((BlockHitResult) hitres).getBlockPos());
|
||||
case ENTITY:
|
||||
return new EntityValue(((EntityHitResult) hitres).getEntity());
|
||||
}
|
||||
@@ -927,7 +927,7 @@ public class EntityValue extends Value
|
||||
}
|
||||
else
|
||||
{
|
||||
((ServerLevel) e.getCommandSenderWorld()).getChunkSource().broadcastAndSend(e, ClientboundEntityPositionSyncPacket.of(e));
|
||||
((ServerLevel) e.level()).getChunkSource().broadcastAndSend(e, ClientboundEntityPositionSyncPacket.of(e));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1376,7 +1376,7 @@ public class EntityValue extends Value
|
||||
List<Value> params = lv.getItems();
|
||||
Vector3Argument blockLocator = Vector3Argument.findIn(params, 0, false, false);
|
||||
BlockPos pos = BlockPos.containing(blockLocator.vec);
|
||||
ResourceKey<Level> world = spe.getCommandSenderWorld().dimension();
|
||||
ResourceKey<Level> world = spe.level().dimension();
|
||||
float angle = spe.getYHeadRot();
|
||||
boolean forced = false;
|
||||
if (params.size() > blockLocator.offset)
|
||||
|
||||
@@ -144,7 +144,7 @@ public class ValueConversions
|
||||
{
|
||||
if (dimensionValue instanceof EntityValue)
|
||||
{
|
||||
return ((EntityValue) dimensionValue).getEntity().getCommandSenderWorld();
|
||||
return ((EntityValue) dimensionValue).getEntity().level();
|
||||
}
|
||||
else if (dimensionValue instanceof BlockValue bv)
|
||||
{
|
||||
@@ -265,7 +265,7 @@ public class ValueConversions
|
||||
}
|
||||
if (v instanceof final BlockPos pos)
|
||||
{
|
||||
return new BlockValue(null, (ServerLevel) e.getCommandSenderWorld(), pos);
|
||||
return new BlockValue(null, (ServerLevel) e.level(), pos);
|
||||
}
|
||||
if (v instanceof final Number number)
|
||||
{
|
||||
@@ -277,7 +277,7 @@ public class ValueConversions
|
||||
}
|
||||
if (v instanceof final UUID uuid)
|
||||
{
|
||||
return ofUUID((ServerLevel) e.getCommandSenderWorld(), uuid);
|
||||
return ofUUID((ServerLevel) e.level(), uuid);
|
||||
}
|
||||
if (v instanceof final DamageSource source)
|
||||
{
|
||||
@@ -288,16 +288,16 @@ public class ValueConversions
|
||||
}
|
||||
if (v instanceof final Path path)
|
||||
{
|
||||
return fromPath((ServerLevel) e.getCommandSenderWorld(), path);
|
||||
return fromPath((ServerLevel) e.level(), path);
|
||||
}
|
||||
if (v instanceof final PositionTracker tracker)
|
||||
{
|
||||
return new BlockValue(null, (ServerLevel) e.getCommandSenderWorld(), tracker.currentBlockPosition());
|
||||
return new BlockValue(null, (ServerLevel) e.level(), tracker.currentBlockPosition());
|
||||
}
|
||||
if (v instanceof final WalkTarget target)
|
||||
{
|
||||
return ListValue.of(
|
||||
new BlockValue(null, (ServerLevel) e.getCommandSenderWorld(), target.getTarget().currentBlockPosition()),
|
||||
new BlockValue(null, (ServerLevel) e.level(), target.getTarget().currentBlockPosition()),
|
||||
new NumericValue(target.getSpeedModifier()),
|
||||
new NumericValue(target.getCloseEnoughDist())
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user