Update to 20w22a (minimal mode only)

This commit is contained in:
Jonas Herzig
2020-06-04 11:54:33 +02:00
parent 6210cb09aa
commit 88be6b3935
26 changed files with 293 additions and 83 deletions

View File

@@ -261,6 +261,9 @@ public class ReplayMod implements
}
}
};
//#if MC>=11600
//$$ // TODO
//#else
//#if MC>=11400
mc.getResourcePackManager().registerProvider(new ResourcePackProvider() {
@Override
@@ -273,6 +276,7 @@ public class ReplayMod implements
//$$ List<IResourcePack> defaultResourcePacks = ((MinecraftAccessor) mc).getDefaultResourcePacks();
//$$ defaultResourcePacks.add(jGuiResourcePack);
//#endif
//#endif
//#if MC<=10710
//$$ FolderResourcePack mainResourcePack = new FolderResourcePack(new File("../src/main/resources")) {
//$$ @Override
@@ -649,13 +653,19 @@ public class ReplayMod implements
if (getSettingsRegistry().get(Setting.NOTIFICATIONS)) {
// Some nostalgia: "§8[§6Replay Mod§8]§r Your message goes here"
//#if MC>=10904
//#if MC>=11600
//$$ Style coloredDarkGray = Style.EMPTY.withColor(Formatting.DARK_GRAY);
//$$ Style coloredGold = Style.EMPTY.withColor(Formatting.GOLD);
//$$ Style alert = Style.EMPTY.withColor(warning ? Formatting.RED : Formatting.DARK_GREEN);
//#else
Style coloredDarkGray = new Style().setColor(Formatting.DARK_GRAY);
Style coloredGold = new Style().setColor(Formatting.GOLD);
Style alert = new Style().setColor(warning ? Formatting.RED : Formatting.DARK_GREEN);
//#endif
Text text = new LiteralText("[").setStyle(coloredDarkGray)
.append(new TranslatableText("replaymod.title").setStyle(coloredGold))
.append(new LiteralText("] "))
.append(new TranslatableText(message, args).setStyle(new Style()
.setColor(warning ? Formatting.RED : Formatting.DARK_GREEN)));
.append(new TranslatableText(message, args).setStyle(alert));
//#else
//$$ ChatStyle coloredDarkGray = new ChatStyle().setColor(EnumChatFormatting.DARK_GRAY);
//$$ ChatStyle coloredGold = new ChatStyle().setColor(EnumChatFormatting.GOLD);

View File

@@ -5,13 +5,16 @@ import de.johni0702.minecraft.gui.utils.EventRegistrations;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.TitleScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.realms.RealmsScreenProxy;
import org.lwjgl.opengl.GL11;
import java.util.List;
import static com.replaymod.core.versions.MCVer.*;
//#if MC>=11400 && MC<11600
import net.minecraft.realms.RealmsScreenProxy;
//#endif
//#if FABRIC>=1
import de.johni0702.minecraft.gui.versions.callbacks.InitScreenCallback;
//#else
@@ -68,7 +71,7 @@ public class MainMenuHandler extends EventRegistrations {
}
//#endif
}
//#if MC>=11400
//#if MC>=11400 && MC<11600
GuiMainMenuAccessor guiA = (GuiMainMenuAccessor) gui;
if (realmsOffset != 0 && guiA.getRealmsNotification() instanceof RealmsScreenProxy) {
guiA.setRealmsNotification(new RealmsNotificationProxy((RealmsScreenProxy) guiA.getRealmsNotification(), realmsOffset));
@@ -77,7 +80,7 @@ public class MainMenuHandler extends EventRegistrations {
}
}
//#if MC>=11400
//#if MC>=11400 && MC<11600
private static class RealmsNotificationProxy extends Screen {
private final RealmsScreenProxy proxy;
private final int offset;

View File

@@ -19,25 +19,39 @@ public class WrappedTimer extends RenderTickCounter {
}
@Override
public void beginRenderTick(
public
//#if MC>=11600
//$$ int
//#else
void
//#endif
beginRenderTick(
//#if MC>=11400
long sysClock
//#endif
) {
copy(this, wrapped);
wrapped.beginRenderTick(
//#if MC>=11400
sysClock
//#endif
);
copy(wrapped, this);
try {
//#if MC>=11600
//$$ return
//#endif
wrapped.beginRenderTick(
//#if MC>=11400
sysClock
//#endif
);
} finally {
copy(wrapped, this);
}
}
protected void copy(RenderTickCounter from, RenderTickCounter to) {
TimerAccessor fromA = (TimerAccessor) from;
TimerAccessor toA = (TimerAccessor) to;
//#if MC<11600
to.ticksThisFrame = from.ticksThisFrame;
//#endif
to.tickDelta = from.tickDelta;
toA.setLastSyncSysClock(fromA.getLastSyncSysClock());
to.lastFrameDuration = from.lastFrameDuration;