Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-25 02:20:07 +01:00
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:
Ursprung
1194f4448e
Commit
71d302c893
@ -75,7 +75,7 @@ public class LocalSession {
|
|||||||
private boolean fastMode = false;
|
private boolean fastMode = false;
|
||||||
private Mask mask;
|
private Mask mask;
|
||||||
private TimeZone timezone = TimeZone.getDefault();
|
private TimeZone timezone = TimeZone.getDefault();
|
||||||
private Boolean jumptoBlock = true;
|
//private Boolean jumptoBlock = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct the object.
|
* Construct the object.
|
||||||
@ -684,20 +684,4 @@ public class LocalSession {
|
|||||||
public void setMask(Mask mask) {
|
public void setMask(Mask mask) {
|
||||||
this.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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1015,18 +1015,16 @@ public class WorldEdit {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public boolean handleArmSwing(LocalPlayer player) {
|
public boolean handleArmSwing(LocalPlayer player) {
|
||||||
LocalSession session = getSession(player);
|
if (player.getItemInHand() == config.navigationWand) {
|
||||||
if (player.getItemInHand() == config.navigationWand
|
if (config.navigationWandMaxDistance <= 0) {
|
||||||
&& config.navigationWandMaxDistance > 0
|
return false;
|
||||||
&& (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.hasPermission("worldedit.navigation.jumpto.tool")
|
||||||
|
&& !player.hasPermission("worldedit.navigation.jumpto")) { // TODO: Remove old permission
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
WorldVector pos = player.getSolidBlockTrace(config.navigationWandMaxDistance);
|
WorldVector pos = player.getSolidBlockTrace(config.navigationWandMaxDistance);
|
||||||
if (pos != null) {
|
if (pos != null) {
|
||||||
player.findFreePosition(pos);
|
player.findFreePosition(pos);
|
||||||
@ -1036,6 +1034,8 @@ public class WorldEdit {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LocalSession session = getSession(player);
|
||||||
|
|
||||||
Tool tool = session.getTool(player.getItemInHand());
|
Tool tool = session.getTool(player.getItemInHand());
|
||||||
if (tool != null && tool instanceof DoubleActionTraceTool) {
|
if (tool != null && tool instanceof DoubleActionTraceTool) {
|
||||||
if (tool.canUse(player)) {
|
if (tool.canUse(player)) {
|
||||||
@ -1043,6 +1043,7 @@ public class WorldEdit {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1053,26 +1054,26 @@ public class WorldEdit {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public boolean handleRightClick(LocalPlayer player) {
|
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
|
if (!player.hasPermission("worldedit.navigation.thru.tool")
|
||||||
&& config.navigationWandMaxDistance > 0
|
&& !player.hasPermission("worldedit.navigation.thru")) { // TODO: Remove old permission
|
||||||
&& (player.hasPermission("worldedit.navigation.thru.tool")
|
return false;
|
||||||
|| player.hasPermission("worldedit.navigation.thru"))) { // TODO: Remove old permission
|
}
|
||||||
|
|
||||||
if (!player.passThroughForwardWall(40)) {
|
if (!player.passThroughForwardWall(40)) {
|
||||||
player.printError("Nothing to pass through!");
|
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;
|
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 != null && tool instanceof TraceTool) {
|
||||||
if (tool.canUse(player)) {
|
if (tool.canUse(player)) {
|
||||||
((TraceTool) tool).actPrimary(server, config, player, session);
|
((TraceTool) tool).actPrimary(server, config, player, session);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren