Remove CUI and other cleaning

This commit is contained in:
MattBDev
2019-06-06 18:39:51 -04:00
parent b42553116c
commit 229182aa63
28 changed files with 574 additions and 2653 deletions

View File

@ -57,6 +57,7 @@ import java.util.EnumMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.atomic.AtomicBoolean;
import static com.google.common.base.Preconditions.checkNotNull;
@ -139,9 +140,9 @@ public class PlatformManager {
// Check whether this platform was chosen to be the preferred one
// for any capability and be sure to remove it
Iterator<Map.Entry<Capability, Platform>> it = preferences.entrySet().iterator();
Iterator<Entry<Capability, Platform>> it = preferences.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<Capability, Platform> entry = it.next();
Entry<Capability, Platform> entry = it.next();
if (entry.getValue().equals(platform)) {
entry.getKey().unload(this, entry.getValue());
it.remove();
@ -347,6 +348,7 @@ public class PlatformManager {
event.setCancelled(true);
return;
}
if (session.hasSuperPickAxe() && player.isHoldingPickAxe()) {
final BlockTool superPickaxe = session.getSuperPickaxe();
if (superPickaxe != null && superPickaxe.canUse(player)) {
@ -357,8 +359,8 @@ public class PlatformManager {
return;
}
}
final Tool tool = session.getTool(player);
if (tool != null && tool instanceof DoubleActionBlockTool) {
Tool tool = session.getTool(player);
if (tool instanceof DoubleActionBlockTool) {
if (tool.canUse(player)) {
FawePlayer<?> fp = FawePlayer.wrap(player);
final Player maskedPlayerWrapper = new LocationMaskedPlayerWrapper(PlayerWrapper.wrap((Player) actor), ((Player) actor).getLocation());
@ -372,6 +374,7 @@ public class PlatformManager {
return;
}
}
} else if (event.getType() == Interaction.OPEN) {
if (session.isToolControlEnabled() && player.getItemInHand(HandSide.MAIN_HAND).getType().getId().equals(getConfiguration().wandItem)) {
if (!actor.hasPermission("worldedit.selection.pos")) {
@ -392,12 +395,13 @@ public class PlatformManager {
}
}, false, true);
}
event.setCancelled(true);
return;
}
final Tool tool = session.getTool(player);
if (tool != null && tool instanceof BlockTool) {
Tool tool = session.getTool(player);
if (tool instanceof BlockTool) {
if (tool.canUse(player)) {
FawePlayer<?> fp = FawePlayer.wrap(player);
if (fp.checkAction()) {
@ -439,8 +443,8 @@ public class PlatformManager {
// Create a proxy actor with a potentially different world for
// making changes to the world
Player actor = createProxyActor(event.getPlayer());
final Player player = new LocationMaskedPlayerWrapper(PlayerWrapper.wrap(actor), actor.getLocation(), true);
final LocalSession session = worldEdit.getSessionManager().get(player);
Player player = new LocationMaskedPlayerWrapper(PlayerWrapper.wrap(actor), actor.getLocation(), true);
LocalSession session = worldEdit.getSessionManager().get(player);
VirtualWorld virtual = session.getVirtualWorld();
if (virtual != null) {
@ -451,7 +455,7 @@ public class PlatformManager {
try {
switch (event.getInputType()) {
case PRIMARY: {
if (getConfiguration().navigationWandMaxDistance > 0 && player.getItemInHand(HandSide.MAIN_HAND).getType().getId().equals(getConfiguration().navigationWand)) {
if ((getConfiguration().navigationWandMaxDistance > 0) && player.getItemInHand(HandSide.MAIN_HAND).getType().getId().equals(getConfiguration().navigationWand)) {
if (!player.hasPermission("worldedit.navigation.jumpto.tool")) {
return;
}
@ -476,6 +480,7 @@ public class PlatformManager {
return;
}
}
break;
}
@ -521,5 +526,4 @@ public class PlatformManager {
}
}