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

Island coordinates load/save offset #1105

Closed
Michel-0 opened this issue Jan 5, 2020 · 5 comments
Closed

Island coordinates load/save offset #1105

Michel-0 opened this issue Jan 5, 2020 · 5 comments
Assignees
Labels
Status: Done This issue has been completed or answered. This pull request has been merged. Type: Bug
Milestone

Comments

@Michel-0
Copy link

Michel-0 commented Jan 5, 2020

Island coordinates load/save offset

Island coordinates switching on each server restart

Steps to reproduce the behavior

Our test island will be 50x50 of size, in range from [0|0] to [50|50], without a single block space inbetween isles. Anyway to reproduce, it could be any island in this grid.
The config options (i assume as relevant) look like (i assume as correct for this grid):

distance-between-islands: 25
protection-range: 25
start-x: 2500
start-z: 2500
offset-x: 25
offset-z: 25
island-height: 64
use-own-generator: true
sea-height: 0
max-islands: 1000

Since this is only about loading / saving existing isles, i assume any new island generation relation is off topic here.
So out test island looks like this:

{
  "deleted": false,
  "uniqueId": "BSkyBlock828f2bed-4075-453a-a799-3bf66848dab9",
  "center": [
    "skyBlockMap",
    0.0,
    66.0,
    0.0,
    0.0,
    0.0
  ],
  "range": 25,
  "protectionRange": 25,
  "maxEverProtectionRange": 25,
  "world": "skyBlockMap",
  "gameMode": "BSkyBlock",
  "createdDate": 1431695107401,
  "updatedDate": 1578083770841,
  "owner": "a7ea593e-8d19-3f32-88f5-b5be926049fc",
  "members": {
    "a7ea593e-8d19-3f32-88f5-b5be926049fc": 1
  },
  "spawn": false,
  "purgeProtected": false,
  "flags": {
    "HURT_ANIMALS": 500,
    "DRAGON_EGG": 500,
    "REDSTONE": 500,
    "BUCKET": 500,
    "LOCK": 0,
    "ENDER_PEARL": 500,
    "DOOR": 500,
    "FURNACE": 500,
    "ANVIL": 500,
    "MINECART": 500,
    "FIRE_IGNITE": 500,
    "FISH_SCOOPING": 500,
    "END_PORTAL": 500,
    "BREEDING": 500,
    "HURT_VILLAGERS": 500,
    "CHALLENGES_ISLAND_PROTECTION": 0,
    "TURTLE_EGGS": 500,
    "FROST_WALKER": 500,
    "COLLECT_LAVA": 500,
    "LEAF_DECAY": 500,
    "LEVER": 500,
    "ELYTRA": 0,
    "CAKE": 500,
    "HURT_MONSTERS": 0,
    "RIDING": 500,
    "ARMOR_STAND": 500,
    "NAME_TAG": 500,
    "FIRE_SPREAD": 0,
    "TRADING": 0,
    "EGGS": 500,
    "ITEM_DROP": 0,
    "PVP_OVERWORLD": -1,
    "NOTE_BLOCK": 0,
    "TNT_DAMAGE": 500,
    "FLINT_AND_STEEL": 500,
    "NETHER_PORTAL": 500,
    "LECTERN": 500,
    "CROP_TRAMPLE": 500,
    "ITEM_PICKUP": 0,
    "DROPPER": 500,
    "BREWING": 500,
    "TNT_PRIMING": 500,
    "PVP_END": -1,
    "COLLECT_WATER": 500,
    "BUTTON": 500,
    "FIRE_EXTINGUISH": 500,
    "COMMAND_RANKS": 500,
    "BEACON": 500,
    "TRAPDOOR": 500,
    "EXPERIENCE_BOTTLE_THROWING": 500,
    "PRESSURE_PLATE": 0,
    "DYE": 500,
    "ITEM_FRAME": 500,
    "PLACE_BLOCKS": 500,
    "CRAFTING": 0,
    "ENCHANTING": 0,
    "SHEARING": 500,
    "BOAT": 500,
    "SPAWN_EGGS": 500,
    "BED": 500,
    "PVP_NETHER": -1,
    "MILKING": 0,
    "MONSTER_SPAWN": 0,
    "DISPENSER": 500,
    "GATE": 0,
    "FIRE_BURNING": 500,
    "EXPERIENCE_PICKUP": 500,
    "HOPPER": 500,
    "ANIMAL_SPAWN": 0,
    "LEASH": 500,
    "MOUNT_INVENTORY": 500,
    "BREAK_BLOCKS": 500,
    "CHORUS_FRUIT": 500,
    "CONTAINER": 500,
    "JUKEBOX": 500,
    "POTION_THROWING": 500
  },
  "history": [],
  "levelHandicap": 0,
  "spawnPoint": {
    "NORMAL": [
      "skyBlockMap",
      25.0,
      66.0,
      25.0,
      0.0,
      0.0
    ]
  },
  "doNotLoad": false,
  "cooldowns": {}
}

Expected behavior

After first server startup, we check the protection area of the isle for this player.
If you use the JSON above, it's the offline UUID for name Michel_0. If your testserver is in online mode, you'll need to change the UUID above to yours or my online UUID... i guess you understand.
It simply can be checked by the console command bsbadmin info Michel_0.
Output will be (at least for me):

[15:22:58] [Server thread/INFO]: ========== Island Info ============
[15:22:58] [Server thread/INFO]: UUID: BSkyBlock828f2bed-4075-453a-a799-3bf66848dab9
[15:22:58] [Server thread/INFO]: Owner: Michel_0 (a7ea593e-8d19-3f32-88f5-b5be926049fc)
[15:22:58] [Server thread/INFO]: Last login: Sun Jan 05 00:39:52 CET 2020
[15:22:58] [Server thread/INFO]: Deaths: 0
[15:22:58] [Server thread/INFO]: Resets: 0 (Max: 2)
[15:22:58] [Server thread/INFO]: Team members:
[15:22:58] [Server thread/INFO]: Michel_0 MemorySection[path='bskyblock', root='YamlConfiguration']
[15:22:58] [Server thread/INFO]: Island location: 25,66,25
[15:22:58] [Server thread/INFO]: Island coordinates: 0,0,0 to 49,256,49
[15:22:58] [Server thread/INFO]: Protection range: 25
[15:22:58] [Server thread/INFO]: Largest historical protection range: 25
[15:22:58] [Server thread/INFO]: Protection coordinates: 0,0,0 to 49,256,49

As it is correct and i "expect to be always like that". But it isn't.
Stop the server and you'll see the JSON has been changed.
It contains now [25|25] as center coordinate.
So start the server again and run bsbadmin info Michel_0 again.
It's now (at least for me):

[15:23:58] [Server thread/INFO]: ========== Island Info ============
[15:23:58] [Server thread/INFO]: UUID: BSkyBlock828f2bed-4075-453a-a799-3bf66848dab9
[15:23:58] [Server thread/INFO]: Owner: Michel_0 (a7ea593e-8d19-3f32-88f5-b5be926049fc)
[15:23:58] [Server thread/INFO]: Last login: Sun Jan 05 00:39:52 CET 2020
[15:23:58] [Server thread/INFO]: Deaths: 0
[15:23:58] [Server thread/INFO]: Resets: 0 (Max: 2)
[15:23:58] [Server thread/INFO]: Team members:
[15:23:58] [Server thread/INFO]: Michel_0 MemorySection[path='bskyblock', root='YamlConfiguration']
[15:23:58] [Server thread/INFO]: Island location: 0,66,0
[15:23:58] [Server thread/INFO]: Island coordinates: -25,0,-25 to 24,256,24
[15:23:58] [Server thread/INFO]: Protection range: 25
[15:23:58] [Server thread/INFO]: Largest historical protection range: 25
[15:23:58] [Server thread/INFO]: Protection coordinates: -25,0,-25 to 24,256,24

Which is wrong. Now stop the server and you'll see the center coordinates has been changed back to [0|0]. So start the server again and run bsbadmin info Michel_0 and you'll see it's correct again.
Stop it, JSON changes, start it, it's wrong, stop it, JSON changes, start it, it's correct.... infinite.
Each second start will be with incorrect coordinates.
If i didn't miss something obvious, i would say it's a major bug, since it's about island protection and you can't expect server owners to restart a server twice on each restart, can you?

Screenshots and videos (Optional)

No screenshots necessary i guess. Console output has been posted as text above (i don't like screenshots from console, prefer text directly).

Environment

BentoBox Version (Mandatory)
[16:09:35] [Server thread/INFO]: Running SPIGOT 1.15.1.
[16:09:35] [Server thread/INFO]: BentoBox version: 1.10.0
[16:09:35] [Server thread/INFO]: Database: JSON
[16:09:35] [Server thread/INFO]: Loaded Game Worlds:
[16:09:35] [Server thread/INFO]: skyBlockMap (BSkyBlock): Overworld, Nether, End
[16:09:35] [Server thread/INFO]: Loaded Addons:
[16:09:35] [Server thread/INFO]: BSkyBlock 1.9.0 (ENABLED)
[16:09:35] [Server thread/INFO]: Challenges 0.8.0 (ENABLED)
[16:09:35] [Server thread/INFO]: Level 1.9.0 (ENABLED)

Plugins (Optional)

[16:10:08] [Server thread/INFO]: Plugins (12): CoreProtect, PermissionsEx, WorldEdit, OldMcstats, Vault, BlockLocker, WorldGuard, ChestShop, BentoBox, Essentials, EssentialsSpawn, EssentialsChat

Additional context (Optional)

Nope.

@Poslovitch Poslovitch transferred this issue from BentoBoxWorld/BSkyBlock Jan 5, 2020
@Poslovitch Poslovitch added Status: Pending Waiting for a developer to start working on this issue. Type: Bug labels Jan 5, 2020
@tastybento tastybento self-assigned this Jan 6, 2020
@tastybento tastybento added Status: Under investigation Investigating the interest and the feasability of the issue. and removed Status: Pending Waiting for a developer to start working on this issue. labels Jan 6, 2020
@tastybento
Copy link
Member

The offset settings are not well tested so I can imagine it's a bug. Mostly there are never used, maybe never so that's probably why we haven't seen any issues so far. I'll try and replicate the issue.

@tastybento
Copy link
Member

I've replicated this. Now I need to find out why it's happening.

@tastybento tastybento added Status: In progress Working on the issue. and removed Status: Under investigation Investigating the interest and the feasability of the issue. labels Jan 7, 2020
@tastybento tastybento added this to the 1.11.0 milestone Jan 7, 2020
@Michel-0
Copy link
Author

Michel-0 commented Jan 7, 2020

Thanks for your effort so far, i really hope you will find out why.
Otherwise i won't be able to switch over to BSkyBlock, because i already got many player isles with this grid in my world and didn't find an other way to declare such a 50x50 grid starting at [0|0].
Setting start-x & start-z to 2525 instead of 2000 (apply the offset to start directly) doesn't work either since the grid seems to get validated independent to the start.
Really would like to use BSkyBlock, because it seems as best for me compared with others.
Keep up the good work guys...

@tastybento
Copy link
Member

I've fixed it. Just running the tests now...

@tastybento tastybento added Status: Done This issue has been completed or answered. This pull request has been merged. and removed Status: In progress Working on the issue. labels Jan 7, 2020
@Michel-0
Copy link
Author

Can confirm commit#90ad75baa94c7b1dcfc68c1316bb9bd60def82f8 seems to have it fixed, tested with 1.11b1567.
Our SkyBlock 1.15.1 is now closer than ever... getting into challenges now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Done This issue has been completed or answered. This pull request has been merged. Type: Bug
Projects
None yet
Development

No branches or pull requests

3 participants