mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-12-22 16:48:25 +01:00
Handle boat velocity change in <= 1.20.6
This commit is contained in:
parent
fad95d2670
commit
dc189976a4
@ -44,6 +44,7 @@ import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@ -84,6 +85,15 @@ public abstract class MixinBoatEntity extends VehicleEntity {
|
||||
super(type, world);
|
||||
}
|
||||
|
||||
@Redirect(method = "updateVelocity", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;isSpaceEmpty(Lnet/minecraft/entity/Entity;Lnet/minecraft/util/math/Box;)Z"))
|
||||
private boolean alwaysUpdatePosition(World instance, Entity entity, Box box) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_20_5)) {
|
||||
return true;
|
||||
} else {
|
||||
return instance.isSpaceEmpty(entity, box);
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "pushAwayFrom", at = @At("HEAD"), cancellable = true)
|
||||
private void pushAwayFrom1_8(Entity entity, CallbackInfo ci) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_8)) {
|
||||
|
Loading…
Reference in New Issue
Block a user