Skip to content

Commit

Permalink
Merge branch 'main' into bugfix/2140
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMeinerLP authored May 12, 2023
2 parents 6aa0086 + c57fee5 commit 16c78b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,15 @@ public class WorldEditPlugin extends JavaPlugin {
private BukkitServerInterface platform;
private BukkitConfiguration config;
private BukkitPermissionAttachmentManager permissionAttachmentManager;
// Fawe start
private BukkitCommandSender bukkitConsoleCommandSender;
// Fawe end

@Override
public void onLoad() {

//FAWE start
this.bukkitConsoleCommandSender = new BukkitCommandSender(this, Bukkit.getConsoleSender());
// This is already covered by Spigot, however, a more pesky warning with a proper explanation over "Ambiguous plugin name..." can't hurt.
Plugin[] plugins = Bukkit.getServer().getPluginManager().getPlugins();
for (Plugin p : plugins) {
Expand Down Expand Up @@ -594,7 +598,7 @@ public Actor wrapCommandSender(CommandSender sender) {
return new BukkitBlockCommandSender(this, (BlockCommandSender) sender);
}

return new BukkitCommandSender(this, sender);
return bukkitConsoleCommandSender;
}

public BukkitServerInterface getInternalPlatform() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void beforeCall(Method method, CommandParameters parameters) {
}
Optional<Actor> actorOpt = parameters.injectedValue(Key.of(Actor.class));

if (!actorOpt.isPresent()) {
if (actorOpt.isEmpty()) {
return;
}
Actor actor = actorOpt.get();
Expand Down

0 comments on commit 16c78b6

Please sign in to comment.