-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e329711
commit 02d2ac3
Showing
4 changed files
with
79 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/main/java/me/lorenzo0111/debugeconomy/command/DebugEconomyCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package me.lorenzo0111.debugeconomy.command; | ||
|
||
import me.lorenzo0111.debugeconomy.DebugEconomy; | ||
import org.bukkit.ChatColor; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.command.TabExecutor; | ||
import org.bukkit.entity.Player; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
public class DebugEconomyCommand implements TabExecutor { | ||
private final DebugEconomy plugin; | ||
|
||
public DebugEconomyCommand(DebugEconomy plugin) { | ||
this.plugin = plugin; | ||
} | ||
|
||
@Override | ||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { | ||
if (!(sender instanceof Player)) return true; | ||
Player player = (Player) sender; | ||
|
||
if (plugin.getNoMoney().contains(player.getUniqueId())) { | ||
plugin.getNoMoney().remove(player.getUniqueId()); | ||
sender.sendMessage(ChatColor.GREEN + "Now vault will see that you have sufficient money."); | ||
return true; | ||
} | ||
|
||
plugin.getNoMoney().add(player.getUniqueId()); | ||
sender.sendMessage(ChatColor.RED + "Now vault will see that you don't have sufficient money."); | ||
return true; | ||
} | ||
|
||
@Override | ||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) { | ||
return Collections.singletonList("toggle"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters