From 7e17b0f96ccc155accec575cd71d647abc0423d3 Mon Sep 17 00:00:00 2001 From: iiAhmedYT <61851106+iiAhmedYT@users.noreply.github.com> Date: Mon, 23 Sep 2024 19:53:51 +0300 Subject: [PATCH] Update incorrect usage --- docs/Imperat/Context Resolver.md | 2 +- docs/Imperat/Throwables.md | 6 +++--- docs/Imperat/Value Resolver.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/Imperat/Context Resolver.md b/docs/Imperat/Context Resolver.md index 0ccc941..5dc6c76 100644 --- a/docs/Imperat/Context Resolver.md +++ b/docs/Imperat/Context Resolver.md @@ -39,7 +39,7 @@ public final class GuildContextResolver implements BukkitContextResolver @NotNull Context context, @Nullable ParameterElement parameter ) throws ImperatException { - var source = context.getSource(); + var source = context.source(); if (source.isConsole()) { throw new SourceException("Only a player can do this !"); } diff --git a/docs/Imperat/Throwables.md b/docs/Imperat/Throwables.md index 662deb1..04d7613 100644 --- a/docs/Imperat/Throwables.md +++ b/docs/Imperat/Throwables.md @@ -3,7 +3,7 @@ title: Throwable Handlers sidebar_position: 4 --- # ThrowableHandler - +~ The `ThrowableHandler` is a core component in the Imperat framework, designed to manage exceptions that occur during command execution. It handles two types of exceptions: @@ -29,7 +29,7 @@ public final class ExampleCustomException extends SelfHandledException { @Override public void handle(Imperat imperat, Context context) { - var source = context.getSource(); + var source = context.source(); source.reply("" + message); } } @@ -54,7 +54,7 @@ To register a `ThrowableResolver` for a non-SelfHandled exception, use the `setT ```java imperat.setThrowableResolver( PermissionDeniedException.class, - (exception, imperat, context) -> context.getSource().error("You don't have permission to use this command!") + (exception, imperat, context) -> context.source().error("You don't have permission to use this command!") ); ``` diff --git a/docs/Imperat/Value Resolver.md b/docs/Imperat/Value Resolver.md index a261dfe..9e05d92 100644 --- a/docs/Imperat/Value Resolver.md +++ b/docs/Imperat/Value Resolver.md @@ -32,7 +32,7 @@ public final class GroupValueResolver implements BukkitValueResolver { String raw ) throws ImperatException { - var sender = context.getSource(); + var sender = context.source(); if (sender.isConsole()) { throw new SourceException("Only players can do this !"); }