Update 1.19.4 (#233)
This commit is contained in:
17
src/main/java/anticope/rejects/mixin/PlayerEntityMixin.java
Normal file
17
src/main/java/anticope/rejects/mixin/PlayerEntityMixin.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package anticope.rejects.mixin;
|
||||
|
||||
import anticope.rejects.events.OffGroundSpeedEvent;
|
||||
import meteordevelopment.meteorclient.MeteorClient;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
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;
|
||||
|
||||
@Mixin(PlayerEntity.class)
|
||||
public class PlayerEntityMixin {
|
||||
@Inject(method = "getOffGroundSpeed", at = @At("RETURN"), cancellable = true)
|
||||
private void onGetOffGroundSpeed(CallbackInfoReturnable<Float> cir) {
|
||||
cir.setReturnValue(MeteorClient.EVENT_BUS.post(OffGroundSpeedEvent.get(cir.getReturnValueF())).speed);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user