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

13
.idea/workspace.xml generated
View File

@@ -11,7 +11,7 @@
<option name="LAST_RESOLUTION" value="IGNORE" /> <option name="LAST_RESOLUTION" value="IGNORE" />
</component> </component>
<component name="DarkyenusTimeTracker"> <component name="DarkyenusTimeTracker">
<option name="totalTimeSeconds" value="26083" /> <option name="totalTimeSeconds" value="28359" />
</component> </component>
<component name="ExternalProjectsData"> <component name="ExternalProjectsData">
<projectState path="$PROJECT_DIR$"> <projectState path="$PROJECT_DIR$">
@@ -31,6 +31,17 @@
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" /> <item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
<item name="GeyserModelEngine" type="f1a62948:ProjectNode" /> <item name="GeyserModelEngine" type="f1a62948:ProjectNode" />
</path> </path>
<path>
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
<item name="GeyserModelEngine" type="f1a62948:ProjectNode" />
<item name="Tasks" type="e4a08cd1:TasksNode" />
</path>
<path>
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
<item name="GeyserModelEngine" type="f1a62948:ProjectNode" />
<item name="Tasks" type="e4a08cd1:TasksNode" />
<item name="build" type="c8890929:TasksNode$1" />
</path>
</expand> </expand>
<select /> <select />
</tree_state> </tree_state>

View File

@@ -4,7 +4,7 @@ plugins {
} }
group = "re.imc" group = "re.imc"
version = "1.0.0" version = "1.0.1"
repositories { repositories {
mavenCentral() mavenCentral()
@@ -59,3 +59,12 @@ tasks.shadowJar {
tasks.build { tasks.build {
dependsOn("shadowJar") 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(); PacketEvents.getAPI().load();
// CommandAPI.onLoad(new CommandAPIPaperConfig(this)); // CommandAPI.onLoad(new CommandAPIPaperConfig(this));
preLoadManagers();
} }
@Override @Override
@@ -68,9 +69,11 @@ public class GeyserModelEngine extends JavaPlugin {
if (this.configManager.getConfig().getBoolean("metrics.bstats", true)) new Metrics(this, 26981); if (this.configManager.getConfig().getBoolean("metrics.bstats", true)) new Metrics(this, 26981);
} }
private void loadManagers() { private void preLoadManagers() {
this.configManager = new ConfigManager(this); this.configManager = new ConfigManager(this);
}
private void loadManagers() {
this.commandManager = new CommandManager(this); this.commandManager = new CommandManager(this);
this.modelManager = new ModelManager(this); this.modelManager = new ModelManager(this);

View File

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

View File

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

View File

@@ -11,3 +11,5 @@ models:
options: options:
debug: false debug: false
hooks:
floodgate: true # Recommended method

View File

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