Change particle density in 1.20.3->1.20.5 (#442)

* tweak particle density

* implement changes

* newlined
This commit is contained in:
RacoonDog 2024-06-14 12:52:34 -04:00 committed by GitHub
parent 456a5a94b9
commit 1f8fb02b53
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,6 +19,7 @@
package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.entity;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import de.florianmichael.viafabricplus.fixes.versioned.visual.EntityRidingOffsetsPre1_20_2;
import de.florianmichael.viafabricplus.protocoltranslator.ProtocolTranslator;
@ -76,6 +77,15 @@ public abstract class MixinLivingEntity extends Entity {
super(type, world);
}
@ModifyExpressionValue(method = "tickStatusEffects", at = @At(value = "CONSTANT", args = "intValue=4"))
private int changeParticleDensity(int original) {
if (ProtocolTranslator.getTargetVersion().olderThan(ProtocolVersion.v1_20_5)) {
return 2;
} else {
return original;
}
}
@Redirect(method = "getPassengerRidingPos", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/LivingEntity;getPassengerAttachmentPos(Lnet/minecraft/entity/Entity;Lnet/minecraft/entity/EntityDimensions;F)Lnet/minecraft/util/math/Vec3d;"))
private Vec3d getPassengerRidingPos1_20_1(LivingEntity instance, Entity entity, EntityDimensions entityDimensions, float v) {
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_20)) {