mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-01 02:46:41 +00:00
Remove all raw usages of BSH, improve API generics
This commit is contained in:
committed by
IronApollo
parent
1d87642b52
commit
590b7e23a9
@ -45,7 +45,6 @@ import static com.sk89q.minecraft.util.commands.Logging.LogMode.POSITION;
|
||||
@Command(aliases = {}, desc = "Commands for moving the player around: [More Info](https://goo.gl/uQTUiT)")
|
||||
public class NavigationCommands {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private final WorldEdit worldEdit;
|
||||
|
||||
/**
|
||||
|
@ -74,6 +74,7 @@ import com.sk89q.worldedit.world.biome.BaseBiome;
|
||||
import com.sk89q.worldedit.world.biome.Biomes;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.registry.BiomeRegistry;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
@ -88,6 +88,7 @@ import com.sk89q.worldedit.util.command.binding.Text;
|
||||
import com.sk89q.worldedit.util.command.parametric.Optional;
|
||||
import com.sk89q.worldedit.util.command.parametric.ParameterData;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
|
@ -36,7 +36,7 @@ import com.sk89q.worldedit.extent.inventory.BlockBag;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
|
||||
/**
|
||||
* A mode that replaces one block.
|
||||
|
@ -30,8 +30,7 @@ import com.sk89q.worldedit.extension.platform.Platform;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
|
||||
/**
|
||||
* A tool that can place (or remove) blocks at a distance.
|
||||
@ -60,7 +59,7 @@ public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTo
|
||||
try {
|
||||
// eS.disableBuffering();
|
||||
BlockVector3 blockPoint = pos.toVector().toBlockPoint();
|
||||
BlockStateHolder applied = secondary.apply(blockPoint);
|
||||
BaseBlock applied = secondary.apply(blockPoint);
|
||||
if (applied.getBlockType().getMaterial().isAir()) {
|
||||
eS.setBlock(blockPoint, secondary);
|
||||
} else {
|
||||
@ -82,7 +81,7 @@ public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTo
|
||||
try {
|
||||
// eS.disableBuffering();
|
||||
BlockVector3 blockPoint = pos.toVector().toBlockPoint();
|
||||
BlockStateHolder applied = primary.apply(blockPoint);
|
||||
BaseBlock applied = primary.apply(blockPoint);
|
||||
if (applied.getBlockType().getMaterial().isAir()) {
|
||||
eS.setBlock(blockPoint, primary);
|
||||
} else {
|
||||
|
@ -28,7 +28,7 @@ import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.extension.platform.Platform;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
|
||||
/**
|
||||
* Looks up information about a block.
|
||||
@ -46,7 +46,7 @@ public class QueryTool implements BlockTool {
|
||||
World world = (World) clicked.getExtent();
|
||||
EditSession editSession = session.createEditSession(player);
|
||||
BlockVector3 blockPoint = clicked.toVector().toBlockPoint();
|
||||
BlockStateHolder block = editSession.getFullBlock(blockPoint);
|
||||
BaseBlock block = editSession.getFullBlock(blockPoint);
|
||||
|
||||
player.print("\u00A79@" + clicked.toVector() + ": " + "\u00A7e"
|
||||
+ block.getBlockType().getName() + "\u00A77" + " ("
|
||||
|
@ -22,7 +22,6 @@ package com.sk89q.worldedit.command.tool.brush;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.function.mask.Mask;
|
||||
import com.sk89q.worldedit.function.mask.Masks;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
@ -47,23 +46,11 @@ public class GravityBrush implements Brush {
|
||||
int endY = position.getBlockY() + size;
|
||||
int startPerformY = Math.max(0, position.getBlockY() - size);
|
||||
int startCheckY = fullHeight ? 0 : startPerformY;
|
||||
// Vector mutablePos = new Vector(0, 0, 0);
|
||||
for (int x = position.getBlockX() + size; x > position.getBlockX() - size; --x) {
|
||||
for (int z = position.getBlockZ() + size; z > position.getBlockZ() - size; --z) {
|
||||
int freeSpot = startCheckY;
|
||||
for (int y = startCheckY; y <= endY; y++) {
|
||||
BlockStateHolder block = editSession.getLazyBlock(x, y, z);
|
||||
//=======
|
||||
// public void build(EditSession editSession, BlockVector3 position, Pattern pattern, double size) throws MaxChangedBlocksException {
|
||||
// final double startY = fullHeight ? editSession.getWorld().getMaxY() : position.getBlockY() + size;
|
||||
// for (double x = position.getBlockX() + size; x > position.getBlockX() - size; --x) {
|
||||
// for (double z = position.getBlockZ() + size; z > position.getBlockZ() - size; --z) {
|
||||
// double y = startY;
|
||||
// final List<BlockStateHolder> blockTypes = new ArrayList<>();
|
||||
// for (; y > position.getBlockY() - size; --y) {
|
||||
// final BlockVector3 pt = new BlockVector3(x, y, z);
|
||||
// final BlockStateHolder block = editSession.getBlock(pt);
|
||||
//>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
if (!block.getBlockType().getMaterial().isAir()) {
|
||||
if (y != freeSpot) {
|
||||
editSession.setBlock(x, y, z, EditSession.nullBlock);
|
||||
@ -72,17 +59,6 @@ public class GravityBrush implements Brush {
|
||||
freeSpot = y + 1;
|
||||
}
|
||||
}
|
||||
//<<<<<<< HEAD
|
||||
//=======
|
||||
// BlockVector3 pt = new BlockVector3(x, y, z);
|
||||
// Collections.reverse(blockTypes);
|
||||
// for (int i = 0; i < blockTypes.size();) {
|
||||
// if (editSession.getBlock(pt).getBlockType().getMaterial().isAir()) {
|
||||
// editSession.setBlock(pt, blockTypes.get(i++));
|
||||
// }
|
||||
// pt = pt.add(0, 1, 0);
|
||||
// }
|
||||
//>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user