Switch core to 1.14 (generated via ./gradlew :1.14:setCoreVersion)
This commit is contained in:
@@ -22,8 +22,8 @@ import com.replaymod.simplepathing.SPTimeline.SPPath;
|
||||
import com.replaymod.simplepathing.gui.GuiPathing;
|
||||
import com.replaymod.simplepathing.preview.PathPreview;
|
||||
import lombok.Getter;
|
||||
import net.minecraft.crash.CrashReport;
|
||||
import net.minecraft.crash.ReportedException;
|
||||
import net.minecraft.util.crash.CrashReport;
|
||||
import net.minecraft.util.crash.CrashException;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -107,7 +107,7 @@ public class ReplayModSimplePathing extends EventRegistrations implements Module
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new ReportedException(CrashReport.makeCrashReport(e, "Reading timeline"));
|
||||
throw new CrashException(CrashReport.create(e, "Reading timeline"));
|
||||
}
|
||||
|
||||
guiPathing = new GuiPathing(core, this, replayHandler);
|
||||
@@ -223,8 +223,8 @@ public class ReplayModSimplePathing extends EventRegistrations implements Module
|
||||
String serialized = serialization.serialize(Collections.singletonMap("", spTimeline.getTimeline()));
|
||||
timeline = serialization.deserialize(serialized).get("");
|
||||
} catch (Throwable t) {
|
||||
CrashReport report = CrashReport.makeCrashReport(t, "Cloning timeline");
|
||||
throw new ReportedException(report);
|
||||
CrashReport report = CrashReport.create(t, "Cloning timeline");
|
||||
throw new CrashException(report);
|
||||
}
|
||||
|
||||
int id = lastSaveId.incrementAndGet();
|
||||
|
||||
@@ -29,9 +29,9 @@ import com.replaymod.replaystudio.util.EntityPositionTracker;
|
||||
import com.replaymod.replaystudio.util.Location;
|
||||
import com.replaymod.simplepathing.properties.ExplicitInterpolationProperty;
|
||||
import lombok.Getter;
|
||||
import net.minecraft.crash.CrashReport;
|
||||
import net.minecraft.crash.CrashReportCategory;
|
||||
import net.minecraft.crash.ReportedException;
|
||||
import net.minecraft.util.crash.CrashReport;
|
||||
import net.minecraft.util.crash.CrashReportSection;
|
||||
import net.minecraft.util.crash.CrashException;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.apache.commons.lang3.tuple.Triple;
|
||||
@@ -657,10 +657,10 @@ public class SPTimeline implements PathingRegistry {
|
||||
jsonWriter.endArray();
|
||||
jsonWriter.flush();
|
||||
} catch (IOException e) {
|
||||
CrashReport crash = CrashReport.makeCrashReport(e, "Serializing interpolator");
|
||||
CrashReportCategory category = crash.makeCategory("Serializing interpolator");
|
||||
CrashReport crash = CrashReport.create(e, "Serializing interpolator");
|
||||
CrashReportSection category = crash.addElement("Serializing interpolator");
|
||||
addDetail(category, "Interpolator", interpolator::toString);
|
||||
throw new ReportedException(crash);
|
||||
throw new CrashException(crash);
|
||||
}
|
||||
|
||||
return baos.toString();
|
||||
@@ -672,10 +672,10 @@ public class SPTimeline implements PathingRegistry {
|
||||
jsonReader.beginArray();
|
||||
return deserializeInterpolator(jsonReader);
|
||||
} catch (IOException e) {
|
||||
CrashReport crash = CrashReport.makeCrashReport(e, "De-serializing interpolator");
|
||||
CrashReportCategory category = crash.makeCategory("De-serializing interpolator");
|
||||
CrashReport crash = CrashReport.create(e, "De-serializing interpolator");
|
||||
CrashReportSection category = crash.addElement("De-serializing interpolator");
|
||||
addDetail(category, "Interpolator", json::toString);
|
||||
throw new ReportedException(crash);
|
||||
throw new CrashException(crash);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ import de.johni0702.minecraft.gui.utils.Colors;
|
||||
import de.johni0702.minecraft.gui.utils.Consumer;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadablePoint;
|
||||
import lombok.Getter;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.resource.language.I18n;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -289,7 +289,7 @@ public abstract class GuiEditKeyframe<T extends GuiEditKeyframe<T>> extends Abst
|
||||
setLayout(new VerticalLayout());
|
||||
|
||||
dropdown = new GuiDropdownMenu<InterpolatorType>()
|
||||
.setToString(s -> I18n.format(s.getI18nName()))
|
||||
.setToString(s -> I18n.translate(s.getI18nName()))
|
||||
.setValues(InterpolatorType.values()).setHeight(20)
|
||||
.onSelection(i -> setSettingsPanel(dropdown.getSelectedValue()));
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ import de.johni0702.minecraft.gui.utils.lwjgl.Dimension;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadablePoint;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.WritablePoint;
|
||||
import net.minecraft.crash.CrashReport;
|
||||
import net.minecraft.util.crash.CrashReport;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -110,7 +110,7 @@ public class GuiPathing {
|
||||
String serialized = serialization.serialize(Collections.singletonMap("", spTimeline.getTimeline()));
|
||||
timeline = serialization.deserialize(serialized).get("");
|
||||
} catch (Throwable t) {
|
||||
error(LOGGER, replayHandler.getOverlay(), CrashReport.makeCrashReport(t, "Cloning timeline"), () -> {});
|
||||
error(LOGGER, replayHandler.getOverlay(), CrashReport.create(t, "Cloning timeline"), () -> {});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -569,7 +569,7 @@ public class GuiPathing {
|
||||
public void onFailure(@Nonnull Throwable t) {
|
||||
String message = "Failed to load entity tracker, pathing will be unavailable.";
|
||||
GuiReplayOverlay overlay = replayHandler.getOverlay();
|
||||
Utils.error(LOGGER, overlay, CrashReport.makeCrashReport(t, message), popup::close);
|
||||
Utils.error(LOGGER, overlay, CrashReport.create(t, message), popup::close);
|
||||
}
|
||||
});
|
||||
return false;
|
||||
@@ -623,8 +623,8 @@ public class GuiPathing {
|
||||
if (!replayHandler.isCameraView()) {
|
||||
spectatedId = getRenderViewEntity(replayHandler.getOverlay().getMinecraft()).getEntityId();
|
||||
}
|
||||
timeline.addPositionKeyframe(time, camera.posX, camera.posY, camera.posZ,
|
||||
camera.rotationYaw, camera.rotationPitch, camera.roll, spectatedId);
|
||||
timeline.addPositionKeyframe(time, camera.x, camera.y, camera.z,
|
||||
camera.yaw, camera.pitch, camera.roll, spectatedId);
|
||||
mod.setSelected(path, time);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -16,19 +16,19 @@ import com.replaymod.simplepathing.ReplayModSimplePathing;
|
||||
import com.replaymod.simplepathing.SPTimeline;
|
||||
import com.replaymod.simplepathing.gui.GuiPathing;
|
||||
import de.johni0702.minecraft.gui.utils.EventRegistrations;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Identifier;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.apache.commons.lang3.tuple.Triple;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
//#if MC>=11400
|
||||
//$$ import com.replaymod.core.events.PostRenderWorldCallback;
|
||||
import com.replaymod.core.events.PostRenderWorldCallback;
|
||||
//#else
|
||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
//$$ import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
//$$ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
//#endif
|
||||
|
||||
import java.util.Comparator;
|
||||
@@ -38,8 +38,8 @@ import static com.replaymod.core.ReplayMod.TEXTURE;
|
||||
import static com.replaymod.core.versions.MCVer.*;
|
||||
|
||||
public class PathPreviewRenderer extends EventRegistrations {
|
||||
private static final ResourceLocation CAMERA_HEAD = new ResourceLocation("replaymod", "camera_head.png");
|
||||
private static final Minecraft mc = MCVer.getMinecraft();
|
||||
private static final Identifier CAMERA_HEAD = new Identifier("replaymod", "camera_head.png");
|
||||
private static final MinecraftClient mc = MCVer.getMinecraft();
|
||||
|
||||
private static final int SLOW_PATH_COLOR = 0xffcccc;
|
||||
private static final int FAST_PATH_COLOR = 0x660000;
|
||||
@@ -54,13 +54,13 @@ public class PathPreviewRenderer extends EventRegistrations {
|
||||
}
|
||||
|
||||
//#if MC>=11400
|
||||
//$$ { on(PostRenderWorldCallback.EVENT, this::renderCameraPath); }
|
||||
//$$ private void renderCameraPath() {
|
||||
{ on(PostRenderWorldCallback.EVENT, this::renderCameraPath); }
|
||||
private void renderCameraPath() {
|
||||
//#else
|
||||
@SubscribeEvent
|
||||
public void renderCameraPath(RenderWorldLastEvent event) {
|
||||
//$$ @SubscribeEvent
|
||||
//$$ public void renderCameraPath(RenderWorldLastEvent event) {
|
||||
//#endif
|
||||
if (!replayHandler.getReplaySender().isAsyncMode() || mc.gameSettings.hideGUI) return;
|
||||
if (!replayHandler.getReplaySender().isAsyncMode() || mc.options.hudHidden) return;
|
||||
|
||||
Entity view = getRenderViewEntity(mc);
|
||||
if (view == null) return;
|
||||
@@ -77,12 +77,12 @@ public class PathPreviewRenderer extends EventRegistrations {
|
||||
|
||||
path.update();
|
||||
|
||||
int renderDistance = mc.gameSettings.renderDistanceChunks * 16;
|
||||
int renderDistance = mc.options.viewDistance * 16;
|
||||
int renderDistanceSquared = renderDistance * renderDistance;
|
||||
|
||||
//#if MC>=10800
|
||||
// Eye height is subtracted to make path appear higher (at eye height) than it actually is (at foot height)
|
||||
Triple<Double, Double, Double> viewPos = Triple.of(view.posX, view.posY - view.getEyeHeight(), view.posZ);
|
||||
Triple<Double, Double, Double> viewPos = Triple.of(view.x, view.y - view.getStandingEyeHeight(), view.z);
|
||||
//#else
|
||||
//$$ Triple<Double, Double, Double> viewPos = Triple.of(view.posX, view.posY, view.posZ);
|
||||
//#endif
|
||||
@@ -180,7 +180,7 @@ public class PathPreviewRenderer extends EventRegistrations {
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
GlStateManager.popAttrib();
|
||||
GlStateManager.popAttributes();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,8 +269,8 @@ public class PathPreviewRenderer extends EventRegistrations {
|
||||
pos.getRight() - view.getRight()
|
||||
);
|
||||
GL11.glNormal3f(0, 1, 0);
|
||||
GL11.glRotatef(-getRenderManager().playerViewY, 0, 1, 0);
|
||||
GL11.glRotatef(getRenderManager().playerViewX, 1, 0, 0);
|
||||
GL11.glRotatef(-getRenderManager().cameraYaw, 0, 1, 0);
|
||||
GL11.glRotatef(getRenderManager().cameraPitch, 1, 0, 0);
|
||||
|
||||
Tessellator_getInstance().draw();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user