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

@@ -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());
}