added a floodgate hook option, defaults to true _yes will be doing versioning from now on)

This commit is contained in:
xSquishyLiam
2025-12-13 23:42:18 +00:00
parent 76de3aead1
commit b8f4be8391
7 changed files with 36 additions and 11 deletions

View File

@@ -4,7 +4,7 @@ plugins {
}
group = "re.imc"
version = "1.0.0"
version = "1.0.1"
repositories {
mavenCentral()
@@ -58,4 +58,13 @@ tasks.shadowJar {
tasks.build {
dependsOn("shadowJar")
}
tasks.processResources {
val props = mapOf("version" to version)
inputs.properties(props)
filteringCharset = "UTF-8"
filesMatching("paper-plugin.yml") {
expand(props)
}
}

View File

@@ -35,6 +35,7 @@ public class GeyserModelEngine extends JavaPlugin {
PacketEvents.getAPI().load();
// CommandAPI.onLoad(new CommandAPIPaperConfig(this));
preLoadManagers();
}
@Override
@@ -68,9 +69,11 @@ public class GeyserModelEngine extends JavaPlugin {
if (this.configManager.getConfig().getBoolean("metrics.bstats", true)) new Metrics(this, 26981);
}
private void loadManagers() {
private void preLoadManagers() {
this.configManager = new ConfigManager(this);
}
private void loadManagers() {
this.commandManager = new CommandManager(this);
this.modelManager = new ModelManager(this);

View File

@@ -9,15 +9,13 @@ public class FloodgateAPIHook {
private static FloodgateApi floodgateAPI;
public static void loadHook(GeyserModelEngine plugin) {
if (Bukkit.getPluginManager().getPlugin("floodgate") == null) {
plugin.getLogger().info("floodgate hook not enabled!");
if (Bukkit.getPluginManager().getPlugin("floodgate") == null || !plugin.getConfigManager().getConfig().getBoolean("options.hooks.floodgate", true)) {
plugin.getLogger().info("Floodgate hook disabled!");
return;
}
floodgateAPI = FloodgateApi.getInstance();
plugin.getLogger().info("Hooking into floodgate!");
plugin.getLogger().info("Floodgate hook enabled!");
}
public static FloodgateApi getAPI() {

View File

@@ -95,6 +95,8 @@ public class ModelEnginePropertyHandler implements PropertyHandler {
if (anim.isOverride() && anim.getLoopMode() == BlueprintAnimation.LoopMode.ONCE) {
break;
}
plugin.getLogger().info(animId);
}
}
@@ -121,8 +123,8 @@ public class ModelEnginePropertyHandler implements PropertyHandler {
if (boneUpdates.isEmpty() && animUpdates.isEmpty()) return;
Map<String, Integer> intUpdates = new HashMap<>();
int i = 0;
int i = 0;
for (Integer integer : BooleanPacker.mapBooleansToInts(boneUpdates)) {
intUpdates.put(plugin.getConfigManager().getConfig().getString("models.namespace") + ":bone" + i, integer);
i++;

View File

@@ -10,4 +10,6 @@ models:
thread-pool-size: 4
options:
debug: false
debug: false
hooks:
floodgate: true # Recommended method

View File

@@ -1,6 +1,6 @@
main: re.imc.geysermodelengine.GeyserModelEngine
name: GeyserModelEngine
version: '1.0.0'
version: '${version}'
api-version: '1.21'
authors: