mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-16 03:14:04 +00:00
Remove stub injector methods
This commit is contained in:
@@ -59,7 +59,5 @@ public class AreaPickaxe implements BlockTool {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static Class<?> inject() {
|
||||
return AreaPickaxe.class;
|
||||
}
|
||||
|
||||
}
|
@@ -499,9 +499,7 @@ public class BrushTool implements DoubleActionTraceTool, ScrollTool, MovableTool
|
||||
return act(BrushAction.SECONDARY, server, config, player, session);
|
||||
}
|
||||
|
||||
public static Class<?> inject() {
|
||||
return BrushTool.class;
|
||||
}
|
||||
|
||||
|
||||
public void setScrollAction(ScrollAction scrollAction) {
|
||||
this.getContext().setScrollAction(scrollAction);
|
||||
|
@@ -24,16 +24,16 @@ import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.world.block.BlockCategories;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.extension.platform.Platform;
|
||||
import com.sk89q.worldedit.util.Direction;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.block.BlockCategories;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
@@ -44,7 +44,6 @@ import java.util.Set;
|
||||
* to anything else)
|
||||
*/
|
||||
public class FloatingTreeRemover implements BlockTool {
|
||||
private static final BlockStateHolder AIR = BlockTypes.AIR.getDefaultState();
|
||||
private int rangeSq;
|
||||
|
||||
public FloatingTreeRemover() {
|
||||
@@ -67,10 +66,10 @@ public class FloatingTreeRemover implements BlockTool {
|
||||
|
||||
@Override
|
||||
public boolean actPrimary(Platform server, LocalConfiguration config,
|
||||
Player player, LocalSession session, Location clicked) {
|
||||
Player player, LocalSession session, Location clicked) {
|
||||
|
||||
final World world = (World) clicked.getExtent();
|
||||
final BlockStateHolder state = world.getBlock(clicked.toVector());
|
||||
final BlockState state = world.getBlock(clicked.toVector());
|
||||
|
||||
if (!isTreeBlock(state.getBlockType())) {
|
||||
player.printError("That's not a tree.");
|
||||
@@ -87,9 +86,9 @@ public class FloatingTreeRemover implements BlockTool {
|
||||
}
|
||||
|
||||
for (Vector blockVector : blockSet) {
|
||||
final BlockStateHolder otherState = editSession.getBlock(blockVector);
|
||||
final BlockState otherState = editSession.getBlock(blockVector);
|
||||
if (isTreeBlock(otherState.getBlockType())) {
|
||||
editSession.setBlock(blockVector, AIR);
|
||||
editSession.setBlock(blockVector, BlockTypes.AIR.getDefaultState());
|
||||
}
|
||||
}
|
||||
} catch (MaxChangedBlocksException e) {
|
||||
@@ -134,7 +133,7 @@ public class FloatingTreeRemover implements BlockTool {
|
||||
}
|
||||
|
||||
if (visited.add(next)) {
|
||||
BlockStateHolder state = world.getBlock(next);
|
||||
BlockState state = world.getBlock(next);
|
||||
if (state.getBlockType() == BlockTypes.AIR || state.getBlockType() == BlockTypes.SNOW) {
|
||||
continue;
|
||||
}
|
||||
@@ -154,4 +153,4 @@ public class FloatingTreeRemover implements BlockTool {
|
||||
|
||||
return visited;
|
||||
}
|
||||
}
|
||||
}
|
@@ -54,7 +54,7 @@ public class FloodFillTool implements BlockTool {
|
||||
public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked) {
|
||||
World world = (World) clicked.getExtent();
|
||||
|
||||
BlockType initialType = world.getLazyBlock(clicked.toVector()).getBlockType();
|
||||
BlockType initialType = world.getBlockType(clicked.toVector());
|
||||
|
||||
if (initialType.getMaterial().isAir()) {
|
||||
return true;
|
||||
@@ -67,7 +67,7 @@ public class FloodFillTool implements BlockTool {
|
||||
EditSession editSession = session.createEditSession(player);
|
||||
|
||||
try {
|
||||
recurse(server, editSession, world, clicked.toVector().toBlockVector(),
|
||||
recurse(editSession, world, clicked.toVector().toBlockVector(),
|
||||
clicked.toVector(), range, initialType, new HashSet<BlockVector>());
|
||||
} catch (WorldEditException e) {
|
||||
throw new RuntimeException(e);
|
||||
@@ -77,7 +77,7 @@ public class FloodFillTool implements BlockTool {
|
||||
return true;
|
||||
}
|
||||
|
||||
private void recurse(Platform server, EditSession editSession, World world, BlockVector pos, Vector origin, int size, BlockType initialType,
|
||||
private void recurse(EditSession editSession, World world, BlockVector pos, Vector origin, int size, BlockType initialType,
|
||||
Set<BlockVector> visited) throws WorldEditException {
|
||||
|
||||
if (origin.distance(pos) > size || visited.contains(pos)) {
|
||||
@@ -92,21 +92,19 @@ public class FloodFillTool implements BlockTool {
|
||||
return;
|
||||
}
|
||||
|
||||
recurse(server, editSession, world, pos.add(1, 0, 0).toBlockVector(),
|
||||
recurse(editSession, world, pos.add(1, 0, 0).toBlockVector(),
|
||||
origin, size, initialType, visited);
|
||||
recurse(server, editSession, world, pos.add(-1, 0, 0).toBlockVector(),
|
||||
recurse(editSession, world, pos.add(-1, 0, 0).toBlockVector(),
|
||||
origin, size, initialType, visited);
|
||||
recurse(server, editSession, world, pos.add(0, 0, 1).toBlockVector(),
|
||||
recurse(editSession, world, pos.add(0, 0, 1).toBlockVector(),
|
||||
origin, size, initialType, visited);
|
||||
recurse(server, editSession, world, pos.add(0, 0, -1).toBlockVector(),
|
||||
recurse(editSession, world, pos.add(0, 0, -1).toBlockVector(),
|
||||
origin, size, initialType, visited);
|
||||
recurse(server, editSession, world, pos.add(0, 1, 0).toBlockVector(),
|
||||
recurse(editSession, world, pos.add(0, 1, 0).toBlockVector(),
|
||||
origin, size, initialType, visited);
|
||||
recurse(server, editSession, world, pos.add(0, -1, 0).toBlockVector(),
|
||||
recurse(editSession, world, pos.add(0, -1, 0).toBlockVector(),
|
||||
origin, size, initialType, visited);
|
||||
}
|
||||
|
||||
public static Class<?> inject() {
|
||||
return FloodFillTool.class;
|
||||
}
|
||||
|
||||
}
|
@@ -63,7 +63,5 @@ public class RecursivePickaxe implements BlockTool {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static Class<?> inject() {
|
||||
return RecursivePickaxe.class;
|
||||
}
|
||||
|
||||
}
|
@@ -63,7 +63,5 @@ public class SinglePickaxe implements BlockTool {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static Class<?> inject() {
|
||||
return SinglePickaxe.class;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -65,8 +65,6 @@ public class GravityBrush implements Brush {
|
||||
}
|
||||
}
|
||||
|
||||
public static Class<?> inject() {
|
||||
return GravityBrush.class;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -39,7 +39,7 @@ public class HollowCylinderBrush implements Brush {
|
||||
@Override
|
||||
public void build(EditSession editSession, Vector position, Pattern pattern, double size) throws MaxChangedBlocksException {
|
||||
if (pattern == null) {
|
||||
pattern = new BlockPattern(new BaseBlock(BlockTypes.COBBLESTONE));
|
||||
pattern = BlockTypes.COBBLESTONE.getDefaultState();
|
||||
}
|
||||
editSession.makeCylinder(position, pattern, size, size, height, false);
|
||||
}
|
||||
|
@@ -33,7 +33,7 @@ public class HollowSphereBrush implements Brush {
|
||||
@Override
|
||||
public void build(EditSession editSession, Vector position, Pattern pattern, double size) throws MaxChangedBlocksException {
|
||||
if (pattern == null) {
|
||||
pattern = new BlockPattern(new BaseBlock(BlockTypes.COBBLESTONE));
|
||||
pattern = BlockTypes.COBBLESTONE.getDefaultState();
|
||||
}
|
||||
editSession.makeSphere(position, pattern, size, size, size, false);
|
||||
}
|
||||
|
Reference in New Issue
Block a user