mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-11-16 17:16:11 +00:00
revert some changes
This commit is contained in:
parent
94d5d8df8e
commit
be5541b61b
@ -84,8 +84,9 @@ public class BukkitBlockRegistry extends BundledBlockRegistry {
|
||||
@Nullable
|
||||
@Override
|
||||
public Map<String, ? extends Property<?>> getProperties(BlockType blockType) {
|
||||
if (WorldEditPlugin.getInstance().getBukkitImplAdapter() != null) {
|
||||
return WorldEditPlugin.getInstance().getBukkitImplAdapter().getProperties(blockType);
|
||||
BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter();
|
||||
if (adapter != null) {
|
||||
return adapter.getProperties(blockType);
|
||||
}
|
||||
return super.getProperties(blockType);
|
||||
}
|
||||
|
@ -300,7 +300,7 @@ public class RegionCommands extends MethodCommands {
|
||||
|
||||
@Command(
|
||||
aliases = { "/replace", "/re", "/rep" },
|
||||
usage = "[from-block] <to-block>",
|
||||
usage = "[from-mask] <to-pattern>",
|
||||
desc = "Replace all blocks in the selection with another",
|
||||
flags = "f",
|
||||
min = 1,
|
||||
|
@ -669,7 +669,7 @@ public class SelectionCommands {
|
||||
|
||||
@Command(
|
||||
aliases = {"/count"},
|
||||
usage = "<block>",
|
||||
usage = "<mask>",
|
||||
desc = "Counts the number of a certain type of block",
|
||||
flags = "d",
|
||||
min = 1,
|
||||
|
@ -104,7 +104,7 @@ public class ToolCommands {
|
||||
|
||||
@Command(
|
||||
aliases = {"repl"},
|
||||
usage = "<block>",
|
||||
usage = "<pattern>",
|
||||
desc = "Block replacer tool",
|
||||
min = 1,
|
||||
max = 1
|
||||
|
@ -372,7 +372,7 @@ public class UtilityCommands extends MethodCommands {
|
||||
|
||||
@Command(
|
||||
aliases = {"/removenear", "removenear"},
|
||||
usage = "<block> [size]",
|
||||
usage = "<mask> [size]",
|
||||
desc = "Remove blocks near you.",
|
||||
min = 1,
|
||||
max = 2
|
||||
|
@ -37,7 +37,7 @@ public class CylinderBrush implements Brush {
|
||||
@Override
|
||||
public void build(EditSession editSession, BlockVector3 position, Pattern pattern, double size) throws MaxChangedBlocksException {
|
||||
if (pattern == null) {
|
||||
pattern = new BlockPattern(BlockTypes.COBBLESTONE.getDefaultState());
|
||||
pattern = (BlockTypes.COBBLESTONE.getDefaultState());
|
||||
}
|
||||
editSession.makeCylinder(position, pattern, size, size, height, true);
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ public class HollowCylinderBrush implements Brush {
|
||||
@Override
|
||||
public void build(EditSession editSession, BlockVector3 position, Pattern pattern, double size) throws MaxChangedBlocksException {
|
||||
if (pattern == null) {
|
||||
pattern = new BlockPattern(BlockTypes.COBBLESTONE.getDefaultState());
|
||||
pattern = (BlockTypes.COBBLESTONE.getDefaultState());
|
||||
}
|
||||
editSession.makeCylinder(position, pattern, size, size, height, false);
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ public class HollowSphereBrush implements Brush {
|
||||
@Override
|
||||
public void build(EditSession editSession, BlockVector3 position, Pattern pattern, double size) throws MaxChangedBlocksException {
|
||||
if (pattern == null) {
|
||||
pattern = new BlockPattern(BlockTypes.COBBLESTONE.getDefaultState());
|
||||
pattern = (BlockTypes.COBBLESTONE.getDefaultState());
|
||||
}
|
||||
editSession.makeSphere(position, pattern, size, size, size, false);
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ public class SphereBrush implements Brush {
|
||||
@Override
|
||||
public void build(EditSession editSession, BlockVector3 position, Pattern pattern, double size) throws MaxChangedBlocksException {
|
||||
if (pattern == null) {
|
||||
pattern = new BlockPattern(BlockTypes.COBBLESTONE.getDefaultState());
|
||||
pattern = (BlockTypes.COBBLESTONE.getDefaultState());
|
||||
}
|
||||
editSession.makeSphere(position, pattern, size, size, size, true);
|
||||
}
|
||||
|
@ -69,10 +69,10 @@ public class BlockCategoryPatternParser extends InputParser<Pattern> {
|
||||
|
||||
if (anyState) {
|
||||
blocks.stream().flatMap(blockType -> blockType.getAllStates().stream()).forEach(state ->
|
||||
randomPattern.add(new BlockPattern(state), 1.0));
|
||||
randomPattern.add((state), 1.0));
|
||||
} else {
|
||||
for (BlockType blockType : blocks) {
|
||||
randomPattern.add(new BlockPattern(blockType.getDefaultState()), 1.0);
|
||||
randomPattern.add((blockType.getDefaultState()), 1.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ public class RandomStatePatternParser extends InputParser<Pattern> {
|
||||
context.setPreferringWildcard(wasFuzzy);
|
||||
if (block.getStates().size() == block.getBlockType().getPropertyMap().size()) {
|
||||
// they requested random with *, but didn't leave any states empty - simplify
|
||||
return new BlockPattern(block);
|
||||
return (block);
|
||||
} else {
|
||||
return null; // only should happen if parseLogic changes
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ public class SingleBlockPatternParser extends InputParser<Pattern> {
|
||||
|
||||
@Override
|
||||
public Pattern parseFromInput(String input, ParserContext context) throws InputParseException {
|
||||
return new BlockPattern(worldEdit.getBlockFactory().parseFromInput(input, context));
|
||||
return (worldEdit.getBlockFactory().parseFromInput(input, context));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -84,9 +84,9 @@ public class FloraGenerator implements RegionFunction {
|
||||
*/
|
||||
public static Pattern getDesertPattern() {
|
||||
RandomPattern pattern = new RandomPattern();
|
||||
pattern.add(new BlockPattern(BlockTypes.DEAD_BUSH.getDefaultState()), 30);
|
||||
pattern.add(new BlockPattern(BlockTypes.CACTUS.getDefaultState()), 20);
|
||||
pattern.add(new BlockPattern(BlockTypes.AIR.getDefaultState()), 300);
|
||||
pattern.add((BlockTypes.DEAD_BUSH.getDefaultState()), 30);
|
||||
pattern.add((BlockTypes.CACTUS.getDefaultState()), 20);
|
||||
pattern.add((BlockTypes.AIR.getDefaultState()), 300);
|
||||
return pattern;
|
||||
}
|
||||
|
||||
@ -97,9 +97,9 @@ public class FloraGenerator implements RegionFunction {
|
||||
*/
|
||||
public static Pattern getTemperatePattern() {
|
||||
RandomPattern pattern = new RandomPattern();
|
||||
pattern.add(new BlockPattern(BlockTypes.GRASS.getDefaultState()), 300);
|
||||
pattern.add(new BlockPattern(BlockTypes.POPPY.getDefaultState()), 5);
|
||||
pattern.add(new BlockPattern(BlockTypes.DANDELION.getDefaultState()), 5);
|
||||
pattern.add((BlockTypes.GRASS.getDefaultState()), 300);
|
||||
pattern.add((BlockTypes.POPPY.getDefaultState()), 5);
|
||||
pattern.add((BlockTypes.DANDELION.getDefaultState()), 5);
|
||||
return pattern;
|
||||
}
|
||||
|
||||
|
@ -208,6 +208,6 @@ public class GardenPatchGenerator implements RegionFunction {
|
||||
* @return a melon pattern
|
||||
*/
|
||||
public static Pattern getMelonPattern() {
|
||||
return new BlockPattern(BlockTypes.MELON.getDefaultState());
|
||||
return (BlockTypes.MELON.getDefaultState());
|
||||
}
|
||||
}
|
||||
|
@ -564,10 +564,7 @@ public class BlockVector2 {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 17;
|
||||
hash = 31 * hash + Integer.hashCode(x);
|
||||
hash = 31 * hash + Integer.hashCode(z);
|
||||
return hash;
|
||||
return (x << 16) ^ z;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -629,11 +629,7 @@ public class BlockVector3 {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 17;
|
||||
hash = 31 * hash + Integer.hashCode(x);
|
||||
hash = 31 * hash + Integer.hashCode(y);
|
||||
hash = 31 * hash + Integer.hashCode(z);
|
||||
return hash;
|
||||
return (x ^ (z << 12)) ^ (y << 24);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -491,7 +491,7 @@ public class Vector2 {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return ((int) getX() ^ ((int) getZ() << 16));
|
||||
return (((int) x) << 16) ^ ((int) z);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -40,21 +40,6 @@ public class Vector3 {
|
||||
public static final Vector3 ONE = new Vector3(1, 1, 1);
|
||||
|
||||
public static Vector3 at(double x, double y, double z) {
|
||||
// switch for efficiency on typical cases
|
||||
// in MC y is rarely 0/1 on selections
|
||||
int yTrunc = (int) y;
|
||||
switch (yTrunc) {
|
||||
case 0:
|
||||
if (x == 0 && y == 0 && z == 0) {
|
||||
return ZERO;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (x == 1 && y == 1 && z == 1) {
|
||||
return ONE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return new Vector3(x, y, z);
|
||||
}
|
||||
|
||||
@ -647,15 +632,14 @@ public class Vector3 {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 17;
|
||||
hash = 31 * hash + Double.hashCode(x);
|
||||
hash = 31 * hash + Double.hashCode(y);
|
||||
hash = 31 * hash + Double.hashCode(z);
|
||||
return hash;
|
||||
return (((int) x) ^ (((int) z) << 12)) ^ (((int) y) << 24);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
String x = (getX() == getBlockX() ? "" + getBlockX() : "" + getX());
|
||||
String y = (getY() == getBlockY() ? "" + getBlockY() : "" + getY());
|
||||
String z = (getZ() == getBlockZ() ? "" + getBlockZ() : "" + getZ());
|
||||
return "(" + x + ", " + y + ", " + z + ")";
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user