Merge pull request #53 from xSquishyLiam/main

Updated PE to 2.9.5 & added bstats & fixed build.yml
This commit is contained in:
zimzaza4
2025-08-31 04:07:22 +08:00
committed by GitHub
9 changed files with 39 additions and 35 deletions

View File

@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v4
# Setup JDK # Setup JDK
- name: Setup Java JDK - name: Setup Java JDK
@@ -19,10 +19,13 @@ jobs:
with: with:
java-version: 17 java-version: 17
distribution: 'zulu' distribution: 'zulu'
# Build # Build
- name: Make gradlew executable
run: chmod +x gradlew
- name: Build with Gradle - name: Build with Gradle
run: gradle build run: ./gradlew build
- name: Auto release - name: Auto release
uses: "marvinpinto/action-automatic-releases@latest" uses: "marvinpinto/action-automatic-releases@latest"

9
.idea/workspace.xml generated
View File

@@ -4,7 +4,10 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="ff2e9770-ec88-4715-adeb-b9dbda130e1a" name="Changes" comment="" /> <list default="true" id="ff2e9770-ec88-4715-adeb-b9dbda130e1a" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/src/main/java/re/imc/geysermodelengine/GeyserModelEngine.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/re/imc/geysermodelengine/GeyserModelEngine.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/resources/config.yml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/config.yml" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@@ -57,6 +60,7 @@
<component name="Git.Settings"> <component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component> </component>
<component name="GradleScriptDefinitionsStorage" workingDir="$PROJECT_DIR$" gradleHome="$USER_HOME$/.gradle/wrapper/dists/gradle-8.12-bin/cetblhg4pflnnks72fxwobvgv/gradle-8.12" javaHome="$USER_HOME$/.jdks/openjdk-21.0.1" gradleVersion="8.12" />
<component name="MavenRunner"> <component name="MavenRunner">
<option name="delegateBuildToMaven" value="true" /> <option name="delegateBuildToMaven" value="true" />
</component> </component>
@@ -76,6 +80,7 @@
</component> </component>
<component name="PropertiesComponent">{ <component name="PropertiesComponent">{
&quot;keyToString&quot;: { &quot;keyToString&quot;: {
&quot;Gradle.Download Sources.executor&quot;: &quot;Run&quot;,
&quot;Gradle.GeyserModelEngine [build].executor&quot;: &quot;Run&quot;, &quot;Gradle.GeyserModelEngine [build].executor&quot;: &quot;Run&quot;,
&quot;Gradle.GeyserModelEngine [jar].executor&quot;: &quot;Run&quot;, &quot;Gradle.GeyserModelEngine [jar].executor&quot;: &quot;Run&quot;,
&quot;Maven.GeyserModelEngine [install...].executor&quot;: &quot;Run&quot;, &quot;Maven.GeyserModelEngine [install...].executor&quot;: &quot;Run&quot;,
@@ -84,6 +89,7 @@
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;, &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.git.unshallow&quot;: &quot;true&quot;, &quot;RunOnceActivity.git.unshallow&quot;: &quot;true&quot;,
&quot;git-widget-placeholder&quot;: &quot;main&quot;, &quot;git-widget-placeholder&quot;: &quot;main&quot;,
&quot;kotlin-language-version-configured&quot;: &quot;true&quot;,
&quot;last_opened_file_path&quot;: &quot;D:/Coding/Forks/Minecraft/GeyserModelEngine&quot;, &quot;last_opened_file_path&quot;: &quot;D:/Coding/Forks/Minecraft/GeyserModelEngine&quot;,
&quot;project.structure.last.edited&quot;: &quot;Project&quot;, &quot;project.structure.last.edited&quot;: &quot;Project&quot;,
&quot;project.structure.proportion&quot;: &quot;0.0&quot;, &quot;project.structure.proportion&quot;: &quot;0.0&quot;,
@@ -96,6 +102,7 @@
<recent name="D:\Coding\Forks\Minecraft\GeyserModelEngine" /> <recent name="D:\Coding\Forks\Minecraft\GeyserModelEngine" />
</key> </key>
<key name="MoveFile.RECENT_KEYS"> <key name="MoveFile.RECENT_KEYS">
<recent name="D:\Coding\Forks\Minecraft\GeyserModelEngine\.github\workflows" />
<recent name="D:\Coding\Forks\Minecraft\GeyserModelEngine\libs" /> <recent name="D:\Coding\Forks\Minecraft\GeyserModelEngine\libs" />
</key> </key>
</component> </component>

View File

@@ -20,27 +20,22 @@ Download the following plugins according to what server software you use.
- Put `GeyserModelEngine` in the plugins folder (only Spigot or forks of Spigot supported) - Put `GeyserModelEngine` in the plugins folder (only Spigot or forks of Spigot supported)
- Put either `geyserutils-spigot` in your plugins folder aswell (`geyserutils-velocity`/`geyserutils-bungeecord` in your Velocity/Bungeecord plugins folder if you use it) - Put either `geyserutils-spigot` in your plugins folder aswell (`geyserutils-velocity`/`geyserutils-bungeecord` in your Velocity/Bungeecord plugins folder if you use it)
- Put `GeyserModelEnginePackGenerator` and `geyserutils-geyser` into `plugins/[Geyser-Folder]/extensions` - Put `GeyserModelEnginePackGenerator` and `geyserutils-geyser` into `plugins/[Geyser-Folder]/extensions`
- Inside `floodgate` set `send-floodgate-data` to `true` in your Velocity/Bungeecord folder and copy over the key.pem into your backend `floodgate` folders
Start the server to generate the relevant configuration files, and then shut down the server to convert any models. Start the server to generate the relevant configuration files, and then shut down the server to convert any models.
# Convert Models # Convert Models
This is old method to convert model:
`GeyserModelEnginePackGenerator` is capable of generating models all by itself. After generating it will also apply this pack automatically. `GeyserModelEnginePackGenerator` is capable of generating models all by itself. After generating it will also apply this pack automatically.
- First go to `plugins/[Geyser-Folder]/extensions/geysermodelenginepackgenerator/input/` - Firstly, install [packer plugin](https://github.com/GeyserExtensionists/GeyserModelEngineBlockbenchPacker) for your blockbench.
- Create a folder in this directory with the ID of the model. (this is the same name as your model within ModelEngine 4.)
- Then, open your bbmodel, go `File -> Export -> Export GeyserModelEngine Model`, you will get a zip, just unzip it to `input` folder.
<img src="docsimg/example.jpg" width="500"> <img src="docsimg/example.jpg" width="500">
> Each model should have a separate model folder > Each model should have a separate model folder
> Subfolders are supported if you want to categorize them > Subfolders are supported if you want to categorize them
- Now use BlockBench and convert your model to a Bedrock Entity, this will allow you to export the Bedrock Geometry and Animations.
- Put the geometry, animations and texture file in this folder you've made.
<img src="docsimg/example1.jpg" width="500">
- Restart the server or reload geyser to start generating the resource pack. - Restart the server or reload geyser to start generating the resource pack.
- Go to `plugins/[Geyser-Folder]/extensions/geysermodelenginepackgenerator`, and you should see your pack generated! - Go to `plugins/[Geyser-Folder]/extensions/geysermodelenginepackgenerator`, and you should see your pack generated!
@@ -49,12 +44,6 @@ This is old method to convert model:
- Final step, reload Geyser or restart the server to load the resource pack. - Final step, reload Geyser or restart the server to load the resource pack.
- Congratulations, you've completed this tutorial! - Congratulations, you've completed this tutorial!
# Model Packer
This is new way to convert model
- Firstly, install [packer plugin](https://github.com/GeyserExtensionists/GeyserModelEngineBlockbenchPacker) for your blockbench.
- Then, open your bbmodel, go `File -> Export -> Export GeyserModelEngine Model`, you will get a zip, just unzip it to `input` folder.
# Tips # Tips
* Pay attention! The pack only regenerates when the number of models changes, you can technically speaking remove the generated_pack folder to force a reload aswell. * Pay attention! The pack only regenerates when the number of models changes, you can technically speaking remove the generated_pack folder to force a reload aswell.

View File

@@ -1,6 +1,6 @@
plugins { plugins {
id("java") id("java")
id("io.github.goooler.shadow") version "8.1.7" id("io.github.goooler.shadow") version "8.1.8"
} }
group = "re.imc" group = "re.imc"
@@ -28,8 +28,8 @@ dependencies {
compileOnly(files("libs/geyserutils-spigot-1.0-SNAPSHOT.jar")) compileOnly(files("libs/geyserutils-spigot-1.0-SNAPSHOT.jar"))
compileOnly("org.geysermc.floodgate:api:2.2.4-SNAPSHOT") compileOnly("org.geysermc.floodgate:api:2.2.4-SNAPSHOT")
implementation("com.github.retrooper:packetevents-spigot:2.9.5")
implementation("com.github.retrooper:packetevents-spigot:2.9.4") implementation("org.bstats:bstats-bukkit:3.0.2")
implementation("org.reflections:reflections:0.10.2") implementation("org.reflections:reflections:0.10.2")
} }
@@ -50,6 +50,8 @@ tasks.shadowJar {
relocate("com.github.retrooper", "re.imc.geysermodelengine.libs.com.github.retrooper.packetevents") relocate("com.github.retrooper", "re.imc.geysermodelengine.libs.com.github.retrooper.packetevents")
relocate("io.github.retrooper", "re.imc.geysermodelengine.libs.io.github.retrooper.packetevents") relocate("io.github.retrooper", "re.imc.geysermodelengine.libs.io.github.retrooper.packetevents")
relocate("org.bstats", "re.imc.geysermodelengine.libs.bstats")
relocate("org.reflections", "re.imc.geysermodelengine.libs.reflections") relocate("org.reflections", "re.imc.geysermodelengine.libs.reflections")
} }

View File

@@ -5,6 +5,7 @@ import com.github.retrooper.packetevents.event.PacketListenerPriority;
import dev.jorel.commandapi.CommandAPI; import dev.jorel.commandapi.CommandAPI;
import dev.jorel.commandapi.CommandAPIBukkitConfig; import dev.jorel.commandapi.CommandAPIBukkitConfig;
import io.github.retrooper.packetevents.factory.spigot.SpigotPacketEventsBuilder; import io.github.retrooper.packetevents.factory.spigot.SpigotPacketEventsBuilder;
import org.bstats.bukkit.Metrics;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import re.imc.geysermodelengine.listener.ModelListener; import re.imc.geysermodelengine.listener.ModelListener;
@@ -43,6 +44,8 @@ public class GeyserModelEngine extends JavaPlugin {
loadManagers(); loadManagers();
loadRunnables(); loadRunnables();
loadBStats();
PacketEvents.getAPI().getEventManager().registerListener(new MountPacketListener(this), PacketListenerPriority.NORMAL); PacketEvents.getAPI().getEventManager().registerListener(new MountPacketListener(this), PacketListenerPriority.NORMAL);
Bukkit.getPluginManager().registerEvents(new ModelListener(this), this); Bukkit.getPluginManager().registerEvents(new ModelListener(this), this);
@@ -62,6 +65,10 @@ public class GeyserModelEngine extends JavaPlugin {
CommandAPI.onEnable(); CommandAPI.onEnable();
} }
private void loadBStats() {
if (configManager.getConfig().getBoolean("bstats", true)) new Metrics(this, 26981);
}
private void loadManagers() { private void loadManagers() {
this.configManager = new ConfigManager(this); this.configManager = new ConfigManager(this);

View File

@@ -1,8 +1,6 @@
package re.imc.geysermodelengine.listener; package re.imc.geysermodelengine.listener;
import com.ticxo.modelengine.api.events.AddModelEvent; import com.ticxo.modelengine.api.events.*;
import com.ticxo.modelengine.api.events.ModelDismountEvent;
import com.ticxo.modelengine.api.events.ModelMountEvent;
import com.ticxo.modelengine.api.model.ActiveModel; import com.ticxo.modelengine.api.model.ActiveModel;
import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Pair;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@@ -31,7 +29,6 @@ public class ModelListener implements Listener {
@EventHandler(priority = EventPriority.MONITOR) @EventHandler(priority = EventPriority.MONITOR)
public void onAddModel(AddModelEvent event) { public void onAddModel(AddModelEvent event) {
if (event.isCancelled()) return; if (event.isCancelled()) return;
plugin.getModelManager().create(event.getTarget(), event.getModel()); plugin.getModelManager().create(event.getTarget(), event.getModel());
} }
@@ -54,6 +51,10 @@ public class ModelListener implements Listener {
} }
} }
/*
/ xSquishyLiam:
/ I'm wondering if we could move this to more of a player loading chunks instead of checking all worlds via PlayerChunkLoadEvent?
*/
@EventHandler @EventHandler
public void onWorldInit(WorldInitEvent event) { public void onWorldInit(WorldInitEvent event) {
World world = event.getWorld(); World world = event.getWorld();
@@ -61,13 +62,7 @@ public class ModelListener implements Listener {
} }
/* /*
/ Temp fix till a better solution is found - / xSquishyLiam - conclusion:
/ the issue is when a player logs out and the mob is there,
/ the player logs back in sometimes it can display as a pig only
/ this issues mainly comes from the functions from EntityTaskManager
/ sendSpawnPacket() and canSee()
/
/ TheLividaProject - conclusion:
/ I'm assuming when a player joins the server the packet for mob spawning is instant so the client resyncs itself / I'm assuming when a player joins the server the packet for mob spawning is instant so the client resyncs itself
/ hence why the pig is shown instead of going invisible and not displaying the texture of the modeled mob / hence why the pig is shown instead of going invisible and not displaying the texture of the modeled mob
*/ */

View File

@@ -33,6 +33,6 @@ public class MountPacketListener implements PacketListener {
if (seat == null) return; if (seat == null) return;
if (action.getAction() != WrapperPlayClientEntityAction.Action.START_SNEAKING) return; if (action.getAction() != WrapperPlayClientEntityAction.Action.START_SNEAKING) return;
ModelEngineAPI.getMountPairManager().tryDismount(event.getPlayer()); ModelEngineAPI.getMountPairManager().tryDismount(player);
} }
} }

View File

@@ -1,3 +1,5 @@
bstats: true
data-send-delay: 5 data-send-delay: 5
entity-view-distance: 50 entity-view-distance: 50
join-send-delay: 20 join-send-delay: 20

View File

@@ -6,7 +6,6 @@ api-version: '1.21'
authors: authors:
- zimzaza4 - zimzaza4
- willem.dev - willem.dev
- TheLividaProject
load: STARTUP load: STARTUP