Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Caves in prerendered world [CaveBlock] #1694

Closed
andramil opened this issue Feb 28, 2021 · 7 comments
Closed

Create Caves in prerendered world [CaveBlock] #1694

andramil opened this issue Feb 28, 2021 · 7 comments
Assignees
Labels

Comments

@andramil
Copy link

andramil commented Feb 28, 2021

Description

Plugin can't create caves in area where chunks was rendered by plugin or player. Cave creator doesn't ignore stone, doesn't treat it as free space.

New world, new database, new server.
Set BentoBox/addons/CaveBlock/config.yml to:

distance-between-caves: 50
protection-range: 30
start-z: 0
offset-x: 0
offset-z: 0
cave-height: 60
use-own-generator: false
max-caves: 0
default-game-mode: SURVIVAL
default-biome: MOUNTAINS
ban-limit: -1
world-depth: 256
generation-tries: 5
normal:
roof: false
floor: true
main-block: STONE
blocks: []

When player create first cave, he is teleported to his cave home. He will render some chunks [as set in server.properties] around him. Mostly stone, and bedrock as floor. When next person will try to create 2nd cave, creator will start to find free location. 1st should be 0,0 [x/z] 2nd 0,100. Unfortunately, chunks at 0,0 are already rendered as spawn of the world, stone is rendered, plugin think that this space is taken, and looks for other free space. 1st cave was created at 200,200, 1st player render area around him. Next cave can't be placed near him because plugin thinks stone is occupied place so it will find non rendered area ar 200,-200.

8 caves locations (there were only 8 caves)
[x/z]: 1: 200/200 2: 200/-200 3: 200/0 4: -200/300 5: -200/100 6: 0/100 7: 0/300 8: 200/400

If I prerender whole map I cant create any cave:

[17:48:51 INFO]: Cry_Sis issued server command: /tb create
[17:48:53 ERROR]: [BentoBox] Could not find a free spot for islands! Is this world empty?
[17:48:53 ERROR]: [BentoBox] Blocks around center locations: 20 max 20
[17:48:53 ERROR]: [BentoBox] Known islands: 126 max unlimited.
[17:48:53 ERROR]: [BentoBox] Failed to make island - no unoccupied spot found.
[17:48:53 ERROR]: [BentoBox] If the world was imported, try multiple times until all unowned islands are known.
[17:48:53 ERROR]: [BentoBox] Could not create island for player. commands.island.create.cannot-create-island

If I set
main-block: AIR
everything works great, 1st cave loc is 0,0, 2nd 0,100, 3rd 100,100, 4th 100,0 5th 100,-100

Environment:
Spigot 1.16.5
Spigot 1.15.2
Tuinity 1.16.5 - fork of spigot

Output of /bbox version (Mandatory)

`
SERVER: TUNITY
BBOX: 1.15.5
DATABASE: SQLITE

BIOMES 1.14.0 ENABLED
caveblock 1.14.2 ENABLED
Challenges 0.8.3 ENABLED
ControlPanel 1.7.0 ENABLED
DimensionalTrees 1.6.0 ENABLED
Level 2.5.1 ENABLED
WARPS 1.10.2 ENABLED
`

@BONNe
Copy link
Member

BONNe commented Feb 28, 2021

@tastybento
The issue is happening when worldRoof or worldFloor is set to bedrock (option in config).

I have set that CaveBlocks uses custom generator, but it still fails to properly detect empty space and takes bedrock as existing island starting block.

@andramil
Copy link
Author

This one is with main-block: AIR
https://prnt.sc/109o013

This one is with main-block: STONE and roof: false floor: false so no bedrock
https://prnt.sc/109o07n

@tastybento
Copy link
Member

@BONNe The issue is that the new island search algorithm checks for blocks in the vicinity of the new island location. If it finds them then it moves on to another spot. See this line:
https://github.com/BentoBoxWorld/BentoBox/blob/develop/src/main/java/world/bentobox/bentobox/managers/island/DefaultNewIslandLocationStrategy.java#L104

I had a look at adjusting the generator to make a hole when generating a chunk if the island location is in the the chunk, but it won't work if the location is at the edge of the chunk because a 3x3x3 hole is required and it will overlap into an adjacent chunk.

So, the only options are:

  1. Add some setting to WorldSettings to define what a safe Material type is when looking for chunks. This is not scalable though where the material could be anything, e.g., ores, etc.
  2. Add a WorldSettings to disable block looking.
  3. Change the block looking to just look for one block and have the CaveBlock generator make a hole. I don't like this though because the hole could fill up with water or lava accidentally.
  4. Remove the block looking. This will cause problems with any worlds that have unowned islands hanging around, like migrations to ASkyBlock.

Right now, it looks like only Option 2 is viable. I think this is the best option because it is unlikely that anyone is going to migrate islands to CaveBlock, unlike ASkyBlock or other SkyBlock worlds.

I'll make a change to BentoBox to enable this option with a default on. CaveBlock can then set it to off.

@BONNe
Copy link
Member

BONNe commented Feb 28, 2021

How does it affect SkyGrid or Boxed?
Shouldn't they also generate empty slots for islands?

I agree with option 2.

@tastybento
Copy link
Member

Yes, it affects Boxed and SkyGrid.

@tastybento
Copy link
Member

Please test with the latest SNAPSHOT build from https://ci.bentobox.world.

@andramil
Copy link
Author

andramil commented Mar 3, 2021

BB 1999 and CB 374. It works good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants