Bug Closed · Resolved

Model Engine 4.0.4 Error

#4701 opened by Unknown 2 years ago

Unknownreported this bug

Installing MEG 4 on a local server causes this error. I have tested with multiple models installed, and with only one model installed. Running paper 1.20.4 v388. I have tested with no plugins except for model engine. The models in question may spawn after server start, and behave normally. Then the error happens. Spawned models not longer do any actions, and cannot be interacted with.

https://pastebin.com/q6azdgzH

Unknowncommented

We got the same kind of error:

java.lang.NoSuchMethodError: 'boolean net.minecraft.world.level.block.state.IBlockData.isOpaque()'
        at com.ticxo.modelengine.v1_20_R3.entity.OcclusionClipContext.a(OcclusionClipContext.java:20) ~[ModelEngine-4.0.4.jar:?]
        at net.minecraft.world.level.Level.fastClip(Level.java:464) ~[?:?]
        at net.minecraft.world.level.Level.a(Level.java:523) ~[?:?]
        at com.ticxo.modelengine.v1_20_R3.entity.EntityHandlerImpl.isVisible(EntityHandlerImpl.java:559) ~[ModelEngine-4.0.4.jar:?]
        at com.ticxo.modelengine.v1_20_R3.entity.EntityHandlerImpl.shouldCull(EntityHandlerImpl.java:551) ~[ModelEngine-4.0.4.jar:?]
        at com.ticxo.modelengine.api.entity.data.BukkitEntityData.updateCulledPlayer(BukkitEntityData.java:152) ~[ModelEngine-4.0.4.jar:?]
        at com.ticxo.modelengine.api.entity.data.BukkitEntityData.asyncUpdate(BukkitEntityData.java:69) ~[ModelEngine-4.0.4.jar:?]
        at com.ticxo.modelengine.api.entity.EntityDataTracker.asyncFetchEntityData(EntityDataTracker.java:32) ~[ModelEngine-4.0.4.jar:?]
        at com.ticxo.modelengine.api.utils.ticker.DualTicker.lambda$queueRepeatingAsyncTask$5(DualTicker.java:57) ~[ModelEngine-4.0.4.jar:?]
        at com.ticxo.modelengine.api.utils.ticker.Task.tick(Task.java:25) ~[ModelEngine-4.0.4.jar:?]
        at java.util.ArrayList.removeIf(ArrayList.java:1672) ~[?:?]
        at java.util.ArrayList.removeIf(ArrayList.java:1660) ~[?:?]
        at com.ticxo.modelengine.api.utils.ticker.PseudoThread.tick(PseudoThread.java:63) ~[ModelEngine-4.0.4.jar:?]
        at org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.20.4.jar:git-Paper-388]
        at org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[paper-1.20.4.jar:git-Paper-388]
        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[paper-1.20.4.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
        at java.lang.Thread.run(Thread.java:840) ~[?:?]
Unknowncommented

It does appear that things work normally on paper 384, but not on 385

Unknowncommented

After decompiling the Spigot.jar for research i fidure it out how it should work in newer versions.

here is the BlockData.java from 1.20.4 build 382 https://gist.github.com/Ste3et/67f42bb0146b24bfdca0a5570d850df6#file-blockdata-java-L65 you can see method BlockData#isOpaque() use field this.p in the newest build the this.p variable is used in method https://gist.github.com/Ste3et/637af8de54fb416cac2ba4751c1ebc37#file-blockdata-java-L239 public method BlockData#p()

Edit the method BlockData#p() is present in both jars and can be used without calling BlockData#isOpaque()

Sign in to join the discussion.