Bonsai Trees 3

Bonsai Trees 3

51M Downloads

Soils are missing in DevEnv

LatvianModder opened this issue ยท 4 comments

commented

Bonsai Trees version: bonsaitrees-1.1.2-b144.jar
Forge version: 2784
I am not using Optifine: That's a silly question, you see, if I answer yes that means Yes, I'm not using Optifine, but if I answer no, that means No, I'm not using Optifine. Either way, I don't have Optifine.
Link to Crashlog: Doesn't crash, but shows this error:

[16:35:13] [Server thread/FATAL] [minecraft/MinecraftServer]: Error executing task
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: bound must be positive
	at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_172]
	at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_172]
	at net.minecraft.util.Util.runTask(Util.java:54) [Util.class:?]
	at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:798) [MinecraftServer.class:?]
	at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:743) [MinecraftServer.class:?]
	at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:192) [IntegratedServer.class:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:592) [MinecraftServer.class:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_172]
Caused by: java.lang.IllegalArgumentException: bound must be positive
	at java.util.Random.nextInt(Random.java:388) ~[?:1.8.0_172]
	at org.dave.bonsaitrees.block.BlockBonsaiPot.onBlockActivated(BlockBonsaiPot.java:327) ~[BlockBonsaiPot.class:?]
	at net.minecraft.server.management.PlayerInteractionManager.processRightClickBlock(PlayerInteractionManager.java:475) ~[PlayerInteractionManager.class:?]
	at net.minecraft.network.NetHandlerPlayServer.processTryUseItemOnBlock(NetHandlerPlayServer.java:769) ~[NetHandlerPlayServer.class:?]
	at net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock.processPacket(CPacketPlayerTryUseItemOnBlock.java:68) ~[CPacketPlayerTryUseItemOnBlock.class:?]
	at net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock.processPacket(CPacketPlayerTryUseItemOnBlock.java:13) ~[CPacketPlayerTryUseItemOnBlock.class:?]
	at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:21) ~[PacketThreadUtil$1.class:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_172]
	at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) ~[?:1.8.0_172]
	at java.util.concurrent.FutureTask.run(FutureTask.java) ~[?:1.8.0_172]
	at net.minecraft.util.Util.runTask(Util.java:53) ~[Util.class:?]
	... 5 more

Screenshot (if possible):

Description of the problem including expected versus actual behavior: Nothing happens when you right-click on bonsai Pot with soil, probably because they are missing from registry

Steps to reproduce: Right-click with any soil on Bonsai Pot in DevEnv.

commented

That seems to be an issue with the ResourceLoader class which seems to not be working on all dev-environments. It's working on my end, which makes debugging this a bit trickier.

The actual error must be happening somewhere here.

Weird that its working for the trees itself though.
Does the debug log say anything about loading soils during mod initialization?

As a temporary workaround you could manually copy the files from the dev env soils.d folder to the runtime config soils.d folder.

commented

Im pretty sure you can't read file like that from class resourse. I recommend parsing the InputStream directly, but also you can look at how Forge reads recipes, in CraftingHelper loadRecipes() method

commented

It's working for the trees though.
Also working on my dev environment for the soils.

commented

Copying files manually fixed it. I copied files for shapes too, but those still dont work. The tree is invisible. Resources are getting produced correctly, so its fine