BentoBoxWorld / Greenhouses

BentoBox Add-on to enable personal biomes in a glass greenhouse
Eclipse Public License 2.0
13 stars 9 forks source link

Greenhouses made below y=0 give the error "You must be inside the greenhouse to try to make it" #94

Closed Zorua162 closed 1 year ago

Zorua162 commented 1 year ago

Expected behavior

When creating a valid greenhouse below y=0 it creates as a normal valid greenhouse would

Observed/Actual behavior

When attempting to make the valid greenhouse the error "You must be inside the greenhouse to try to make it" is displayed. image

Steps/models to reproduce

Create a greenhouse below y=0, attempt to make the greenhouse, view error in chat

BentoBox version

[21:43:34 INFO]: Running PAPER 1.19.                                                                                    
[21:43:34 INFO]: BentoBox version: 1.21.1                                                                               
[21:43:34 INFO]: Database: JSON                                                                                         
[21:43:34 INFO]: Loaded Game Worlds:                                                                                    
[21:43:34 INFO]: bskyblock_world (BSkyBlock): Overworld, Nether, The End                                                
[21:43:34 INFO]: Loaded Addons:                                                                                         
[21:43:34 INFO]: BSkyBlock 1.16.0 (ENABLED)                                                                             
[21:43:34 INFO]: Greenhouses 1.7.0 (ENABLED) 

Plugin list

[21:44:44 INFO]: Plugins (1): BentoBox

Other

No response

Zorua162 commented 1 year ago

As an extra insight I added logging statements to the area that does this error check:

        Bukkit.getLogger().info(roof.getLocation().getBlockY() + " : " + y);
        if (roof.getLocation().getBlockY() <= y) {
            result.add(GreenhouseResult.FAIL_BELOW);
        }

And I found that roof.getLocation().getBlockY() doesn't seem to be giving the right location? I.e the output is: [21:55:07 INFO]: -49 : -47 (so roof.getLocation().getBlockY()=-49 and y=-47) My player was stood at y=-50 and the greenhouse roof was at y=-47

Zorua162 commented 1 year ago

I've proposed a fix in #95, worth having a look if that is acceptable or not, and then hopefully close this from there

Zorua162 commented 1 year ago

Closed from the merge of #95