-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleaned up code y agregué /back, lo programé como me salió del orto
Así que me chupa la pija haber instanciado y accesado un HM desde un comando
- Loading branch information
Showing
5 changed files
with
48 additions
and
23 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
30 changes: 30 additions & 0 deletions
30
src/main/java/club/frozed/lunarutils/commands/BackCommand.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,30 @@ | ||
package club.frozed.lunarutils.commands; | ||
|
||
import club.frozed.lunarutils.utils.CC; | ||
import club.frozed.lunarutils.utils.command.BaseCommand; | ||
import club.frozed.lunarutils.utils.command.Command; | ||
import club.frozed.lunarutils.utils.command.CommandArgs; | ||
import org.bukkit.Location; | ||
import org.bukkit.entity.Player; | ||
|
||
import java.util.HashMap; | ||
|
||
/** | ||
* Created by Elb1to | ||
* Project: LunarClientUtils | ||
* Date: 1/11/2021 @ 12:45 PM | ||
*/ | ||
public class BackCommand extends BaseCommand { | ||
|
||
public static HashMap<Player, Location> playerLocation = new HashMap<>(); | ||
|
||
@Command(name = "back", aliases = {"backpos", "goback"}) | ||
|
||
@Override | ||
public void onCommand(CommandArgs cmd) { | ||
Player player = cmd.getPlayer(); | ||
|
||
player.teleport(playerLocation.get(player)); | ||
player.sendMessage(CC.translate("&aSending you back to your previous death location.")); | ||
} | ||
} |
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