Remove StructureArgument to work around vanilla issue, clean up custom arguments

This commit is contained in:
tterrag committed 2019-09-08 02:01:17 -04:00
1 parent 5efa373d7f
commit f777aba227
5 files changed
+33 -131

No files matched your search

@@ -0,0 +1,15 @@
package net.minecraftforge.server.command;
public class ForgeArguments
{
public static void register()
{
/*
* We can't actually add any of these, because vanilla clients will choke on unknown argument types
* So our custom arguments will not validate client-side, but they do still work
ArgumentTypes.register("forge:enum", EnumArgument.class, new EnumArgument.Serializer());
ArgumentTypes.register("forge:modid", ModIdArgument.class, new ArgumentSerializer<>(ModIdArgument::modIdArgument));
ArgumentTypes.register("forge:structure_type", StructureArgument.class, new ArgumentSerializer<>(StructureArgument::structure));
*/
}
}
@@ -19,16 +19,14 @@
package net.minecraftforge.server.command;
import com.google.gson.JsonObject;
import com.mojang.brigadier.StringReader;
import com.mojang.brigadier.arguments.ArgumentType;
import com.mojang.brigadier.context.CommandContext;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.suggestion.Suggestions;
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
import net.minecraft.command.ISuggestionProvider;
import net.minecraft.command.arguments.IArgumentSerializer;
import net.minecraft.network.PacketBuffer;
import net.minecraftforge.fml.ModContainer;
import net.minecraftforge.fml.ModList;
@@ -58,22 +56,4 @@ public class ModIdArgument implements ArgumentType<String> {
public Collection<String> getExamples() {
return EXAMPLES;
}
public static class Serialzier implements IArgumentSerializer<ModIdArgument> {
@Override
public void write(ModIdArgument argument, PacketBuffer buffer) {
}
@Override
public ModIdArgument read(PacketBuffer buffer) {
return null;
}
@Override
public void write(ModIdArgument argument, JsonObject json) {
}
}
}