Fixed set components

This commit is contained in:
boy0001 2015-02-27 12:06:51 +11:00
parent 55b6cee748
commit c2d932db85
2 changed files with 12 additions and 8 deletions

View File

@ -20,6 +20,7 @@
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
package com.intellectualcrafters.plot.commands; package com.intellectualcrafters.plot.commands;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@ -75,7 +76,8 @@ public class Set extends SubCommand {
} }
if (args.length < 1) { if (args.length < 1) {
PlotManager manager = PlotSquared.getPlotManager(loc.getWorld()); PlotManager manager = PlotSquared.getPlotManager(loc.getWorld());
List<String> newValues = Arrays.asList(values);; ArrayList<String> newValues = new ArrayList<String>();
newValues.addAll(Arrays.asList(values));
newValues.addAll(Arrays.asList(manager.getPlotComponents(PlotSquared.getPlotWorld(loc.getWorld()), plot.id))); newValues.addAll(Arrays.asList(manager.getPlotComponents(PlotSquared.getPlotWorld(loc.getWorld()), plot.id)));
MainUtil.sendMessage(plr, C.SUBCOMMAND_SET_OPTIONS_HEADER.s() + getArgumentList(newValues)); MainUtil.sendMessage(plr, C.SUBCOMMAND_SET_OPTIONS_HEADER.s() + getArgumentList(newValues));
return false; return false;
@ -262,8 +264,9 @@ public class Set extends SubCommand {
return true; return true;
} }
} }
List<String> newValues = Arrays.asList(values);; ArrayList<String> newValues = new ArrayList<String>();
newValues.addAll(Arrays.asList(manager.getPlotComponents(plotworld, plot.id))); newValues.addAll(Arrays.asList(values));
newValues.addAll(Arrays.asList(manager.getPlotComponents(PlotSquared.getPlotWorld(loc.getWorld()), plot.id)));
MainUtil.sendMessage(plr, C.SUBCOMMAND_SET_OPTIONS_HEADER.s() + getArgumentList(newValues)); MainUtil.sendMessage(plr, C.SUBCOMMAND_SET_OPTIONS_HEADER.s() + getArgumentList(newValues));
return false; return false;
} }

View File

@ -55,7 +55,7 @@ public abstract class ClassicPlotManager extends SquarePlotManager {
z = bottom.getZ(); z = bottom.getZ();
final int length1 = top.getX() - bottom.getX(); final int length1 = top.getX() - bottom.getX();
final int length2 = top.getZ() - bottom.getZ(); final int length2 = top.getZ() - bottom.getZ();
final int size = length1 * 2 + length2 * 2 * (dpw.WALL_HEIGHT); final int size = (length1 * 2 + length2 * 2) * (dpw.WALL_HEIGHT);
final int[] xl = new int[size]; final int[] xl = new int[size];
final int[] yl = new int[size]; final int[] yl = new int[size];
final int[] zl = new int[size]; final int[] zl = new int[size];
@ -262,9 +262,10 @@ public abstract class ClassicPlotManager extends SquarePlotManager {
@Override @Override
public boolean finishPlotMerge(final PlotWorld plotworld, final ArrayList<PlotId> plotIds) { public boolean finishPlotMerge(final PlotWorld plotworld, final ArrayList<PlotId> plotIds) {
final PlotId pos1 = plotIds.get(0); final PlotId pos1 = plotIds.get(0);
final PlotBlock block = ((ClassicPlotWorld) plotworld).WALL_BLOCK; final PlotBlock block = ((ClassicPlotWorld) plotworld).CLAIMED_WALL_BLOCK;
if (block.id != 0) { final PlotBlock unclaim = ((ClassicPlotWorld) plotworld).WALL_BLOCK;
setWall(plotworld, pos1, new PlotBlock[] { ((ClassicPlotWorld) plotworld).WALL_BLOCK }); if (!block.equals(unclaim)) {
setWall(plotworld, pos1, new PlotBlock[] { block });
} }
return true; return true;
} }
@ -274,7 +275,7 @@ public abstract class ClassicPlotManager extends SquarePlotManager {
final PlotBlock block = ((ClassicPlotWorld) plotworld).CLAIMED_WALL_BLOCK; final PlotBlock block = ((ClassicPlotWorld) plotworld).CLAIMED_WALL_BLOCK;
final PlotBlock unclaim = ((ClassicPlotWorld) plotworld).WALL_BLOCK; final PlotBlock unclaim = ((ClassicPlotWorld) plotworld).WALL_BLOCK;
for (final PlotId id : plotIds) { for (final PlotId id : plotIds) {
if (block.equals(unclaim)) { if (!block.equals(unclaim)) {
setWall(plotworld, id, new PlotBlock[] { block }); setWall(plotworld, id, new PlotBlock[] { block });
} }
} }