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 b58a3a6 commit 03a36fd6e167a8cb0e34056d5cd1e867d89f31ee
@@ -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 03a36fd

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