-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from the-obsidian/core
Update support for Bukkit, Sponge, and Forge
- Loading branch information
Showing
102 changed files
with
2,886 additions
and
1,651 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
repositories { | ||
mavenCentral() | ||
maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' } | ||
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } | ||
} | ||
|
||
dependencies { | ||
compile project(':discordbridge-core') | ||
compile group: 'org.spigotmc', name: 'spigot-api', version: '1.12-R0.1-SNAPSHOT' | ||
compile (group: 'org.pegdown', name:'pegdown', version: '1.6.0') | ||
compile files('../libraries/dynmap-api-2.5-SNAPSHOT.jar') | ||
} | ||
|
||
shadowJar { | ||
dependencies { | ||
include(project(':discordbridge-core')) | ||
include(dependency('org.ow2.asm:asm')) | ||
include(dependency('org.ow2.asm:asm-analysis')) | ||
include(dependency('org.ow2.asm:asm-tree')) | ||
include(dependency('org.ow2.asm:asm-util')) | ||
} | ||
relocate 'org.json', 'shadow.json' | ||
} | ||
build.dependsOn(shadowJar) | ||
|
||
artifacts { | ||
archives shadowJar | ||
} |
43 changes: 43 additions & 0 deletions
43
discordbridge-bukkit/src/main/kotlin/gg/obsidian/discordbridge/BukkitDiscordBridge.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package gg.obsidian.discordbridge | ||
|
||
import gg.obsidian.discordbridge.wrapper.DbBukkitServer | ||
import org.bukkit.plugin.java.JavaPlugin | ||
import org.slf4j.Logger | ||
import org.slf4j.LoggerFactory | ||
|
||
/** | ||
* The primary Plugin class that maintains the plugin's connection with Bukkit | ||
*/ | ||
class BukkitDiscordBridge : JavaPlugin() { | ||
private lateinit var instance: BukkitDiscordBridge | ||
private lateinit var logger: Logger | ||
|
||
override fun onLoad() { | ||
logger = LoggerFactory.getLogger("DiscordBrdige") | ||
logger.info("Loading DiscordBridge") | ||
} | ||
|
||
override fun onEnable() { | ||
logger.info("Enabling DiscordBridge") | ||
instance = this | ||
val isMultiverse = server.pluginManager.getPlugin("Multiverse-Core") != null | ||
DiscordBridge.init(DbBukkitServer(this, this.server), dataFolder, isMultiverse=isMultiverse) | ||
|
||
server.pluginManager.registerEvents(EventListener(), this) | ||
|
||
getCommand("discord").executor = EventListener() | ||
getCommand("f").executor = EventListener() | ||
getCommand("rate").executor = EventListener() | ||
getCommand("8ball").executor = EventListener() | ||
getCommand("insult").executor = EventListener() | ||
getCommand("choose").executor = EventListener() | ||
getCommand("talk").executor = EventListener() | ||
getCommand("roll").executor = EventListener() | ||
|
||
DiscordBridge.handleServerStart() | ||
} | ||
|
||
override fun onDisable() { | ||
DiscordBridge.handleServerStop() | ||
} | ||
} |
Oops, something went wrong.