-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new RTPOnDeath option for world configuration
- Loading branch information
1 parent
2350b6a
commit 418ef2a
Showing
13 changed files
with
91 additions
and
220 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
src/main/java/me/SuperRonanCraft/BetterRTP/player/events/Death.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,22 @@ | ||
package me.SuperRonanCraft.BetterRTP.player.events; | ||
|
||
import me.SuperRonanCraft.BetterRTP.player.rtp.RTPSetupInformation; | ||
import me.SuperRonanCraft.BetterRTP.player.rtp.RTP_TYPE; | ||
import me.SuperRonanCraft.BetterRTP.references.helpers.HelperRTP; | ||
import me.SuperRonanCraft.BetterRTP.references.rtpinfo.worlds.WorldPlayer; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.player.PlayerRespawnEvent; | ||
|
||
public class Death { | ||
|
||
static void respawnEvent(PlayerRespawnEvent e) { | ||
Player p = e.getPlayer(); | ||
WorldPlayer worldPlayer = HelperRTP.getPlayerWorld(new RTPSetupInformation( | ||
p.getWorld(), | ||
p, p, false | ||
)); | ||
if (worldPlayer.getRTPOnDeath()) { | ||
HelperRTP.tp(p, p, p.getWorld(), null, RTP_TYPE.FORCED, true, 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,4 +39,6 @@ default String getID() { | |
} | ||
|
||
long getCooldown(); | ||
|
||
boolean getRTPOnDeath(); | ||
} |
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
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
Oops, something went wrong.