Skip to content

Commit

Permalink
Fix some checks in the compley trophy model handler parser
Browse files Browse the repository at this point in the history
  • Loading branch information
glowredman committed Dec 3, 2023
1 parent 15052a4 commit 2c6de35
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import javax.annotation.Nullable;

import net.minecraft.block.Block;
import net.minecraftforge.oredict.OreDictionary;

import org.apache.commons.lang3.tuple.Pair;
import org.lwjgl.opengl.GL11;
Expand Down Expand Up @@ -72,7 +73,7 @@ private Map<Character, Pair<Block, Integer>> parseKeysToBlockInfoMap(JsonObject
resultMap.put(keyChar.charAt(0), Pair.of(block, 0));
} else {
int meta = ConfigHandler.getIntegerProperty(metadata, keyChar, 0);
if (meta < 0 || meta > 15) {
if (meta < 0 || meta > OreDictionary.WILDCARD_VALUE) {
throw new IllegalArgumentException("Illegal meta value (" + meta + ")!");
}
resultMap.put(keyChar.charAt(0), Pair.of(block, meta));
Expand Down Expand Up @@ -119,7 +120,7 @@ private String[][] parseStructureToArray(JsonObject json, Set<Character> blockKe

for (int k = 0; k < line.length(); k++) {
char c = line.charAt(k);
if (!blockKeys.contains(c)) {
if (!Character.isSpaceChar(c) && !blockKeys.contains(c)) {
throw new IllegalArgumentException(
"Structure key '" + c
+ "' (array="
Expand Down

0 comments on commit 2c6de35

Please sign in to comment.