From 0d1036693c129141f95f734b122a2cb3659892dd Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Thu, 24 Sep 2015 16:31:07 -0700 Subject: [PATCH] Minor fix. --- .../org/spacehq/mc/protocol/data/game/chunk/BlockStorage.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/org/spacehq/mc/protocol/data/game/chunk/BlockStorage.java b/src/main/java/org/spacehq/mc/protocol/data/game/chunk/BlockStorage.java index 0bf0615e..84da7bcf 100644 --- a/src/main/java/org/spacehq/mc/protocol/data/game/chunk/BlockStorage.java +++ b/src/main/java/org/spacehq/mc/protocol/data/game/chunk/BlockStorage.java @@ -1,6 +1,5 @@ package org.spacehq.mc.protocol.data.game.chunk; -import org.spacehq.mc.protocol.util.NetUtil; import org.spacehq.packetlib.io.NetInput; import org.spacehq.packetlib.io.NetOutput; @@ -54,7 +53,7 @@ public class BlockStorage { protected void resize(int size) { FlexibleStorage oldStorage = this.storage; - this.storage = new FlexibleStorage(NetUtil.nextExponentOfTwo(size), this.storage.getSize()); + this.storage = new FlexibleStorage(size != 0 ? 32 - Integer.numberOfLeadingZeros(size - 1) : 0, this.storage.getSize()); for(int index = 0; index < this.storage.getSize(); index++) { this.storage.set(index, oldStorage.get(index)); }