Get pathing module compiling

This commit is contained in:
Jonas Herzig
2019-03-01 11:55:00 +01:00
parent c1fefdeb3c
commit 641014b0d1
5 changed files with 29 additions and 10 deletions

View File

@@ -38,7 +38,7 @@ public class WrappedTimer extends Timer {
to.lastSyncSysClock = from.lastSyncSysClock;
to.elapsedPartialTicks = from.elapsedPartialTicks;
//#if MC>=11200
// FIXME (should be good to go once AT are applied) to.tickLength = from.tickLength;
to.tickLength = from.tickLength;
//#else
//$$ to.ticksPerSecond = from.ticksPerSecond;
//$$ to.lastHRTime = from.lastHRTime;

View File

@@ -28,8 +28,8 @@ import de.johni0702.minecraft.gui.layout.VerticalLayout;
import de.johni0702.minecraft.gui.popup.GuiYesNoPopup;
import de.johni0702.minecraft.gui.utils.Colors;
import de.johni0702.minecraft.gui.utils.Consumer;
import org.lwjgl.util.Dimension;
import org.lwjgl.util.ReadableDimension;
import de.johni0702.minecraft.gui.utils.lwjgl.Dimension;
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
import java.io.IOException;
import java.util.LinkedHashMap;

View File

@@ -14,7 +14,11 @@ import com.replaymod.replaystudio.pathing.path.Timeline;
import net.minecraft.client.Minecraft;
//#if MC>=10800
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
//#if MC>=11300
import net.minecraftforge.eventbus.api.SubscribeEvent;
//#else
//$$ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
//#endif
//#else
//$$ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
//#endif
@@ -28,7 +32,7 @@ import static com.replaymod.core.versions.MCVer.*;
* Plays a timeline.
*/
public abstract class AbstractTimelinePlayer {
private final Minecraft mc = Minecraft.getMinecraft();
private final Minecraft mc = getMinecraft();
private final ReplayHandler replayHandler;
private Timeline timeline;
protected long startOffset;

View File

@@ -4,7 +4,11 @@ import com.replaymod.core.utils.WrappedTimer;
import net.minecraft.util.Timer;
//#if MC>=10800
import net.minecraftforge.fml.common.eventhandler.Event;
//#if MC>=11300
import net.minecraftforge.eventbus.api.Event;
//#else
//$$ import net.minecraftforge.fml.common.eventhandler.Event;
//#endif
//#else
//$$ import cpw.mods.fml.common.eventhandler.Event;
//#endif
@@ -15,16 +19,28 @@ import static com.replaymod.core.versions.MCVer.*;
* Wrapper around the current timer that prevents the timer from advancing by itself.
*/
public class ReplayTimer extends WrappedTimer {
private final Timer state = new Timer(0);
//#if MC>=11300
private final Timer state = new Timer(0, 0);
//#else
//$$ private final Timer state = new Timer(0);
//#endif
public ReplayTimer(Timer wrapped) {
super(wrapped);
}
@Override
public void updateTimer() {
public void updateTimer(
//#if MC>=11300
long sysClock
//#endif
) {
copy(this, state); // Save our current state
super.updateTimer(); // Update current state
wrapped.updateTimer(
//#if MC>=11300
sysClock
//#endif
); // Update current state
copy(state, this); // Restore our old state
FML_BUS.post(new UpdatedEvent());
}