Fix some merge issues

This commit is contained in:
Jesse Boyd 2018-08-14 00:38:33 +10:00
parent 025360753f
commit 0632a9ce96
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
5 changed files with 27 additions and 11 deletions

View File

@ -135,12 +135,24 @@ public class CompoundTagBuilder {
/**
* Put the given key and value into the compound tag as a
* {@code LongTag}.
* {@code LongArrayTag}.
*
* @param key they key
* @param value the value
* @return this object
*/
public CompoundTagBuilder putLongArray(String key, long[] value) {
return put(key, new LongArrayTag(value));
}
/**
* Put the given key and value into the compound tag as a
* {@code LongTag}.
*
* @param key they key
* @param value the value
* @return this object
*/
public CompoundTagBuilder putLong(String key, long value) {
return put(key, new LongTag(value));
}

View File

@ -67,7 +67,7 @@ public class FloodFillTool implements BlockTool {
EditSession editSession = session.createEditSession(player);
try {
recurse(editSession, world, clicked.toVector().toBlockVector(),
recurse(editSession, 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(EditSession editSession, World world, BlockVector pos, Vector origin, int size, BlockType initialType,
private void recurse(EditSession editSession, BlockVector pos, Vector origin, int size, BlockType initialType,
Set<BlockVector> visited) throws WorldEditException {
if (origin.distance(pos) > size || visited.contains(pos)) {
@ -92,17 +92,17 @@ public class FloodFillTool implements BlockTool {
return;
}
recurse(editSession, world, pos.add(1, 0, 0).toBlockVector(),
recurse(editSession, pos.add(1, 0, 0).toBlockVector(),
origin, size, initialType, visited);
recurse(editSession, world, pos.add(-1, 0, 0).toBlockVector(),
recurse(editSession, pos.add(-1, 0, 0).toBlockVector(),
origin, size, initialType, visited);
recurse(editSession, world, pos.add(0, 0, 1).toBlockVector(),
recurse(editSession, pos.add(0, 0, 1).toBlockVector(),
origin, size, initialType, visited);
recurse(editSession, world, pos.add(0, 0, -1).toBlockVector(),
recurse(editSession, pos.add(0, 0, -1).toBlockVector(),
origin, size, initialType, visited);
recurse(editSession, world, pos.add(0, 1, 0).toBlockVector(),
recurse(editSession, pos.add(0, 1, 0).toBlockVector(),
origin, size, initialType, visited);
recurse(editSession, world, pos.add(0, -1, 0).toBlockVector(),
recurse(editSession, pos.add(0, -1, 0).toBlockVector(),
origin, size, initialType, visited);
}

View File

@ -104,7 +104,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable {
byte free = 0;
while (y <= world.getMinimumPoint().getBlockY() + 2) {
while (y <= world.getMaximumPoint().getBlockY() + 2) {
if (!world.getBlock(new Vector(x, y, z)).getBlockType().getMaterial().isMovementBlocker()) {
++free;
} else {

View File

@ -96,7 +96,7 @@ public class FloraGenerator implements RegionFunction {
*/
public static Pattern getTemperatePattern() {
RandomPattern pattern = new RandomPattern();
pattern.add(new BlockPattern(BlockTypes.GRASS_BLOCK.getDefaultState()), 300);
pattern.add(new BlockPattern(BlockTypes.GRASS.getDefaultState()), 300);
pattern.add(new BlockPattern(BlockTypes.POPPY.getDefaultState()), 5);
pattern.add(new BlockPattern(BlockTypes.DANDELION.getDefaultState()), 5);
return pattern;

View File

@ -1011,6 +1011,10 @@ public enum BlockTypes implements BlockType {
return existing;
}
public static final @Nullable BlockTypes get(final String id) {
return $REGISTRY.get(id);
}
public static final @Nullable BlockTypes get(final CharSequence id) {
return $REGISTRY.get(id);
}