-
-
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
Showing
10 changed files
with
95 additions
and
27 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
35 changes: 35 additions & 0 deletions
35
src/main/java/fr/jachou/reanimatemc/commands/ReanimateCommand.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,35 @@ | ||
package fr.jachou.reanimatemc.commands; | ||
|
||
import fr.jachou.reanimatemc.ReanimateMC; | ||
import fr.jachou.reanimatemc.utils.PlayerFreezeUtil; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
|
||
public class ReanimateCommand implements CommandExecutor { | ||
@Override | ||
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { | ||
if (args.length < 1) { | ||
sender.sendMessage(ReanimateMC.PREFIX + "§cUsage: /reanimate <player>"); | ||
return false; | ||
} | ||
|
||
Player target = Bukkit.getPlayer(args[0]); | ||
|
||
if (target == null || !target.isOnline()) { | ||
sender.sendMessage(ReanimateMC.PREFIX + "§cPlayer not found or not online."); | ||
return false; | ||
} | ||
|
||
if (PlayerFreezeUtil.playerIsFreezed(target)) { | ||
PlayerFreezeUtil.unfreezePlayer(target); | ||
sender.sendMessage(ReanimateMC.PREFIX + "§aThis player is no longer KO."); | ||
} else { | ||
sender.sendMessage(ReanimateMC.PREFIX + "§cThis player isn't KO."); | ||
} | ||
|
||
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
Empty file.
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 |
---|---|---|
@@ -1,4 +1,9 @@ | ||
name: ReanimateMC | ||
version: '1.0' | ||
version: 'alpha-1.0.1' | ||
main: fr.jachou.reanimatemc.ReanimateMC | ||
description: ReanimateMC plugin for Minecraft | ||
description: ReanimateMC plugin for Minecraft | ||
commands: | ||
reanimate: | ||
description: Reanimate a dead player | ||
usage: /<command> <player> | ||
permission: reanimatemc.reanimate |