Skip to content

Commit

Permalink
Update to 1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobwgillespie committed Nov 22, 2016
1 parent b9ae5b7 commit eff4e82
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.apache.tools.ant.filters.ReplaceTokens

buildscript {
ext.kotlin_version = '1.0.0'
ext.kotlin_version = '1.0.5-2'

repositories {
mavenCentral()
Expand All @@ -25,7 +25,7 @@ apply plugin: 'kotlin'
group = 'gg.obsidian'
version = '1.0.1'
description = """Use Discourse group as a whitelist"""
ext.url = 'https://github.com/the-obsidian/DiscordBridge'
ext.url = 'https://github.com/the-obsidian/DiscourseBridge'

sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand All @@ -41,7 +41,7 @@ repositories {
}

dependencies {
compile group: 'org.spigotmc', name: 'spigot-api', version:'1.8.8-R0.1-SNAPSHOT'
compile group: 'org.spigotmc', name: 'spigot-api', version:'1.11-R0.1-SNAPSHOT'
compile group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib', version:'1.0.0-rc-1036'
compile group: 'net.dv8tion', name: 'JDA', version:'1.3.0_188'
compile group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.2.0'
Expand Down
6 changes: 3 additions & 3 deletions src/main/kotlin/gg/obsidian/discoursewhitelist/Plugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class Plugin : JavaPlugin(), Listener {
@EventHandler
fun onLogin(e: PlayerLoginEvent) {
if (configuration.GROUP_ID != 0) {
val discourdGroups = getDiscordGroupIds(e.player.name)
if (!discourdGroups.contains(configuration.GROUP_ID)) {
val disourseGroups = getDiscourseGroupIds(e.player.name)
if (!disourseGroups.contains(configuration.GROUP_ID)) {
val message = ChatColor.translateAlternateColorCodes('&', configuration.MESSAGE)
e.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, message)
}
Expand All @@ -53,7 +53,7 @@ class Plugin : JavaPlugin(), Listener {
configuration.load()
}

private fun getDiscordGroupIds(username: String): Set<Int> {
private fun getDiscourseGroupIds(username: String): Set<Int> {
val url = configuration.DISCOURSE_URL + "/users/" + username + ".json"
val request = Request.Builder().url(url).get().build()
val response = httpClient.newCall(request).execute()
Expand Down

0 comments on commit eff4e82

Please sign in to comment.