Create

Create

86M Downloads

[1.15.2_v0.3+custom][f58a7c8] Basins are unable to render and throws an AbstractMethodError

wchen1990 opened this issue ยท 2 comments

commented

Minecraft Version: 1.15.2
Forge Version: 31.2.36
Create Version: 0.3+custom (f58a7c8)

Crash Report: crash-2020-09-19_01.15.43-client.txt
Repro Steps: Create a new world or use an existing one and just place a create:basin down anywhere


Checked out the repo and compiled a jar to fool around with and to check compatibility with mods. Started playing with the Blaze Burners to figure out their functionality and noticed that a Basin was one of the contraptions you can use with them and I placed down a Basin. Game immediately crashes with an AbstractMethodError.

Just in case I removed all other mods and checked to see if maybe it was just a conflict with the other mods. Still the same issue.

Figured maybe there might've been an issue with the Forge version I was using and used the Forge version specified in the gradle.properties file (which was 31.2.31). Still the same issue.

My Java skills are pretty rusty, but I figured I'd give it a shot to see if I can figure out what the problem is, since programming concepts carry over between languages pretty easily. Unfortunately, I had no luck since it doesn't make sense that this error would be thrown even when I defined the method in the offending class. My only guess is that SmartInventory is doing too many things at once compared to how it was done previously.

That or since this is a dev build the basins are still being refactored and this is a known issue. But, I figured I'd just open the issue just in case.

Let me know if you need any more information.

commented

Diddled around some more and I think I found the issue and figured out a solution.

During the refactor of the BasinTileEntity class in 651e06a, the inventory property (now itemCapability) was a CombinedInvWrapper instantiated with two ItemStackHandler objects. Currently, it's being instantiated with two SmartInventory objects, which extends RecipeWrapper.

I've made the getInv() method in SmartInventory public and instantiated itemCapability with that method for both inputInventory and outputInventory.

Not sure if this is the best way to go about solving this issue but it resolved the rendering issue and the AbstractMethodError on my end. I'll be testing to see if this has any unintended side effects.

Edit: Doesn't seem like I can mix anything but I'm not sure if that's just because this is still being refactored or what not.
Edit 2: Oh boy, just found out that if you break a basin it throws the same error as well. crash-2020-09-19_23.03.20-server.txt


Lines changed:

BasinTileEntity:49
itemCapability = LazyOptional.of(() -> new CombinedInvWrapper(inputInventory.getInv(), outputInventory.getInv()));

SmartInventory:100
public SyncedStackHandler getInv() {

commented

Latest commit addresses this issue a lot better than the way I did it.