Project Red - Compat

Project Red - Compat

27M Downloads

[1.18.2] Incompatible with Waterlogged Redstone

border999 opened this issue ยท 3 comments

commented

Describe the bug
Upon attempting to create a new world Waterlogged throws an issue citing being unable to cast to a class related to ProjectRed Core. Causing the world generation to halt and forcing me to force close Minecraft.

To Reproduce
Steps to reproduce the behavior:

  1. Attempt to create a world with Waterlogged Redstone and ProjectRed Core both in your modlist.
  2. Wait till it locks up.

Expected behavior
World generation completing without issue.

Logs
Required for crash. Crash report did not appear in .minecraft folder even after log shows the report was generated.
Debug.log: https://gist.github.com/border999/875eb9b5c6b0af02c6ff17b2b0c0c9c5
Latest.log: https://gist.github.com/border999/04a85c302fb6d7573b1257f4d4a63c8e
Versions

  • CCL Version: CodeChickenLib-1.18.2-4.1.4.488-universal
  • Forge Version: 1.18.2-forge-40.2.9
  • ProjectRed Version: ProjectRed-1.18.2-4.16.0-beta-17-core
  • Waterlogged Redstone Version: WaterloggedRedstone-1.13.1-1.18.2
commented

Unfortunately those logs don't contain the crash details. I'll need them to investigate this

commented

Looks like Waterlogged Redstone replaces the original Redstone block with its own class. Crash comes from ProjectRed side, which tries to cast Blocks.REDSTONE:

Encountered an unexpected exception
java.lang.ClassCastException: class com.the_millman.waterlogged_redstone.common.blocks.RedStoneWireBlock cannot be cast to class net.minecraft.world.level.block.RedStoneWireBlock (com.the_millman.waterlogged_redstone.common.blocks.RedStoneWireBlock is in module [email protected] of loader 'TRANSFORMER' @43aeb5e0; net.minecraft.world.level.block.RedStoneWireBlock is in module [email protected] of loader 'TRANSFORMER' @43aeb5e0)
	at TRANSFORMER/[email protected]/mrtjp.projectred.core.RedstonePropagator.setDustProvidesPower(RedstonePropagator.java:59)
	at TRANSFORMER/[email protected]/mrtjp.projectred.core.RedstonePropagator.resetPowerFlags(RedstonePropagator.java:66)
	at TRANSFORMER/[email protected]/mrtjp.projectred.transmission.ProjectRedTransmission.onServerStartEvent(ProjectRedTransmission.java:80)
	at MC-BOOTSTRAP/[email protected]/net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:247)
	at MC-BOOTSTRAP/[email protected]/net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:239)
	at MC-BOOTSTRAP/[email protected]/net.minecraftforge.eventbus.EventBus.post(EventBus.java:302)
	at MC-BOOTSTRAP/[email protected]/net.minecraftforge.eventbus.EventBus.post(EventBus.java:283)
	at TRANSFORMER/[email protected]/net.minecraftforge.server.ServerLifecycleHooks.handleServerAboutToStart(ServerLifecycleHooks.java:86)
	at TRANSFORMER/[email protected]/net.minecraft.client.server.IntegratedServer.m_7038_(IntegratedServer.java:63)
	at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:661)
	at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_177918_(MinecraftServer.java:261)
	at java.base/java.lang.Thread.run(Thread.java:833)

Checking if this can be done some other way

commented

Confirmed that Waterlogged Redstone is creating a brand new subclass of Block and basically copying the vanilla RedStoneWireBlock source before making modifications. While I can use reflection to get at the shouldSignal field and change it, I don't see any reason why RedStoneWireBlock can't be subclassed directly.

You can point the mod author of WLRS to this issue. This won't be fixed on ProjectRed side (unless a concrete reason for not subclassing RedStoneWireBlock can be given).