Get rid of all the ATs in favor of Mixins

This commit is contained in:
Jonas Herzig
2019-05-06 16:53:39 +02:00
parent 2094c518a0
commit bd91d0d3bd
41 changed files with 302 additions and 778 deletions

View File

@@ -42,10 +42,11 @@ public class FullBrightness extends EventRegistrations implements Extra {
@Override
public void run() {
active = !active;
// need to tick once to update lightmap when replay is paused
//#if MC>=11300
mod.getMinecraft().entityRenderer.tick(); // need to tick once to update lightmap when replay is paused
mod.getMinecraft().entityRenderer.tick();
//#else
//$$ mod.getMinecraft().entityRenderer.lightmapUpdateNeeded = true;
//$$ mod.getMinecraft().entityRenderer.updateRenderer();
//#endif
ReplayHandler replayHandler = module.getReplayHandler();
if (replayHandler != null) {

View File

@@ -3,25 +3,6 @@ package com.replaymod.extras.advancedscreenshots;
import com.replaymod.core.ReplayMod;
import com.replaymod.extras.Extra;
//#if MC<11300
//$$ import com.replaymod.core.versions.MCVer;
//$$ import com.replaymod.replay.events.ReplayDispatchKeypressesEvent;
//$$ import net.minecraft.client.Minecraft;
//$$ import net.minecraft.client.gui.GuiControls;
//$$ import net.minecraftforge.client.event.GuiScreenEvent;
//$$ import net.minecraftforge.common.MinecraftForge;
//$$ import org.lwjgl.input.Keyboard;
//#endif
//#if MC>=10800
//#if MC>=11300
//#else
//$$ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
//#endif
//#else
//$$ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
//#endif
public class AdvancedScreenshots implements Extra {
private ReplayMod mod;
@@ -29,33 +10,14 @@ public class AdvancedScreenshots implements Extra {
@Override
public void register(ReplayMod mod) {
this.mod = mod;
//#if MC<11300
//$$ MinecraftForge.EVENT_BUS.register(this);
//#endif
}
//#if MC>=11300
private static AdvancedScreenshots instance; { instance = this; }
public static void take() {
if (instance != null) {
instance.takeScreenshot();
}
}
//#else
//$$ @SubscribeEvent
//$$ public void onDispatchKeypresses(ReplayDispatchKeypressesEvent.Pre event) {
//$$ Minecraft mc = MCVer.getMinecraft();
//$$ if (mc.currentScreen instanceof GuiControls) return;
//$$ if (!Keyboard.getEventKeyState()) return;
//$$ if (Keyboard.isRepeatEvent()) return;
//$$ int keyCode = Keyboard.getEventKey() == 0 ? Keyboard.getEventCharacter() : Keyboard.getEventKey();
//$$ if (keyCode == 0 || keyCode != mc.gameSettings.keyBindScreenshot.getKeyCode()) return;
//$$
//$$ takeScreenshot();
//$$
//$$ event.setCanceled(true);
//$$ }
//#endif
private void takeScreenshot() {
ReplayMod.instance.runLater(() -> new GuiCreateScreenshot(mod).display());