Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Commit

Permalink
Bugs fixed and new check added.
Browse files Browse the repository at this point in the history
- Console error with /stick command fixed
- Some corrected messages
- Added check so that the plugin only works with the stick that has the corresponding name.
  • Loading branch information
dnlblasco committed Dec 2, 2021
1 parent aefb3a9 commit b7a69a6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Expand Up @@ -39,7 +39,7 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String
target.sendMessage(ChatColor.translateAlternateColorCodes('&', main.getLanguages().getString("messages.stick_obtained")));
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', main.getLanguages().getString("messages.stick_delivered").replace("{player}", target.getName())));
} else {
sender.sendMessage("jugador offline");
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', main.getLanguages().getString("messages.offline_player")));
}
}
} else {
Expand Down Expand Up @@ -71,11 +71,11 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String
target.sendMessage(ChatColor.translateAlternateColorCodes('&', main.getLanguages().getString("messages.stick_obtained")));
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', main.getLanguages().getString("messages.stick_delivered").replace("{player}", target.getName())));
} else {
sender.sendMessage("jugador offline");
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', main.getLanguages().getString("messages.offline_player")));
}
}
} else {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', main.getLanguages().getString("console.other.use_feed_command")));
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', main.getLanguages().getString("messages.correct_use").replace("{correct_use}", "/stick [PLAYER]")));
}
}
return true;
Expand Down
Expand Up @@ -21,7 +21,8 @@ public OnPlayerInteract(Main main) {
@EventHandler
public void OnPlayerInteract(PlayerInteractEvent event) {
if (event.getPlayer().getGameMode() == GameMode.SURVIVAL &&
event.getPlayer().getItemInHand().getType() == Material.STICK) {
event.getPlayer().getInventory().getItemInMainHand().equals(Material.STICK) &&
event.getPlayer().getInventory().getItemInMainHand().getItemMeta().getDisplayName().equals(main.getLanguages().getString("items.stick_name"))) {
if (event.getAction() == Action.LEFT_CLICK_BLOCK) {
main.pos1.put(event.getPlayer().getName(), event.getClickedBlock().getLocation());
event.setCancelled(true);
Expand Down
2 changes: 1 addition & 1 deletion src/plugin.yml
@@ -1,5 +1,5 @@
name: SurvivalWorldEdit
version: 1.0.1
version: 1.0.2
main: org.jachi.whirss.survivalworldedit.Main
author: Whirss
api-version: 1.17
Expand Down

0 comments on commit b7a69a6

Please sign in to comment.