AgriCraft

AgriCraft

30M Downloads

[1.10.2] Unanalyzed Seeds cause crash on Mutation tick (a18)

DevOpDan opened this issue ยท 4 comments

commented

Tested on a fresh install for 1.10.2
AgriCraft: a18 (Latest)
InfinityLib: 0.10.0 (Latest)
Forge: 2185 (Recommended)

I have been experimenting with crop mutations in a fresh install when I encountered a ticking world crash. Upon further experimentation I discovered I forgot to Analyze my seeds on one of my farms. I tested a small 2x2 farm with the typical mutation set up with Analyzed seeds only and left the game running for a while. I got the typical weeds, but eventually a successful mutation without issue.

I then re-tried with Unanalyzed seeds and began to once again get a ticking world error relating to the mutations API. My logical guess is that the NBT data is of course missing on an unanalyzed seed causing the error.

Description: Exception ticking world

java.lang.AbstractMethodError: Method com/infinityraider/agricraft/tiles/TileEntityCrop.getWorld()Lnet/minecraft/world/World; is abstract
	at com.infinityraider.agricraft.tiles.TileEntityCrop.getWorld(TileEntityCrop.java)
	at com.infinityraider.agricraft.farming.mutation.MutateStrategy.executeStrategy(MutateStrategy.java:32)
	at com.infinityraider.agricraft.api.v1.mutation.IAgriMutationEngine.lambda$attemptCross$0(IAgriMutationEngine.java:34)
	at java.util.Optional.flatMap(Unknown Source)
	at com.infinityraider.agricraft.api.v1.mutation.IAgriMutationEngine.attemptCross(IAgriMutationEngine.java:34)
	at com.infinityraider.agricraft.tiles.TileEntityCrop.crossOver(TileEntityCrop.java:495)
	at com.infinityraider.agricraft.tiles.TileEntityCrop.onGrowthTick(TileEntityCrop.java:57)
	at java.util.Optional.ifPresent(Unknown Source)
	at com.infinityraider.agricraft.blocks.BlockCrop.func_180650_b(BlockCrop.java:91)
	at net.minecraft.block.Block.func_180645_a(Block.java:480)
	at net.minecraft.world.WorldServer.func_147456_g(WorldServer.java:471)
	at net.minecraft.world.WorldServer.func_72835_b(WorldServer.java:220)
	at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:698)
	at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:613)
	at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:149)
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:471)
	at java.lang.Thread.run(Unknown Source)

I believe #993 may be related.

Here is the full log: https://paste.ee/p/sQpr0

This screenshot shows the Analyzed farm which I left running long enough to get a successful mutation.
2017-06-08_17 27 29

This farm is unanalyzed, created later; never mutates, just crashes.
2017-06-08_17 27 32

commented

Looks related to #989... Still abstract method errors really should be caught by the compiler which is what makes this so odd of an issue.

commented

For the sake of sanity, I'm combining this issue with #989.

commented

@LordDan1989 I came back to this report since unlike the others, you found a set of steps that avoided the crash. But I've looked at the code, and I'm a little perplexed because the crash happens before any of the neighboring plants are looked at, and so the analysis state shouldn't affect the crash conditions. At the same time, the problematic line(s) of code cannot be avoided when a plant is created because of a crossover event. So I'm really wondering how the successful mutation is possible. ๐Ÿ˜• Can you confirm that you're using the latest default JSONs. Also, and I'm sorry to have a doubt, but is it possible that the successful case was previous an empty regular crop instead of a cross-crop? Thank you again, very much!

commented

@CodesCubesAndCrashes Interestingly I think I may have since had a crash even with analyzed seeds. I need to do some more experimenting. I haven't touched the JSON files myself yet, but I'll make sure they're update and test that as well and report back any findings.