Simplifications to VoxelSniper

Signed-off-by: MattBDev <4009945+MattBDev@users.noreply.github.com>
This commit is contained in:
MattBDev
2019-06-05 15:52:47 -04:00
parent 6c94cca15e
commit e6f2e17bdf
16 changed files with 102 additions and 133 deletions

View File

@@ -1,4 +1,4 @@
/**
/*
This file is part of VoxelSniper, licensed under the MIT License (MIT).
Copyright (c) The VoxelBox <http://thevoxelbox.com>
@@ -71,7 +71,6 @@ import java.util.Map;
import java.util.UUID;
public class Sniper {
private VoxelSniper plugin;
private final UUID player;
private boolean enabled = true;
// private LinkedList<FaweChangeSet> undoList = new LinkedList<>();
@@ -80,7 +79,6 @@ public class Sniper {
public Sniper(VoxelSniper plugin, Player player) {
Preconditions.checkNotNull(plugin);
Preconditions.checkNotNull(player);
this.plugin = plugin;
this.player = player.getUniqueId();
SniperTool sniperTool = new SniperTool(this);
sniperTool.assignAction(SnipeAction.ARROW, Material.ARROW);
@@ -89,7 +87,7 @@ public class Sniper {
}
public String getCurrentToolId() {
return getToolId((getPlayer().getInventory().getItemInMainHand() != null) ? getPlayer().getInventory().getItemInMainHand().getType() : null);
return getToolId(getPlayer().getInventory().getItemInMainHand().getType());
}
public String getToolId(Material itemInHand) {
@@ -397,14 +395,12 @@ public class Sniper {
} else {
changeQueue.flush();
}
if (changeSet != null) {
if (Settings.IMP.HISTORY.COMBINE_STAGES) {
changeSet.closeAsync();
} else {
changeSet.close();
}
session.remember(changeSet.toEditSession(fp));
if (Settings.IMP.HISTORY.COMBINE_STAGES) {
changeSet.closeAsync();
} else {
changeSet.close();
}
session.remember(changeSet.toEditSession(fp));
return true;
}
return false;