./gradlew :1.16.2:setCoreVersion

This commit is contained in:
Jonas Herzig
2020-08-28 14:54:53 +02:00
parent 9001fdc9de
commit c2f51d41fa
36 changed files with 233 additions and 233 deletions

View File

@@ -657,13 +657,13 @@ public class ReplayMod implements
// 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);
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);
//$$ 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))

View File

@@ -12,7 +12,7 @@ import java.util.List;
import static com.replaymod.core.versions.MCVer.*;
//#if MC>=11400 && MC<11600
import net.minecraft.realms.RealmsScreenProxy;
//$$ import net.minecraft.realms.RealmsScreenProxy;
//#endif
//#if FABRIC>=1
@@ -72,53 +72,53 @@ public class MainMenuHandler extends EventRegistrations {
//#endif
}
//#if MC>=11400 && MC<11600
GuiMainMenuAccessor guiA = (GuiMainMenuAccessor) gui;
if (realmsOffset != 0 && guiA.getRealmsNotification() instanceof RealmsScreenProxy) {
guiA.setRealmsNotification(new RealmsNotificationProxy((RealmsScreenProxy) guiA.getRealmsNotification(), realmsOffset));
}
//$$ GuiMainMenuAccessor guiA = (GuiMainMenuAccessor) gui;
//$$ if (realmsOffset != 0 && guiA.getRealmsNotification() instanceof RealmsScreenProxy) {
//$$ guiA.setRealmsNotification(new RealmsNotificationProxy((RealmsScreenProxy) guiA.getRealmsNotification(), realmsOffset));
//$$ }
//#endif
}
}
//#if MC>=11400 && MC<11600
private static class RealmsNotificationProxy extends Screen {
private final RealmsScreenProxy proxy;
private final int offset;
private RealmsNotificationProxy(RealmsScreenProxy proxy, int offset) {
//$$ private static class RealmsNotificationProxy extends Screen {
//$$ private final RealmsScreenProxy proxy;
//$$ private final int offset;
//$$
//$$ private RealmsNotificationProxy(RealmsScreenProxy proxy, int offset) {
//#if MC>=11400
super(null);
//$$ super(null);
//#endif
this.proxy = proxy;
this.offset = offset;
}
@Override
public void init(MinecraftClient mc, int width, int height) {
proxy.init(mc, width, height);
}
@Override
public void tick() {
proxy.tick();
}
@Override
public void render(int mouseX, int mouseY, float partialTicks) {
GL11.glTranslated(0, offset, 0);
proxy.render(mouseX, mouseY - offset, partialTicks);
GL11.glTranslated(0, -offset, 0);
}
@Override
public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) {
return proxy.mouseClicked(mouseX, mouseY - offset, mouseButton);
}
@Override
public void removed() {
proxy.removed();
}
}
//$$ this.proxy = proxy;
//$$ this.offset = offset;
//$$ }
//$$
//$$ @Override
//$$ public void init(MinecraftClient mc, int width, int height) {
//$$ proxy.init(mc, width, height);
//$$ }
//$$
//$$ @Override
//$$ public void tick() {
//$$ proxy.tick();
//$$ }
//$$
//$$ @Override
//$$ public void render(int mouseX, int mouseY, float partialTicks) {
//$$ GL11.glTranslated(0, offset, 0);
//$$ proxy.render(mouseX, mouseY - offset, partialTicks);
//$$ GL11.glTranslated(0, -offset, 0);
//$$ }
//$$
//$$ @Override
//$$ public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) {
//$$ return proxy.mouseClicked(mouseX, mouseY - offset, mouseButton);
//$$ }
//$$
//$$ @Override
//$$ public void removed() {
//$$ proxy.removed();
//$$ }
//$$ }
//#endif
}

View File

@@ -11,7 +11,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(Keyboard.class)
public class MixinKeyboardListener {
@Inject(method = "onKey", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/options/KeyBinding;onKeyPressed(Lnet/minecraft/client/util/InputUtil$KeyCode;)V", shift = At.Shift.AFTER))
@Inject(method = "onKey", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/options/KeyBinding;onKeyPressed(Lnet/minecraft/client/util/InputUtil$Key;)V", shift = At.Shift.AFTER))
private void afterKeyBindingTick(long windowPointer, int key, int scanCode, int action, int modifiers, CallbackInfo ci) {
KeyBindingEventCallback.EVENT.invoker().onKeybindingEvent();
KeyEventCallback.EVENT.invoker().onKeyEvent(key, scanCode, action, modifiers);

View File

@@ -12,7 +12,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(Mouse.class)
public class MixinMouse {
@Inject(method = "onMouseButton", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/options/KeyBinding;onKeyPressed(Lnet/minecraft/client/util/InputUtil$KeyCode;)V", shift = At.Shift.AFTER))
@Inject(method = "onMouseButton", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/options/KeyBinding;onKeyPressed(Lnet/minecraft/client/util/InputUtil$Key;)V", shift = At.Shift.AFTER))
private void afterKeyBindingTick(CallbackInfo ci) {
KeyBindingEventCallback.EVENT.invoker().onKeybindingEvent();
}

View File

@@ -45,7 +45,7 @@ public class Mixin_ContextualKeyBindings {
} else {
// Not in a replay, remove all replay-exclusive keybindings
for (KeyBinding keyBinding : onlyInReplay) {
if (Mixin_ContextualKeyBindings.keysById.remove(keyBinding.getId()) != null) {
if (Mixin_ContextualKeyBindings.keysById.remove(keyBinding.getTranslationKey()) != null) {
temporarilyRemoved.add(keyBinding);
}
}
@@ -55,7 +55,7 @@ public class Mixin_ContextualKeyBindings {
@Inject(method = "updateKeysByCode", at = @At("RETURN"))
private static void postContextualKeyBindings(CallbackInfo ci) {
for (KeyBinding keyBinding : temporarilyRemoved) {
Mixin_ContextualKeyBindings.keysById.put(keyBinding.getId(), keyBinding);
Mixin_ContextualKeyBindings.keysById.put(keyBinding.getTranslationKey(), keyBinding);
}
temporarilyRemoved.clear();
}

View File

@@ -1,7 +1,7 @@
package com.replaymod.core.utils;
import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket;
import net.minecraft.util.PacketByteBuf;
import net.minecraft.network.PacketByteBuf;
//#if MC>=10904
import net.minecraft.util.Identifier;
//#endif

View File

@@ -21,9 +21,9 @@ public class WrappedTimer extends RenderTickCounter {
@Override
public
//#if MC>=11600
//$$ int
int
//#else
void
//$$ void
//#endif
beginRenderTick(
//#if MC>=11400
@@ -33,7 +33,7 @@ public class WrappedTimer extends RenderTickCounter {
copy(this, wrapped);
try {
//#if MC>=11600
//$$ return
return
//#endif
wrapped.beginRenderTick(
//#if MC>=11400
@@ -50,7 +50,7 @@ public class WrappedTimer extends RenderTickCounter {
TimerAccessor toA = (TimerAccessor) to;
//#if MC<11600
to.ticksThisFrame = from.ticksThisFrame;
//$$ to.ticksThisFrame = from.ticksThisFrame;
//#endif
to.tickDelta = from.tickDelta;
toA.setLastSyncSysClock(fromA.getLastSyncSysClock());

View File

@@ -14,7 +14,7 @@ import net.minecraft.client.model.ModelPart;
import net.minecraft.util.crash.CrashReportSection;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.PacketByteBuf;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.util.Identifier;
import net.minecraft.util.Util;
import net.minecraft.util.math.MathHelper;
@@ -24,7 +24,7 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
//#if MC>=11600
//$$ import net.minecraft.resource.ResourcePackSource;
import net.minecraft.resource.ResourcePackSource;
//#endif
//#if MC>=11500
@@ -44,9 +44,9 @@ import net.minecraft.client.gui.widget.AbstractButtonWidget;
import java.util.concurrent.CompletableFuture;
//#if MC>=11600
//$$ import net.minecraft.text.TranslatableText;
import net.minecraft.text.TranslatableText;
//#else
import net.minecraft.client.resource.language.I18n;
//$$ import net.minecraft.client.resource.language.I18n;
//#endif
//#else
//$$ import com.google.common.util.concurrent.FutureCallback;
@@ -448,7 +448,7 @@ public class MCVer {
return getMinecraft().getResourcePackDownloader().loadServerPack(
file
//#if MC>=11600
//$$ , ResourcePackSource.PACK_SOURCE_SERVER
, ResourcePackSource.PACK_SOURCE_SERVER
//#endif
);
//#else
@@ -574,7 +574,7 @@ public class MCVer {
public static EntityRenderDispatcher getRenderManager() {
//#if MC>=10800
return getMinecraft().getEntityRenderManager();
return getMinecraft().getEntityRenderDispatcher();
//#else
//$$ return RenderManager.instance;
//#endif
@@ -613,9 +613,9 @@ public class MCVer {
//#if MC>=11400
public static Optional<AbstractButtonWidget> findButton(List<AbstractButtonWidget> buttonList, @SuppressWarnings("unused") String text, @SuppressWarnings("unused") int id) {
//#if MC>=11600
//$$ final TranslatableText message = new TranslatableText(text);
final TranslatableText message = new TranslatableText(text);
//#else
final String message = I18n.translate(text);
//$$ final String message = I18n.translate(text);
//#endif
for (AbstractButtonWidget b : buttonList) {
if (message.equals(b.getMessage())) {