-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
disabled saving previous location when teleport protection triggers fixed command cooldown for /wild
- Loading branch information
1 parent
43c3fe3
commit 70fa855
Showing
6 changed files
with
76 additions
and
6 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
38 changes: 38 additions & 0 deletions
38
src/main/java/me/shakeforprotein/treeboteleport/Commands/DisableTpSafety.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 me.shakeforprotein.treeboteleport.Commands; | ||
|
||
import me.shakeforprotein.treeboteleport.TreeboTeleport; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
|
||
public class DisableTpSafety implements CommandExecutor { | ||
|
||
private TreeboTeleport pl; | ||
|
||
public DisableTpSafety(TreeboTeleport main) { | ||
this.pl = main; | ||
} | ||
|
||
@Override | ||
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { | ||
|
||
if(sender instanceof Player){ | ||
Player p = (Player) sender; | ||
//If hash contains player id then tp protection is currently disabled. As such, we remove the player id to re enable protection. | ||
if(pl.tpSafetyOff.containsKey(p.getUniqueId())){ | ||
pl.tpSafetyOff.remove(p.getUniqueId()); | ||
p.sendMessage(pl.badge + "Teleport protection enabled."); | ||
} | ||
else{ | ||
pl.tpSafetyOff.put(p.getUniqueId(), p.getName()); | ||
p.sendMessage(pl.badge + "Teleport Safeties disabled. TreeboMC takes no responsibility for any death as a result of this. Be safe out there."); | ||
} | ||
} | ||
else{ | ||
sender.sendMessage(pl.err + "Only players may disable their teleport protection."); | ||
} | ||
|
||
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
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