Skip to content

Commit

Permalink
fix: UnMorphCommand在控制台补全指令时抛出异常
Browse files Browse the repository at this point in the history
  • Loading branch information
MATRIX-feather committed Dec 8, 2024
1 parent 77dffe7 commit 95b5526
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,4 @@ private int execWithArg(CommandContext<CommandSourceStack> context)

return Command.SINGLE_SUCCESS;
}

@Override
public boolean checkPermission(CommandSourceStack cmdSourceStack)
{
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public boolean register(Commands dispatcher)
{
dispatcher.register(
Commands.literal(name())
.requires(this::checkPermission)
.then(
Commands.argument("who", StringArgumentType.greedyString())
.executes(this::executes)
Expand Down Expand Up @@ -82,12 +81,6 @@ public int executes(CommandContext<CommandSourceStack> context)
});
}

@Override
public boolean checkPermission(CommandSourceStack cmdSourceStack)
{
return true;
}

@Override
public FormattableMessage getHelpMessage()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import xyz.nifeather.morph.MorphPluginObject;
import xyz.nifeather.morph.commands.brigadier.IConvertibleBrigadier;
import xyz.nifeather.morph.messages.HelpStrings;
import xyz.nifeather.morph.misc.permissions.CommonPermissions;

public class UnMorphCommand extends MorphPluginObject implements IConvertibleBrigadier
{
Expand All @@ -25,20 +24,13 @@ public boolean register(Commands dispatcher)
{
dispatcher.register(
Commands.literal("unmorph")
.requires(this::checkPermission)
.executes(this::executes)
.build()
);

return true;
}

@Override
public boolean checkPermission(CommandSourceStack cmdSourceStack)
{
return cmdSourceStack.getExecutor().hasPermission(CommonPermissions.UNMORPH);
}

@Override
public FormattableMessage getHelpMessage()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ public String name()
return "deny";
}

@Override
public boolean checkPermission(CommandSourceStack cmdSourceStack)
{
return true;
}

@Override
public FormattableMessage getHelpMessage()
{
Expand Down

0 comments on commit 95b5526

Please sign in to comment.