Fix wrong color for a player going too high & add a new detection method for the player going too high
This commit is contained in:
@@ -21,10 +21,10 @@ class PlayerMoveListener(val plugin: GalaxyLobbyPlugin) : Listener {
|
|||||||
if (location.y < 0) {
|
if (location.y < 0) {
|
||||||
plugin.resetPlayer(player, true)
|
plugin.resetPlayer(player, true)
|
||||||
player.sendComponent(MessageFormat.setPrefix("<rainbow>You happy with yourself?</rainbow>"))
|
player.sendComponent(MessageFormat.setPrefix("<rainbow>You happy with yourself?</rainbow>"))
|
||||||
} else if (location.y > 200) {
|
} else if (player.world.maxHeight < location.y) {
|
||||||
location.y = 200.0
|
location.y = player.world.maxHeight.toDouble()
|
||||||
player.teleport(location)
|
player.teleport(location)
|
||||||
player.sendComponent(MessageFormat.setPrefix(MessageFormat.setSecondaryColor("You can't go that high!")))
|
player.sendComponent(MessageFormat.setPrefix(MessageFormat.setPrimaryColor("You can't go that high!")))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user