AbdElAziz333 / Canary

A performance mod designed to optimize Minecraft's general performance and unofficial fork of Lithium mod for Minecraft Forge.
https://www.curseforge.com/minecraft/mc-mods/canary
GNU Lesser General Public License v3.0
41 stars 3 forks source link

Clean Forge dedicated server won't start with Canary if mixin.world enabled #51

Closed claviger closed 1 year ago

claviger commented 1 year ago

Version

canary-mc1.19.2-0.0.10.jar forge-1.19.2-43.1.52 minecraft 1.19.2

Reproduction Steps

  1. Install a clean Forge server with java -jar forge-1.19.2-43.1.52-installer.jar --installServer, then create eula.txt
  2. Copy canary-mc1.19.2-0.0.10.jar into mods
  3. Start the server with ./run.sh

Crash Report File

This is a log of the complete output from starting a server.

canary.log

Something in Canary is causing it to try to load the renderer on a dedicated server (which does not exist on a dedicated server.) Obviously a dedicated server is one of the primary places one would want to run Canary.

Minecraft Save

n/a

Additional Information

Crash doesn't happen without Canary. In addition, adding 'mixin.world=false' to the canary.properties will avoid the crash, so it's something in the world section.

Crash doesn't happen on a fabric server with Lithium. Crash also doesn't happen with Radium instead of canary, but Radium has its own set of problems.

AtomicHaggis commented 1 year ago

This is also occurring with the exact same circumstances for me. Fresh Forge 1.19.2-43.1.53 server. Won't run if Canary is installed in the mods folder. Runs fine without.

AbdElAziz333 commented 1 year ago

i will look into that.

AbdElAziz333 commented 1 year ago

fixed in the coming version.

AbdElAziz333 commented 1 year ago

can you please test this build?

AtomicHaggis commented 1 year ago

I tested that build yesterday and it still appears to exhibit the same error. Here's the error log.

Ivan-Khar commented 1 year ago

This error happens probably because of this https://github.com/AbdElAziz333/Canary/blob/mc1.19.2/dev/src/main/java/com/abdelaziz/canary/mixin/block/hopper/HopperBlockMixin.java#L21

Ivan-Khar commented 1 year ago

You should change it to BlockBehaviour.UPDATE_SHAPE_ORDER

AbdElAziz333 commented 1 year ago

You are correct, i don't know how i don't noticed that, Thanks for your help!

Ivan-Khar commented 1 year ago

I tried to build the mod with this change, but got this error on server startup. Maybe there's something with my Dev environment or something, but I couldn't start the server.

[16Nov2022 22:44:21.458] [main/FATAL] [mixin/]: Mixin apply failed canary.mixins.json:world.block_entity_ticking.sleeping.LevelChunkMixin -> net.minecraft.world.level.chunk.LevelChunk: org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException Critical injection failure: @Inject annotation on setBlockEntityTickingOrder could not find any targets matching 'lambda$updateBlockEntityTicker$7' in net.minecraft.world.level.chunk.LevelChunk. Using refmap canary.refmap.json [PREINJECT Applicator Phase -> canary.mixins.json:world.block_entity_ticking.sleeping.LevelChunkMixin -> Prepare Injections ->  -> handler$bbj000$setBlockEntityTickingOrder(Lnet/minecraft/world/level/block/entity/BlockEntity;Lnet/minecraft/world/level/block/entity/BlockEntityTicker;Lnet/minecraft/core/BlockPos;Ljava/lang/Object;Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfoReturnable;Lnet/minecraft/world/level/block/entity/TickingBlockEntity;Ljava/lang/Object;)V -> Parse]
org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException: Critical injection failure: @Inject annotation on setBlockEntityTickingOrder could not find any targets matching 'lambda$updateBlockEntityTicker$7' in net.minecraft.world.level.chunk.LevelChunk. Using refmap canary.refmap.json [PREINJECT Applicator Phase -> canary.mixins.json:world.block_entity_ticking.sleeping.LevelChunkMixin -> Prepare Injections ->  -> handler$bbj000$setBlockEntityTickingOrder(Lnet/minecraft/world/level/block/entity/BlockEntity;Lnet/minecraft/world/level/block/entity/BlockEntityTicker;Lnet/minecraft/core/BlockPos;Ljava/lang/Object;Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfoReturnable;Lnet/minecraft/world/level/block/entity/TickingBlockEntity;Ljava/lang/Object;)V -> Parse]
    at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.validateTargets(InjectionInfo.java:656) ~[mixin-0.8.5.jar%2363!/:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]
AbdElAziz333 commented 1 year ago

In the dev environment you should use the regular method names, but when you come to use it in the client you should use SRG names instead.

in LevelChunkMixin you should replace lambda$updateBlockEntityTicker$7 with m187960 and in common.entity.EntityClassGroup you should replace canCollideWith with m7337 and canBeCollidedWith with m5829.

The version will released now, Thanks for your help!

AbdElAziz333 commented 1 year ago

The issue is fixed in both 0.1.1 for MC 1.19.2 and 0.0.10 for MC 1.18.2. I hope you have a good day!