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

/is reset resetting chunks from other player's islands #405

Closed
ProSl3nderMan opened this issue Dec 19, 2018 · 12 comments
Closed

/is reset resetting chunks from other player's islands #405

ProSl3nderMan opened this issue Dec 19, 2018 · 12 comments
Assignees
Milestone

Comments

@ProSl3nderMan
Copy link

ProSl3nderMan commented Dec 19, 2018

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.

@tastybento
Copy link
Member

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

@ProSl3nderMan
Copy link
Author

configs.zip

@tastybento
Copy link
Member

tastybento commented Dec 20, 2018

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

@tastybento tastybento self-assigned this Dec 20, 2018
@tastybento tastybento added Type: Bug Status: Under investigation Investigating the interest and the feasability of the issue. labels Dec 20, 2018
@ProSl3nderMan
Copy link
Author

How embarrassing... here:
configs.zip

@tastybento
Copy link
Member

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

@ProSl3nderMan
Copy link
Author

ProSl3nderMan commented Dec 20, 2018

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

@tastybento
Copy link
Member

Okay, thanks. I can replicate this now.

@Poslovitch
Copy link
Member

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.

@tastybento
Copy link
Member

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.

tastybento added a commit that referenced this issue Dec 20, 2018
#405

Adds test class for DeleteIslandChunks class.
@Poslovitch
Copy link
Member

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

@tastybento
Copy link
Member

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.

@tastybento
Copy link
Member

@ProSl3nderMan Thanks for the report and the video!

@tastybento tastybento removed the Status: Under investigation Investigating the interest and the feasability of the issue. label Dec 20, 2018
@Poslovitch Poslovitch added this to the Alpha 13 milestone Dec 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants