Skip to content

Commit

Permalink
refactor: code cleanup, imports, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbker committed Dec 13, 2023
1 parent 0e1440a commit 01c3e6e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
4 changes: 1 addition & 3 deletions src/main/kotlin/gg/flyte/event/ChristmasEvent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ import gg.flyte.event.listener.ConnectionListener
import gg.flyte.event.listener.MapListener
import gg.flyte.event.util.CommandManager
import gg.flyte.event.util.MapLocation

import gg.flyte.event.util.npc.NPCListener
import gg.flyte.twilight.event.custom.admin.listener.OpEventListener
import gg.flyte.twilight.event.disableCustomEventListeners
import gg.flyte.twilight.time.TimeUnit
import gg.flyte.twilight.twilight
import org.bukkit.*
import org.bukkit.plugin.java.JavaPlugin
Expand All @@ -27,7 +25,7 @@ class ChristmasEvent : JavaPlugin() {
INSTANCE = this
SERVER = server
WORLD = Bukkit.getWorld("world")!!
LOBBY_SPAWN = MapLocation( 559.5, 105.5, 554.5, 170F, -5F)
LOBBY_SPAWN = MapLocation(559.5, 105.5, 554.5, 170F, -5F)

twilight(this)
disableCustomEventListeners(OpEventListener)
Expand Down
26 changes: 11 additions & 15 deletions src/main/kotlin/gg/flyte/event/listener/ConnectionListener.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,9 @@ import org.bukkit.attribute.Attribute
import org.bukkit.entity.Player
import org.bukkit.event.inventory.InventoryClickEvent
import org.bukkit.event.inventory.InventoryType
import org.bukkit.event.player.PlayerJoinEvent
import org.bukkit.event.player.PlayerKickEvent
import org.bukkit.event.player.PlayerLoginEvent
import org.bukkit.event.player.PlayerQuitEvent
import org.bukkit.event.player.PlayerResourcePackStatusEvent
import org.bukkit.event.player.*
import org.bukkit.inventory.ItemStack
import org.bukkit.inventory.PlayerInventory
import org.bukkit.potion.PotionEffect
import org.bukkit.potion.PotionEffectType

object ConnectionListener {

Expand Down Expand Up @@ -58,14 +52,16 @@ object ConnectionListener {
event<PlayerLoginEvent> {
if (player.canBypassPlayerLimit()) return@event
if (ChristmasEvent.SERVER.onlinePlayers.size < playerLimit) return@event
disallow(PlayerLoginEvent.Result.KICK_FULL, text().append(
text("Sorry, the event is currently full.", CHRISTMAS_RED),
newline(),
newline(),
text("You can still join the fun over at", NamedTextColor.WHITE),
newline(),
text("twitch.tv/flytelabs", CHRISTMAS_RED)
).build())
disallow(
PlayerLoginEvent.Result.KICK_FULL, text().append(
text("Sorry, the event is currently full.", CHRISTMAS_RED),
newline(),
newline(),
text("You can still join the fun over at", NamedTextColor.WHITE),
newline(),
text("twitch.tv/flytelabs", CHRISTMAS_RED)
).build()
)
}

event<PlayerJoinEvent> {
Expand Down

0 comments on commit 01c3e6e

Please sign in to comment.