1.20.4 compatibility
This commit is contained in:
parent
c5132221ae
commit
27627e8404
38 changed files with 2790 additions and 31 deletions
31
remappedSrc/themixray/repeating/mod/mixin/EntityMixin.java
Normal file
31
remappedSrc/themixray/repeating/mod/mixin/EntityMixin.java
Normal file
|
@ -0,0 +1,31 @@
|
|||
package themixray.repeating.mod.mixin;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import themixray.repeating.mod.Main;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@Mixin(Entity.class)
|
||||
public abstract class EntityMixin {
|
||||
@Shadow public abstract UUID getUuid();
|
||||
|
||||
@Inject(at = @At(value = "HEAD"), method = "setSprinting", cancellable = true)
|
||||
private void onSprint(boolean sprinting,CallbackInfo ci) {
|
||||
if (Main.client.player != null) {
|
||||
if (getUuid().equals(Main.client.player.getUuid())) {
|
||||
if (Main.me.is_replaying) {
|
||||
if (Main.input_replay != null &&
|
||||
Main.input_replay.sprinting != null &&
|
||||
Main.input_replay.sprinting != sprinting) {
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue