Re-enable and fix building for older MC versions

This commit is contained in:
Jonas Herzig
2019-03-02 18:11:01 +01:00
parent 528791c91f
commit 8705bbad9a
24 changed files with 142 additions and 84 deletions

View File

@@ -506,16 +506,22 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
//$$ if (p instanceof S3FPacketCustomPayload) {
//$$ S3FPacketCustomPayload packet = (S3FPacketCustomPayload) p;
//#endif
/* FIXME
//#if MC>=10800
String channelName = packet.getChannelName();
//#if MC>=11300
ResourceLocation channelName = packet.getChannelName();
//#else
//$$ String channelName = packet.getChannelName();
//#endif
//#else
//$$ String channelName = packet.func_149169_c();
//#endif
if ("MC|BOpen".equals(channelName)) {
//#if MC>=11300
if (SPacketCustomPayload.BOOK_OPEN.equals(channelName)) {
//#else
//$$ if ("MC|BOpen".equals(channelName)) {
//#endif
return null;
}
*/
//#if MC>=10800
}

View File

@@ -1,4 +1,3 @@
/* FIXME
package com.replaymod.replay;
import com.replaymod.core.utils.WrappedTimer;
@@ -7,20 +6,21 @@ import com.replaymod.replay.camera.CameraEntity;
import com.replaymod.replay.events.ReplayDispatchKeypressesEvent;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.crash.CrashReport;
import net.minecraft.util.ReportedException;
import net.minecraft.util.Timer;
import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.common.MinecraftForge;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
//#if MC>=11300
//#else
//$$ import net.minecraft.client.settings.GameSettings;
//$$ import org.lwjgl.input.Keyboard;
//$$ import org.lwjgl.input.Mouse;
//#if MC>=10800
import net.minecraftforge.fml.common.FMLCommonHandler;
import java.io.IOException;
//$$ import net.minecraftforge.fml.common.FMLCommonHandler;
//$$
//$$ import java.io.IOException;
//#else
//$$ import cpw.mods.fml.common.FMLCommonHandler;
//$$ import cpw.mods.fml.common.eventhandler.Event;
@@ -28,6 +28,7 @@ import java.io.IOException;
//$$
//$$ import static com.replaymod.core.versions.MCVer.FML_BUS;
//#endif
//#endif
public class InputReplayTimer extends WrappedTimer {
private final ReplayModReplay mod;
@@ -39,6 +40,7 @@ public class InputReplayTimer extends WrappedTimer {
this.mc = mod.getCore().getMinecraft();
}
/* FIXME
@Override
public void updateTimer() {
super.updateTimer();
@@ -260,9 +262,9 @@ public class InputReplayTimer extends WrappedTimer {
FMLCommonHandler.instance().fireKeyInput();
}
*/
//#if MC<=10710
//$$ public static class RunScheduledTasks extends Event {}
//#endif
}
*/

View File

@@ -61,7 +61,7 @@ public class ReplayModReplay implements Module {
@Override
public void registerKeyBindings(KeyBindingRegistry registry) {
registry.registerKeyBinding("replaymod.input.marker", MCVer.Keyboard.KEY_M, new Runnable() {
registry.registerKeyBinding("replaymod.input.marker", Keyboard.KEY_M, new Runnable() {
@Override
public void run() {
if (replayHandler != null ) {

View File

@@ -67,7 +67,7 @@ public class GuiHandler {
// Replace "Exit Server" button with "Exit Replay" button
case BUTTON_EXIT_SERVER:
removeButton(event, b);
addButton(event, new GuiButton(BUTTON_EXIT_REPLAY, b.x, b.y, b.width, b.height, I18n.format("replaymod.gui.exit")) {
addButton(event, new GuiButton(BUTTON_EXIT_REPLAY, x(b), y(b), b.width, b.height, I18n.format("replaymod.gui.exit")) {
//#if MC>=11300
@Override
public void onClick(double mouseX, double mouseY) {

View File

@@ -47,7 +47,7 @@ public abstract class MixinPlayerControllerMP {
//$$ private NetHandlerPlayClient netClientHandler;
//#endif
//#if MC>=11200
//#if MC>=11300
@Inject(method = "createPlayer", at=@At("HEAD"), cancellable = true)
private void replayModReplay_createReplayCamera(World worldIn, StatisticsManager statisticsManager, RecipeBookClient recipeBookClient, CallbackInfoReturnable<EntityPlayerSP> ci) {
if (ReplayModReplay.instance.getReplayHandler() != null) {