Closed Rossterd closed 3 years ago
Can you fix the test failure?
Error: BiomeRecipeTest.testConvertBlockNotInGreenhouse:286
block.setType(<any>);
Never wanted here:
-> at world.bentobox.greenhouses.greenhouse.BiomeRecipeTest.testConvertBlockNotInGreenhouse(BiomeRecipeTest.java:286)
But invoked here:
-> at world.bentobox.greenhouses.greenhouse.BiomeRecipe.convertBlock(BiomeRecipe.java:253)
Ideally, there will be a test with no LocalMaterial and one with it. If you don't know about tests then I can do it, but it'd be great if you can.
Also, how does this solve the issue that Lektro had? Does it?
To be honest, I am new to almost everything github related.. I have some experience bodging code here and there but have only recently taken to programming in a more structured way. I saw the test fail on my other merge aswell but I wasn't quite sure what to do with it. It calls ConvertBlock for a block that isn't inside of a greenhouse expecting to get a rejection while the current Convertblocks logic makes it so that ConvertBlock will never be called on a block outside of a greenhouse. Adding a check would be unnecessary I think. But I wasn't certain enough to outright remove the test. (And removing tests just because they fail feels a bit weird ;) )
I'd happily take a look at making some tests for this, but I don't really know how it all works. Any chance you could point me in a direction?
Sorry about the long delay. I tested it, but apparently not thoroughly enough! It seems like leaving localMaterial = null
implicitly requires air. Will try to investigate this soon
Originally posted by @lekro in https://github.com/BentoBoxWorld/Greenhouses/issues/38#issuecomment-570979270
It seems that the original block conversion logic took localBlock = null as air, it no longer does this so now this works.
Thanks for the changes. I can try this later in the week.
Is there a problem?
Sorry, I was very busy at real life work. I can merge this.
…ck to be required.
Same idea as Lekro, almost the same code