mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-13 12:38:34 +00:00
Fixed some bugs and cleanup some code.
This commit is contained in:
@ -26,6 +26,7 @@ import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.extension.platform.Platform;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
@ -35,10 +36,10 @@ import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
*/
|
||||
public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTool {
|
||||
|
||||
private BlockStateHolder primary;
|
||||
private BlockStateHolder secondary;
|
||||
private Pattern primary;
|
||||
private Pattern secondary;
|
||||
|
||||
public LongRangeBuildTool(BlockStateHolder primary, BlockStateHolder secondary) {
|
||||
public LongRangeBuildTool(Pattern secondary, Pattern primary) {
|
||||
super("worldedit.tool.lrbuild");
|
||||
this.primary = primary;
|
||||
this.secondary = secondary;
|
||||
@ -55,7 +56,8 @@ public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTo
|
||||
if (pos == null) return false;
|
||||
EditSession eS = session.createEditSession(player);
|
||||
try {
|
||||
if (secondary.getBlockType() == BlockTypes.AIR) {
|
||||
BlockStateHolder applied = secondary.apply(pos.toVector());
|
||||
if (applied.getBlockType() == BlockTypes.AIR) {
|
||||
eS.setBlock(pos.toVector(), secondary);
|
||||
} else {
|
||||
eS.setBlock(pos.getDirection(), secondary);
|
||||
@ -74,7 +76,8 @@ public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTo
|
||||
if (pos == null) return false;
|
||||
EditSession eS = session.createEditSession(player);
|
||||
try {
|
||||
if (primary.getBlockType() == BlockTypes.AIR) {
|
||||
BlockStateHolder applied = primary.apply(pos.toVector());
|
||||
if (applied.getBlockType() == BlockTypes.AIR) {
|
||||
eS.setBlock(pos.toVector(), primary);
|
||||
} else {
|
||||
eS.setBlock(pos.getDirection(), primary);
|
||||
|
Reference in New Issue
Block a user