Upstream, generics, formatting

This commit is contained in:
MattBDev
2019-06-11 16:07:43 -04:00
parent e2c2205dac
commit cd88e513a8
126 changed files with 2488 additions and 3091 deletions

View File

@ -38,7 +38,7 @@ public class BlockReplace implements RegionFunction {
/**
* Create a new instance.
*
* @param extent an extent
* @param extent an extent
* @param pattern a pattern
*/
public BlockReplace(Extent extent, Pattern pattern) {
@ -55,4 +55,4 @@ public class BlockReplace implements RegionFunction {
}
}

View File

@ -19,13 +19,9 @@
package com.sk89q.worldedit.function.block;
import com.boydti.fawe.util.ReflectionUtils;
import com.sk89q.jnbt.ByteTag;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.jnbt.Tag;
import com.sk89q.worldedit.WorldEditException;
import static com.google.common.base.Preconditions.checkNotNull;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.jnbt.CompoundTagBuilder;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.extent.Extent;
@ -36,8 +32,6 @@ import com.sk89q.worldedit.math.Vector3;
import com.sk89q.worldedit.math.transform.Transform;
import com.sk89q.worldedit.util.Direction;
import com.sk89q.worldedit.util.Direction.Flag;
import static com.google.common.base.Preconditions.checkNotNull;
import com.sk89q.worldedit.world.block.BaseBlock;
/**
@ -54,11 +48,11 @@ public class ExtentBlockCopy implements RegionFunction {
/**
* Make a new copy.
*
* @param source the source extent
* @param from the source offset
* @param source the source extent
* @param from the source offset
* @param destination the destination extent
* @param to the destination offset
* @param transform a transform to apply to positions (after source offset, before destination offset)
* @param to the destination offset
* @param transform a transform to apply to positions (after source offset, before destination offset)
*/
public ExtentBlockCopy(Extent source, BlockVector3 from, Extent destination, BlockVector3 to, Transform transform) {
checkNotNull(source);
@ -75,11 +69,13 @@ public class ExtentBlockCopy implements RegionFunction {
@Override
public boolean apply(BlockVector3 position) throws WorldEditException {
BaseBlock block = source.getFullBlock(position);
BlockVector3 orig = position.subtract(from);
BlockVector3 transformed = transform.apply(orig.toVector3()).toBlockPoint();
// Apply transformations to NBT data if necessary
BaseBlock block = transformNbtData(source.getFullBlock(position));
block = transformNbtData(block);
return destination.setBlock(transformed.add(to), block);
}
@ -118,6 +114,4 @@ public class ExtentBlockCopy implements RegionFunction {
return state;
}
}

View File

@ -76,15 +76,15 @@ public class Naturalizer implements LayerFunction {
affected++;
switch (depth) {
case 0:
editSession.setBlock(position, BlockTypes.GRASS_BLOCK);
editSession.setBlock(position, BlockTypes.GRASS_BLOCK.getDefaultState());
break;
case 1:
case 2:
case 3:
editSession.setBlock(position, BlockTypes.DIRT);
editSession.setBlock(position, BlockTypes.DIRT.getDefaultState());
break;
default:
editSession.setBlock(position, BlockTypes.STONE);
editSession.setBlock(position, BlockTypes.STONE.getDefaultState());
}
}