FoundationGames / Sandwichable

Customizable Sandwich mod for Minecraft
MIT License
32 stars 28 forks source link

Crop blocks' appendProperties should call super #16

Closed liach closed 4 years ago

liach commented 4 years ago

Problematic methods: https://github.com/FoundationGames/Sandwichable/blob/f750f25ef0cdccc95043fbd9bf5473f6f2dab61b/src/main/java/io/github/foundationgames/sandwichable/blocks/LettuceCropBlock.java#L56-L58 https://github.com/FoundationGames/Sandwichable/blob/f750f25ef0cdccc95043fbd9bf5473f6f2dab61b/src/main/java/io/github/foundationgames/sandwichable/blocks/TomatoCropBlock.java#L54-L56 super.appendProperties(builder); should be called in both method bodies.

Reason: Wtoll/demeter#13 Similar issue: CottonMC/Epicurean#30

FoundationGames commented 4 years ago

Good eye! Will fix.

FoundationGames commented 4 years ago

Now that I think about it, this might be the "compatibility issue" with Demeter...

liach commented 4 years ago

Yes, these methods theoretically should have super called even if the super method is blank. In other implementations it is more obvious that super should be called like in logs (I think?), but this one here is indeed tricky.

FoundationGames commented 4 years ago

This is, unfortunately, not possible since the super method is not blank, it actually appends a conflicting IntProperty to the builder, meaning that the two conflict and the game crashes. This means that calling super will not fix anything, instead it will just break the game.

Neubulae commented 4 years ago

This is, unfortunately, not possible since the super method is not blank, it actually appends a conflicting IntProperty to the builder, meaning that the two conflict and the game crashes. This means that calling super will not fix anything, instead it will just break the game.

...but while I try prepending this to the code, it actually fixes the problem without crashing the game. And yes since the source is incomplete I have to use something to decompile the jar. The only problem is the crops don't grow. Maybe that's also why the game crashes.