mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-12-01 08:47:59 +01:00
21 lines
827 B
Java
21 lines
827 B
Java
package com.minelittlepony.unicopia.mixin;
|
|
|
|
import org.jetbrains.annotations.Nullable;
|
|
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 com.minelittlepony.unicopia.EquinePredicates;
|
|
|
|
import net.minecraft.entity.LivingEntity;
|
|
|
|
@Mixin(targets = "net.minecraft.entity.mob.GuardianEntity$GuardianTargetPredicate")
|
|
abstract class MixinGuardianTargetPredicate {
|
|
@Inject(method = "test", at = @At("HEAD"), cancellable = true)
|
|
private void test(@Nullable LivingEntity livingEntity, CallbackInfoReturnable<Boolean> info) {
|
|
if (EquinePredicates.PLAYER_SEAPONY.test(livingEntity)) {
|
|
info.setReturnValue(false);
|
|
}
|
|
}
|
|
}
|