MCMTFabric icon indicating copy to clipboard operation
MCMTFabric copied to clipboard

Incompatble with Lithium

Open duplexsystem opened this issue 3 years ago • 17 comments

20:30:27] [main/FATAL]: Mixin apply failed mcmtfabric.mixins.json:ServerChunkManagerMixin -> net.minecraft.class_3215: org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException @At("FIELD") on net/minecraft/class_3215::overwriteServerThread with priority 1000 cannot inject into net/minecraft/class_3215::method_12121(IILnet/minecraft/class_2806;Z)Lnet/minecraft/class_2791; merged by me.jellysquid.mods.lithium.mixin.world.chunk_access.ServerChunkManagerMixin with priority 1000 [PREINJECT Applicator Phase -> mcmtfabric.mixins.json:ServerChunkManagerMixin -> Prepare Injections ->  -> redirect$bgm000$overwriteServerThread(Lnet/minecraft/class_3215;)Ljava/lang/Thread; -> Prepare]
org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException: @At("FIELD") on net/minecraft/class_3215::overwriteServerThread with priority 1000 cannot inject into net/minecraft/class_3215::method_12121(IILnet/minecraft/class_2806;Z)Lnet/minecraft/class_2791; merged by me.jellysquid.mods.lithium.mixin.world.chunk_access.ServerChunkManagerMixin with priority 1000 [PREINJECT Applicator Phase -> mcmtfabric.mixins.json:ServerChunkManagerMixin -> Prepare Injections ->  -> redirect$bgm000$overwriteServerThread(Lnet/minecraft/class_3215;)Ljava/lang/Thread; -> Prepare]

duplexsystem avatar Apr 20 '21 01:04 duplexsystem

I hope this gets fixed soon! This mod looks AMAZING. And thanks for porting this to fabric so us fabric users can enjoy it too :)

Titaniumtown avatar Apr 20 '21 03:04 Titaniumtown

Sorry but they are overwriting the whole function. It's not a good practice in general and I'm afraid I cannot fix it on my side.

himekifee avatar Apr 20 '21 07:04 himekifee

It might be possible for you to overwrite lithiums mixins related to it but not sure if that would blow lithium up

PhantomG27249 avatar Apr 20 '21 23:04 PhantomG27249

You can get lithium to run on your server at the same time as MCMT you just need to add those two lines to lithium's config file. There's probably even more specific options you could use for the world/chunk settings that will still allow MCMT to run with lithium, but I'm too lazy to find them now and have been trying to squeeze every drop of performance out of this server for the past like 4 days.

mixin.world=false mixin.chunk=false

Edit: This was a horrible idea, I don't even know how to explain what happened, there was fire everywhere, sugarcane and cactus was growing on air, and farmland was also just in the sky for no reason. I was indeed playing with fire and got horribly burnt.

Vampiee avatar Jun 12 '21 19:06 Vampiee

Please reopen @himekifee

KyGost avatar Sep 24 '21 15:09 KyGost

Working on supporting Lithium. Currently trying to figure out what is and isn't compatible via Lithium's config. This is not yet exhaustive.

mixin.ai=true
mixin.item=true
mixin.math=true
mixin.shapes=true
mixin.tag=true
mixin.block=true
mixin.chunk=true
mixin.collections=true
mixin.entity=true

# Some mystery implementation exists making in such that despite deep_passenger being expressly disabled, one cannot enable alloc
mixin.alloc=false
mixin.alloc.chunk_random=true
mixin.alloc.chunk_ticking=true
mixin.alloc.composter=true
mixin.alloc.deep_passenger=false
mixin.alloc.entity_tracker=false
mixin.alloc.enum_values=true
mixin.alloc.explosion_behavior=true

# untested as I use C2ME
mixin.gen=false

# to test
mixin.cached_hashcode=false

# to test
mixin.world=false
mixin.world.mob_spawning=true

With above config it seems to mostly work but occasionally throws & crashes.

KyGost avatar Sep 24 '21 16:09 KyGost

Hmmmm... Above gets big errors & crashes sometimes... going to be arduous to figure out what does what. Probably going to need to take it quite slow. Will work on soonish.

KyGost avatar Sep 24 '21 16:09 KyGost

Getting this from something:

[STDERR]: java.util.ConcurrentModificationException
[STDERR]: at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1013)
[STDERR]: at java.base/java.util.ArrayList$Itr.next(ArrayList.java:967)
[STDERR]: at java.base/java.util.Collections$UnmodifiableCollection$1.next(Collections.java:1049)
[STDERR]: at net.minecraft.class_5572.method_31762(class_5572.java:40)
[STDERR]: at net.minecraft.class_5573.method_31774(class_5573.java:127)
[STDERR]: at net.minecraft.class_5573.method_31777(class_5573.java:1038)
[STDERR]: at net.minecraft.class_5573.method_31773(class_5573.java:127)
[STDERR]: at net.minecraft.class_5578.method_31805(class_5578.java:47)
[STDERR]: at net.minecraft.class_1937.method_18023(MixinWorld.java:631)
[STDERR]: at net.minecraft.class_1924.method_8390(class_1924.java:27)
[STDERR]: at net.minecraft.class_1542.method_6973(class_1542.java:201)
[STDERR]: at net.minecraft.class_1542.method_5773(class_1542.java:149)
[STDERR]: at net.himeki.mcmtfabric.ParallelProcessor.lambda$callEntityTick$3(ParallelProcessor.java:162)
[STDERR]: at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1434)
[STDERR]: at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:295)
[STDERR]: at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1016)
[STDERR]: at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1665)
[STDERR]: at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1598)
[STDERR]: at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)

Which leads to index OOB errors.

KyGost avatar Sep 24 '21 17:09 KyGost

Using the lithium API could help to fix issues related to entities.

toinouH avatar Sep 24 '21 19:09 toinouH

Using the lithium API could help to fix issues related to entities.

Thanks, could you point me in the right direction for that perchance? What does the API allow?

KyGost avatar Sep 25 '21 05:09 KyGost

@KyGost it's the work of @himekifee , on your side you can do nothing except findind and disabling problematic mixins.

toinouH avatar Sep 25 '21 08:09 toinouH

@KyGost it's the work of @himekifee , on your side you can do nothing except findind and disabling problematic mixins.

Not quite sure what you're implying?.. I can manipulate the code and submit PRs if you're implying that that's why it doesn't relate to me?

KyGost avatar Sep 25 '21 09:09 KyGost

I have not yet drilled through them all (see below, those without a phase haven't been tested) but here's a functional list of mixins (see #20 for more info).

Raw
# Phase 1
mixin.ai=true
# Phase 5
mixin.ai.goal=true
# Phase 2
mixin.ai.nearby_entity_tracking=true
# XPhase 2 - OOB1-4, NPE3
mixin.ai.nearby_entity_tracking.goals=false
# Phase 3
mixin.ai.pathing=true
# Phase 3
mixin.ai.poi=true
# Phase 3
mixin.ai.poi.fast_init=true
# Phase 3
mixin.ai.poi.fast_retrieval=true
# Phase 5
mixin.ai.raid=true
# Phase 5
mixin.ai.task=true

# Phase 1
mixin.alloc=true
# XPhase 7 - ILE1
mixin.alloc.chunk_random=false
# XPhase 7 - CHAOS1
mixin.alloc.chunk_ticking=false
mixin.alloc.composter=false
mixin.alloc.deep_passenger=false
mixin.alloc.entity_tracker=false
mixin.alloc.enum_values=false
mixin.alloc.explosion_behavior=false

# Phase 1
mixin.block=true
# Phase 9
mixin.block.flatten_states=true
# Phase 5
mixin.block.hopper=true
# Phase 9
mixin.block.moving_block_shapes=true
# Phase 7
mixin.block.redstone_wire=true

mixin.cached_hashcode=false

# Phase 1
mixin.chunk=true
mixin.chunk.block_counting=false
# XPhase 7 - NPE5, Warn2
mixin.chunk.entity_class_groups=false
mixin.chunk.no_locking=false
mixin.chunk.no_validation=false
# Phase 9
mixin.chunk.palette=true
mixin.chunk.section_update_tracking=false
mixin.chunk.serialization=false

# Phase 1
mixin.collections=true
# Phase 9
mixin.collections.entity_filtering=true

# Phase 1
mixin.entity=true
# Phase 6
mixin.entity.collisions=true
mixin.entity.data_tracker=false
mixin.entity.data_tracker.no_locks=false
mixin.entity.data_tracker.use_arrays=false
# Phase 6
mixin.entity.fast_retrieval=true
# Phase 6
mixin.entity.fast_suffocation_check=true
mixin.entity.gravity_check_block_below=false
mixin.entity.inactive_navigations=false
mixin.entity.replace_entitytype_predicates=false
# Phase 6
mixin.entity.skip_fire_check=true
# Phase 6
mixin.entity.stream_entity_collisions_lazily=true

# Untested as I use C2ME
mixin.gen=false

# Phase 1
mixin.item=true

# Phase 1
mixin.math=true
mixin.math.fast_blockpos=false
mixin.math.fast_util=false
# Phase 2
mixin.math.sine_lut=true

# Phase 1
mixin.shapes=true
# Phase 8
mixin.shapes.blockstate_cache=true
# Phase 8
mixin.shapes.lazy_shape_context=true
# Phase 2
mixin.shapes.optimized_matching=true
# Phase 8
mixin.shapes.precompute_shape_arrays=true
# Phase 8
mixin.shapes.shape_merging=true
# Phase 8
mixin.shapes.specialized_shapes=true

# Phase 1
mixin.tag=true

# Phase 1
mixin.world=true
# Phase 4
mixin.world.block_entity_retrieval=true
# Phase 8
mixin.world.block_entity_ticking=true
# Phase 8
mixin.world.block_entity_ticking.support_cache=true
mixin.world.chunk_access=false
mixin.world.chunk_task_system=false
mixin.world.chunk_tickets=false
mixin.world.chunk_ticking=false
mixin.world.explosions=false
mixin.world.inline_block_access=false
mixin.world.inline_height=false
# Phase 7
mixin.world.mob_spawning=false
mixin.world.player_chunk_tick=false
mixin.world.tick_scheduler=false
# XPhase 2 - OOB1-4, NPE3
mixin.ai.nearby_entity_tracking.goals=false
# XPhase 7 - ILE1
mixin.alloc.chunk_random=false
# XPhase 7 - CHAOS1
mixin.alloc.chunk_ticking=false
# XPhase 7 - NPE5, Warn2
mixin.chunk.entity_class_groups=false

# Unchecked
mixin.alloc.composter=false
mixin.alloc.deep_passenger=false
mixin.alloc.entity_tracker=false
mixin.alloc.enum_values=false
mixin.alloc.explosion_behavior=false
mixin.cached_hashcode=false
mixin.chunk.block_counting=false
mixin.chunk.no_locking=false
mixin.chunk.no_validation=false
mixin.chunk.section_update_tracking=false
mixin.chunk.serialization=false
mixin.entity.data_tracker=false
mixin.entity.data_tracker.no_locks=false
mixin.entity.data_tracker.use_arrays=false
mixin.entity.gravity_check_block_below=false
mixin.entity.inactive_navigations=false
mixin.entity.replace_entitytype_predicates=false
mixin.gen=false
mixin.math.fast_blockpos=false
mixin.math.fast_util=false
mixin.world.chunk_access=false
mixin.world.chunk_task_system=false
mixin.world.chunk_tickets=false
mixin.world.chunk_ticking=false
mixin.world.explosions=false
mixin.world.inline_block_access=false
mixin.world.inline_height=false
mixin.world.player_chunk_tick=false
mixin.world.tick_scheduler=false

KyGost avatar Sep 25 '21 12:09 KyGost

I'll continue narrowing down the list but the main improvement for compatibility that can be done is fastutil concurrency improvements (see also: #19).

I would expect this to allow:

  • mixin.ai.nearby_entity_tracking.goals
  • mixin.chunk.entity_class_groups

And likely quite a few more, probably most of the "tracker" mixins.

As well as cleaning up a few things and stabilising a bit more. Not unlikely that fast util issues would also cause issues with other mods.

Thus for MCMT development fast util work is a top priority.

KyGost avatar Sep 25 '21 12:09 KyGost

Do you have an updated list?

IdiosyncraticLawyer avatar Oct 16 '21 16:10 IdiosyncraticLawyer

try mixin.world.chunk_access=false in the lithium config.

2No2Name avatar Nov 21 '21 19:11 2No2Name

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Jul 22 '22 02:07 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Aug 06 '22 02:08 github-actions[bot]

This issue should not be closed imo

toinouH avatar Aug 06 '22 19:08 toinouH

This is a won't fix so close it should be fine.

himekifee avatar Aug 06 '22 19:08 himekifee

Is there a working lithium config? If so then I could probably get MCMT to work with it without manually changing the config

Just give me the values that has been modified in the config to make it work

Ran-Mewo avatar Aug 15 '22 12:08 Ran-Mewo

Is there an updated Lithium config?

kristibektashi avatar Jan 20 '23 19:01 kristibektashi

Is there an updated Lithium config?

They are not compatible, sort of causes a crash when entering the ancient city, but you can try this configuration:

mixin.entity.collisions=false
mixin.alloc.chunk_random=false
mixin.collections=false
mixin.world.chunk_access=false
mixin.ai.task=false
mixin.ai.nearby_entity_tracking=false
mixin.entity.inactive_navigations=false

wicivo avatar Jan 20 '23 19:01 wicivo

Is there an updated Lithium config?

https://github.com/himekifee/lithium-fabric

But to avoid a crash, you can try this, but there is no guarantee that everything will be fine

wicivo avatar Jan 20 '23 19:01 wicivo

Is there an updated Lithium config?

https://github.com/himekifee/lithium-fabric

But to avoid a crash, you can try this, but there is no guarantee that everything will be fine

To clarify things, this branch only works with a special midified version of MCMT I didn't push. Even with that, there is a dead lock that the game eventually hit that cannot be disabled by turning lithium config. Unless lithium actively want to support us or I have enough time to maintain another branch of lithium, MCMT won't work with lithium. Unfortunately, neither are true at the moment.

himekifee avatar Jan 20 '23 19:01 himekifee