Skip to content
This repository has been archived by the owner on Jan 4, 2024. It is now read-only.

Commit

Permalink
cca crash
Browse files Browse the repository at this point in the history
  • Loading branch information
florensie committed May 9, 2021
1 parent 6b2e786 commit 786c72e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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<Float> 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));
}
}
}

0 comments on commit 786c72e

Please sign in to comment.