Skip to content

Commit

Permalink
Version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
samolego committed Jan 2, 2022
1 parent aa9cf4f commit d7cc47a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ public static void registerNode(LiteralCommandNode<CommandSourceStack> 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();
Expand All @@ -66,14 +69,6 @@ public static void registerNode(LiteralCommandNode<CommandSourceStack> editNode)
editNode.addChild(lookNode);
}

private static int setAllowFlight(CommandContext<CommandSourceStack> 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<CommandSourceStack> context, String movement) throws CommandSyntaxException {
CommandSourceStack source = context.getSource();
return NpcCommand.selectedTaterzenExecutor(source.getEntityOrException(), taterzen -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -110,7 +110,7 @@ private static int editNameVisibility(CommandContext<CommandSourceStack> context
});
}

private static int setTag(CommandContext<CommandSourceStack> context, String flagName, boolean flagValue, Consumer<TaterzenNPC> flag) throws CommandSyntaxException {
public static int setTag(CommandContext<CommandSourceStack> context, String flagName, boolean flagValue, Consumer<TaterzenNPC> flag) throws CommandSyntaxException {
CommandSourceStack source = context.getSource();
return NpcCommand.selectedTaterzenExecutor(source.getEntityOrException(), taterzen -> {
flag.accept(taterzen);
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit d7cc47a

Please sign in to comment.