mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
fix indexoutofbounds
This commit is contained in:
parent
1a64976195
commit
c9c602470f
@ -37,6 +37,8 @@ public class BlockID {
|
||||
public static final int BARRIER = 24;
|
||||
public static final int BEACON = 25;
|
||||
public static final int BEDROCK = 26;
|
||||
public static final int BEE_NEST= 677;
|
||||
public static final int BEEHIVE = 678; // highest
|
||||
public static final int BEETROOTS = 27;
|
||||
public static final int BELL = 605;
|
||||
public static final int BIRCH_BUTTON = 28;
|
||||
|
@ -179,7 +179,7 @@ public class BlockTypesCache {
|
||||
Collection<String> blocks = blockReg.values();
|
||||
Map<String, String> blockMap = blocks.stream().collect(Collectors.toMap(item -> item.charAt(item.length() - 1) == ']' ? item.substring(0, item.indexOf('[')) : item, item -> item));
|
||||
|
||||
int size = blockMap.size();
|
||||
int size = blockMap.size() + 1;
|
||||
Field[] idFields = BlockID.class.getDeclaredFields();
|
||||
for (Field field : idFields) size = Math.max(field.getInt(null) + 1, size);
|
||||
BIT_OFFSET = MathMan.log2nlz(size);
|
||||
|
Loading…
Reference in New Issue
Block a user