Removed fix for issue #376, since the problem appears to have been fixed on the CraftBukkit side now.

Also cleaned up the input handlers a bit.
Dieser Commit ist enthalten in:
TomyLobo 2011-11-20 01:45:25 +01:00
Ursprung 1194f4448e
Commit 71d302c893
2 geänderte Dateien mit 28 neuen und 43 gelöschten Zeilen

Datei anzeigen

@ -75,7 +75,7 @@ public class LocalSession {
private boolean fastMode = false;
private Mask mask;
private TimeZone timezone = TimeZone.getDefault();
private Boolean jumptoBlock = true;
//private Boolean jumptoBlock = true;
/**
* Construct the object.
@ -684,20 +684,4 @@ public class LocalSession {
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;
}
}

Datei anzeigen

@ -1015,18 +1015,16 @@ public class WorldEdit {
* @return
*/
public boolean handleArmSwing(LocalPlayer player) {
LocalSession session = getSession(player);
if (player.getItemInHand() == config.navigationWand
&& config.navigationWandMaxDistance > 0
&& (player.hasPermission("worldedit.navigation.jumpto.tool")
|| player.hasPermission("worldedit.navigation.jumpto"))) { // TODO: Remove old permission
// Bug workaround
// Blocks this from being used after the thru function
// @TODO do this right or make craftbukkit do it right
if (!session.canUseJumpto()){
session.toggleJumptoBlock();
return true;
if (player.getItemInHand() == config.navigationWand) {
if (config.navigationWandMaxDistance <= 0) {
return false;
}
if (!player.hasPermission("worldedit.navigation.jumpto.tool")
&& !player.hasPermission("worldedit.navigation.jumpto")) { // TODO: Remove old permission
return false;
}
WorldVector pos = player.getSolidBlockTrace(config.navigationWandMaxDistance);
if (pos != null) {
player.findFreePosition(pos);
@ -1036,6 +1034,8 @@ public class WorldEdit {
return true;
}
LocalSession session = getSession(player);
Tool tool = session.getTool(player.getItemInHand());
if (tool != null && tool instanceof DoubleActionTraceTool) {
if (tool.canUse(player)) {
@ -1043,6 +1043,7 @@ public class WorldEdit {
return true;
}
}
return false;
}
@ -1053,26 +1054,26 @@ public class WorldEdit {
* @return
*/
public boolean handleRightClick(LocalPlayer player) {
LocalSession session = getSession(player);
if (player.getItemInHand() == config.navigationWand) {
if (config.navigationWandMaxDistance <= 0) {
return false;
}
if (player.getItemInHand() == config.navigationWand
&& config.navigationWandMaxDistance > 0
&& (player.hasPermission("worldedit.navigation.thru.tool")
|| player.hasPermission("worldedit.navigation.thru"))) { // TODO: Remove old permission
if (!player.hasPermission("worldedit.navigation.thru.tool")
&& !player.hasPermission("worldedit.navigation.thru")) { // TODO: Remove old permission
return false;
}
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());
LocalSession session = getSession(player);
Tool tool = session.getTool(player.getItemInHand());
if (tool != null && tool instanceof TraceTool) {
if (tool.canUse(player)) {
((TraceTool) tool).actPrimary(server, config, player, session);