Skip to content

Commit

Permalink
Custom data getter
Browse files Browse the repository at this point in the history
  • Loading branch information
paulevsGitch committed Jun 7, 2021
1 parent a2a3671 commit 0f012d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ yarn_mappings=6
loader_version=0.11.3

# Mod Properties
mod_version = 0.1.22
mod_version = 0.1.23
maven_group = ru.bclib
archives_base_name = bclib

Expand Down
5 changes: 5 additions & 0 deletions src/main/java/ru/bclib/world/biomes/BCLBiomeDef.java
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,11 @@ public void addCustomData(String name, Object value) {
customData.put(name, value);
}

@SuppressWarnings("unchecked")
public <T> T getCustomData(String name, Object defaultValue) {
return (T) customData.getOrDefault(name, defaultValue);
}

protected Map<String, Object> getCustomData() {
return customData;
}
Expand Down

0 comments on commit 0f012d0

Please sign in to comment.