-
Notifications
You must be signed in to change notification settings - Fork 58
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 #20 from CaaMoe/Dev
提交更新 RC.5
- Loading branch information
Showing
58 changed files
with
2,023 additions
and
214 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
plugins { | ||
id 'com.github.johnrengelman.shadow' | ||
} | ||
|
||
repositories { | ||
maven { url "https://hub.spigotmc.org/nexus/content/groups/public/" } | ||
maven { url "https://repo.codemc.io/repository/nms/" } | ||
} | ||
|
||
dependencies { | ||
implementation project(":core:loader") | ||
compileOnly group: 'com.destroystokyo.paper', name: 'paper', version: '1.16.5-R0.1-SNAPSHOT' | ||
} | ||
|
||
shadowJar { | ||
String env = System.getProperty("env", "AUTO") | ||
archiveBaseName.set('MultiLogin-Bukkit') | ||
if (env.toLowerCase() == "final") { | ||
archiveVersion.set(project.plugin_version as String) | ||
} else { | ||
String ver = "Build_" + ((System.currentTimeMillis() / 1000) as int) | ||
archiveVersion.set(ver) | ||
} | ||
archiveClassifier.set("") | ||
|
||
from { | ||
project(':bukkit').tasks.shadowJar.archiveFile | ||
} | ||
} | ||
|
||
artifacts { | ||
archives shadowJar | ||
} |
64 changes: 64 additions & 0 deletions
64
...it/loader/src/main/java/moe/caa/multilogin/bukkit/loader/main/MultiLoginBukkitLoader.java
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,64 @@ | ||
package moe.caa.multilogin.bukkit.loader.main; | ||
|
||
import moe.caa.multilogin.core.loader.impl.BasePluginBootstrap; | ||
import moe.caa.multilogin.core.loader.impl.IPluginLoader; | ||
import moe.caa.multilogin.core.loader.main.MultiLoginCoreLoader; | ||
import org.bukkit.Server; | ||
import org.bukkit.plugin.java.JavaPlugin; | ||
|
||
import java.util.logging.Level; | ||
|
||
/** | ||
* Bukkit 插件引导程序 | ||
*/ | ||
public class MultiLoginBukkitLoader extends JavaPlugin implements IPluginLoader { | ||
private MultiLoginCoreLoader coreLoader; | ||
private BasePluginBootstrap pluginBootstrap; | ||
|
||
@Override | ||
public void onLoad() { | ||
try { | ||
coreLoader = new MultiLoginCoreLoader(this); | ||
if (!coreLoader.start()) { | ||
shutdown(); | ||
return; | ||
} | ||
|
||
pluginBootstrap = coreLoader.loadBootstrap( | ||
"moe.caa.multilogin.bukkit.main.MultiLoginBukkitPluginBootstrap", | ||
new Class[]{JavaPlugin.class, Server.class}, new Object[]{this, getServer()}); | ||
pluginBootstrap.onLoad(); | ||
} catch (Throwable throwable) { | ||
loggerLog(Level.SEVERE, "A FATAL ERROR OCCURRED DURING INITIALIZATION.", throwable); | ||
onDisable(); | ||
} | ||
} | ||
|
||
@Override | ||
public void onEnable() { | ||
if (pluginBootstrap != null) pluginBootstrap.onEnable(); | ||
} | ||
|
||
@Override | ||
public void onDisable() { | ||
if (pluginBootstrap != null) pluginBootstrap.onDisable(); | ||
pluginBootstrap = null; | ||
coreLoader.close(); | ||
getServer().shutdown(); | ||
} | ||
|
||
@Override | ||
public String getSectionJarFileName() { | ||
return "MultiLogin-Bukkit.JarFile"; | ||
} | ||
|
||
@Override | ||
public void shutdown() { | ||
getServer().shutdown(); | ||
} | ||
|
||
@Override | ||
public void loggerLog(Level level, String message, Throwable throwable) { | ||
getLogger().log(level, message, throwable); | ||
} | ||
} |
6 changes: 2 additions & 4 deletions
6
bukkit/src/main/resources/plugin.yml → bukkit/loader/src/main/resources/plugin.yml
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
6 changes: 3 additions & 3 deletions
6
bukkit/src/main/java/moe/caa/multilogin/bukkit/impl/BukkitScheduler.java
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
Oops, something went wrong.