mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2024-12-27 05:00:08 +08:00
Fixed issue #376 "right-clicking with a compass on a door is treated if the door was not there and the left mousebutton was clicked."
Also when you use the compass for jumpto/thru it wont interact with items anymore.
This commit is contained in:
parent
5e45fd1625
commit
ddcf948974
@ -77,6 +77,7 @@ public class LocalSession {
|
||||
private boolean fastMode = false;
|
||||
private Mask mask;
|
||||
private TimeZone timezone = TimeZone.getDefault();
|
||||
private Boolean jumptoBlock = true;
|
||||
|
||||
/**
|
||||
* Construct the object.
|
||||
@ -702,4 +703,20 @@ public Mask getMask() {
|
||||
public void setMask(Mask mask) {
|
||||
this.mask = mask;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is used as a workaround for a bug.
|
||||
* It blocks the compass from using the jumpto function after the thru function
|
||||
*/
|
||||
public void toggleJumptoBlock() {
|
||||
this.jumptoBlock = !jumptoBlock;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is used as a workaround for a bug.
|
||||
* @return true if the compass's jumpto function can be used again
|
||||
*/
|
||||
public Boolean canUseJumpto() {
|
||||
return jumptoBlock;
|
||||
}
|
||||
}
|
||||
|
@ -43,6 +43,7 @@
|
||||
import com.sk89q.worldedit.tools.*;
|
||||
import com.sk89q.worldedit.masks.*;
|
||||
import com.sk89q.worldedit.patterns.*;
|
||||
import com.sk89q.worldedit.util.TargetBlock;
|
||||
|
||||
/**
|
||||
* This class is the main entry point for WorldEdit. All events are routed
|
||||
@ -946,12 +947,19 @@ public boolean handleArmSwing(LocalPlayer player) {
|
||||
if (player.getItemInHand() == config.navigationWand
|
||||
&& config.navigationWandMaxDistance > 0
|
||||
&& player.hasPermission("worldedit.navigation.jumpto")) {
|
||||
WorldVector pos = player.getSolidBlockTrace(config.navigationWandMaxDistance);
|
||||
// Bug workaround
|
||||
// Blocks this from being used after the thru function
|
||||
if (!session.canUseJumpto()){
|
||||
session.toggleJumptoBlock();
|
||||
return false;
|
||||
}
|
||||
WorldVector pos = player.getSolidBlockTrace(config.navigationWandMaxDistance);
|
||||
if (pos != null) {
|
||||
player.findFreePosition(pos);
|
||||
} else {
|
||||
player.printError("No block in sight (or too far)!");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Tool tool = session.getTool(player.getItemInHand());
|
||||
@ -980,6 +988,11 @@ public boolean handleRightClick(LocalPlayer player) {
|
||||
if (!player.passThroughForwardWall(40)) {
|
||||
player.printError("Nothing to pass through!");
|
||||
}
|
||||
// Bug workaround, so it wont do the Jumpto compass function
|
||||
// Right after this teleport
|
||||
if (session.canUseJumpto())
|
||||
session.toggleJumptoBlock();
|
||||
return true;
|
||||
}
|
||||
|
||||
Tool tool = session.getTool(player.getItemInHand());
|
||||
|
Loading…
Reference in New Issue
Block a user