Skip to content

Commit

Permalink
! Blind Push ! Just fixes dumb mistakes made by tired me.
Browse files Browse the repository at this point in the history
  • Loading branch information
LegendEffects committed Mar 1, 2021
1 parent 494feea commit 86b1cd0
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,24 @@ public boolean onCommand(CommandSender sender, Command command, String label, St

if(args[0].length() == 36) {
Player target = Bukkit.getPlayer(UUID.fromString(args[0]));
if(target == null) {
sender.sendMessage(OpenAFK.parse(plugin.getConfig().getString("messages.isAfk.unknown")));
return true;
}

if(plugin.isAfkPlayer(target)) {
sender.sendMessage(OpenAFK.parse(target, plugin.getConfig().getString("messages.isAfk.afk")));
} else {
sender.sendMessage(OpenAFK.parse(target, plugin.getConfig().getString("messages.isAfk.notAfk")));
}
return true;
return sendIsAFKResponse(sender, target);
}

Player target = Bukkit.getPlayer(args[0]);
return sendIsAFKResponse(sender, target);
}

private boolean sendIsAFKResponse(CommandSender sender, Player target) {
if(target == null) {
sender.sendMessage(OpenAFK.parse(plugin.getConfig().getString("messages.isAfk.unknown")));
return true;
}

if(plugin.isAfkPlayer(target)) {
sender.sendMessage(OpenAFK.parse(target, plugin.getConfig().getString("messages.isAfk.afk")));
} else {
sender.sendMessage(OpenAFK.parse(target, plugin.getConfig().getString("messages.isAfk.notAfk")));
}

return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public FishingDetection(OpenAFK plugin) {
this.plugin = plugin;
}

private Set<Player> playersFishing = new HashSet<>();
private HashMap<Player, Integer> violationLevel = new HashMap<>();
private final Set<Player> playersFishing = new HashSet<>();
private final HashMap<Player, Integer> violationLevel = new HashMap<>();

@EventHandler
public void fishEvent(PlayerFishEvent event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public OnBlockPlace(OpenAFK plugin) {
}

@EventHandler
public void onBlockBreak(BlockPlaceEvent event) {
public void onBlockPlace(BlockPlaceEvent event) {
if(!plugin.getConfig().getBoolean("detection.events.blockPlaceEvent")) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public OnChat(OpenAFK plugin) {
}

@EventHandler
public void onBlockBreak(AsyncPlayerChatEvent event) {
public void onChat(AsyncPlayerChatEvent event) {
if(!plugin.getConfig().getBoolean("detection.events.chatEvent")) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public PlayerConnect(OpenAFK plugin) {
}

@EventHandler
public void handler(PlayerJoinEvent event) {
public void onPlayerConnect(PlayerJoinEvent event) {
Player player = event.getPlayer();
DataHandler data = plugin.getPlayerData();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public PlayerDisconnect(OpenAFK openAFK) {
}

@EventHandler
public void Handler(PlayerQuitEvent event) {
public void onPlayerDisconnect(PlayerQuitEvent event) {
if(this.openAFK.isAfkPlayer(event.getPlayer())) {
openAFK.getActionParser().parse(event.getPlayer(), ActionType.OTHER, "onAfkDisconnect");
}
Expand Down

0 comments on commit 86b1cd0

Please sign in to comment.