mirror of
https://github.com/darksaid98/Flashback.git
synced 2026-12-02 06:28:48 +00:00
Backport 0.17.0 to 1.21
This commit is contained in:
1 parent
2d43b9d54c
commit
89201e682c
3 files changed
+6
-15
No files matched your search
@@ -3,15 +3,15 @@ package com.moulberry.flashback.mixin.millis;
|
||||
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
|
||||
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
|
||||
import com.moulberry.flashback.Flashback;
|
||||
import net.minecraft.client.renderer.WorldBorderRenderer;
|
||||
import net.minecraft.client.renderer.LevelRenderer;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
|
||||
@Mixin(WorldBorderRenderer.class)
|
||||
@Mixin(LevelRenderer.class)
|
||||
public class MixinWorldBorderRenderer {
|
||||
|
||||
@WrapOperation(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/Util;getMillis()J"), require = 0)
|
||||
public long render(Operation<Long> original) {
|
||||
@WrapOperation(method = "renderWorldBorder", at = @At(value = "INVOKE", target = "Lnet/minecraft/Util;getMillis()J"), require = 0)
|
||||
public long renderWorldBorder(Operation<Long> original) {
|
||||
if (Flashback.isInReplay()) {
|
||||
return Flashback.getVisualMillis();
|
||||
}
|
||||
|
||||
@@ -33,15 +33,6 @@ public abstract class MixinEntity {
|
||||
@Shadow
|
||||
public abstract UUID getUUID();
|
||||
|
||||
// Force entities to be able to ride players on servers
|
||||
@WrapOperation(method = "startRiding(Lnet/minecraft/world/entity/Entity;Z)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/Level;isClientSide()Z"))
|
||||
public boolean startRiding_isClientSide(Level instance, Operation<Boolean> original) {
|
||||
if (Flashback.isInReplay()) {
|
||||
return true; // Always pretend we're clientside so mounting players is allowed
|
||||
}
|
||||
return original.call(instance);
|
||||
}
|
||||
|
||||
@Inject(method = "isInvisibleTo", at = @At("HEAD"), cancellable = true)
|
||||
public void isInvisibleTo(Player player, CallbackInfoReturnable<Boolean> cir) {
|
||||
ReplayServer replayServer = Flashback.getReplayServer();
|
||||
|
||||
Reference in new issue
Block a user