Switch core to 1.14 (generated via ./gradlew :1.14:setCoreVersion)

This commit is contained in:
Jonas Herzig
2019-05-10 14:09:22 +02:00
parent 7f7d33def8
commit 7cbf7f7c94
183 changed files with 3250 additions and 3250 deletions

View File

@@ -103,7 +103,7 @@ public class GuiKeyframeRepository extends GuiScreen implements Closeable {
public final GuiButton loadButton = new GuiButton(buttonPanel).onClick(new Runnable() {
@Override
public void run() {
getMinecraft().displayGuiScreen(null);
getMinecraft().openScreen(null);
try {
Timeline timeline = timelines.get(selectedEntry.name);
for (Path path : timeline.getPaths()) {

View File

@@ -14,8 +14,8 @@ import com.replaymod.replaystudio.pathing.path.Keyframe;
import com.replaymod.replaystudio.pathing.path.Path;
import com.replaymod.replaystudio.pathing.path.Timeline;
import de.johni0702.minecraft.gui.utils.EventRegistrations;
import net.minecraft.client.Minecraft;
import net.minecraft.util.Timer;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.RenderTickCounter;
import javax.annotation.Nullable;
import java.util.Iterator;
@@ -26,7 +26,7 @@ import static com.replaymod.core.versions.MCVer.*;
* Plays a timeline.
*/
public abstract class AbstractTimelinePlayer extends EventRegistrations {
private final Minecraft mc = getMinecraft();
private final MinecraftClient mc = getMinecraft();
private final ReplayHandler replayHandler;
private Timeline timeline;
protected long startOffset;
@@ -81,7 +81,7 @@ public abstract class AbstractTimelinePlayer extends EventRegistrations {
TimerAccessor timerA = (TimerAccessor) timer;
//#if MC>=11200
timerA.setTickLength(WrappedTimer.DEFAULT_MS_PER_TICK);
timer.renderPartialTicks = timer.elapsedTicks = 0;
timer.tickDelta = timer.ticksThisFrame = 0;
//#else
//$$ timer.timerSpeed = 1;
//$$ timer.elapsedPartialTicks = timer.elapsedTicks = 0;
@@ -124,10 +124,10 @@ public abstract class AbstractTimelinePlayer extends EventRegistrations {
float timeInTicks = replayTime / 50f;
float previousTimeInTicks = lastTime / 50f;
float passedTicks = timeInTicks - previousTimeInTicks;
Timer timer = ((MinecraftAccessor) mc).getTimer();
timer.renderPartialTicks += passedTicks;
timer.elapsedTicks = (int) timer.renderPartialTicks;
timer.renderPartialTicks -= timer.elapsedTicks;
RenderTickCounter timer = ((MinecraftAccessor) mc).getTimer();
timer.tickDelta += passedTicks;
timer.ticksThisFrame = (int) timer.tickDelta;
timer.tickDelta -= timer.ticksThisFrame;
lastTime = replayTime;

View File

@@ -3,35 +3,35 @@ package com.replaymod.pathing.player;
import com.replaymod.core.utils.WrappedTimer;
import net.fabricmc.fabric.api.event.Event;
import net.fabricmc.fabric.api.event.EventFactory;
import net.minecraft.util.Timer;
import net.minecraft.client.render.RenderTickCounter;
/**
* Wrapper around the current timer that prevents the timer from advancing by itself.
*/
public class ReplayTimer extends WrappedTimer {
//#if MC>=11300
private final Timer state = new Timer(0, 0);
private final RenderTickCounter state = new RenderTickCounter(0, 0);
//#else
//$$ private final Timer state = new Timer(0);
//#endif
public ReplayTimer(Timer wrapped) {
public ReplayTimer(RenderTickCounter wrapped) {
super(wrapped);
}
@Override
// This should be handled by Remap but it isn't (was handled before a9724e3).
//#if MC>=11400
//$$ public void beginRenderTick(
public void beginRenderTick(
//#else
public void updateTimer(
//$$ public void updateTimer(
//#endif
//#if MC>=11300
long sysClock
//#endif
) {
copy(this, state); // Save our current state
wrapped.updateTimer(
wrapped.beginRenderTick(
//#if MC>=11300
sysClock
//#endif
@@ -40,7 +40,7 @@ public class ReplayTimer extends WrappedTimer {
UpdatedCallback.EVENT.invoker().onUpdate();
}
public Timer getWrapped() {
public RenderTickCounter getWrapped() {
return wrapped;
}

View File

@@ -7,7 +7,7 @@ import com.replaymod.replaystudio.pathing.property.AbstractProperty;
import com.replaymod.replaystudio.pathing.property.PropertyPart;
import com.replaymod.replaystudio.pathing.property.PropertyParts;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.LivingEntity;
import net.minecraft.world.World;
import java.io.IOException;
@@ -34,7 +34,7 @@ public class SpectatorProperty extends AbstractProperty<Integer> {
ReplayHandler handler = ((ReplayHandler) replayHandler);
World world = handler.getCameraEntity().getEntityWorld();
// Lookup entity by id, returns null if an entity with the id does not exists
Entity target = world.getEntityByID(value);
Entity target = world.getEntityById(value);
// Spectate entity, when called with null, returns to camera
//#if MC>=10800
handler.spectateEntity(target);