From 0f012d0886f0865661b2dec57920730d93c10f28 Mon Sep 17 00:00:00 2001 From: paulevsGitch Date: Mon, 7 Jun 2021 13:41:38 +0300 Subject: [PATCH] Custom data getter --- gradle.properties | 2 +- src/main/java/ru/bclib/world/biomes/BCLBiomeDef.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 9f690fd5..a60ab4be 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 diff --git a/src/main/java/ru/bclib/world/biomes/BCLBiomeDef.java b/src/main/java/ru/bclib/world/biomes/BCLBiomeDef.java index 7a96e694..c41fb5d7 100644 --- a/src/main/java/ru/bclib/world/biomes/BCLBiomeDef.java +++ b/src/main/java/ru/bclib/world/biomes/BCLBiomeDef.java @@ -377,6 +377,11 @@ public void addCustomData(String name, Object value) { customData.put(name, value); } + @SuppressWarnings("unchecked") + public T getCustomData(String name, Object defaultValue) { + return (T) customData.getOrDefault(name, defaultValue); + } + protected Map getCustomData() { return customData; }