mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-16 22:03:53 +00:00
Added a tool that allows a player to place and remove blocks at a distance.
This commit is contained in:
@ -27,6 +27,8 @@ import com.sk89q.worldedit.BlockWorldVector;
|
||||
import com.sk89q.worldedit.LocalPlayer;
|
||||
import com.sk89q.worldedit.LocalWorld;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.WorldVectorFace;
|
||||
import com.sk89q.worldedit.blocks.BlockID;
|
||||
import com.sk89q.worldedit.blocks.BlockType;
|
||||
|
||||
/**
|
||||
@ -110,7 +112,7 @@ public class TargetBlock {
|
||||
boolean searchForLastBlock = true;
|
||||
BlockWorldVector lastBlock = null;
|
||||
while (getNextBlock() != null) {
|
||||
if (world.getBlockType(getCurrentBlock()) == 0) {
|
||||
if (world.getBlockType(getCurrentBlock()) == BlockID.AIR) {
|
||||
if(searchForLastBlock) {
|
||||
lastBlock = getCurrentBlock();
|
||||
if (lastBlock.getBlockY() <= 0 || lastBlock.getBlockY() >= 127) {
|
||||
@ -196,4 +198,14 @@ public class TargetBlock {
|
||||
public BlockWorldVector getPreviousBlock() {
|
||||
return new BlockWorldVector(world, prevPos);
|
||||
}
|
||||
|
||||
public WorldVectorFace getAnyTargetBlockFace() {
|
||||
getAnyTargetBlock();
|
||||
return WorldVectorFace.getWorldVectorFace(world, getCurrentBlock(), getPreviousBlock());
|
||||
}
|
||||
|
||||
public WorldVectorFace getTargetBlockFace() {
|
||||
getAnyTargetBlock();
|
||||
return WorldVectorFace.getWorldVectorFace(world, getCurrentBlock(), getPreviousBlock());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user