Railcraft

Railcraft

34M Downloads

[1.12.2] Not well compatible with SpongeForge

xfl03 opened this issue · 13 comments

commented

There is some small problems like destory the block will lose the item and cannot open TunnelBore GUI.
The second problem has an Exception in console:

[Server thread/FATAL] [net.minecraft.server.MinecraftServer]: Error executing task
java.util.concurrent.ExecutionException: java.lang.AbstractMethodError: Method mods/railcraft/common/carts/EntityTunnelBore.getRootLens()Lorg/spongepowered/common/item/inventory/lens/Lens; is abstract
	at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_151]
	at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_151]
	at net.minecraft.util.Util.func_181617_a(SourceFile:47) [h.class:?]
	at org.spongepowered.common.SpongeImplHooks.onUtilRunTask(SpongeImplHooks.java:284) [SpongeImplHooks.class:1.12.2-2705-7.1.0-BETA-3136]
	at net.minecraft.server.MinecraftServer.redirect$onRun$zjg000(MinecraftServer.java:3987) [MinecraftServer.class:?]
	at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:723) [MinecraftServer.class:?]
	at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:396) [nz.class:?]
	at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:668) [MinecraftServer.class:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526) [MinecraftServer.class:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]
Caused by: java.lang.AbstractMethodError: Method mods/railcraft/common/carts/EntityTunnelBore.getRootLens()Lorg/spongepowered/common/item/inventory/lens/Lens; is abstract
	at mods.railcraft.common.carts.EntityTunnelBore.getRootLens(EntityTunnelBore.java) ~[EntityTunnelBore.class:?]
	at net.minecraft.inventory.Slot.handler$onConstructed$zih004(Slot.java:1067) ~[agr.class:?]
	at net.minecraft.inventory.Slot.<init>(Slot.java:23) ~[agr.class:?]
	at mods.railcraft.common.gui.slots.SlotBore.<init>(SlotBore.java:22) ~[SlotBore.class:?]
	at mods.railcraft.common.gui.containers.ContainerBore.<init>(ContainerBore.java:32) ~[ContainerBore.class:?]
	at mods.railcraft.common.gui.containers.FactoryContainer.build(FactoryContainer.java:112) ~[FactoryContainer.class:?]
	at mods.railcraft.common.gui.GuiHandler.getServerGuiElement(GuiHandler.java:59) ~[GuiHandler.class:?]
	at net.minecraftforge.fml.common.network.NetworkRegistry.redirect$setRemoteContainerPlugin$bag000(NetworkRegistry.java:547) ~[NetworkRegistry.class:?]
	at net.minecraftforge.fml.common.network.NetworkRegistry.getRemoteGuiContainer(NetworkRegistry.java:253) ~[NetworkRegistry.class:?]
	at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:88) ~[FMLNetworkHandler.class:?]
	at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2550) ~[aed.class:?]
	at mods.railcraft.common.gui.GuiHandler.openGui(GuiHandler.java:44) ~[GuiHandler.class:?]
	at mods.railcraft.common.carts.EntityTunnelBore.doInteract(EntityTunnelBore.java:1104) ~[EntityTunnelBore.class:?]
	at mods.railcraft.common.carts.CartBaseContainer.func_184230_a(CartBaseContainer.java:91) ~[CartBaseContainer.class:?]
	at net.minecraft.entity.player.EntityPlayer.func_190775_a(EntityPlayer.java:1199) ~[aed.class:?]
	at net.minecraft.network.NetHandlerPlayServer.func_147340_a(NetHandlerPlayServer.java:2567) ~[pa.class:?]
	at net.minecraft.network.play.client.CPacketUseEntity.func_148833_a(SourceFile:69) ~[li.class:?]
	at net.minecraft.network.play.client.CPacketUseEntity.func_148833_a(SourceFile:13) ~[li.class:?]
	at org.spongepowered.common.network.PacketUtil.onProcessPacket(PacketUtil.java:148) ~[PacketUtil.class:1.12.2-2705-7.1.0-BETA-3136]
	at net.minecraft.network.PacketThreadUtil$1.redirect$onProcessPacket$zlb000(SourceFile:539) ~[hv$1.class:?]
	at net.minecraft.network.PacketThreadUtil$1.run(SourceFile:13) ~[hv$1.class:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_151]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_151]
	at net.minecraft.util.Util.func_181617_a(SourceFile:46) ~[h.class:?]
	... 7 more

Hope to be fixed, thanks to authors!

P.S. another exception

[Server thread/ERROR] [Sponge]: Error while creating CraftingInventoryLensImpl for mods.railcraft.common.gui.containers.ContainerRollingMachine
java.lang.ClassCastException: org.spongepowered.common.item.inventory.lens.impl.slots.SlotLensImpl cannot be cast to org.spongepowered.common.item.inventory.lens.slots.CraftingOutputSlotLens
	at org.spongepowered.common.item.inventory.lens.impl.comp.CraftingInventoryLensImpl.<init>(CraftingInventoryLensImpl.java:55) ~[CraftingInventoryLensImpl.class:1.12.2-2705-7.1.0-BETA-3136]
	at org.spongepowered.common.item.inventory.lens.impl.comp.CraftingInventoryLensImpl.<init>(CraftingInventoryLensImpl.java:49) ~[CraftingInventoryLensImpl.class:1.12.2-2705-7.1.0-BETA-3136]
	at org.spongepowered.common.item.inventory.util.ContainerUtil.generateLens(ContainerUtil.java:295) ~[ContainerUtil.class:1.12.2-2705-7.1.0-BETA-3136]
	at org.spongepowered.common.item.inventory.util.ContainerUtil.getLens(ContainerUtil.java:222) ~[ContainerUtil.class:1.12.2-2705-7.1.0-BETA-3136]
	at net.minecraft.inventory.Container.spongeInit(Container.java:1019) ~[afr.class:?]
	at net.minecraft.inventory.Container.detectAndSendChanges(Container.java:1076) ~[afr.class:?]
	at net.minecraft.inventory.Container.func_75142_b(Container.java:1071) ~[afr.class:?]
	at mods.railcraft.common.gui.containers.RailcraftContainer.func_75142_b(RailcraftContainer.java:68) ~[RailcraftContainer.class:?]
	at net.minecraft.inventory.Container.func_75132_a(Container.java:1058) ~[afr.class:?]
	at mods.railcraft.common.gui.containers.RailcraftContainer.func_75132_a(RailcraftContainer.java:62) ~[RailcraftContainer.class:?]
	at mods.railcraft.common.gui.containers.ContainerRollingMachine.func_75132_a(ContainerRollingMachine.java:75) ~[ContainerRollingMachine.class:?]
	at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:101) ~[FMLNetworkHandler.class:?]
	at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2550) ~[aed.class:?]
	at mods.railcraft.common.gui.GuiHandler.openGui(GuiHandler.java:33) ~[GuiHandler.class:?]
	at mods.railcraft.common.gui.GuiHandler.openGui(GuiHandler.java:27) ~[GuiHandler.class:?]
	at mods.railcraft.common.blocks.machine.equipment.TileRollingMachineManual.openGui(TileRollingMachineManual.java:48) ~[TileRollingMachineManual.class:?]
	at mods.railcraft.common.blocks.machine.TileMachineBase.blockActivated(TileMachineBase.java:102) ~[TileMachineBase.class:?]
	at mods.railcraft.common.blocks.machine.BlockMachine.lambda$onBlockActivated$1(BlockMachine.java:129) ~[BlockMachine.class:?]
	at java.util.Optional.map(Optional.java:215) [?:1.8.0_151]
	at mods.railcraft.common.blocks.TileManager.retrieve(TileManager.java:62) [TileManager.class:?]
	at mods.railcraft.common.blocks.machine.BlockMachine.func_180639_a(BlockMachine.java:129) [BlockMachine.class:?]
	at net.minecraft.server.management.PlayerInteractionManager.func_187251_a(PlayerInteractionManager.java:1268) [or.class:?]
	at net.minecraft.network.NetHandlerPlayServer.redirect$onProcessRightClickBlock$zil000(NetHandlerPlayServer.java:2393) [pa.class:?]
	at net.minecraft.network.NetHandlerPlayServer.func_184337_a(NetHandlerPlayServer.java:739) [pa.class:?]
	at net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock.func_148833_a(SourceFile:55) [ma.class:?]
	at net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock.func_148833_a(SourceFile:11) [ma.class:?]
	at org.spongepowered.common.network.PacketUtil.onProcessPacket(PacketUtil.java:148) [PacketUtil.class:1.12.2-2705-7.1.0-BETA-3136]
	at net.minecraft.network.PacketThreadUtil$1.redirect$onProcessPacket$zlb000(SourceFile:539) [hv$1.class:?]
	at net.minecraft.network.PacketThreadUtil$1.run(SourceFile:13) [hv$1.class:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_151]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_151]
	at net.minecraft.util.Util.func_181617_a(SourceFile:46) [h.class:?]
	at org.spongepowered.common.SpongeImplHooks.onUtilRunTask(SpongeImplHooks.java:284) [SpongeImplHooks.class:1.12.2-2705-7.1.0-BETA-3136]
	at net.minecraft.server.MinecraftServer.redirect$onRun$zjg000(MinecraftServer.java:3987) [MinecraftServer.class:?]
	at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:723) [MinecraftServer.class:?]
	at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:396) [nz.class:?]
	at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:668) [MinecraftServer.class:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526) [MinecraftServer.class:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]
commented

@Dockter Have you had that before?

commented

Seems we need to add this code to every minecart with inventory. Well, this is hard to generalize indeed.
https://github.com/SpongePowered/SpongeCommon/blob/stable-7/src/main/java/org/spongepowered/common/mixin/core/entity/item/MixinEntityMinecartChest.java#L55-L60

commented

@bloodmc
But I think is it a bug of railcraft, other mods has no Exception.

commented

@xfl03 因为sponge的mixin没有处理好一些类所以出错了

commented

This issue should be closed as it is a sponge problem with our inventory implementation.

@Faithcaio Can you get this resolved?

commented

We would need some kind of fallback when we cant do all mixins necessary for the Inventory.

commented

@Faithcaio Hmm, so you suggest railcraft using a compatibility mod for spongeforge, right? I have a prototype at https://github.com/Railcraft/SpongeOnRails already. I will do that.

commented
commented

Actually I can maybe fix this in Sponge by mixing into EntityMinecartContainer.
Which is an IInventory so I could at least give indexed access...

commented

Second one fixed by SpongePowered/SpongeCommon#25ec936593afd6bf645877cd3cba49a5509b4841

commented

Should be fixed by SpongePowered/Sponge@13668d9
@xfl03 comment if the first issue is still there. the second one will not affect gameplay, in theory.

commented

The second has to do with Sponge failing to find all slots of a CraftingInventory (CraftingGrid + OutputSlot)
Looks like there is a Grid InventoryCrafting here but not the Slot with an InventoryCraftResult

It just catches and prints the error currently. "Normal" Inventory access via plugins still works.

What does this RollingMachine do with its OutputSlot?

commented

During the test all the day, I think it has been solved fully.
Thanks!