Release 2.6.5
This commit is contained in:
@@ -341,7 +341,7 @@ dependencies {
|
||||
|
||||
shadow 'com.github.ReplayMod.JavaBlend:2.79.0:a0696f8'
|
||||
|
||||
shadow "com.github.ReplayMod:ReplayStudio:b5539d1", shadeExclusions
|
||||
shadow "com.github.ReplayMod:ReplayStudio:6fc8e20", shadeExclusions
|
||||
|
||||
implementation(FABRIC ? dependencies.project(path: jGui.path, configuration: "namedElements") : jGui) {
|
||||
transitive = false // FG 1.2 puts all MC deps into the compile configuration and we don't want to shade those
|
||||
|
||||
@@ -59,6 +59,7 @@ import java.io.OutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.InvalidPathException;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.StandardOpenOption;
|
||||
import java.nio.file.attribute.FileAttribute;
|
||||
@@ -185,7 +186,16 @@ public class Utils {
|
||||
* Checks whether a given file name is actually usable with the file system / operating system at the given folder.
|
||||
*/
|
||||
private static boolean isUsable(Path folder, String fileName) {
|
||||
Path path = folder.resolve(fileName);
|
||||
if (fileName.contains(folder.getFileSystem().getSeparator())) {
|
||||
return false; // file name contains the name separator, definitely not usable
|
||||
}
|
||||
|
||||
Path path;
|
||||
try {
|
||||
path = folder.resolve(fileName);
|
||||
} catch (InvalidPathException e) {
|
||||
return false; // file name contains invalid characters, definitely not usable
|
||||
}
|
||||
if (Files.exists(path)) {
|
||||
return true; // if it already exits, it's definitely usable
|
||||
}
|
||||
|
||||
@@ -27,9 +27,9 @@ import net.minecraft.resource.ResourcePackSource;
|
||||
//#if MC>=11400
|
||||
import com.replaymod.render.mixin.MainWindowAccessor;
|
||||
import net.minecraft.SharedConstants;
|
||||
import net.minecraft.client.gl.Framebuffer;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.gui.widget.AbstractButtonWidget;
|
||||
import net.minecraft.client.util.Window;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
@@ -106,17 +106,10 @@ public class MCVer {
|
||||
|
||||
public static void resizeMainWindow(MinecraftClient mc, int width, int height) {
|
||||
//#if MC>=11400
|
||||
Framebuffer fb = mc.getFramebuffer();
|
||||
if (fb.viewportWidth != width || fb.viewportHeight != height) {
|
||||
fb.resize(width, height, false);
|
||||
}
|
||||
Window window = mc.getWindow();
|
||||
MainWindowAccessor mainWindow = (MainWindowAccessor) (Object) window;
|
||||
//noinspection ConstantConditions
|
||||
MainWindowAccessor mainWindow = (MainWindowAccessor) (Object) mc.getWindow();
|
||||
mainWindow.setFramebufferWidth(width);
|
||||
mainWindow.setFramebufferHeight(height);
|
||||
//#if MC>=11500
|
||||
mc.gameRenderer.onResized(width, height);
|
||||
//#endif
|
||||
mainWindow.invokeOnFramebufferSizeChanged(window.getHandle(), width, height);
|
||||
//#else
|
||||
//$$ if (width != mc.displayWidth || height != mc.displayHeight) {
|
||||
//$$ mc.resize(width, height);
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
package com.replaymod.render.gui.progress;
|
||||
|
||||
import com.replaymod.render.hooks.MinecraftClientExt;
|
||||
import com.replaymod.render.mixin.MainWindowAccessor;
|
||||
import de.johni0702.minecraft.gui.function.Closeable;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gl.Framebuffer;
|
||||
import net.minecraft.client.util.Window;
|
||||
|
||||
//#if MC>=11700
|
||||
//$$ import net.minecraft.client.gl.WindowFramebuffer;
|
||||
//#endif
|
||||
|
||||
public class VirtualWindow implements Closeable {
|
||||
private final MinecraftClient mc;
|
||||
private final Window window;
|
||||
private final MainWindowAccessor acc;
|
||||
|
||||
private final Framebuffer guiFramebuffer;
|
||||
private boolean isBound;
|
||||
private int framebufferWidth, framebufferHeight;
|
||||
|
||||
private int gameWidth, gameHeight;
|
||||
|
||||
|
||||
public VirtualWindow(MinecraftClient mc) {
|
||||
this.mc = mc;
|
||||
this.window = mc.getWindow();
|
||||
this.acc = (MainWindowAccessor) (Object) this.window;
|
||||
|
||||
framebufferWidth = acc.getFramebufferWidth();
|
||||
framebufferHeight = acc.getFramebufferHeight();
|
||||
|
||||
//#if MC>=11700
|
||||
//$$ guiFramebuffer = new WindowFramebuffer(framebufferWidth, framebufferHeight);
|
||||
//#else
|
||||
guiFramebuffer = new Framebuffer(framebufferWidth, framebufferHeight, true
|
||||
//#if MC>=11400
|
||||
, false
|
||||
//#endif
|
||||
);
|
||||
//#endif
|
||||
|
||||
MinecraftClientExt.get(mc).setWindowDelegate(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
guiFramebuffer.delete();
|
||||
|
||||
MinecraftClientExt.get(mc).setWindowDelegate(null);
|
||||
}
|
||||
|
||||
public void bind() {
|
||||
gameWidth = acc.getFramebufferWidth();
|
||||
gameHeight = acc.getFramebufferHeight();
|
||||
acc.setFramebufferWidth(framebufferWidth);
|
||||
acc.setFramebufferHeight(framebufferHeight);
|
||||
applyScaleFactor();
|
||||
isBound = true;
|
||||
}
|
||||
|
||||
public void unbind() {
|
||||
acc.setFramebufferWidth(gameWidth);
|
||||
acc.setFramebufferHeight(gameHeight);
|
||||
applyScaleFactor();
|
||||
isBound = false;
|
||||
}
|
||||
|
||||
public void beginWrite() {
|
||||
guiFramebuffer.beginWrite(true);
|
||||
}
|
||||
|
||||
public void endWrite() {
|
||||
guiFramebuffer.endWrite();
|
||||
}
|
||||
|
||||
public void flip() {
|
||||
guiFramebuffer.draw(framebufferWidth, framebufferHeight);
|
||||
|
||||
//#if MC>=11500
|
||||
window.swapBuffers();
|
||||
//#else
|
||||
//#if MC>=11400
|
||||
//$$ window.setFullscreen(false);
|
||||
//#else
|
||||
//#if MC>=10800
|
||||
//$$ mc.updateDisplay();
|
||||
//#else
|
||||
//$$ mc.resetSize();
|
||||
//#endif
|
||||
//#endif
|
||||
//#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the size of the window's framebuffer. Must only be called while this window is bound.
|
||||
*/
|
||||
public void onResolutionChanged(int newWidth, int newHeight) {
|
||||
if (newWidth == 0 || newHeight == 0) {
|
||||
// These can be zero on Windows if minimized.
|
||||
// Creating zero-sized framebuffers however will throw an error, so we never want to switch to zero values.
|
||||
return;
|
||||
}
|
||||
|
||||
if (framebufferWidth == newWidth && framebufferHeight == newHeight) {
|
||||
return; // size is unchanged, nothing to do
|
||||
}
|
||||
|
||||
framebufferWidth = newWidth;
|
||||
framebufferHeight = newHeight;
|
||||
|
||||
//#if MC>=11400
|
||||
guiFramebuffer.resize(newWidth, newHeight
|
||||
//#if MC>=11400
|
||||
, false
|
||||
//#endif
|
||||
);
|
||||
//#else
|
||||
//$$ guiFramebuffer.createBindFramebuffer(newWidth, newHeight);
|
||||
//#endif
|
||||
|
||||
applyScaleFactor();
|
||||
if (mc.currentScreen != null) {
|
||||
mc.currentScreen.resize(mc, window.getScaledWidth(), window.getScaledHeight());
|
||||
}
|
||||
}
|
||||
|
||||
private void applyScaleFactor() {
|
||||
//#if MC>=11400
|
||||
window.setScaleFactor(window.calculateScaleFactor(mc.options.guiScale, mc.forcesUnicodeFont()));
|
||||
//#else
|
||||
//$$ // Nothing to do, ScaledResolution re-computes the scale factor every time it is created
|
||||
//#endif
|
||||
}
|
||||
|
||||
public int getFramebufferWidth() {
|
||||
return framebufferWidth;
|
||||
}
|
||||
|
||||
public int getFramebufferHeight() {
|
||||
return framebufferHeight;
|
||||
}
|
||||
|
||||
public boolean isBound() {
|
||||
return isBound;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.replaymod.render.hooks;
|
||||
|
||||
import com.replaymod.render.gui.progress.VirtualWindow;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
|
||||
public interface MinecraftClientExt {
|
||||
void setWindowDelegate(VirtualWindow window);
|
||||
|
||||
static MinecraftClientExt get(MinecraftClient mc) {
|
||||
return (MinecraftClientExt) mc;
|
||||
}
|
||||
}
|
||||
@@ -15,12 +15,6 @@ public interface MainWindowAccessor {
|
||||
int getFramebufferHeight();
|
||||
@Accessor
|
||||
void setFramebufferHeight(int value);
|
||||
// FIXME preprocessor should be able to infer this mapping
|
||||
// FIXME preprocessor should be able to remap this one when the mapping is given manually
|
||||
//#if MC>=11500
|
||||
@Invoker
|
||||
//#else
|
||||
//$$ @Invoker("method_4483")
|
||||
//#endif
|
||||
void invokeUpdateFramebufferSize();
|
||||
void invokeOnFramebufferSizeChanged(long window, int width, int height);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.replaymod.render.mixin;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.replaymod.core.versions.MCVer;
|
||||
import com.replaymod.render.hooks.EntityRendererHandler;
|
||||
import net.minecraft.client.render.BackgroundRenderer;
|
||||
@@ -20,6 +21,17 @@ public abstract class Mixin_ChromaKeyDisableFog {
|
||||
((EntityRendererHandler.IEntityRenderer) MCVer.getMinecraft().gameRenderer).replayModRender_getHandler();
|
||||
if (handler == null) return;
|
||||
if (handler.getSettings().getChromaKeyingColor() != null) {
|
||||
// Starting with 1.15, fog is no longer enabled in this method but is instead managed by the RenderLayer
|
||||
// system (and with 1.17, they are enabled permanently / depend only on the shader). Therefore, cancelling
|
||||
// this method is no longer sufficient, and we additionally also need to set the start value to get rid of
|
||||
// fog (this doesn't hurt on 1.14 either).
|
||||
// Note: This only becomes noticeable with Sodium because Vanilla would already set the start to max for
|
||||
// unrelated reasons. But Sodium does some math which gives wrong results if end isn't greater than
|
||||
// start, as would be the case in these cases. Sodium doing math is also the reason we don't set start
|
||||
// equal to end (that'll result in undefined behavior because it sticks those into a smoothstep on old
|
||||
// versions), and we don't set it to MAX_VALUE because that also gives wrong results.
|
||||
GlStateManager.fogStart(1E10F);
|
||||
GlStateManager.fogEnd(2E10F);
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,6 +83,8 @@ public abstract class Mixin_Omnidirectional_Rotation {
|
||||
//#else
|
||||
//$$ GL11.glRotatef(angle, x, y, 0);
|
||||
//#endif
|
||||
|
||||
getMinecraft().worldRenderer.scheduleTerrainUpdate();
|
||||
}
|
||||
//#if MC<11500
|
||||
//$$ if (getHandler() != null && getHandler().omnidirectional) {
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.replaymod.render.mixin;
|
||||
|
||||
import com.replaymod.render.gui.progress.VirtualWindow;
|
||||
import com.replaymod.render.hooks.MinecraftClientExt;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.util.Window;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(MinecraftClient.class)
|
||||
public class Mixin_SuppressFramebufferResizeDuringRender implements MinecraftClientExt {
|
||||
|
||||
@Unique
|
||||
private VirtualWindow windowDelegate;
|
||||
|
||||
@Override
|
||||
public void setWindowDelegate(VirtualWindow window) {
|
||||
this.windowDelegate = window;
|
||||
}
|
||||
|
||||
//#if MC>=11400
|
||||
@Inject(method = "onResolutionChanged", at = @At("HEAD"), cancellable = true)
|
||||
//#else
|
||||
//$$ @Inject(method = "resize", at = @At("HEAD"), cancellable = true)
|
||||
//#endif
|
||||
private void suppressResizeDuringRender(CallbackInfo ci) {
|
||||
VirtualWindow delegate = this.windowDelegate;
|
||||
if (delegate != null && delegate.isBound()) {
|
||||
Window window = ((MinecraftClient) (Object) this).getWindow();
|
||||
delegate.onResolutionChanged(window.getFramebufferWidth(), window.getFramebufferHeight());
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import com.replaymod.core.mixin.TimerAccessor;
|
||||
import com.replaymod.core.utils.WrappedTimer;
|
||||
import com.replaymod.core.versions.MCVer;
|
||||
import com.replaymod.pathing.player.AbstractTimelinePlayer;
|
||||
import com.replaymod.pathing.player.ReplayTimer;
|
||||
import com.replaymod.pathing.properties.TimestampProperty;
|
||||
import com.replaymod.render.CameraPathExporter;
|
||||
import com.replaymod.render.PNGWriter;
|
||||
@@ -19,9 +18,9 @@ import com.replaymod.render.events.ReplayRenderCallback;
|
||||
import com.replaymod.render.frame.BitmapFrame;
|
||||
import com.replaymod.render.gui.GuiRenderingDone;
|
||||
import com.replaymod.render.gui.GuiVideoRenderer;
|
||||
import com.replaymod.render.gui.progress.VirtualWindow;
|
||||
import com.replaymod.render.hooks.ForceChunkLoadingHook;
|
||||
import com.replaymod.render.metadata.MetadataInjector;
|
||||
import com.replaymod.render.mixin.MainWindowAccessor;
|
||||
import com.replaymod.render.mixin.WorldRendererAccessor;
|
||||
import com.replaymod.render.utils.FlawlessFrames;
|
||||
import com.replaymod.replay.ReplayHandler;
|
||||
@@ -32,7 +31,6 @@ import de.johni0702.minecraft.gui.utils.lwjgl.Dimension;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import com.mojang.blaze3d.platform.GLX;
|
||||
import net.minecraft.client.gl.Framebuffer;
|
||||
import net.minecraft.client.sound.PositionedSoundInstance;
|
||||
import net.minecraft.client.util.Window;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
@@ -43,7 +41,6 @@ import net.minecraft.client.render.RenderTickCounter;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
//#if MC>=11700
|
||||
//$$ import net.minecraft.client.gl.WindowFramebuffer;
|
||||
//$$ import net.minecraft.client.render.DiffuseLighting;
|
||||
//$$ import net.minecraft.util.math.Matrix4f;
|
||||
//#endif
|
||||
@@ -113,15 +110,12 @@ public class VideoRenderer implements RenderInfo {
|
||||
private int framesDone;
|
||||
private int totalFrames;
|
||||
|
||||
private final VirtualWindow guiWindow = new VirtualWindow(mc);
|
||||
private final GuiVideoRenderer gui;
|
||||
private boolean paused;
|
||||
private boolean cancelled;
|
||||
private volatile Throwable failureCause;
|
||||
|
||||
private Framebuffer guiFramebuffer;
|
||||
private int displayWidth, displayHeight;
|
||||
private int framebufferWidth, framebufferHeight;
|
||||
|
||||
public VideoRenderer(RenderSettings settings, ReplayHandler replayHandler, Timeline timeline) throws IOException {
|
||||
this.settings = settings;
|
||||
this.replayHandler = replayHandler;
|
||||
@@ -245,11 +239,7 @@ public class VideoRenderer implements RenderInfo {
|
||||
@Override
|
||||
public float updateForNextFrame() {
|
||||
// because the jGui lib uses Minecraft's displayWidth and displayHeight values, update these temporarily
|
||||
MainWindowAccessor acc = (MainWindowAccessor) (Object) mc.getWindow();
|
||||
int framebufferWidthBefore = acc.getFramebufferWidth();
|
||||
int framebufferHeightBefore = acc.getFramebufferHeight();
|
||||
acc.setFramebufferWidth(framebufferWidth);
|
||||
acc.setFramebufferHeight(framebufferHeight);
|
||||
guiWindow.bind();
|
||||
|
||||
if (!settings.isHighPerformance() || framesDone % fps == 0) {
|
||||
while (drawGui() && paused) {
|
||||
@@ -290,8 +280,7 @@ public class VideoRenderer implements RenderInfo {
|
||||
}
|
||||
|
||||
// change Minecraft's display size back
|
||||
acc.setFramebufferWidth(framebufferWidthBefore);
|
||||
acc.setFramebufferHeight(framebufferHeightBefore);
|
||||
guiWindow.unbind();
|
||||
|
||||
if (cameraPathExporter != null) {
|
||||
cameraPathExporter.recordFrame(timer.tickDelta);
|
||||
@@ -362,23 +351,9 @@ public class VideoRenderer implements RenderInfo {
|
||||
cameraPathExporter.setup(totalFrames);
|
||||
}
|
||||
|
||||
updateDisplaySize();
|
||||
updateFramebufferSize();
|
||||
|
||||
gui.toMinecraft().init(mc, mc.getWindow().getScaledWidth(), mc.getWindow().getScaledHeight());
|
||||
|
||||
forceChunkLoadingHook = new ForceChunkLoadingHook(mc.worldRenderer);
|
||||
|
||||
// Set up our own framebuffer to render the GUI to
|
||||
//#if MC>=11700
|
||||
//$$ guiFramebuffer = new WindowFramebuffer(framebufferWidth, framebufferHeight);
|
||||
//#else
|
||||
guiFramebuffer = new Framebuffer(framebufferWidth, framebufferHeight, true
|
||||
//#if MC>=11400
|
||||
, false
|
||||
//#endif
|
||||
);
|
||||
//#endif
|
||||
}
|
||||
|
||||
private void finish() {
|
||||
@@ -388,6 +363,8 @@ public class VideoRenderer implements RenderInfo {
|
||||
// Tear down of the timeline player might only happen the next tick after it was cancelled
|
||||
timelinePlayer.onTick();
|
||||
|
||||
guiWindow.close();
|
||||
|
||||
// FBOs are always used in 1.14+
|
||||
//#if MC<11400
|
||||
//$$ if (!OpenGlHelper.isFramebufferEnabled()) {
|
||||
@@ -427,7 +404,7 @@ public class VideoRenderer implements RenderInfo {
|
||||
}
|
||||
|
||||
// Finally, resize the Minecraft framebuffer to the actual width/height of the window
|
||||
resizeMainWindow(mc, framebufferWidth, framebufferHeight);
|
||||
resizeMainWindow(mc, guiWindow.getFramebufferWidth(), guiWindow.getFramebufferHeight());
|
||||
}
|
||||
|
||||
private void executeTaskQueue() {
|
||||
@@ -485,26 +462,6 @@ public class VideoRenderer implements RenderInfo {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if display size has changes and force recalculate GUI framebuffer size.
|
||||
if (displaySizeChanged()) {
|
||||
updateDisplaySize();
|
||||
((MainWindowAccessor) (Object) window).invokeUpdateFramebufferSize();
|
||||
}
|
||||
|
||||
// Resize the GUI framebuffer if the display size changed
|
||||
if (framebufferSizeChanged()) {
|
||||
updateFramebufferSize();
|
||||
//#if MC>=11400
|
||||
guiFramebuffer.resize(framebufferWidth, framebufferHeight
|
||||
//#if MC>=11400
|
||||
, false
|
||||
//#endif
|
||||
);
|
||||
//#else
|
||||
//$$ guiFramebuffer.createBindFramebuffer(framebufferWidth, framebufferHeight);
|
||||
//#endif
|
||||
}
|
||||
|
||||
pushMatrix();
|
||||
GlStateManager.clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT
|
||||
//#if MC>=11400
|
||||
@@ -512,7 +469,7 @@ public class VideoRenderer implements RenderInfo {
|
||||
//#endif
|
||||
);
|
||||
GlStateManager.enableTexture();
|
||||
guiFramebuffer.beginWrite(true);
|
||||
guiWindow.beginWrite();
|
||||
|
||||
//#if MC>=11500
|
||||
RenderSystem.clear(256, MinecraftClient.IS_SYSTEM_MAC);
|
||||
@@ -568,8 +525,8 @@ public class VideoRenderer implements RenderInfo {
|
||||
//#endif
|
||||
|
||||
//#if MC>=11400
|
||||
int mouseX = (int) mc.mouse.getX() * window.getScaledWidth() / displayWidth;
|
||||
int mouseY = (int) mc.mouse.getY() * window.getScaledHeight() / displayHeight;
|
||||
int mouseX = (int) mc.mouse.getX() * window.getScaledWidth() / Math.max(window.getWidth(), 1);
|
||||
int mouseY = (int) mc.mouse.getY() * window.getScaledHeight() / Math.max(window.getHeight(), 1);
|
||||
|
||||
if (mc.getOverlay() != null) {
|
||||
Screen orgScreen = mc.currentScreen;
|
||||
@@ -599,31 +556,12 @@ public class VideoRenderer implements RenderInfo {
|
||||
//$$ gui.toMinecraft().drawScreen(mouseX, mouseY, 0);
|
||||
//#endif
|
||||
|
||||
guiFramebuffer.endWrite();
|
||||
guiWindow.endWrite();
|
||||
popMatrix();
|
||||
pushMatrix();
|
||||
guiFramebuffer.draw(framebufferWidth, framebufferHeight);
|
||||
guiWindow.flip();
|
||||
popMatrix();
|
||||
|
||||
//#if MC>=11500
|
||||
window.swapBuffers();
|
||||
//#else
|
||||
//#if MC>=11400
|
||||
//$$ window.setFullscreen(false);
|
||||
//#else
|
||||
//$$ // if not in high performance mode, update the gui size if screen size changed
|
||||
//$$ // otherwise just swap the progress gui to screen
|
||||
//$$ if (settings.isHighPerformance()) {
|
||||
//$$ Display.update();
|
||||
//$$ } else {
|
||||
//#if MC>=10800
|
||||
//$$ mc.updateDisplay();
|
||||
//#else
|
||||
//$$ mc.resetSize();
|
||||
//#endif
|
||||
//$$ }
|
||||
//#endif
|
||||
//#endif
|
||||
//#if MC>=11400
|
||||
if (mc.mouse.isCursorLocked()) {
|
||||
mc.mouse.unlockCursor();
|
||||
@@ -638,33 +576,6 @@ public class VideoRenderer implements RenderInfo {
|
||||
} while (true);
|
||||
}
|
||||
|
||||
private boolean displaySizeChanged() {
|
||||
int realWidth = mc.getWindow().getWidth();
|
||||
int realHeight = mc.getWindow().getHeight();
|
||||
return displayWidth != realWidth || displayHeight != realHeight;
|
||||
}
|
||||
|
||||
private boolean framebufferSizeChanged() {
|
||||
int realWidth = mc.getWindow().getFramebufferWidth();
|
||||
int realHeight = mc.getWindow().getFramebufferHeight();
|
||||
if (realWidth == 0 || realHeight == 0) {
|
||||
// These can be zero on Windows if minimized.
|
||||
// Creating zero-sized framebuffers however will throw an error, so we never want to switch to zero values.
|
||||
return false;
|
||||
}
|
||||
return framebufferWidth != realWidth || framebufferHeight != realHeight;
|
||||
}
|
||||
|
||||
private void updateDisplaySize() {
|
||||
displayWidth = mc.getWindow().getWidth();
|
||||
displayHeight = mc.getWindow().getHeight();
|
||||
}
|
||||
|
||||
private void updateFramebufferSize() {
|
||||
framebufferWidth = mc.getWindow().getFramebufferWidth();
|
||||
framebufferHeight = mc.getWindow().getFramebufferHeight();
|
||||
}
|
||||
|
||||
public int getFramesDone() {
|
||||
return framesDone;
|
||||
}
|
||||
|
||||
@@ -585,6 +585,12 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
||||
//#else
|
||||
//$$ String channelName = packet.getChannelName();
|
||||
//#endif
|
||||
String channelNameStr = channelName.toString();
|
||||
|
||||
if (channelNameStr.startsWith("fabric-screen-handler-api-v")) {
|
||||
return null; // we do not want to show modded screens which got opened for the recording player
|
||||
}
|
||||
|
||||
// On 1.14+ there's a dedicated OpenWrittenBookS2CPacket now
|
||||
//#if MC<11400
|
||||
//#if MC>=11400
|
||||
|
||||
@@ -688,6 +688,7 @@ public class CameraEntity
|
||||
//#if MC>=10904
|
||||
cameraA.setItemStackMainHand(viewPlayerA != null ? viewPlayerA.getItemStackMainHand() : empty);
|
||||
this.preferredHand = viewPlayer != null ? viewPlayer.preferredHand : Hand.MAIN_HAND;
|
||||
this.activeItemStack = viewPlayer != null ? viewPlayer.getActiveItem() : empty;
|
||||
cameraA.setActiveItemStackUseCount(viewPlayerA != null ? viewPlayerA.getActiveItemStackUseCount() : 0);
|
||||
//#else
|
||||
//$$ cameraA.setItemInUse(viewPlayerA != null ? viewPlayerA.getItemInUse() : empty);
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
"Mixin_StabilizeCamera",
|
||||
"Mixin_Stereoscopic_Camera",
|
||||
"Mixin_Stereoscopic_HandRenderPass",
|
||||
"Mixin_SuppressFramebufferResizeDuringRender",
|
||||
//#if MC>=11600
|
||||
"Mixin_AddIrisOdsShaderUniforms",
|
||||
"Mixin_LoadIrisOdsShaderPack",
|
||||
|
||||
@@ -1 +1 @@
|
||||
2.6.4
|
||||
2.6.5
|
||||
|
||||
@@ -8,7 +8,6 @@ import org.lwjgl.opengl.Display;
|
||||
public class Window implements MainWindowAccessor {
|
||||
|
||||
private final Minecraft mc;
|
||||
private ScaledResolution scaledResolution;
|
||||
|
||||
public Window(Minecraft mc) {
|
||||
this.mc = mc;
|
||||
@@ -34,11 +33,6 @@ public class Window implements MainWindowAccessor {
|
||||
mc.displayHeight = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invokeUpdateFramebufferSize() {
|
||||
// no-op, pre-LWJGL3 MC doesn't differentiate between window and framebuffer size
|
||||
}
|
||||
|
||||
public long getHandle() {
|
||||
return 0;
|
||||
}
|
||||
@@ -52,16 +46,11 @@ public class Window implements MainWindowAccessor {
|
||||
}
|
||||
|
||||
private ScaledResolution scaledResolution() {
|
||||
ScaledResolution scaledResolution = this.scaledResolution;
|
||||
if (scaledResolution == null) {
|
||||
//#if MC>=10809
|
||||
scaledResolution = new ScaledResolution(mc);
|
||||
//#else
|
||||
//$$ scaledResolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
||||
//#endif
|
||||
this.scaledResolution = scaledResolution;
|
||||
}
|
||||
return scaledResolution;
|
||||
//#if MC>=10809
|
||||
return new ScaledResolution(mc);
|
||||
//#else
|
||||
//$$ return new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
||||
//#endif
|
||||
}
|
||||
|
||||
public int getScaledWidth() {
|
||||
|
||||
@@ -15,6 +15,4 @@ public interface MainWindowAccessor {
|
||||
int getFramebufferHeight();
|
||||
@Accessor("displayHeight")
|
||||
void setFramebufferHeight(int value);
|
||||
@Invoker
|
||||
void invokeUpdateFramebufferSize();
|
||||
}
|
||||
|
||||
@@ -181,6 +181,7 @@ net.minecraft.client.gui.screen.Screen hasShiftDown() isShiftKeyDown()
|
||||
net.minecraft.client.gui.screen.Screen init() setWorldAndResolution()
|
||||
net.minecraft.client.gui.screen.Screen minecraft mc
|
||||
net.minecraft.client.gui.screen.Screen net.minecraft.client.gui.GuiScreen
|
||||
net.minecraft.client.gui.screen.Screen resize() onResize()
|
||||
net.minecraft.client.gui.screen.Screen passEvents allowUserInput
|
||||
net.minecraft.client.gui.screen.Screen removed() onGuiClosed()
|
||||
net.minecraft.client.gui.screen.Screen renderBackground() drawDefaultBackground()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
net.minecraft.client.gui.GuiScreen onResize() func_175273_b()
|
||||
net.minecraft.entity.player.EntityPlayer isWearing() func_175148_a()
|
||||
net.minecraft.client.renderer.WorldRenderer begin() startDrawing()
|
||||
net.minecraft.network.play.server.S38PacketPlayerListItem getAction() func_179768_b()
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
com.mojang.blaze3d.systems.RenderSystem com.mojang.blaze3d.platform.GlStateManager
|
||||
com.mojang.blaze3d.systems.RenderSystem setShaderFogStart() fogStart()
|
||||
com.mojang.blaze3d.systems.RenderSystem setShaderFogEnd() fogEnd()
|
||||
net.minecraft.network.packet.s2c.play.PlayerRespawnS2CPacket getDimensionType() method_29445()
|
||||
net.minecraft.entity.Entity getId() getEntityId()
|
||||
net.minecraft.client.network.ClientPlayerEntity init() net.minecraft.entity.player.PlayerEntity afterSpawn()
|
||||
|
||||
Reference in New Issue
Block a user