Skip to content

Commit

Permalink
Update incorrect usage
Browse files Browse the repository at this point in the history
  • Loading branch information
iiAhmedYT committed Sep 23, 2024
1 parent ccc5011 commit 7e17b0f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/Imperat/Context Resolver.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public final class GuildContextResolver implements BukkitContextResolver<Guild>
@NotNull Context<BukkitSource> 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 !");
}
Expand Down
6 changes: 3 additions & 3 deletions docs/Imperat/Throwables.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -29,7 +29,7 @@ public final class ExampleCustomException extends SelfHandledException {

@Override
public <S extends Source> void handle(Imperat<S> imperat, Context<S> context) {
var source = context.getSource();
var source = context.source();
source.reply("<red>" + message);
}
}
Expand All @@ -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!")
);
```

Expand Down
2 changes: 1 addition & 1 deletion docs/Imperat/Value Resolver.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public final class GroupValueResolver implements BukkitValueResolver<Group> {
String raw
) throws ImperatException {

var sender = context.getSource();
var sender = context.source();
if (sender.isConsole()) {
throw new SourceException("Only players can do this !");
}
Expand Down

0 comments on commit 7e17b0f

Please sign in to comment.