Skip to content
Permalink
Browse files

Increase LBL load factor, fix long-pack limit detection

  • Loading branch information...
kenzierocks committed Jul 16, 2019
1 parent c358ce0 commit 71ae1d2ee7fc48ac8f005507d9f0fb06a645d10e
@@ -40,6 +40,7 @@
<allow pkg="org.mozilla.javascript"/>
<allow pkg="de.schlichtherle"/>
<allow pkg="com.google.auto"/>
<allow pkg="it.unimi.dsi.fastutil"/>

<subpackage name="bukkit">
<allow pkg="org.bukkit"/>
@@ -26,7 +26,6 @@
import static com.google.common.base.Preconditions.checkArgument;
import static com.sk89q.worldedit.math.BitMath.BITS_12;
import static com.sk89q.worldedit.math.BitMath.BITS_26;
import static com.sk89q.worldedit.math.BitMath.fixSign26;
import static com.sk89q.worldedit.math.BitMath.unpackX;
import static com.sk89q.worldedit.math.BitMath.unpackY;
import static com.sk89q.worldedit.math.BitMath.unpackZ;
@@ -70,14 +69,14 @@ public static BlockVector3 at(int x, int y, int z) {
private static final int WORLD_XZ_MINMAX = 30_000_000;
private static final int WORLD_Y_MAX = 4095;

private static boolean isHorizontallyOOB(int h) {
return h < -WORLD_XZ_MINMAX || h > WORLD_XZ_MINMAX;
private static boolean isHorizontallyInBounds(int h) {
return -WORLD_XZ_MINMAX <= h && h <= WORLD_XZ_MINMAX;
}

public static boolean isLongPackable(BlockVector3 location) {
return isHorizontallyOOB(location.getX()) ||
isHorizontallyOOB(location.getZ()) ||
location.getY() < 0 || location.getY() > WORLD_Y_MAX;
return isHorizontallyInBounds(location.getX()) &&
isHorizontallyInBounds(location.getZ()) &&
0 <= location.getY() && location.getY() <= WORLD_Y_MAX;
}

public static void checkLongPackable(BlockVector3 location) {
@@ -41,7 +41,7 @@
*/
public class LocatedBlockList implements Iterable<LocatedBlock> {

private final Map<BlockVector3, BaseBlock> map = new LinkedHashMap<>();
private final Map<BlockVector3, BaseBlock> map = new LinkedHashMap<>(16, 1.5f);

public LocatedBlockList() {
}

0 comments on commit 71ae1d2

Please sign in to comment.
You can’t perform that action at this time.