3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-26 02:50:06 +01:00

fix indexoutofbounds

Dieser Commit ist enthalten in:
Jesse Boyd 2019-12-19 16:48:14 +00:00
Ursprung 1a64976195
Commit c9c602470f
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 59F1DE6293AF6E1F
2 geänderte Dateien mit 3 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -37,6 +37,8 @@ public class BlockID {
public static final int BARRIER = 24; public static final int BARRIER = 24;
public static final int BEACON = 25; public static final int BEACON = 25;
public static final int BEDROCK = 26; 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 BEETROOTS = 27;
public static final int BELL = 605; public static final int BELL = 605;
public static final int BIRCH_BUTTON = 28; public static final int BIRCH_BUTTON = 28;

Datei anzeigen

@ -179,7 +179,7 @@ public class BlockTypesCache {
Collection<String> blocks = blockReg.values(); 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)); 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(); Field[] idFields = BlockID.class.getDeclaredFields();
for (Field field : idFields) size = Math.max(field.getInt(null) + 1, size); for (Field field : idFields) size = Math.max(field.getInt(null) + 1, size);
BIT_OFFSET = MathMan.log2nlz(size); BIT_OFFSET = MathMan.log2nlz(size);