22w16b with massive Component changes
This commit is contained in:
1 parent
8101abb431
commit
746c8548e9
31 files changed
+153
-162
No files matched your search
@@ -95,7 +95,7 @@ import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.core.RegistryAccess;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.server.commands.BossBarCommands;
|
||||
@@ -111,7 +111,7 @@ public abstract class CommandArgument
|
||||
{
|
||||
public static CommandSyntaxException error(String text)
|
||||
{
|
||||
return new SimpleCommandExceptionType(new TextComponent(text)).create();
|
||||
return new SimpleCommandExceptionType(Component.literal(text)).create();
|
||||
}
|
||||
|
||||
private static final List<? extends CommandArgument> baseTypes = Lists.newArrayList(
|
||||
@@ -459,7 +459,7 @@ public abstract class CommandArgument
|
||||
if (!caseSensitive) choseValue = choseValue.toLowerCase(Locale.ROOT);
|
||||
if (!validOptions.isEmpty() && !validOptions.contains(choseValue))
|
||||
{
|
||||
throw new SimpleCommandExceptionType(new TextComponent("Incorrect value for "+param+": "+choseValue+" for custom type "+suffix)).create();
|
||||
throw new SimpleCommandExceptionType(Component.literal("Incorrect value for "+param+": "+choseValue+" for custom type "+suffix)).create();
|
||||
}
|
||||
return StringValue.of(choseValue);
|
||||
}
|
||||
@@ -610,7 +610,7 @@ public abstract class CommandArgument
|
||||
if (!single) return ListValue.wrap(founds.stream().map(EntityValue::new).collect(Collectors.toList()));
|
||||
if (founds.size() == 0) return Value.NULL;
|
||||
if (founds.size() == 1) return new EntityValue(founds.iterator().next());
|
||||
throw new SimpleCommandExceptionType(new TextComponent("Multiple entities returned while only one was requested"+" for custom type "+suffix)).create();
|
||||
throw new SimpleCommandExceptionType(Component.literal("Multiple entities returned while only one was requested"+" for custom type "+suffix)).create();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -651,7 +651,7 @@ public abstract class CommandArgument
|
||||
int size = profiles.size();
|
||||
if (size == 0) return Value.NULL;
|
||||
if (size == 1) return StringValue.of(profiles.iterator().next().getName());
|
||||
throw new SimpleCommandExceptionType(new TextComponent("Multiple game profiles returned while only one was requested"+" for custom type "+suffix)).create();
|
||||
throw new SimpleCommandExceptionType(Component.literal("Multiple game profiles returned while only one was requested"+" for custom type "+suffix)).create();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -692,7 +692,7 @@ public abstract class CommandArgument
|
||||
int size = holders.size();
|
||||
if (size == 0) return Value.NULL;
|
||||
if (size == 1) return StringValue.of(holders.iterator().next());
|
||||
throw new SimpleCommandExceptionType(new TextComponent("Multiple score holders returned while only one was requested"+" for custom type "+suffix)).create();
|
||||
throw new SimpleCommandExceptionType(Component.literal("Multiple score holders returned while only one was requested"+" for custom type "+suffix)).create();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -767,7 +767,7 @@ public abstract class CommandArgument
|
||||
ResourceLocation choseValue = ResourceLocationArgument.getId(context, param);
|
||||
if (!validOptions.isEmpty() && !validOptions.contains(choseValue))
|
||||
{
|
||||
throw new SimpleCommandExceptionType(new TextComponent("Incorrect value for "+param+": "+choseValue+" for custom type "+suffix)).create();
|
||||
throw new SimpleCommandExceptionType(Component.literal("Incorrect value for "+param+": "+choseValue+" for custom type "+suffix)).create();
|
||||
}
|
||||
return ValueConversions.of(choseValue);
|
||||
}
|
||||
@@ -957,7 +957,7 @@ public abstract class CommandArgument
|
||||
int slot = net.minecraft.commands.arguments.SlotArgument.getSlot(context, param);
|
||||
if (restrict != null && !RESTRICTED_CONTAINERS.get(restrict).numericalIds().contains(slot))
|
||||
{
|
||||
throw new SimpleCommandExceptionType(new TextComponent("Incorrect slot restricted to "+restrict+" for custom type "+suffix)).create();
|
||||
throw new SimpleCommandExceptionType(Component.literal("Incorrect slot restricted to "+restrict+" for custom type "+suffix)).create();
|
||||
}
|
||||
return ValueConversions.ofVanillaSlotResult(slot);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user