WearBlackAllDay / DimensionalThreading

An attempt to optimize the fabric server, by assigning each dimension their own thread.
MIT License
256 stars 22 forks source link

Gravity duping is removed. #9

Open ZuccySuccy opened 3 years ago

ZuccySuccy commented 3 years ago

Not sure if it works with the 4 gravity block types or all dupers, but I know that it is fixed with a ray style duper. The blocks on the overworld side stay as expected, but the gravity entity on the end side is not there which is the expected behavior

DragonEggBedrockBreaking commented 3 years ago

Bug confirmed with dragon egg duper, someone's efficient rewiring of ilmango's design I found on discord.

Apricityx commented 3 years ago

This feature usually useful for some redstone used server

coke-the-gal commented 2 years ago

Issue is caused by EntityMixin.java, when removed sand duping works as in vanilla.

Apricityx commented 2 years ago

Issue is caused by EntityMixin.java, when removed sand duping works as in vanilla.

So I can fix it by just deleting EntityMixin.java?

coke-the-gal commented 2 years ago

Ehh, no. Removing the file fixes it in singleplayer worlds, but on servers, when you activate the duper, it causes a server crash. Would have put this in originally, but I couldnt test it on a server until yesterday.

Apricityx commented 2 years ago

Ehh, no. Removing the file fixes it in singleplayer worlds, but on servers, when you activate the duper, it causes a server crash. Would have put this in originally, but I couldnt test it on a server until yesterday.

Then how can i fix it on my server?

coke-the-gal commented 2 years ago

No clue, just documenting my attempts

Apricityx commented 2 years ago

Fine,thank you

xiaoyu2006 commented 2 years ago

TL;DR: DimensionalThreading is dangerous for it breaks vanilla cross-dimensional entity behavior. For the fix check the fork or grab a prebuilt jar.

To prevent race conditions, DimThread delays the moveToWorld function to the end of the tick. The scheduled function call from sand dupers will find the entity removed and won't execute anymore.

https://github.com/WearBlackAllDay/DimensionalThreading/blob/a60f0983cd65416e9b60ce648d78de8dcdee3215/src/main/java/wearblackallday/dimthread/mixin/EntityMixin.java#L18

The patch manually checks and forces the moveToWorld to execute by redirecting isRemoved here. However the fix is ugly and may cause problems so i won't open a PR for this.

Syntax3rror404 commented 2 years ago

Get a crash with your fix:

net.minecraft.class_148: Exception ticking world
        at wearblackallday.dimthread.util.CrashInfo.crash(CrashInfo.java:12) ~[DimThread-1.2.6-sand-duper-fix.jar:?]
        at net.minecraft.server.MinecraftServer.handler$zim000$tickWorlds(MinecraftServer.java:4336) ~[server-intermediary.jar:?]
        at net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:896) ~[server-intermediary.jar:?]
        at net.minecraft.class_3176.method_3813(class_3176.java:322) ~[server-intermediary.jar:?]
        at net.minecraft.server.MinecraftServer.method_3748(MinecraftServer.java:851) ~[server-intermediary.jar:?]
        at net.minecraft.server.MinecraftServer.handler$zbe000$modifiedRunLoop(MinecraftServer.java:2896) ~[server-intermediary.jar:?]
        at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:676) ~[server-intermediary.jar:?]
        at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:273) ~[server-intermediary.jar:?]
        at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.lang.ClassCastException
[19:29:48] [Server thread/ERROR]: This crash report has been saved to: /home/container/./crash-reports/crash-2022-03-15_19.29.48-server.txt
[19:29:48] [Server thread/INFO]: Stopping server
xiaoyu2006 commented 2 years ago

Get a crash with your fix:

net.minecraft.class_148: Exception ticking world
        at wearblackallday.dimthread.util.CrashInfo.crash(CrashInfo.java:12) ~[DimThread-1.2.6-sand-duper-fix.jar:?]
        at net.minecraft.server.MinecraftServer.handler$zim000$tickWorlds(MinecraftServer.java:4336) ~[server-intermediary.jar:?]
        at net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:896) ~[server-intermediary.jar:?]
        at net.minecraft.class_3176.method_3813(class_3176.java:322) ~[server-intermediary.jar:?]
        at net.minecraft.server.MinecraftServer.method_3748(MinecraftServer.java:851) ~[server-intermediary.jar:?]
        at net.minecraft.server.MinecraftServer.handler$zbe000$modifiedRunLoop(MinecraftServer.java:2896) ~[server-intermediary.jar:?]
        at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:676) ~[server-intermediary.jar:?]
        at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:273) ~[server-intermediary.jar:?]
        at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.lang.ClassCastException
[19:29:48] [Server thread/ERROR]: This crash report has been saved to: /home/container/./crash-reports/crash-2022-03-15_19.29.48-server.txt
[19:29:48] [Server thread/INFO]: Stopping server

@Syntax3rror404 No idea why this crashed. It works on both my local test environment and @Apricityx ‘s server.

NOTE 'works' means not to crash.

What’s the version of your Minecraft & Fabric?

Syntax3rror404 commented 2 years ago

It runs on mc 1.18.2 with latest fabric and fabric api only with the mods carpet, litihum, phosphor and voicechat. It have 4 GB RAM and 12 CPU Cores. Without the dimthread mod it runs fine but with players in end, nether, overworld the mspt gets near 40 with your mod we have 17

xiaoyu2006 commented 2 years ago

@Syntax3rror404 I have bumped dependency versions here: https://github.com/MCTown/DimensionalThreading/releases/download/v1.2.6-sand-duper-fix/DimThread-1.2.6-1.18.2-sand-duper-fix.jar. I don’t know if it will work.

Note that the fix still have some known bugs about dragon eggs. Don’t rely on it.

BTW you have way too much CPUs and too little RAM.

PS. Your issue seems to be the same one as #58.

LarveyOfficial commented 2 years ago

@xiaoyu2006 While your fix does solve part of the problem, it still isn't exactly vanilla behavior, below I've attached 2 videos The first one showing the dupe running in vanilla, and the other running w/ your fix.

Without:

https://user-images.githubusercontent.com/39219859/163069390-adddf12a-b5f4-463c-9e12-b03875e093b9.mp4

With:

https://user-images.githubusercontent.com/39219859/163069416-d4ab4ea6-c720-40dd-8494-e06b1c6c59f9.mp4

xiaoyu2006 commented 2 years ago

@xiaoyu2006 While your fix does solve part of the problem, it still isn't exactly vanilla behavior, below I've attached 2 videos The first one showing the dupe running in vanilla, and the other running w/ your fix.

Without:

javaw_6fVArPvEWj.mp4

With:

javaw_rpVMedUPLe.mp4

@LarveyOfficial Please provide an game archive for further debugging.

LarveyOfficial commented 2 years ago

@xiaoyu2006 While your fix does solve part of the problem, it still isn't exactly vanilla behavior, below I've attached 2 videos The first one showing the dupe running in vanilla, and the other running w/ your fix. Without: javaw_6fVArPvEWj.mp4 With: javaw_rpVMedUPLe.mp4

@LarveyOfficial Please provide an game archive for further debugging.

@xiaoyu2006 Here is a google drive with the server I was using to test. https://drive.google.com/file/d/1AUqoEQqRB9fuRttlGEgcoKIO8ZxqrSty/view?usp=sharing Strong hold at /execute in minecraft:overworld run tp @s 1544.13 -25.76 -595.81 75.59 13.66

xiaoyu2006 commented 2 years ago

@LarveyOfficial Sure. I’ll take a look when I have time.

LarveyOfficial commented 2 years ago

@xiaoyu2006 Any updates?

xiaoyu2006 commented 2 years ago

@LarveyOfficial There’s a more elegant hack in commit https://github.com/MCTown/DimensionalThreading/commit/a912fcf0c96ef37b2ec07ce78996d8571a62c6ab, however it will create a lot of spam messages in server console. (I have no more time to debug it. My time is very limited.)

Download the fix here. I will release it when I have more time to fix the spammed console.


UPDATE: There’re still severe bugs. Don’t use it yet.

xiaoyu2006 commented 2 years ago

Released at https://github.com/MCTown/DimensionalThreading/releases/tag/v1.2.6-sand-duper-fix.2.

It will cause a weird client-side animation glitch… And still has problems with some concrete solidificaters for unknown reasons.

micrwvae commented 2 years ago

any updates to this

LarveyOfficial commented 2 years ago

Not that I've heard of no