From 579dea8ec976d223d09b0c709415b75f7d6a5202 Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Sun, 7 Apr 2024 13:26:50 +0200 Subject: [PATCH 1/6] Fix crash when IC2 is installed, Closes #254 --- .../everlastingabilities/core/helper/WorldHelpers.java | 3 +++ .../core/helper/WorldHelpersClient.java | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/src/main/java/org/cyclops/everlastingabilities/core/helper/WorldHelpers.java b/src/main/java/org/cyclops/everlastingabilities/core/helper/WorldHelpers.java index d35d8bc1..9f86df37 100644 --- a/src/main/java/org/cyclops/everlastingabilities/core/helper/WorldHelpers.java +++ b/src/main/java/org/cyclops/everlastingabilities/core/helper/WorldHelpers.java @@ -4,6 +4,8 @@ import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.server.ServerLifecycleHooks; +import javax.annotation.Nullable; + /** * Helpers for world related logic. * TODO: use CyclopsCore's version in >1.19.2 @@ -15,6 +17,7 @@ public class WorldHelpers { /** * @return The registry access client-side server-side. */ + @Nullable public static RegistryAccess getRegistryAccess() { if (ServerLifecycleHooks.getCurrentServer() != null) { return ServerLifecycleHooks.getCurrentServer().registryAccess(); diff --git a/src/main/java/org/cyclops/everlastingabilities/core/helper/WorldHelpersClient.java b/src/main/java/org/cyclops/everlastingabilities/core/helper/WorldHelpersClient.java index e0aed7e5..f64640f0 100644 --- a/src/main/java/org/cyclops/everlastingabilities/core/helper/WorldHelpersClient.java +++ b/src/main/java/org/cyclops/everlastingabilities/core/helper/WorldHelpersClient.java @@ -5,13 +5,19 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; +import javax.annotation.Nullable; + /** * @author rubensworks */ public class WorldHelpersClient { @OnlyIn(Dist.CLIENT) + @Nullable public static RegistryAccess getRegistryAccess() { + if (Minecraft.getInstance().level == null) { + return null; + } return Minecraft.getInstance().level.registryAccess(); } From 677f85405a7af71e5358568c93edd37510e3ebd7 Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Sun, 7 Apr 2024 13:27:03 +0200 Subject: [PATCH 2/6] Bump mod version --- gradle.properties | 2 +- resources/changelog/1.19.2-2.1.3.txt | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 resources/changelog/1.19.2-2.1.3.txt diff --git a/gradle.properties b/gradle.properties index a4e04030..9c17b0db 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -mod_version=2.1.2 +mod_version=2.1.3 minecraft_version=1.19.2 forge_version=43.2.2 cyclopscore_version=1.17.0-237 diff --git a/resources/changelog/1.19.2-2.1.3.txt b/resources/changelog/1.19.2-2.1.3.txt new file mode 100644 index 00000000..0b4c1b1a --- /dev/null +++ b/resources/changelog/1.19.2-2.1.3.txt @@ -0,0 +1,6 @@ +As always, don't forget to backup your world before updating! +Requires CyclopsCore version 1.17.0 or higher. + +Fixes: +* Fix crash when IC2 is installed, Closes #254 + From 0a72ad0eb846f41317756432200dd544a035be7c Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Sun, 7 Apr 2024 13:28:12 +0200 Subject: [PATCH 3/6] Bump mod version --- gradle.properties | 2 +- resources/changelog/1.20.1-2.0.13.txt | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 resources/changelog/1.20.1-2.0.13.txt diff --git a/gradle.properties b/gradle.properties index 9f60c0be..1f67e6da 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -mod_version=2.0.12 +mod_version=2.0.13 minecraft_version=1.20.1 forge_version=47.2.1 cyclopscore_version=1.18.4-340 diff --git a/resources/changelog/1.20.1-2.0.13.txt b/resources/changelog/1.20.1-2.0.13.txt new file mode 100644 index 00000000..91f18feb --- /dev/null +++ b/resources/changelog/1.20.1-2.0.13.txt @@ -0,0 +1,6 @@ +As always, don't forget to backup your world before updating! +Requires CyclopsCore version 1.18.4 or higher. + +Fixes: +* Fix crash when IC2 is installed, Closes #254 + From b99b8cba37ab7aeb89bbaad437cc71240813d619 Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Tue, 23 Apr 2024 20:01:42 +0200 Subject: [PATCH 4/6] Fix step assist stacking on world rejoin Closes #255 --- .../ability/AbilityTypeSpecialStepAssist.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/cyclops/everlastingabilities/ability/AbilityTypeSpecialStepAssist.java b/src/main/java/org/cyclops/everlastingabilities/ability/AbilityTypeSpecialStepAssist.java index 74f39f40..a1b4f15a 100644 --- a/src/main/java/org/cyclops/everlastingabilities/ability/AbilityTypeSpecialStepAssist.java +++ b/src/main/java/org/cyclops/everlastingabilities/ability/AbilityTypeSpecialStepAssist.java @@ -46,6 +46,20 @@ public boolean isForceDefaultStepHeight() { return forceDefaultStepHeight; } + @Override + public void onTick(Player player, int level) { + super.onTick(player, level); + + // On world re-join, ensure the modifier is in place. + AttributeInstance attribute = player.getAttribute(ForgeMod.STEP_HEIGHT_ADDITION.get()); + if (attribute != null) { + AttributeModifier modifier = this.attributeModifiers.get(level); + if (!attribute.hasModifier(modifier)) { + attribute.addTransientModifier(modifier); + } + } + } + @Override public void onChangedLevel(Player player, int oldLevel, int newLevel) { AttributeInstance attribute = player.getAttribute(ForgeMod.STEP_HEIGHT_ADDITION.get()); @@ -54,7 +68,7 @@ public void onChangedLevel(Player player, int oldLevel, int newLevel) { attribute.removeModifier(this.attributeModifiers.get(oldLevel)); } if (newLevel > 0) { - attribute.addPermanentModifier(this.attributeModifiers.get(newLevel)); + attribute.addTransientModifier(this.attributeModifiers.get(newLevel)); } } } From 7af24fd21c88eb81ebaffe2fce8accd917595641 Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Tue, 23 Apr 2024 20:02:12 +0200 Subject: [PATCH 5/6] Bump mod version --- gradle.properties | 2 +- resources/changelog/1.19.2-2.1.4.txt | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 resources/changelog/1.19.2-2.1.4.txt diff --git a/gradle.properties b/gradle.properties index 9c17b0db..1456f8cd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -mod_version=2.1.3 +mod_version=2.1.4 minecraft_version=1.19.2 forge_version=43.2.2 cyclopscore_version=1.17.0-237 diff --git a/resources/changelog/1.19.2-2.1.4.txt b/resources/changelog/1.19.2-2.1.4.txt new file mode 100644 index 00000000..8b888a4c --- /dev/null +++ b/resources/changelog/1.19.2-2.1.4.txt @@ -0,0 +1,6 @@ +As always, don't forget to backup your world before updating! +Requires CyclopsCore version 1.17.0 or higher. + +Fixes: +* Fix step assist stacking on world rejoin, Closes #255 + From aebed0802935e96d0d4b4740d00b4669737a3ebf Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Tue, 23 Apr 2024 20:03:28 +0200 Subject: [PATCH 6/6] Bump mod version --- gradle.properties | 2 +- resources/changelog/1.20.1-2.0.14.txt | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 resources/changelog/1.20.1-2.0.14.txt diff --git a/gradle.properties b/gradle.properties index 1f67e6da..5b8f89d0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -mod_version=2.0.13 +mod_version=2.0.14 minecraft_version=1.20.1 forge_version=47.2.1 cyclopscore_version=1.18.4-340 diff --git a/resources/changelog/1.20.1-2.0.14.txt b/resources/changelog/1.20.1-2.0.14.txt new file mode 100644 index 00000000..dba15ba1 --- /dev/null +++ b/resources/changelog/1.20.1-2.0.14.txt @@ -0,0 +1,6 @@ +As always, don't forget to backup your world before updating! +Requires CyclopsCore version 1.18.4 or higher. + +Fixes: +* Fix step assist stacking on world rejoin, Closes #255 +