-
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.
Merge pull request #5 from Minecraft-InCraftTime-Server/优化交互方式
优化交互方式
- Loading branch information
Showing
8 changed files
with
82 additions
and
148 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
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
38 changes: 38 additions & 0 deletions
38
src/main/java/ict/minesunshineone/landmark/command/impl/UnlockAllCommand.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,38 @@ | ||
package ict.minesunshineone.landmark.command.impl; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
|
||
import ict.minesunshineone.landmark.LandmarkPlugin; | ||
import ict.minesunshineone.landmark.command.SubCommand; | ||
|
||
public class UnlockAllCommand extends SubCommand { | ||
|
||
public UnlockAllCommand(LandmarkPlugin plugin) { | ||
super(plugin); | ||
} | ||
|
||
@Override | ||
public void execute(CommandSender sender, String[] args) { | ||
if (!(sender instanceof Player)) { | ||
plugin.getConfigManager().sendMessage(sender, "command-player-only", "<red>该命令只能由玩家执行!</red>"); | ||
return; | ||
} | ||
|
||
Player player = (Player) sender; | ||
plugin.getLandmarkManager().unlockAllLandmarks(player); | ||
} | ||
|
||
@Override | ||
public String getPermission() { | ||
return "landmark.unlock.all"; | ||
} | ||
|
||
@Override | ||
public List<String> onTabComplete(CommandSender sender, String[] args) { | ||
return Collections.emptyList(); | ||
} | ||
} |
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
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
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