diff --git a/common/src/main/java/org/samo_lego/taterzens/commands/edit/MovementCommand.java b/common/src/main/java/org/samo_lego/taterzens/commands/edit/MovementCommand.java index ea37d30b2..abbcf445d 100644 --- a/common/src/main/java/org/samo_lego/taterzens/commands/edit/MovementCommand.java +++ b/common/src/main/java/org/samo_lego/taterzens/commands/edit/MovementCommand.java @@ -51,7 +51,10 @@ public static void registerNode(LiteralCommandNode editNode) ) .then(literal("allowFlight") .then(argument("allowFlight", BoolArgumentType.bool()) - .executes(MovementCommand::setAllowFlight) + .executes(context -> { + boolean allowFlight = BoolArgumentType.getBool(context, "allowFlight"); + return TagsCommand.setTag(context, "allowFlight", allowFlight, npc -> npc.setAllowFlight(allowFlight)); + }) ) ) .build(); @@ -66,14 +69,6 @@ public static void registerNode(LiteralCommandNode editNode) editNode.addChild(lookNode); } - private static int setAllowFlight(CommandContext context) throws CommandSyntaxException { - CommandSourceStack source = context.getSource(); - boolean allowFlight = BoolArgumentType.getBool(context, "allowFlight"); - return NpcCommand.selectedTaterzenExecutor(source.getEntityOrException(), taterzen -> { - taterzen.setAllowFlight(allowFlight); - }); - } - private static int changeMovement(CommandContext context, String movement) throws CommandSyntaxException { CommandSourceStack source = context.getSource(); return NpcCommand.selectedTaterzenExecutor(source.getEntityOrException(), taterzen -> { diff --git a/common/src/main/java/org/samo_lego/taterzens/commands/edit/TagsCommand.java b/common/src/main/java/org/samo_lego/taterzens/commands/edit/TagsCommand.java index 9933e77c6..dfb81cff1 100644 --- a/common/src/main/java/org/samo_lego/taterzens/commands/edit/TagsCommand.java +++ b/common/src/main/java/org/samo_lego/taterzens/commands/edit/TagsCommand.java @@ -4,14 +4,14 @@ import com.mojang.brigadier.context.CommandContext; import com.mojang.brigadier.exceptions.CommandSyntaxException; import com.mojang.brigadier.tree.LiteralCommandNode; -import org.samo_lego.taterzens.commands.NpcCommand; -import org.samo_lego.taterzens.npc.TaterzenNPC; - -import java.util.function.Consumer; import net.minecraft.ChatFormatting; import net.minecraft.commands.CommandSourceStack; import net.minecraft.network.chat.TextComponent; import net.minecraft.world.entity.Pose; +import org.samo_lego.taterzens.commands.NpcCommand; +import org.samo_lego.taterzens.npc.TaterzenNPC; + +import java.util.function.Consumer; import static net.minecraft.commands.Commands.argument; import static net.minecraft.commands.Commands.literal; @@ -110,7 +110,7 @@ private static int editNameVisibility(CommandContext context }); } - private static int setTag(CommandContext context, String flagName, boolean flagValue, Consumer flag) throws CommandSyntaxException { + public static int setTag(CommandContext context, String flagName, boolean flagValue, Consumer flag) throws CommandSyntaxException { CommandSourceStack source = context.getSource(); return NpcCommand.selectedTaterzenExecutor(source.getEntityOrException(), taterzen -> { flag.accept(taterzen); diff --git a/gradle.properties b/gradle.properties index 611b871d6..42e2221dd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,7 +13,7 @@ fabric_version=0.44.0+1.18 forge_version=39.0.5 # Mod Properties -mod_version = 1.6.5 +mod_version = 1.7.0 maven_group = org.samo_lego archives_base_name = taterzens