mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 13:37:58 +01:00
Revert mixinextras usage
This commit is contained in:
parent
a6b16ec09f
commit
6eb2464d78
2 changed files with 16 additions and 8 deletions
|
@ -5,7 +5,9 @@ import org.spongepowered.asm.mixin.Final;
|
|||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
import com.minelittlepony.unicopia.entity.effect.SeaponyGraceStatusEffect;
|
||||
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
|
@ -16,8 +18,10 @@ abstract class MixinGuardianTargetPredicate {
|
|||
@Shadow
|
||||
private @Final GuardianEntity owner;
|
||||
|
||||
@ModifyReturnValue(method = "test", at = @At("RETURN"))
|
||||
private boolean unicopia_excludeSeaponysGrace(boolean result, @Nullable LivingEntity target) {
|
||||
return result && SeaponyGraceStatusEffect.hasIre(target, owner);
|
||||
@Inject(method = "test", at = @At("HEAD"), cancellable = true)
|
||||
private void unicopia_excludeSeaponysGrace(@Nullable LivingEntity target, CallbackInfoReturnable<Boolean> info) {
|
||||
if (!SeaponyGraceStatusEffect.hasIre(target, owner)) {
|
||||
info.setReturnValue(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,9 @@ package com.minelittlepony.unicopia.mixin;
|
|||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
import com.minelittlepony.unicopia.entity.effect.SeaponyGraceStatusEffect;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.passive.FishEntity;
|
||||
|
@ -12,8 +14,10 @@ import net.minecraft.entity.passive.PufferfishEntity;
|
|||
abstract class MixinPufferfishEntity extends FishEntity {
|
||||
MixinPufferfishEntity() { super(null, null); }
|
||||
|
||||
@ModifyReturnValue(method = "method_6591(Lnet/minecraft/entity/LivingEntity;)Z", at = @At("RETURN"))
|
||||
private static boolean unicopia_excludeSeaponysGrace(boolean result, LivingEntity entity) {
|
||||
return result && !SeaponyGraceStatusEffect.hasGrace(entity);
|
||||
@Inject(method = "method_6591(Lnet/minecraft/entity/LivingEntity;)Z", at = @At("HEAD"), cancellable = true)
|
||||
private static void unicopia_excludeSeaponysGrace(LivingEntity entity, CallbackInfoReturnable<Boolean> info) {
|
||||
if (SeaponyGraceStatusEffect.hasGrace(entity)) {
|
||||
info.setReturnValue(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue