Get replay module compiling on 1.13

This commit is contained in:
Jonas Herzig
2018-12-19 10:11:08 +01:00
parent 9655677972
commit 1470123ec9
29 changed files with 476 additions and 206 deletions

View File

@@ -2,25 +2,42 @@ package com.replaymod.replay.mixin;
import com.replaymod.replay.ReplayHandler;
import com.replaymod.replay.ReplayModReplay;
import net.minecraft.client.Minecraft;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
//#if MC>=11300
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.util.Util;
//#else
//$$ import net.minecraft.client.Minecraft;
//#if MC>=10904
import net.minecraft.client.renderer.RenderItem;
//$$ import net.minecraft.client.renderer.RenderItem;
//#else
//$$ import net.minecraft.client.renderer.entity.RenderItem;
//#endif
//#endif
@Mixin(RenderItem.class)
//#if MC>=11300
@Mixin(ItemRenderer.class)
//#else
//$$ @Mixin(RenderItem.class)
//#endif
public class MixinRenderItem {
@Redirect(method = "renderEffect", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;getSystemTime()J"))
private long getEnchantmentTime() {
//#if MC>=11300
@Redirect(method = "renderEffect", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Util;milliTime()J"))
//#else
//$$ @Redirect(method = "renderEffect", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;getSystemTime()J"))
//#endif
private static long getEnchantmentTime() {
ReplayHandler replayHandler = ReplayModReplay.instance.getReplayHandler();
if (replayHandler != null) {
return replayHandler.getReplaySender().currentTimeStamp();
}
return Minecraft.getSystemTime();
//#if MC>=11300
return Util.milliTime();
//#else
//$$ return Minecraft.getSystemTime();
//#endif
}
}