Skip to content

Commit

Permalink
Merge pull request #2 from akaJuliaan/1.8-compatible
Browse files Browse the repository at this point in the history
make plugin 1.8 compatible
  • Loading branch information
Jakkoble authored Sep 5, 2022
2 parents 767f215 + 296c8ac commit 90e4d9c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repositories {
}

dependencies {
compileOnly("io.papermc.paper:paper-api:1.18.2-R0.1-SNAPSHOT")
compileOnly("org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT")
implementation(kotlin("stdlib-jdk8"))
implementation("com.github.twitch4j:twitch4j:1.11.0")
implementation("com.fasterxml.jackson.core:jackson-databind:2.13.3")
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/de/jakkoble/TwitchWhitelist.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package de.jakkoble

import de.jakkoble.Whitelist.isListed
import net.kyori.adventure.text.Component
import org.bukkit.ChatColor
import org.bukkit.event.EventHandler
import org.bukkit.event.Listener
Expand Down Expand Up @@ -37,12 +36,12 @@ class TwitchWhitelist : JavaPlugin(), Listener {
@EventHandler
fun onPlayerJoin(event: PlayerJoinEvent) {
if (event.player.isListed()) return
event.player.kick(Component.text(String.format(Config().getData("notWhitelistedMessage"),
"https://twitch.tv/${twitchBot.getChannelofID(Config().getData("channelID")).lowercase()}")))
event.player.kickPlayer(String.format(Config().getData("notWhitelistedMessage"),
"https://twitch.tv/${twitchBot.getChannelofID(Config().getData("channelID")).lowercase()}"))
}

@EventHandler
fun onPlayerLeft(event: PlayerKickEvent) {
if (!event.player.isListed()) event.leaveMessage(Component.empty())
if (!event.player.isListed()) event.leaveMessage = ""
}
}
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: TwitchWhitelist
version: 1.1
main: de.jakkoble.TwitchWhitelist
api-version: 1.19
api-version: 1.16
authors: [ Jakkoble ]
description: Whitlist Players via Twitch Channel Points Reward
website: https://jakkoble.de

0 comments on commit 90e4d9c

Please sign in to comment.