-
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.
Add invall/showall command (Close #4)
- Loading branch information
1 parent
a25edff
commit 6087dba
Showing
4 changed files
with
75 additions
and
3 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
31 changes: 31 additions & 0 deletions
31
src/main/java/com/rathserver/event/invisible/command/InvAllCommand.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,31 @@ | ||
package com.rathserver.event.invisible.command; | ||
|
||
import com.rathserver.event.invisible.InvisiblePlugin; | ||
import org.bukkit.Sound; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
|
||
/** | ||
* Created by Nekoneko on 2020/06/17. | ||
*/ | ||
public class InvAllCommand implements CommandExecutor { | ||
private final InvisiblePlugin plugin; | ||
|
||
public InvAllCommand(InvisiblePlugin plugin) { | ||
this.plugin = plugin; | ||
} | ||
|
||
@Override | ||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { | ||
if (!(sender instanceof Player)) { | ||
return false; | ||
} | ||
|
||
Player player = (Player) sender; | ||
this.plugin.hidePlayers(player); | ||
player.playSound(player.getLocation(), Sound.ENTITY_ITEM_PICKUP, 1.6F, 0.5F); | ||
return true; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/main/java/com/rathserver/event/invisible/command/ShowAllCommand.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,31 @@ | ||
package com.rathserver.event.invisible.command; | ||
|
||
import com.rathserver.event.invisible.InvisiblePlugin; | ||
import org.bukkit.Sound; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
|
||
/** | ||
* Created by Nekoneko on 2020/06/17. | ||
*/ | ||
public class ShowAllCommand implements CommandExecutor { | ||
private final InvisiblePlugin plugin; | ||
|
||
public ShowAllCommand(InvisiblePlugin plugin) { | ||
this.plugin = plugin; | ||
} | ||
|
||
@Override | ||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { | ||
if (!(sender instanceof Player)) { | ||
return false; | ||
} | ||
|
||
Player player = (Player) sender; | ||
this.plugin.showPlayers(player); | ||
player.playSound(player.getLocation(), Sound.ENTITY_ITEM_PICKUP, 1.6F, 0.5F); | ||
return true; | ||
} | ||
} |
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