diff --git a/CHANGELOG.md b/CHANGELOG.md index fe7c313a2..c32408e3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.2.1] - 2021-05-10 +### Fixed +- Updated Cardinal Components API (fixes crash on start) + ## [3.2.0] - 2021-04-08 ### Changed -- You can now equip multiple of the same artifacts (eg. 2 power gloves) +- You can now equip multiple of the same artifacts (e.g. 2 power gloves) - In most cases this will not amplify the effects over just one ### Fixed @@ -166,7 +170,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Initial release -[Unreleased]: https://github.com/florensie/artifacts-fabric/compare/v3.2.0...HEAD +[Unreleased]: https://github.com/florensie/artifacts-fabric/compare/v3.2.1...HEAD +[3.2.1]: https://github.com/florensie/artifacts-fabric/compare/v3.2.0...v3.2.1 [3.2.0]: https://github.com/florensie/artifacts-fabric/compare/v3.1.0...v3.2.0 [3.1.0]: https://github.com/florensie/artifacts-fabric/compare/v3.0.3...v3.1.0 [3.0.3]: https://github.com/florensie/artifacts-fabric/compare/v3.0.2...v3.0.3 diff --git a/gradle.properties b/gradle.properties index 8c2edd8a2..60fd48991 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ org.gradle.daemon=false # Fabric Properties (https://modmuss50.me/fabric.html) minecraft_version=1.16.5 -yarn_mappings=1.16.5+build.6 +yarn_mappings=1.16.5+build.9 loader_version=0.11.3 # Mod Properties @@ -15,9 +15,9 @@ maven_group=artifacts archives_base_name=artifacts # Dependencies -fabric_version=0.32.5+1.16 +fabric_version=0.34.1+1.16 trinkets_version=2.6.7 -cca_version=2.7.10 +cca_version=2.8.2 cloth_config_version=4.11.14 mod_menu_version=1.16.8 step_height_attr_version=v1.0.1 diff --git a/src/main/java/artifacts/mixin/mixins/statuseffect/client/GameRendererMixin.java b/src/main/java/artifacts/mixin/mixins/statuseffect/client/GameRendererMixin.java index f272ee0b3..5178d5330 100644 --- a/src/main/java/artifacts/mixin/mixins/statuseffect/client/GameRendererMixin.java +++ b/src/main/java/artifacts/mixin/mixins/statuseffect/client/GameRendererMixin.java @@ -4,13 +4,14 @@ import artifacts.trinkets.TrinketsHelper; import net.minecraft.client.render.GameRenderer; import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffects; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import java.util.Optional; + @Mixin(GameRenderer.class) public abstract class GameRendererMixin { @@ -20,13 +21,11 @@ public abstract class GameRendererMixin { @Inject(method = "getNightVisionStrength", at = @At("RETURN"), cancellable = true) private static void cancelNightVisionFadeEffect(LivingEntity entity, float tickDelta, CallbackInfoReturnable info) { if (info.getReturnValueF() != 1f) { - TrinketsHelper.getAllEquipped(entity).forEach(stack -> { - StatusEffectInstance effect = ((TrinketArtifactItem) stack.getItem()).getPermanentEffect(); - - if (effect != null && effect.getEffectType() == StatusEffects.NIGHT_VISION) { - info.setReturnValue(1.0f); - } - }); + TrinketsHelper.getAllEquipped(entity).stream() + .map(stack -> Optional.ofNullable(((TrinketArtifactItem) stack.getItem()).getPermanentEffect())) + .filter(effect -> effect.isPresent() && effect.get().getEffectType() == StatusEffects.NIGHT_VISION) + .findAny() + .ifPresent(effect -> info.setReturnValue(1.0f)); } } }