mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2025-01-23 21:51:26 +01:00
Made shieldBlockCounter injection optional
Fixed https://github.com/ViaVersion/ViaFabricPlus/issues/306
This commit is contained in:
parent
2e42a4565e
commit
a1024831dc
@ -45,7 +45,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
import java.util.Optional;
|
||||
|
||||
@SuppressWarnings("ConstantValue")
|
||||
@Mixin(LivingEntity.class)
|
||||
@Mixin(value = LivingEntity.class, priority = 999 /* Workaround for https://github.com/ViaVersion/ViaFabricPlus/issues/306 */)
|
||||
public abstract class MixinLivingEntity extends Entity {
|
||||
|
||||
@Shadow
|
||||
@ -177,7 +177,7 @@ public abstract class MixinLivingEntity extends Entity {
|
||||
return height;
|
||||
}
|
||||
|
||||
@ModifyConstant(method = "isBlocking", constant = @Constant(intValue = 5))
|
||||
@ModifyConstant(method = "isBlocking", constant = @Constant(intValue = 5), require = 0 /* Workaround for https://github.com/ViaVersion/ViaFabricPlus/issues/306 */)
|
||||
public int shieldBlockCounter(int constant) {
|
||||
if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8)) {
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user