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

Fix region restrictions with methods non-overriden #1948

Merged

Conversation

Aurelien30000
Copy link
Member

Overview

Fixes IntellectualSites/fastasyncvoxelsniper#195

Description

FAWE handles internally region restrictions through ExditSession. However, FAWE does not override methods correctlty with direct coordinates (x, y, z) in FaweRegionExtent. Thus, the block may be returned without any process of the region restriction extents.

Example:

ExtentTraverser<Extent> traverser = new ExtentTraverser<>(editSession.getExtent());
while (traverser != null && traverser.exists()) {
    Extent extent = traverser.get();
    if (extent instanceof SingleRegionExtent singleRegionExtent) {
        System.out.println(singleRegionExtent.getRegions().iterator().next().toString());

        // Polished andeside, inside plot.
        System.out.println(singleRegionExtent.getBlock(-3938, 64, 1571));
        System.out.println(singleRegionExtent.getBlock(BlockVector3.at(-3938, 64, 1571)));

        // Brick slab, the plot border.
        System.out.println(singleRegionExtent.getBlock(-3938, 65, 1570));
        System.out.println(singleRegionExtent.getBlock(BlockVector3.at(-3938, 65, 1570)));
    }
    traverser = traverser.next();
}
[21:19:44 INFO]: minecraft:polished_andesite
[21:19:44 INFO]: minecraft:polished_andesite
[21:19:44 INFO]: minecraft:brick_slab[type=bottom,waterlogged=false]
[21:19:44 INFO]: minecraft:air

Perhaps such a fix could be deployed to other extents that have the same issue.

Submitter Checklist

  • Make sure you are opening from a topic branch (/feature/fix/docs/ branch (right side)) and not your main branch.
  • Ensure that the pull request title represents the desired changelog entry.
  • New public fields and methods are annotated with @since TODO.
  • I read and followed the contribution guidelines.

@Aurelien30000 Aurelien30000 requested a review from a team as a code owner September 15, 2022 19:06
@github-actions github-actions bot added the Bugfix This PR fixes a bug label Sep 15, 2022
@Aurelien30000 Aurelien30000 changed the title Fix region registrictions with methods non-overriden Fix region restrictions with methods non-overriden Sep 15, 2022
@NotMyFault NotMyFault merged commit 2e386ea into IntellectualSites:main Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugfix This PR fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug with /b and PlotSquared borders
3 participants