Bentobox: /is reset resetting chunks from other player's islands

Created on 19 Dec 2018  路  12Comments  路  Source: BentoBoxWorld/BentoBox

Description
All islands with a positive x and negative x coords on the SAME island will loose 2 blocks in their negative x side if the player to their negative x side resets their island. This also happens with islands that have positive z and negative z coords on the SAME island, they will loose 2 blocks in their negative z side if the player to their negative z side resets their island. Now, I cannot explain this in greater detail because of how confusing it can be, please watch this video to get a good explanation of what is happening:
https://www.youtube.com/watch?v=mSiEf-7lBRY&feature=youtu.be

Steps to reproduce the behavior:

  1. create an island at a position where the island will have one half as positive x and the other negative x.
  2. create another island next to it (has to be up against the negative x side of the island created in the previous step).
  3. The first island you created, build all the way up to the border of that island.
  4. Go to the second island created and reset that island.
  5. Go back to the first island you created and notice it deleted two blocks of the blocks you placed up against the border.
    To text for the positive z and negative z coords islands, do the same exact steps as above but replace x with z.
    Watch this video for a better explanation and a tutorial on how I produced these bugs:
    https://www.youtube.com/watch?v=mSiEf-7lBRY&feature=youtu.be

Expected behavior
What I expect to happen is when the player resets their island, it does not take out 2 blocks into another player's island. Only islands with half positive and half negative coords loose 2 blocks, and they only loose the 2 blocks in the negative side of their island.

Screenshots
Instead of screenshots, I made a video:
https://www.youtube.com/watch?v=mSiEf-7lBRY&feature=youtu.be

Server Information:

  • Database being used (YAML, JSON, MySQL, MongoDB): YAML
  • OS: [e.g. iOS] Ubuntu 18
  • Java Version: [e.g. Java 8] Java 8
  • BentoBox version: [e.g. 1.7.2.21] Bentobox version: 0.16.0
  • Addons installed? [Do '/bentobox version' and copy/paste from the console]
    > [15:45:15 INFO]: Loaded Game Worlds:
    > [15:45:15 INFO]: BSkyBlock_world (BSkyBlock)
    > [15:45:15 INFO]: Loaded Add-Ons
    > [15:45:15 INFO]: BSkyBlock 0.5.0-SNAPSHOT
    > [15:45:15 INFO]: Level 0.1.0-SNAPSHOT
    > [15:45:15 INFO]: BentoBox-Challenges 0.2.2-SNAPSHOT
    > [15:45:15 INFO]: WelcomeWarps 0.1.0-SNAPSHOT
  • Other plugins? [Do '/plugins' and copy/paste from the console] CoreProtect, ProTest, ProChristmas, LuckPerms, dynmap, WorldEdit, BentoBox, PacketListenerApi, PlugMan, ProEssentials, Ridables, PerWorldInventory, WorldBorder, ProEverything, CraftingStore, LiteBans, Votifier, StaffPlus, ProShop, Multiverse-Core, WorldGuard, GriefPrevention, GriefPreventionFlags, ProWarps, MobFarmManager

I do believe this problem can be fixed in the util class "DeleteIslandChunks," the problem should be how the chunks are being calculated/found. I would try fixing myself but I am not good with that type of math.

Bug

All 12 comments

What config do you have? You can drag and drop it to this ticket (may need to zip it)

@ProSl3nderMan You put the same config (BentoBox's) in both files :-) I'm really after your island size and protection size settings.

How embarrassing... here:
configs.zip

Also, to help, could you give me the center coordinates of the two islands in the first example shown in the video?

The island not being reset: x:0 y:120 z:-128
The island that was /is reset: x: -128 y: 120 z: -128

Okay, thanks. I can replicate this now.

Might be our chunk-based island-deleter working too well? :laugh:
I hope you'll find a fix for that @tastybento.

@ProSl3nderMan Thanks for the explanatory video. That helps us a lot.

The problem was with the way that chunk coordinates were being calculated. The correct way is to use signed right shift >> 4 but I was doing divide /16. Divide doesn't work with negative values correctly.

Use bit shift instead of dividing? I didn't know we could use bit shifting in Java.

Yes, that is how actually Minecraft calculates chunk values, by doing >> 4. I double checked Dinnerbone's own code after seeing the difference with negative coordinates.

@ProSl3nderMan Thanks for the report and the video!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

voodootje0 picture voodootje0  路  6Comments

OverBrave picture OverBrave  路  5Comments

SirvydasS picture SirvydasS  路  6Comments

OverBrave picture OverBrave  路  4Comments

rudipratm picture rudipratm  路  4Comments