Skip to content
Permalink
Browse files

Clear the world override if the selector is called on another world.

  • Loading branch information...
me4502 committed Aug 6, 2019
1 parent 21f0e73 commit 3c737e23005c531ef2978532cdaf089072c16008
@@ -326,6 +326,9 @@ public RegionSelector getRegionSelector(World world) {
if (selector.getWorld() == null || !selector.getWorld().equals(world)) {
selector.setWorld(world);
selector.clear();
if (hasWorldOverride() && !world.equals(getWorldOverride())) {
setWorldOverride(null);
}
}
return selector;
}
@@ -341,6 +344,9 @@ public void setRegionSelector(World world, RegionSelector selector) {
checkNotNull(selector);
selector.setWorld(world);
this.selector = selector;
if (hasWorldOverride() && !world.equals(getWorldOverride())) {
setWorldOverride(null);
}
}

/**
@@ -34,8 +34,8 @@
@Override
public boolean actSecondary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked) {
RegionSelector selector = session.getRegionSelector(player.getWorld());

BlockVector3 blockPoint = clicked.toVector().toBlockPoint();

if (selector.selectPrimary(blockPoint, ActorSelectorLimits.forActor(player))) {
selector.explainPrimarySelection(player, session, blockPoint);
}
@@ -46,6 +46,7 @@ public boolean actSecondary(Platform server, LocalConfiguration config, Player p
public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked) {
RegionSelector selector = session.getRegionSelector(player.getWorld());
BlockVector3 blockPoint = clicked.toVector().toBlockPoint();

if (selector.selectSecondary(blockPoint, ActorSelectorLimits.forActor(player))) {
selector.explainSecondarySelection(player, session, blockPoint);
}

0 comments on commit 3c737e2

Please sign in to comment.
You can’t perform that action at this time.