Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix EMT Nightvision #35

Merged
merged 2 commits into from
Dec 4, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ java {
languageVersion.set(projectJavaVersion)
}
}
runClient {
mitchej123 marked this conversation as resolved.
Show resolved Hide resolved
jvmArgs "-noverify"
}

idea {
module {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ public enum MixinSets {
() -> config.fixIc2Nightvision,
Arrays.asList(
"fixIc2Nightvision.MixinIc2NanoSuitNightVision",
"fixIc2Nightvision.MixinIc2QuantumSuitNightVision"
"fixIc2Nightvision.MixinIc2QuantumSuitNightVision",
"fixIc2Nightvision.MixinIc2NightVisionGoggles"
)
),
IC2_REACTOR_DUPE("IC2 Reactor Dupe",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.mitchej123.hodgepodge.mixins.fixIc2Nightvision;

import ic2.core.item.armor.ItemArmorNightvisionGoggles;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

@Mixin(value = ItemArmorNightvisionGoggles.class)
public class MixinIc2NightVisionGoggles {
@Redirect(
method= "onArmorTick(Lnet/minecraft/world/World;Lnet/minecraft/entity/player/EntityPlayer;Lnet/minecraft/item/ItemStack;)V",
at = @At(
value="INVOKE",
target="Lnet/minecraft/world/World;getBlockLightValue(III)I"
)
)
public int getBlockLightValue(World world, int p_72957_1_, int p_72957_2_, int p_72957_3_) {
// Ic2 nightvision will blind anyone if `getBlockLightValue` returns > 8; so always return 1
return 1;
}
}