From cfc46fb2066f93574f543706eacebde0e38d9649 Mon Sep 17 00:00:00 2001 From: Luke Bemish Date: Thu, 4 Jan 2024 16:22:57 -0600 Subject: [PATCH] Metabolism compat --- .../lukebemish/tempest/impl/TempestWeatherCheck.java | 6 +++++- .../data/tempest/environment_effects/hail.json | 10 ++++++++++ .../data/tempest/environment_effects/sleet.json | 10 ++++++++++ .../data/tempest/environment_effects/snow.json | 10 ++++++++++ 4 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 common/src/main/resources/data/tempest/environment_effects/hail.json create mode 100644 common/src/main/resources/data/tempest/environment_effects/sleet.json create mode 100644 common/src/main/resources/data/tempest/environment_effects/snow.json diff --git a/common/src/main/java/dev/lukebemish/tempest/impl/TempestWeatherCheck.java b/common/src/main/java/dev/lukebemish/tempest/impl/TempestWeatherCheck.java index 3ca010e..ea49a4b 100644 --- a/common/src/main/java/dev/lukebemish/tempest/impl/TempestWeatherCheck.java +++ b/common/src/main/java/dev/lukebemish/tempest/impl/TempestWeatherCheck.java @@ -48,7 +48,7 @@ public void serialize(JsonObject json, TempestWeatherCheck value, JsonSerializat }); @Override - public LootItemConditionType getType() { + public @NotNull LootItemConditionType getType() { return TYPE; } @@ -60,6 +60,10 @@ public boolean test(LootContext lootContext) { return false; } var blockPos = new BlockPos((int) Math.round(pos.x()), (int) Math.round(pos.y()), (int) Math.round(pos.z())); + var data = Services.PLATFORM.getChunkData(level.getChunkAt(blockPos)); + if (!level.canSeeSky(blockPos) || !data.canSeeWind(blockPos)) { + return false; + } var weather = WeatherStatus.atPosition(level, blockPos); if (weather == null) { return false; diff --git a/common/src/main/resources/data/tempest/environment_effects/hail.json b/common/src/main/resources/data/tempest/environment_effects/hail.json new file mode 100644 index 0000000..95dc580 --- /dev/null +++ b/common/src/main/resources/data/tempest/environment_effects/hail.json @@ -0,0 +1,10 @@ +{ + "conditions": [ + { + "condition": "tempest:tempest_weather_check", + "kind": "hail" + } + ], + "is_additive": true, + "heat_target": -4.0 +} diff --git a/common/src/main/resources/data/tempest/environment_effects/sleet.json b/common/src/main/resources/data/tempest/environment_effects/sleet.json new file mode 100644 index 0000000..1d97bcb --- /dev/null +++ b/common/src/main/resources/data/tempest/environment_effects/sleet.json @@ -0,0 +1,10 @@ +{ + "conditions": [ + { + "condition": "tempest:tempest_weather_check", + "kind": "sleet" + } + ], + "is_additive": true, + "heat_target": -6.0 +} diff --git a/common/src/main/resources/data/tempest/environment_effects/snow.json b/common/src/main/resources/data/tempest/environment_effects/snow.json new file mode 100644 index 0000000..5b8f854 --- /dev/null +++ b/common/src/main/resources/data/tempest/environment_effects/snow.json @@ -0,0 +1,10 @@ +{ + "conditions": [ + { + "condition": "tempest:tempest_weather_check", + "kind": "snow" + } + ], + "is_additive": true, + "heat_target": -8.0 +}