mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-11-20 02:45:00 +00:00
Added left click support to /repl to pick up the block.
This commit is contained in:
parent
47268bef20
commit
3ffd67e7f3
@ -22,13 +22,14 @@ package com.sk89q.worldedit.tools;
|
||||
import com.sk89q.worldedit.*;
|
||||
import com.sk89q.worldedit.bags.BlockBag;
|
||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||
import com.sk89q.worldedit.blocks.BlockType;
|
||||
|
||||
/**
|
||||
* A mode that replaces one block.
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class BlockReplacer implements BlockTool {
|
||||
public class BlockReplacer implements DoubleActionBlockTool {
|
||||
private BaseBlock targetBlock;
|
||||
|
||||
public BlockReplacer(BaseBlock targetBlock) {
|
||||
@ -57,4 +58,20 @@ public class BlockReplacer implements BlockTool {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean actSecondary(ServerInterface server,
|
||||
LocalConfiguration config, LocalPlayer player,
|
||||
LocalSession session, WorldVector clicked) {
|
||||
|
||||
LocalWorld world = clicked.getWorld();
|
||||
targetBlock = (new EditSession(world, -1)).getBlock(clicked);
|
||||
BlockType type = BlockType.fromID(targetBlock.getType());
|
||||
|
||||
if (type != null) {
|
||||
player.print("Replacer tool switched to: " + type.getName());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user