mirror of
https://github.com/xSquishyLiam/mc-GeyserModelEngine-plugin.git
synced 2025-12-19 14:59:19 +00:00
just sorting my build to match the main build
This commit is contained in:
1
.github/workflows/build.yml
vendored
1
.github/workflows/build.yml
vendored
@@ -4,7 +4,6 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- bettermodel-support-dev
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
4
.idea/workspace.xml
generated
4
.idea/workspace.xml
generated
@@ -11,7 +11,7 @@
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="DarkyenusTimeTracker">
|
||||
<option name="totalTimeSeconds" value="24424" />
|
||||
<option name="totalTimeSeconds" value="32226" />
|
||||
</component>
|
||||
<component name="ExternalProjectsData">
|
||||
<projectState path="$PROJECT_DIR$">
|
||||
@@ -96,7 +96,7 @@
|
||||
"git-widget-placeholder": "main",
|
||||
"ignore.virus.scanning.warn.message": "true",
|
||||
"kotlin-language-version-configured": "true",
|
||||
"last_opened_file_path": "D:/Coding/Forks/Minecraft/GeyserModelEngine/geyser",
|
||||
"last_opened_file_path": "D:/Coding/Minecraft/GeyserExtensionists/GeyserModelEngine",
|
||||
"project.structure.last.edited": "Project",
|
||||
"project.structure.proportion": "0.0",
|
||||
"project.structure.side.proportion": "0.2",
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import io.github.retrooper.packetevents.factory.spigot.SpigotPacketEventsBuilder
|
||||
import org.bstats.bukkit.Metrics;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import re.imc.geysermodelengine.hooks.FloodgateAPIHook;
|
||||
import re.imc.geysermodelengine.listener.ModelListener;
|
||||
import re.imc.geysermodelengine.listener.MountPacketListener;
|
||||
import re.imc.geysermodelengine.managers.ConfigManager;
|
||||
@@ -34,6 +35,7 @@ public class GeyserModelEngine extends JavaPlugin {
|
||||
PacketEvents.getAPI().load();
|
||||
|
||||
// CommandAPI.onLoad(new CommandAPIPaperConfig(this));
|
||||
preLoadManagers();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -59,16 +61,19 @@ public class GeyserModelEngine extends JavaPlugin {
|
||||
|
||||
private void loadHooks() {
|
||||
PacketEvents.getAPI().init();
|
||||
FloodgateAPIHook.loadHook(this);
|
||||
// CommandAPI.onEnable();
|
||||
}
|
||||
|
||||
private void loadBStats() {
|
||||
if (configManager.getConfig().getBoolean("metrics.bstats", true)) new Metrics(this, 26981);
|
||||
if (this.configManager.getConfig().getBoolean("metrics.bstats", true)) new Metrics(this, 26981);
|
||||
}
|
||||
|
||||
private void preLoadManagers() {
|
||||
this.configManager = new ConfigManager(this);
|
||||
}
|
||||
|
||||
private void loadManagers() {
|
||||
this.configManager = new ConfigManager(this);
|
||||
|
||||
this.commandManager = new CommandManager(this);
|
||||
|
||||
this.modelManager = new ModelManager(this);
|
||||
@@ -77,9 +82,8 @@ public class GeyserModelEngine extends JavaPlugin {
|
||||
|
||||
private void loadRunnables() {
|
||||
this.schedulerPool = Executors.newScheduledThreadPool(configManager.getConfig().getInt("models.thread-pool-size", 4));
|
||||
|
||||
schedulerPool.scheduleAtFixedRate(new UpdateTaskRunnable(this), 10, configManager.getConfig().getLong("models.entity-position-update-period", 35), TimeUnit.MILLISECONDS);
|
||||
schedulerPool.scheduleAtFixedRate(new BedrockMountControlRunnable(this), 1, 1, TimeUnit.MILLISECONDS);
|
||||
this.schedulerPool.scheduleAtFixedRate(new UpdateTaskRunnable(this), 10, configManager.getConfig().getLong("models.entity-position-update-period", 35), TimeUnit.MILLISECONDS);
|
||||
this.schedulerPool.scheduleAtFixedRate(new BedrockMountControlRunnable(this), 1, 1, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
public ConfigManager getConfigManager() {
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package re.imc.geysermodelengine.hooks;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.geysermc.floodgate.api.FloodgateApi;
|
||||
import re.imc.geysermodelengine.GeyserModelEngine;
|
||||
|
||||
public class FloodgateAPIHook {
|
||||
|
||||
private static FloodgateApi floodgateAPI;
|
||||
|
||||
public static void loadHook(GeyserModelEngine plugin) {
|
||||
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("Floodgate hook enabled!");
|
||||
}
|
||||
|
||||
public static FloodgateApi getAPI() {
|
||||
return floodgateAPI;
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,7 @@ public class EntityTaskManager {
|
||||
|
||||
public void checkViewers(EntityData model, Set<Player> viewers) {
|
||||
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
|
||||
if (!BedrockUtils.isBedrockPlayer(onlinePlayer)) return;
|
||||
if (!BedrockUtils.isBedrockPlayer(onlinePlayer)) continue;
|
||||
|
||||
if (canSee(onlinePlayer, model.getEntity())) {
|
||||
if (!viewers.contains(onlinePlayer)) {
|
||||
|
||||
@@ -134,9 +134,7 @@ public class BetterModelPropertyHandler implements PropertyHandler {
|
||||
List<String> list = new ArrayList<>(boneUpdates.keySet());
|
||||
Collections.sort(list);
|
||||
|
||||
for (Player player : players) {
|
||||
EntityUtils.sendIntProperties(player, entity, intUpdates);
|
||||
}
|
||||
players.forEach(player -> EntityUtils.sendIntProperties(player, entity, intUpdates));
|
||||
}
|
||||
|
||||
public String unstripName(RenderedBone bone) {
|
||||
|
||||
@@ -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++;
|
||||
@@ -172,8 +174,8 @@ public class ModelEnginePropertyHandler implements PropertyHandler {
|
||||
return name;
|
||||
}
|
||||
|
||||
private Color calculateCurrentColor(ModelEngineEntityData data) {
|
||||
if (data.getActiveModel().isMarkedHurt()) return new Color(data.getActiveModel().getDamageTint().asARGB());
|
||||
return new Color(data.getActiveModel().getDefaultTint().asARGB());
|
||||
private Color calculateCurrentColor(ModelEngineEntityData modelEngineEntityData) {
|
||||
if (modelEngineEntityData.getActiveModel().isMarkedHurt()) return new Color(modelEngineEntityData.getActiveModel().getDamageTint().asARGB());
|
||||
return new Color(modelEngineEntityData.getActiveModel().getDefaultTint().asARGB());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,17 +2,16 @@ package re.imc.geysermodelengine.util;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.geysermc.floodgate.api.FloodgateApi;
|
||||
import re.imc.geysermodelengine.hooks.FloodgateAPIHook;
|
||||
|
||||
public class BedrockUtils {
|
||||
|
||||
private static FloodgateApi FLOODGATE_API;
|
||||
private static final FloodgateApi floodgateAPIHook = FloodgateAPIHook.getAPI();
|
||||
|
||||
public static boolean isBedrockPlayer(Player player) {
|
||||
if (FLOODGATE_API != null) return FLOODGATE_API.isFloodgatePlayer(player.getUniqueId());
|
||||
return player.getClientBrandName().contains("Geyser");
|
||||
}
|
||||
|
||||
public static FloodgateApi getFloodgateApi() {
|
||||
return FLOODGATE_API;
|
||||
if (floodgateAPIHook != null) return floodgateAPIHook.isFloodgatePlayer(player.getUniqueId());
|
||||
String clientBrand = player.getClientBrandName();
|
||||
if (clientBrand == null) return false;
|
||||
return clientBrand.contains("Geyser");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,4 +10,6 @@ models:
|
||||
thread-pool-size: 4
|
||||
|
||||
options:
|
||||
debug: false
|
||||
debug: false
|
||||
hooks:
|
||||
floodgate: true # Recommended method
|
||||
@@ -1,6 +1,6 @@
|
||||
main: re.imc.geysermodelengine.GeyserModelEngine
|
||||
name: GeyserModelEngine
|
||||
version: '1.0.0'
|
||||
version: '${version}'
|
||||
api-version: '1.21'
|
||||
|
||||
authors:
|
||||
|
||||
Reference in New Issue
Block a user