diff --git a/src/main/java/city/thefloating/floatyplugin/server/JoinQuitListener.java b/src/main/java/city/thefloating/floatyplugin/server/JoinQuitListener.java index 24f3b3d..4cf3219 100644 --- a/src/main/java/city/thefloating/floatyplugin/server/JoinQuitListener.java +++ b/src/main/java/city/thefloating/floatyplugin/server/JoinQuitListener.java @@ -16,6 +16,7 @@ import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.event.player.PlayerResourcePackStatusEvent; import org.bukkit.inventory.meta.FireworkMeta; import org.spongepowered.configurate.NodePath; @@ -42,6 +43,15 @@ public JoinQuitListener( this.worldService = worldService; } + @EventHandler + public void onPack(final PlayerResourcePackStatusEvent event) { + if (event.getStatus() == PlayerResourcePackStatusEvent.Status.DECLINED) { + event.getPlayer().kick(this.langConfig.c(NodePath.path("resource-pack", "decline-kick"))); + } else if (event.getStatus() == PlayerResourcePackStatusEvent.Status.FAILED_DOWNLOAD) { + event.getPlayer().kick(this.langConfig.c(NodePath.path("resource-pack", "fail-kick"))); + } + } + @EventHandler public void onJoin(final PlayerJoinEvent event) { final Player player = event.getPlayer(); diff --git a/src/main/resources/lang.conf b/src/main/resources/lang.conf index 9d6d055..6e6c863 100644 --- a/src/main/resources/lang.conf +++ b/src/main/resources/lang.conf @@ -45,6 +45,14 @@ transpose: { resource-pack: { sending: "Zooming the epic resource pack your way!" + decline-kick: """You must accept the resource pack. + +Check that you have <#dddd99>server resource packs set +to <#dddd99>allow or <#dddd99>prompt in the server list settings (edit).""" + fail-kick: """The resource pack failed to load. + +If this issue persists, visit our Discord server +at <#BB77FF>thefloating.city/discord and ask staff for help.""" } tag: {