Skip to content

Commit

Permalink
Fixed detection of block values that are read from the config files (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
OmerBenGera committed Aug 26, 2023
1 parent a582221 commit aa5aeb8
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -109,7 +109,10 @@ public static Key of(Material type) {
public static Key ofMaterialAndData(String material, @Nullable String data) {
try {
Material blockType = Material.valueOf(material);
short blockData = Text.isBlank(data) ? 0 : Short.parseShort(data);
if (Text.isBlank(data)) {
return Keys.of(blockType);
}
short blockData = Short.parseShort(data);
return Keys.of(blockType, blockData);
} catch (Exception error) {
return Keys.of(material, data);
Expand Down

0 comments on commit aa5aeb8

Please sign in to comment.