mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-22 07:56:52 +00:00
More work on getting commands to compile
This commit is contained in:
@ -4,9 +4,27 @@ import com.boydti.fawe.config.BBC;
|
||||
import com.boydti.fawe.object.FawePlayer;
|
||||
import com.sk89q.minecraft.util.commands.CommandException;
|
||||
import com.sk89q.worldedit.extension.platform.PlatformCommandManager;
|
||||
import com.sk89q.worldedit.util.command.parametric.ExceptionConverter;
|
||||
import com.sk89q.worldedit.internal.command.exception.ExceptionConverter;
|
||||
import com.thevoxelbox.voxelsniper.api.command.VoxelCommand;
|
||||
import com.thevoxelbox.voxelsniper.command.*;
|
||||
import com.thevoxelbox.voxelsniper.command.VoxelBrushCommand;
|
||||
import com.thevoxelbox.voxelsniper.command.VoxelBrushToolCommand;
|
||||
import com.thevoxelbox.voxelsniper.command.VoxelCenterCommand;
|
||||
import com.thevoxelbox.voxelsniper.command.VoxelChunkCommand;
|
||||
import com.thevoxelbox.voxelsniper.command.VoxelDefaultCommand;
|
||||
import com.thevoxelbox.voxelsniper.command.VoxelGoToCommand;
|
||||
import com.thevoxelbox.voxelsniper.command.VoxelHeightCommand;
|
||||
import com.thevoxelbox.voxelsniper.command.VoxelInkCommand;
|
||||
import com.thevoxelbox.voxelsniper.command.VoxelInkReplaceCommand;
|
||||
import com.thevoxelbox.voxelsniper.command.VoxelListCommand;
|
||||
import com.thevoxelbox.voxelsniper.command.VoxelPaintCommand;
|
||||
import com.thevoxelbox.voxelsniper.command.VoxelPerformerCommand;
|
||||
import com.thevoxelbox.voxelsniper.command.VoxelReplaceCommand;
|
||||
import com.thevoxelbox.voxelsniper.command.VoxelSniperCommand;
|
||||
import com.thevoxelbox.voxelsniper.command.VoxelUndoCommand;
|
||||
import com.thevoxelbox.voxelsniper.command.VoxelUndoUserCommand;
|
||||
import com.thevoxelbox.voxelsniper.command.VoxelVoxelCommand;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -14,9 +32,6 @@ import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class VoxelSniperListener implements Listener {
|
||||
|
||||
|
@ -17,7 +17,7 @@ public CloneStampBrush() {
|
||||
/**
|
||||
* The clone method is used to grab a snapshot of the selected area dictated blockPositionY targetBlock.x y z v.brushSize v.voxelHeight and v.cCen.
|
||||
* <p/>
|
||||
* x y z -- initial center of the selection v.brushSize -- the radius of the cylinder v.voxelHeight -- the heigth of the cylinder c.cCen -- the offset on
|
||||
* x y z -- initial center of the selection v.brushSize -- the radius of the cylinder v.voxelHeight -- the height of the cylinder c.cCen -- the offset on
|
||||
* the Y axis of the selection ( bottom of the cylinder ) as blockPositionY: Bottom_Y = targetBlock.y + v.cCen;
|
||||
*
|
||||
* @param v Sniper Caller
|
||||
@ -71,7 +71,7 @@ public CloneStampBrush() {
|
||||
}
|
||||
}
|
||||
}
|
||||
v.sendMessage(ChatColor.GREEN + String.valueOf(this.clone.size()) + ChatColor.AQUA + " blocks copied sucessfully.");
|
||||
v.sendMessage(ChatColor.GREEN + String.valueOf(this.clone.size()) + ChatColor.AQUA + " blocks copied successfully.");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -174,7 +174,7 @@ public class ErodeBrush extends Brush {
|
||||
vm.brushName(this.getName());
|
||||
vm.size();
|
||||
vm.custom(ChatColor.AQUA + "Erosion minimum exposed faces set to " + this.currentPreset.getErosionFaces());
|
||||
vm.custom(ChatColor.BLUE + "Fill minumum touching faces set to " + this.currentPreset.getFillFaces());
|
||||
vm.custom(ChatColor.BLUE + "Fill minimum touching faces set to " + this.currentPreset.getFillFaces());
|
||||
vm.custom(ChatColor.DARK_BLUE + "Erosion recursion amount set to " + this.currentPreset.getErosionRecursion());
|
||||
vm.custom(ChatColor.DARK_GREEN + "Fill recursion amount set to " + this.currentPreset.getFillRecursion());
|
||||
}
|
||||
@ -252,9 +252,9 @@ public class ErodeBrush extends Brush {
|
||||
/**
|
||||
* Generates a concat string of all options.
|
||||
*
|
||||
* @param seperator Seperator for delimiting entries.
|
||||
* @param separator Separator for delimiting entries.
|
||||
*/
|
||||
public static String getValuesString(String seperator) {
|
||||
public static String getValuesString(String separator) {
|
||||
StringBuilder valuesString = new StringBuilder();
|
||||
|
||||
boolean delimiterHelper = true;
|
||||
@ -262,7 +262,7 @@ public class ErodeBrush extends Brush {
|
||||
if (delimiterHelper) {
|
||||
delimiterHelper = false;
|
||||
} else {
|
||||
valuesString.append(seperator);
|
||||
valuesString.append(separator);
|
||||
}
|
||||
valuesString.append(preset.name());
|
||||
}
|
||||
|
@ -102,10 +102,10 @@ public class Rot3DBrush extends Brush {
|
||||
|
||||
private void rotate(final SnipeData v) {
|
||||
// basically 1) make it a sphere we are rotating in, not a cylinder
|
||||
// 2) do three rotations in a row, one in each dimension, unless some dimensions are set to zero or udnefined or whatever, then skip those.
|
||||
// --> Why not utilize Sniper'world new oportunities and have arrow rotate all 3, powder rotate x, goldsisc y, otherdisc z. Or something like that. Or
|
||||
// 2) do three rotations in a row, one in each dimension, unless some dimensions are set to zero or undefined or whatever, then skip those.
|
||||
// --> Why not utilize Sniper'world new opportunities and have arrow rotate all 3, powder rotate x, goldsisc y, otherdisc z. Or something like that. Or
|
||||
// we
|
||||
// could just use arrow and powder and just differenciate between left and right click that gis 4 different situations
|
||||
// could just use arrow and powder and just differentiate between left and right click that gis 4 different situations
|
||||
// --> Well, there would be 7 different possibilities... X, Y, Z, XY, XZ, YZ, XYZ, and different numbers of parameters for each, so I think each having
|
||||
// and item is too confusing. How about this: arrow = rotate one dimension, based on the face you click, and takes 1 param... powder: rotates all three
|
||||
// at once, and takes 3 params.
|
||||
|
@ -27,8 +27,8 @@ public class SnowConeBrush extends Brush {
|
||||
}
|
||||
|
||||
final int brushSizeDoubled = 2 * brushSize;
|
||||
final int[][] snowcone = new int[brushSizeDoubled + 1][brushSizeDoubled + 1]; // Will hold block IDs
|
||||
final int[][] snowconeData = new int[brushSizeDoubled + 1][brushSizeDoubled + 1]; // Will hold data values for snowcone
|
||||
final int[][] snowCone = new int[brushSizeDoubled + 1][brushSizeDoubled + 1]; // Will hold block IDs
|
||||
final int[][] snowConeData = new int[brushSizeDoubled + 1][brushSizeDoubled + 1]; // Will hold data values for snowCone
|
||||
final int[][] yOffset = new int[brushSizeDoubled + 1][brushSizeDoubled + 1];
|
||||
// prime the arrays
|
||||
|
||||
@ -44,12 +44,12 @@ public class SnowConeBrush extends Brush {
|
||||
}
|
||||
}
|
||||
}
|
||||
snowcone[x][z] = this.getBlockIdAt(blockPositionX - brushSize + x, blockPositionY - yOffset[x][z], blockPositionZ - brushSize + z);
|
||||
snowconeData[x][z] = this.clampY(blockPositionX - brushSize + x, blockPositionY - yOffset[x][z], blockPositionZ - brushSize + z).getPropertyId();
|
||||
snowCone[x][z] = this.getBlockIdAt(blockPositionX - brushSize + x, blockPositionY - yOffset[x][z], blockPositionZ - brushSize + z);
|
||||
snowConeData[x][z] = this.clampY(blockPositionX - brushSize + x, blockPositionY - yOffset[x][z], blockPositionZ - brushSize + z).getPropertyId();
|
||||
}
|
||||
}
|
||||
|
||||
// figure out new snowheights
|
||||
// figure out new snowHeights
|
||||
for (int x = 0; x <= brushSizeDoubled; x++) {
|
||||
final double xSquared = Math.pow(x - brushSize, 2);
|
||||
|
||||
@ -61,35 +61,35 @@ public class SnowConeBrush extends Brush {
|
||||
if (snowData >= 0) { // no funny business
|
||||
switch (snowData) {
|
||||
case 0:
|
||||
if (BlockTypes.get(snowcone[x][z]).getMaterial().isAir()) {
|
||||
snowcone[x][z] = BlockTypes.SNOW.getInternalId();
|
||||
snowconeData[x][z] = 0;
|
||||
if (BlockTypes.get(snowCone[x][z]).getMaterial().isAir()) {
|
||||
snowCone[x][z] = BlockTypes.SNOW.getInternalId();
|
||||
snowConeData[x][z] = 0;
|
||||
}
|
||||
break;
|
||||
case 7: // Turn largest snowtile into snowblock
|
||||
if (snowcone[x][z] == BlockTypes.SNOW.getInternalId()) {
|
||||
snowcone[x][z] = BlockTypes.SNOW_BLOCK.getInternalId();
|
||||
snowconeData[x][z] = 0;
|
||||
case 7: // Turn largest snowTile into snow block
|
||||
if (snowCone[x][z] == BlockTypes.SNOW.getInternalId()) {
|
||||
snowCone[x][z] = BlockTypes.SNOW_BLOCK.getInternalId();
|
||||
snowConeData[x][z] = 0;
|
||||
}
|
||||
break;
|
||||
default: // Increase snowtile size, if smaller than target
|
||||
default: // Increase snowTile size, if smaller than target
|
||||
|
||||
if (snowData > snowconeData[x][z]) {
|
||||
if (snowData > snowConeData[x][z]) {
|
||||
BlockType blockType =
|
||||
BlockTypes.get(snowcone[x][z]);
|
||||
BlockTypes.get(snowCone[x][z]);
|
||||
if (blockType.getMaterial().isAir()) {
|
||||
snowconeData[x][z] = snowData;
|
||||
snowcone[x][z] = BlockTypes.SNOW.getInternalId();
|
||||
snowConeData[x][z] = snowData;
|
||||
snowCone[x][z] = BlockTypes.SNOW.getInternalId();
|
||||
|
||||
snowconeData[x][z] = snowData;
|
||||
snowConeData[x][z] = snowData;
|
||||
} else if (blockType == BlockTypes.SNOW_BLOCK) {
|
||||
snowconeData[x][z] = snowData;
|
||||
snowConeData[x][z] = snowData;
|
||||
}
|
||||
} else if (yOffset[x][z] > 0 && snowcone[x][z] == BlockTypes.SNOW.getInternalId()) {
|
||||
snowconeData[x][z]++;
|
||||
if (snowconeData[x][z] == 7) {
|
||||
snowconeData[x][z] = 0;
|
||||
snowcone[x][z] = BlockTypes.SNOW_BLOCK.getInternalId();
|
||||
} else if (yOffset[x][z] > 0 && snowCone[x][z] == BlockTypes.SNOW.getInternalId()) {
|
||||
snowConeData[x][z]++;
|
||||
if (snowConeData[x][z] == 7) {
|
||||
snowConeData[x][z] = 0;
|
||||
snowCone[x][z] = BlockTypes.SNOW_BLOCK.getInternalId();
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -103,11 +103,11 @@ public class SnowConeBrush extends Brush {
|
||||
for (int x = 0; x <= brushSizeDoubled; x++) {
|
||||
for (int z = 0; z <= brushSizeDoubled; z++) {
|
||||
|
||||
if (this.getBlockIdAt(blockPositionX - brushSize + x, blockPositionY - yOffset[x][z], blockPositionZ - brushSize + z) != snowcone[x][z] || this.clampY(blockPositionX - brushSize + x, blockPositionY - yOffset[x][z], blockPositionZ - brushSize + z).getPropertyId() != snowconeData[x][z]) {
|
||||
if (this.getBlockIdAt(blockPositionX - brushSize + x, blockPositionY - yOffset[x][z], blockPositionZ - brushSize + z) != snowCone[x][z] || this.clampY(blockPositionX - brushSize + x, blockPositionY - yOffset[x][z], blockPositionZ - brushSize + z).getPropertyId() != snowConeData[x][z]) {
|
||||
undo.put(this.clampY(blockPositionX - brushSize + x, blockPositionY - yOffset[x][z], blockPositionZ - brushSize + z));
|
||||
}
|
||||
this.setBlockIdAt(blockPositionZ - brushSize + z, blockPositionX - brushSize + x, blockPositionY - yOffset[x][z], snowcone[x][z]);
|
||||
this.clampY(blockPositionX - brushSize + x, blockPositionY - yOffset[x][z], blockPositionZ - brushSize + z).setPropertyId(snowconeData[x][z]);
|
||||
this.setBlockIdAt(blockPositionZ - brushSize + z, blockPositionX - brushSize + x, blockPositionY - yOffset[x][z], snowCone[x][z]);
|
||||
this.clampY(blockPositionX - brushSize + x, blockPositionY - yOffset[x][z], blockPositionZ - brushSize + z).setPropertyId(snowConeData[x][z]);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -22,11 +22,11 @@ import java.util.logging.Logger;
|
||||
*
|
||||
* new extra: n = no undo
|
||||
*
|
||||
* The main benefit of this system is that it provides the least possible number of characters in the paramaters
|
||||
* The main benefit of this system is that it provides the least possible number of characters in the parameters
|
||||
* while guaranteeing that all sensible combinations will be made. Additionally, the names will be VERY consistent
|
||||
*
|
||||
* EX Old System: /b b isrcup (use /v, /vi, /vr and /vir, update graphics and no physics)
|
||||
* EX New System: /b b ccup (two characters shorter, good because snipers have been complaing about keystrokes)
|
||||
* EX New System: /b b ccup (two characters shorter, good because snipers have been complaining about keystrokes)
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -43,12 +43,12 @@ public class VoxelBrushCommand extends VoxelCommand {
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
snipeData.getVoxelMessage().size();
|
||||
return true;
|
||||
} catch (NumberFormatException ingored) {
|
||||
} catch (NumberFormatException ignored) {
|
||||
}
|
||||
|
||||
Class<? extends IBrush> brush = plugin.getBrushManager().getBrushForHandle(args[0]);
|
||||
if (brush != null) {
|
||||
IBrush orignalBrush = sniper.getBrush(currentToolId);
|
||||
IBrush originalBrush = sniper.getBrush(currentToolId);
|
||||
sniper.setBrush(currentToolId, brush);
|
||||
|
||||
if (args.length > 1) {
|
||||
@ -63,7 +63,7 @@ public class VoxelBrushCommand extends VoxelCommand {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
SniperBrushChangedEvent event = new SniperBrushChangedEvent(sniper, currentToolId, orignalBrush, sniper.getBrush(currentToolId));
|
||||
SniperBrushChangedEvent event = new SniperBrushChangedEvent(sniper, currentToolId, originalBrush, sniper.getBrush(currentToolId));
|
||||
sniper.displayInfo();
|
||||
return true;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user