|
1 | 1 | package dev.rvbsm.fsit.mixin;
|
2 | 2 |
|
3 | 3 | import net.minecraft.entity.Entity;
|
| 4 | +import net.minecraft.entity.MovementType; |
4 | 5 | import net.minecraft.server.network.ServerPlayerEntity;
|
5 | 6 | import net.minecraft.util.Util;
|
6 | 7 | import net.minecraft.util.math.Vec3d;
|
7 | 8 |
|
8 |
| -import com.llamalad7.mixinextras.sugar.Local; |
9 | 9 | import org.jetbrains.annotations.NotNull;
|
10 | 10 | import org.jetbrains.annotations.Nullable;
|
11 | 11 | import org.spongepowered.asm.mixin.Mixin;
|
12 |
| -import org.spongepowered.asm.mixin.Shadow; |
13 | 12 | import org.spongepowered.asm.mixin.Unique;
|
14 | 13 | import org.spongepowered.asm.mixin.injection.At;
|
15 | 14 | import org.spongepowered.asm.mixin.injection.Inject;
|
@@ -37,9 +36,6 @@ public abstract class ServerPlayerEntityMixin extends PlayerEntityMixin implemen
|
37 | 36 | @Unique
|
38 | 37 | private long lastSneakTime = 0L;
|
39 | 38 |
|
40 |
| - @Shadow |
41 |
| - public abstract void stopRiding(); |
42 |
| - |
43 | 39 | @Inject(method = "playerTick", at = @At("TAIL"))
|
44 | 40 | private void tickPosing(CallbackInfo ci) {
|
45 | 41 | if (this.fsit$isInPose()) {
|
@@ -68,16 +64,16 @@ private void copyConfig(ServerPlayerEntity oldPlayer, boolean alive, CallbackInf
|
68 | 64 | }
|
69 | 65 | }
|
70 | 66 |
|
71 |
| - @Inject(method = "stopRiding", at = @At("TAIL")) |
72 |
| - private void resetPose(CallbackInfo ci, @Local Entity entity) { |
73 |
| - if (this.fsit$isInPose(ModPose.Sitting)) { |
74 |
| - this.fsit$resetPose(); |
75 |
| - } |
| 67 | + @Override |
| 68 | + protected void onMove(MovementType type, Vec3d movement, CallbackInfo ci) { |
| 69 | + this.playerVelocity = movement; |
76 | 70 | }
|
77 | 71 |
|
78 | 72 | @Override
|
79 |
| - protected void move(CallbackInfo ci, Vec3d velocity) { |
80 |
| - this.playerVelocity = velocity; |
| 73 | + protected void onDismount(Entity vehicle, CallbackInfo ci) { |
| 74 | + if (this.fsit$isInPose(ModPose.Sitting)) { |
| 75 | + this.fsit$resetPose(); |
| 76 | + } |
81 | 77 | }
|
82 | 78 |
|
83 | 79 | @Override
|
|
0 commit comments