Update to 1.21
This commit is contained in:
@@ -3,7 +3,7 @@ import gg.essential.gradle.util.*
|
|||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
java
|
java
|
||||||
id("com.github.johnrengelman.shadow") apply false
|
id("io.github.goooler.shadow") apply false
|
||||||
id("gg.essential.multi-version")
|
id("gg.essential.multi-version")
|
||||||
id("gg.essential.defaults.repo")
|
id("gg.essential.defaults.repo")
|
||||||
id("gg.essential.defaults.java")
|
id("gg.essential.defaults.java")
|
||||||
@@ -86,6 +86,7 @@ dependencies {
|
|||||||
12002 -> "0.91.2+1.20.2"
|
12002 -> "0.91.2+1.20.2"
|
||||||
12004 -> "0.91.2+1.20.4"
|
12004 -> "0.91.2+1.20.4"
|
||||||
12006 -> "0.98.0+1.20.6"
|
12006 -> "0.98.0+1.20.6"
|
||||||
|
12100 -> "0.100.3+1.21"
|
||||||
else -> throw UnsupportedOperationException()
|
else -> throw UnsupportedOperationException()
|
||||||
}
|
}
|
||||||
val fabricApiModules = mutableListOf(
|
val fabricApiModules = mutableListOf(
|
||||||
@@ -155,7 +156,7 @@ dependencies {
|
|||||||
|
|
||||||
implementation(shadow("com.github.ReplayMod.JavaBlend:2.79.0:a0696f8")!!)
|
implementation(shadow("com.github.ReplayMod.JavaBlend:2.79.0:a0696f8")!!)
|
||||||
|
|
||||||
implementation(shadow("com.github.ReplayMod:ReplayStudio:6d59510")!!)
|
implementation(shadow("com.github.ReplayMod:ReplayStudio:5d17653db9")!!)
|
||||||
// FIXME this should be pulled in by ReplayStudio, and IntelliJ sees it, but javac for some reason does not
|
// FIXME this should be pulled in by ReplayStudio, and IntelliJ sees it, but javac for some reason does not
|
||||||
implementation("com.github.viaversion:opennbt:0a02214") // 2.0-SNAPSHOT (ViaVersion Edition)
|
implementation("com.github.viaversion:opennbt:0a02214") // 2.0-SNAPSHOT (ViaVersion Edition)
|
||||||
|
|
||||||
@@ -164,6 +165,7 @@ dependencies {
|
|||||||
|
|
||||||
if (platform.isFabric) {
|
if (platform.isFabric) {
|
||||||
val modMenuVersion = when {
|
val modMenuVersion = when {
|
||||||
|
mcVersion >= 12100 -> "11.0.0-rc.4"
|
||||||
mcVersion >= 12006 -> "10.0.0-beta.1"
|
mcVersion >= 12006 -> "10.0.0-beta.1"
|
||||||
mcVersion >= 12003 -> "9.0.0-pre.1"
|
mcVersion >= 12003 -> "9.0.0-pre.1"
|
||||||
mcVersion >= 12002 -> "8.0.0"
|
mcVersion >= 12002 -> "8.0.0"
|
||||||
|
|||||||
2
jGui
2
jGui
Submodule jGui updated: 7d60bf0532...d2626659b0
@@ -202,6 +202,7 @@ val doRelease by tasks.registering {
|
|||||||
defaultTasks("bundleJar")
|
defaultTasks("bundleJar")
|
||||||
|
|
||||||
preprocess {
|
preprocess {
|
||||||
|
val mc12100 = createNode("1.21", 12100, "yarn")
|
||||||
val mc12006 = createNode("1.20.6", 12006, "yarn")
|
val mc12006 = createNode("1.20.6", 12006, "yarn")
|
||||||
val mc12004 = createNode("1.20.4", 12004, "yarn")
|
val mc12004 = createNode("1.20.4", 12004, "yarn")
|
||||||
val mc12002 = createNode("1.20.2", 12002, "yarn")
|
val mc12002 = createNode("1.20.2", 12002, "yarn")
|
||||||
@@ -230,6 +231,7 @@ preprocess {
|
|||||||
val mc10800 = createNode("1.8", 10800, "srg")
|
val mc10800 = createNode("1.8", 10800, "srg")
|
||||||
val mc10710 = createNode("1.7.10", 10710, "srg")
|
val mc10710 = createNode("1.7.10", 10710, "srg")
|
||||||
|
|
||||||
|
mc12100.link(mc12006)
|
||||||
mc12006.link(mc12004)
|
mc12006.link(mc12004)
|
||||||
mc12004.link(mc12002, file("versions/mapping-fabric-1.20.4-1.20.2.txt"))
|
mc12004.link(mc12002, file("versions/mapping-fabric-1.20.4-1.20.2.txt"))
|
||||||
mc12002.link(mc12001)
|
mc12002.link(mc12001)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ pluginManagement {
|
|||||||
}
|
}
|
||||||
plugins {
|
plugins {
|
||||||
id("gg.essential.multi-version.root") version "0.6.1"
|
id("gg.essential.multi-version.root") version "0.6.1"
|
||||||
id("com.github.johnrengelman.shadow") version "8.1.1"
|
id("io.github.goooler.shadow") version "8.1.7"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,6 +39,7 @@ val jGuiVersions = listOf(
|
|||||||
"1.20.2",
|
"1.20.2",
|
||||||
"1.20.4",
|
"1.20.4",
|
||||||
"1.20.6",
|
"1.20.6",
|
||||||
|
"1.21",
|
||||||
)
|
)
|
||||||
val replayModVersions = listOf(
|
val replayModVersions = listOf(
|
||||||
// "1.7.10",
|
// "1.7.10",
|
||||||
@@ -68,6 +69,7 @@ val replayModVersions = listOf(
|
|||||||
"1.20.2",
|
"1.20.2",
|
||||||
"1.20.4",
|
"1.20.4",
|
||||||
"1.20.6",
|
"1.20.6",
|
||||||
|
"1.21",
|
||||||
)
|
)
|
||||||
|
|
||||||
rootProject.buildFileName = "root.gradle.kts"
|
rootProject.buildFileName = "root.gradle.kts"
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
|
|||||||
import net.minecraft.client.util.InputUtil;
|
import net.minecraft.client.util.InputUtil;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
import static com.replaymod.core.ReplayMod.MOD_ID;
|
import static com.replaymod.core.ReplayMod.MOD_ID;
|
||||||
|
import static de.johni0702.minecraft.gui.versions.MCVer.identifier;
|
||||||
//#else
|
//#else
|
||||||
//$$ import net.minecraftforge.fml.client.registry.ClientRegistry;
|
//$$ import net.minecraftforge.fml.client.registry.ClientRegistry;
|
||||||
//#endif
|
//#endif
|
||||||
@@ -66,7 +67,7 @@ public class KeyBindingRegistry extends EventRegistrations {
|
|||||||
if (keyCode == 0) {
|
if (keyCode == 0) {
|
||||||
keyCode = -1;
|
keyCode = -1;
|
||||||
}
|
}
|
||||||
Identifier id = new Identifier(MOD_ID, name.substring(LangResourcePack.LEGACY_KEY_PREFIX.length()));
|
Identifier id = identifier(MOD_ID, name.substring(LangResourcePack.LEGACY_KEY_PREFIX.length()));
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
String key = String.format("key.%s.%s", id.getNamespace(), id.getPath());
|
String key = String.format("key.%s.%s", id.getNamespace(), id.getPath());
|
||||||
KeyBinding keyBinding = new KeyBinding(key, InputUtil.Type.KEYSYM, keyCode, CATEGORY);
|
KeyBinding keyBinding = new KeyBinding(key, InputUtil.Type.KEYSYM, keyCode, CATEGORY);
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ import java.util.List;
|
|||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
import java.util.concurrent.TimeoutException;
|
import java.util.concurrent.TimeoutException;
|
||||||
|
|
||||||
|
import static de.johni0702.minecraft.gui.versions.MCVer.identifier;
|
||||||
|
|
||||||
//#if MC>=12006
|
//#if MC>=12006
|
||||||
//$$ import net.minecraft.resource.ResourcePackInfo;
|
//$$ import net.minecraft.resource.ResourcePackInfo;
|
||||||
//$$ import net.minecraft.resource.ResourcePackSource;
|
//$$ import net.minecraft.resource.ResourcePackSource;
|
||||||
@@ -52,9 +54,9 @@ public class ReplayMod implements Module, Scheduler {
|
|||||||
|
|
||||||
public static final String MOD_ID = "replaymod";
|
public static final String MOD_ID = "replaymod";
|
||||||
|
|
||||||
public static final Identifier TEXTURE = new Identifier("replaymod", "replay_gui.png");
|
public static final Identifier TEXTURE = identifier("replaymod", "replay_gui.png");
|
||||||
public static final int TEXTURE_SIZE = 256;
|
public static final int TEXTURE_SIZE = 256;
|
||||||
public static final Identifier LOGO_FAVICON = new Identifier("replaymod", "favicon_logo.png");
|
public static final Identifier LOGO_FAVICON = identifier("replaymod", "favicon_logo.png");
|
||||||
|
|
||||||
private static final MinecraftClient mc = MCVer.getMinecraft();
|
private static final MinecraftClient mc = MCVer.getMinecraft();
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,10 @@ import de.johni0702.minecraft.gui.element.GuiButton;
|
|||||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
|
|
||||||
|
import static de.johni0702.minecraft.gui.versions.MCVer.identifier;
|
||||||
|
|
||||||
public class GuiReplayButton extends GuiButton {
|
public class GuiReplayButton extends GuiButton {
|
||||||
public static final Identifier ICON = new Identifier("replaymod", "logo_button.png");
|
public static final Identifier ICON = identifier("replaymod", "logo_button.png");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(GuiRenderer renderer, ReadableDimension size, RenderInfo renderInfo) {
|
public void draw(GuiRenderer renderer, ReadableDimension size, RenderInfo renderInfo) {
|
||||||
|
|||||||
@@ -29,6 +29,13 @@ import java.util.concurrent.CompletableFuture;
|
|||||||
|
|
||||||
@Mixin(MinecraftClient.class)
|
@Mixin(MinecraftClient.class)
|
||||||
public interface MinecraftAccessor {
|
public interface MinecraftAccessor {
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ @Accessor("renderTickCounter")
|
||||||
|
//$$ RenderTickCounter.Dynamic getTimer();
|
||||||
|
//$$ @Accessor("renderTickCounter")
|
||||||
|
//$$ @Mutable
|
||||||
|
//$$ void setTimer(RenderTickCounter.Dynamic value);
|
||||||
|
//#else
|
||||||
@Accessor("renderTickCounter")
|
@Accessor("renderTickCounter")
|
||||||
RenderTickCounter getTimer();
|
RenderTickCounter getTimer();
|
||||||
@Accessor("renderTickCounter")
|
@Accessor("renderTickCounter")
|
||||||
@@ -36,6 +43,7 @@ public interface MinecraftAccessor {
|
|||||||
@Mutable
|
@Mutable
|
||||||
//#endif
|
//#endif
|
||||||
void setTimer(RenderTickCounter value);
|
void setTimer(RenderTickCounter value);
|
||||||
|
//#endif
|
||||||
|
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
@Accessor
|
@Accessor
|
||||||
|
|||||||
@@ -48,16 +48,22 @@ public abstract class MixinMinecraft
|
|||||||
}
|
}
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ private static final String GAME_RENDERER_RENDER = "Lnet/minecraft/client/render/GameRenderer;render(Lnet/minecraft/client/render/RenderTickCounter;Z)V";
|
||||||
|
//#else
|
||||||
|
private static final String GAME_RENDERER_RENDER = "Lnet/minecraft/client/render/GameRenderer;render(FJZ)V";
|
||||||
|
//#endif
|
||||||
|
|
||||||
@Inject(method = "render",
|
@Inject(method = "render",
|
||||||
at = @At(value = "INVOKE",
|
at = @At(value = "INVOKE",
|
||||||
target = "Lnet/minecraft/client/render/GameRenderer;render(FJZ)V"))
|
target = GAME_RENDERER_RENDER))
|
||||||
private void preRender(boolean unused, CallbackInfo ci) {
|
private void preRender(boolean unused, CallbackInfo ci) {
|
||||||
PreRenderCallback.EVENT.invoker().preRender();
|
PreRenderCallback.EVENT.invoker().preRender();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "render",
|
@Inject(method = "render",
|
||||||
at = @At(value = "INVOKE",
|
at = @At(value = "INVOKE",
|
||||||
target = "Lnet/minecraft/client/render/GameRenderer;render(FJZ)V",
|
target = GAME_RENDERER_RENDER,
|
||||||
shift = At.Shift.AFTER))
|
shift = At.Shift.AFTER))
|
||||||
private void postRender(boolean unused, CallbackInfo ci) {
|
private void postRender(boolean unused, CallbackInfo ci) {
|
||||||
PostRenderCallback.EVENT.invoker().postRender();
|
PostRenderCallback.EVENT.invoker().postRender();
|
||||||
|
|||||||
@@ -5,7 +5,11 @@ import org.spongepowered.asm.mixin.Mixin;
|
|||||||
import org.spongepowered.asm.mixin.Mutable;
|
import org.spongepowered.asm.mixin.Mutable;
|
||||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||||
|
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ @Mixin(RenderTickCounter.Dynamic.class)
|
||||||
|
//#else
|
||||||
@Mixin(RenderTickCounter.class)
|
@Mixin(RenderTickCounter.class)
|
||||||
|
//#endif
|
||||||
public interface TimerAccessor {
|
public interface TimerAccessor {
|
||||||
//#if MC>=11200
|
//#if MC>=11200
|
||||||
@Accessor("tickTime")
|
@Accessor("tickTime")
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import net.minecraft.network.PacketByteBuf;
|
|||||||
|
|
||||||
//#if MC>=10904
|
//#if MC>=10904
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
|
import static de.johni0702.minecraft.gui.versions.MCVer.identifier;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC<=10710 || MC>=12002
|
//#if MC<=10710 || MC>=12002
|
||||||
@@ -22,7 +23,7 @@ import net.minecraft.util.Identifier;
|
|||||||
*/
|
*/
|
||||||
public class Restrictions {
|
public class Restrictions {
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
public static final Identifier PLUGIN_CHANNEL = new Identifier("replaymod", "restrict");
|
public static final Identifier PLUGIN_CHANNEL = identifier("replaymod", "restrict");
|
||||||
//#else
|
//#else
|
||||||
//$$ public static final String PLUGIN_CHANNEL = "Replay|Restrict";
|
//$$ public static final String PLUGIN_CHANNEL = "Replay|Restrict";
|
||||||
//#endif
|
//#endif
|
||||||
@@ -77,7 +78,7 @@ public class Restrictions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//#if MC>=12006
|
//#if MC>=12006
|
||||||
//$$ public static final CustomPayload.Id<Payload> ID = CustomPayload.id(PLUGIN_CHANNEL.toString());
|
//$$ public static final CustomPayload.Id<Payload> ID = new CustomPayload.Id<>(PLUGIN_CHANNEL);
|
||||||
//$$ public static final PacketCodec<? super PacketByteBuf, Payload> CODEC = PacketCodec.ofStatic(
|
//$$ public static final PacketCodec<? super PacketByteBuf, Payload> CODEC = PacketCodec.ofStatic(
|
||||||
//$$ (buf, payload) -> buf.writeBytes(payload.bytes()),
|
//$$ (buf, payload) -> buf.writeBytes(payload.bytes()),
|
||||||
//$$ buf -> {
|
//$$ buf -> {
|
||||||
|
|||||||
@@ -68,6 +68,10 @@ import java.util.function.Consumer;
|
|||||||
|
|
||||||
import static com.replaymod.core.versions.MCVer.getMinecraft;
|
import static com.replaymod.core.versions.MCVer.getMinecraft;
|
||||||
|
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ import net.minecraft.util.crash.ReportType;
|
||||||
|
//#endif
|
||||||
|
|
||||||
public class Utils {
|
public class Utils {
|
||||||
private static Logger LOGGER = LogManager.getLogger();
|
private static Logger LOGGER = LogManager.getLogger();
|
||||||
|
|
||||||
@@ -248,7 +252,11 @@ public class Utils {
|
|||||||
|
|
||||||
public static GuiInfoPopup error(Logger logger, GuiContainer container, CrashReport crashReport, Runnable onClose) {
|
public static GuiInfoPopup error(Logger logger, GuiContainer container, CrashReport crashReport, Runnable onClose) {
|
||||||
// Convert crash report to string
|
// Convert crash report to string
|
||||||
String crashReportStr = crashReport.asString();
|
String crashReportStr = crashReport.asString(
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ ReportType.MINECRAFT_CRASH_REPORT
|
||||||
|
//#endif
|
||||||
|
);
|
||||||
|
|
||||||
// Log via logger
|
// Log via logger
|
||||||
logger.error(crashReportStr);
|
logger.error(crashReportStr);
|
||||||
@@ -259,7 +267,11 @@ public class Utils {
|
|||||||
File folder = new File(getMinecraft().runDirectory, "crash-reports");
|
File folder = new File(getMinecraft().runDirectory, "crash-reports");
|
||||||
File file = new File(folder, "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-client.txt");
|
File file = new File(folder, "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-client.txt");
|
||||||
logger.debug("Saving crash report to file: {}", file);
|
logger.debug("Saving crash report to file: {}", file);
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ crashReport.writeToFile(file.toPath(), ReportType.MINECRAFT_CRASH_REPORT);
|
||||||
|
//#else
|
||||||
crashReport.writeToFile(file);
|
crashReport.writeToFile(file);
|
||||||
|
//#endif
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
logger.error("Saving crash report file:", t);
|
logger.error("Saving crash report file:", t);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ import java.util.regex.Matcher;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
import static de.johni0702.minecraft.gui.versions.MCVer.identifier;
|
||||||
|
|
||||||
//#if FABRIC>=1
|
//#if FABRIC>=1
|
||||||
import net.fabricmc.loader.api.FabricLoader;
|
import net.fabricmc.loader.api.FabricLoader;
|
||||||
import net.fabricmc.loader.api.ModContainer;
|
import net.fabricmc.loader.api.ModContainer;
|
||||||
@@ -253,7 +255,7 @@ public class LangResourcePack extends AbstractFileResourcePack {
|
|||||||
.map(LANG_FILE_NAME_PATTERN::matcher)
|
.map(LANG_FILE_NAME_PATTERN::matcher)
|
||||||
.filter(Matcher::matches)
|
.filter(Matcher::matches)
|
||||||
.map(matcher -> String.format("%s_%s.json", matcher.group(1), matcher.group(1)))
|
.map(matcher -> String.format("%s_%s.json", matcher.group(1), matcher.group(1)))
|
||||||
.map(name -> new Identifier(ReplayMod.MOD_ID, "lang/" + name))
|
.map(name -> identifier(ReplayMod.MOD_ID, "lang/" + name))
|
||||||
.forEach(consumer);
|
.forEach(consumer);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
@@ -454,13 +454,15 @@ public class MCVer {
|
|||||||
//#if MC>=11700
|
//#if MC>=11700
|
||||||
//$$ .normal(n.x, n.y, n.z)
|
//$$ .normal(n.x, n.y, n.z)
|
||||||
//#endif
|
//#endif
|
||||||
.next();
|
;
|
||||||
|
buffer.next();
|
||||||
buffer.vertex(p2.x, p2.y, p2.z)
|
buffer.vertex(p2.x, p2.y, p2.z)
|
||||||
.color(r, g, b, a)
|
.color(r, g, b, a)
|
||||||
//#if MC>=11700
|
//#if MC>=11700
|
||||||
//$$ .normal(n.x, n.y, n.z)
|
//$$ .normal(n.x, n.y, n.z)
|
||||||
//#endif
|
//#endif
|
||||||
.next();
|
;
|
||||||
|
buffer.next();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void bindTexture(Identifier id) {
|
public static void bindTexture(Identifier id) {
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ import org.lwjgl.opengl.GL11;
|
|||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
|
import net.minecraft.client.render.VertexConsumer;
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
import net.minecraft.client.util.math.Vector3f;
|
import net.minecraft.client.util.math.Vector3f;
|
||||||
import net.minecraft.util.math.Matrix4f;
|
import net.minecraft.util.math.Matrix4f;
|
||||||
@@ -367,6 +368,9 @@ class Patterns {
|
|||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ @Pattern private static void Tessellator_getBuffer() {}
|
||||||
|
//#else
|
||||||
@Pattern
|
@Pattern
|
||||||
private static BufferBuilder Tessellator_getBuffer(Tessellator tessellator) {
|
private static BufferBuilder Tessellator_getBuffer(Tessellator tessellator) {
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
@@ -375,6 +379,20 @@ class Patterns {
|
|||||||
//$$ return new BufferBuilder(tessellator);
|
//$$ return new BufferBuilder(tessellator);
|
||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
|
//#endif
|
||||||
|
|
||||||
|
//#if MC>=11600
|
||||||
|
@Pattern
|
||||||
|
private static void VertexConsumer_next(VertexConsumer buffer) {
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ buffer./*next()*/getClass();
|
||||||
|
//#else
|
||||||
|
buffer.next();
|
||||||
|
//#endif
|
||||||
|
}
|
||||||
|
//#else
|
||||||
|
//$$ private static void VertexConsumer_next() {}
|
||||||
|
//#endif
|
||||||
|
|
||||||
//#if MC<11700
|
//#if MC<11700
|
||||||
@Pattern
|
@Pattern
|
||||||
@@ -477,7 +495,9 @@ class Patterns {
|
|||||||
|
|
||||||
@Pattern
|
@Pattern
|
||||||
private static float getRenderPartialTicks(MinecraftClient mc) {
|
private static float getRenderPartialTicks(MinecraftClient mc) {
|
||||||
//#if MC>=10900
|
//#if MC>=12100
|
||||||
|
//$$ return mc.getRenderTickCounter().getTickDelta(true);
|
||||||
|
//#elseif MC>=10900
|
||||||
return mc.getTickDelta();
|
return mc.getTickDelta();
|
||||||
//#else
|
//#else
|
||||||
//$$ return ((com.replaymod.core.mixin.MinecraftAccessor) mc).getTimer().renderPartialTicks;
|
//$$ return ((com.replaymod.core.mixin.MinecraftAccessor) mc).getTimer().renderPartialTicks;
|
||||||
@@ -524,7 +544,7 @@ class Patterns {
|
|||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//#if MC>=11600
|
//#if MC>=11600 && MC<12100
|
||||||
@Pattern
|
@Pattern
|
||||||
private static void BufferBuilder_beginLineStrip(BufferBuilder buffer, VertexFormat vertexFormat) {
|
private static void BufferBuilder_beginLineStrip(BufferBuilder buffer, VertexFormat vertexFormat) {
|
||||||
//#if MC>=11700
|
//#if MC>=11700
|
||||||
|
|||||||
@@ -9,6 +9,10 @@ import java.util.concurrent.ExecutionException;
|
|||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.TimeoutException;
|
import java.util.concurrent.TimeoutException;
|
||||||
|
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ import net.minecraft.util.crash.ReportType;
|
||||||
|
//#endif
|
||||||
|
|
||||||
public class SchedulerImpl implements Scheduler {
|
public class SchedulerImpl implements Scheduler {
|
||||||
private static final MinecraftClient mc = MinecraftClient.getInstance();
|
private static final MinecraftClient mc = MinecraftClient.getInstance();
|
||||||
|
|
||||||
@@ -113,7 +117,11 @@ public class SchedulerImpl implements Scheduler {
|
|||||||
runnable.run();
|
runnable.run();
|
||||||
} catch (CrashException e) {
|
} catch (CrashException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ System.err.println(e.getReport().asString(ReportType.MINECRAFT_CRASH_REPORT));
|
||||||
|
//#else
|
||||||
System.err.println(e.getReport().asString());
|
System.err.println(e.getReport().asString());
|
||||||
|
//#endif
|
||||||
mc.setCrashReport(e.getReport());
|
mc.setCrashReport(e.getReport());
|
||||||
} finally {
|
} finally {
|
||||||
inRunLater = false;
|
inRunLater = false;
|
||||||
|
|||||||
@@ -31,7 +31,11 @@ public abstract class AbstractTimelinePlayer extends EventRegistrations {
|
|||||||
private Timeline timeline;
|
private Timeline timeline;
|
||||||
protected long startOffset;
|
protected long startOffset;
|
||||||
private boolean wasAsyncMode;
|
private boolean wasAsyncMode;
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ private RenderTickCounter.Dynamic orgTimer;
|
||||||
|
//#else
|
||||||
private RenderTickCounter orgTimer;
|
private RenderTickCounter orgTimer;
|
||||||
|
//#endif
|
||||||
private long lastTime;
|
private long lastTime;
|
||||||
private long lastTimestamp;
|
private long lastTimestamp;
|
||||||
private ListenableFuture<Void> future;
|
private ListenableFuture<Void> future;
|
||||||
|
|||||||
@@ -6,7 +6,11 @@ import net.minecraft.client.render.RenderTickCounter;
|
|||||||
/**
|
/**
|
||||||
* A timer that does not advance by itself.
|
* A timer that does not advance by itself.
|
||||||
*/
|
*/
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ public class ReplayTimer extends RenderTickCounter.Dynamic {
|
||||||
|
//#else
|
||||||
public class ReplayTimer extends RenderTickCounter {
|
public class ReplayTimer extends RenderTickCounter {
|
||||||
|
//#endif
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
public int ticksThisFrame;
|
public int ticksThisFrame;
|
||||||
//#endif
|
//#endif
|
||||||
@@ -37,13 +41,28 @@ public class ReplayTimer extends RenderTickCounter {
|
|||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
long sysClock
|
long sysClock
|
||||||
//#endif
|
//#endif
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ , boolean tick
|
||||||
|
//#endif
|
||||||
) {
|
) {
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ if (!tick) return 0;
|
||||||
|
//#endif
|
||||||
UpdatedCallback.EVENT.invoker().onUpdate();
|
UpdatedCallback.EVENT.invoker().onUpdate();
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
return ticksThisFrame;
|
return ticksThisFrame;
|
||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ public float tickDelta;
|
||||||
|
//$$
|
||||||
|
//$$ @Override
|
||||||
|
//$$ public float getTickDelta(boolean bl) {
|
||||||
|
//$$ return tickDelta;
|
||||||
|
//$$ }
|
||||||
|
//#endif
|
||||||
|
|
||||||
public interface UpdatedCallback {
|
public interface UpdatedCallback {
|
||||||
Event<UpdatedCallback> EVENT = Event.create((listeners) ->
|
Event<UpdatedCallback> EVENT = Event.create((listeners) ->
|
||||||
() -> {
|
() -> {
|
||||||
|
|||||||
@@ -113,7 +113,21 @@ public class RecordingEventHandler extends EventRegistrations {
|
|||||||
try {
|
try {
|
||||||
ClientPlayerEntity player = mc.player;
|
ClientPlayerEntity player = mc.player;
|
||||||
assert player != null;
|
assert player != null;
|
||||||
//#if MC>=12002
|
//#if MC>=12100
|
||||||
|
//$$ packetListener.save(new EntitySpawnS2CPacket(
|
||||||
|
//$$ player.getId(),
|
||||||
|
//$$ player.getUuid(),
|
||||||
|
//$$ player.getX(),
|
||||||
|
//$$ player.getY(),
|
||||||
|
//$$ player.getZ(),
|
||||||
|
//$$ player.getPitch(),
|
||||||
|
//$$ player.getYaw(),
|
||||||
|
//$$ player.getType(),
|
||||||
|
//$$ 0,
|
||||||
|
//$$ player.getVelocity(),
|
||||||
|
//$$ player.getHeadYaw()
|
||||||
|
//$$ ));
|
||||||
|
//#elseif MC>=12002
|
||||||
//$$ packetListener.save(new EntitySpawnS2CPacket(player));
|
//$$ packetListener.save(new EntitySpawnS2CPacket(player));
|
||||||
//#else
|
//#else
|
||||||
packetListener.save(new PlayerSpawnS2CPacket(player));
|
packetListener.save(new PlayerSpawnS2CPacket(player));
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import com.replaymod.render.blend.data.DMaterial;
|
|||||||
import com.replaymod.render.blend.data.DPackedFile;
|
import com.replaymod.render.blend.data.DPackedFile;
|
||||||
import com.replaymod.render.blend.data.DTexture;
|
import com.replaymod.render.blend.data.DTexture;
|
||||||
import de.johni0702.minecraft.gui.versions.Image;
|
import de.johni0702.minecraft.gui.versions.Image;
|
||||||
import net.minecraft.client.util.GlAllocationUtils;
|
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
import org.lwjgl.BufferUtils;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
@@ -25,7 +25,7 @@ public class BlendMaterials {
|
|||||||
// Read raw image data from GL
|
// Read raw image data from GL
|
||||||
int width = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH);
|
int width = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH);
|
||||||
int height = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_HEIGHT);
|
int height = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_HEIGHT);
|
||||||
ByteBuffer buffer = GlAllocationUtils.allocateByteBuffer(width * height * 4);
|
ByteBuffer buffer = BufferUtils.createByteBuffer(width * height * 4);
|
||||||
GL11.glGetTexImage(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, buffer);
|
GL11.glGetTexImage(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, buffer);
|
||||||
|
|
||||||
// Convert to Image
|
// Convert to Image
|
||||||
|
|||||||
@@ -5,13 +5,13 @@ import de.johni0702.minecraft.gui.utils.lwjgl.vector.Matrix4f;
|
|||||||
import de.johni0702.minecraft.gui.utils.lwjgl.vector.Quaternion;
|
import de.johni0702.minecraft.gui.utils.lwjgl.vector.Quaternion;
|
||||||
import de.johni0702.minecraft.gui.utils.lwjgl.vector.Vector3f;
|
import de.johni0702.minecraft.gui.utils.lwjgl.vector.Vector3f;
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.client.util.GlAllocationUtils;
|
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.block.entity.BlockEntity;
|
import net.minecraft.block.entity.BlockEntity;
|
||||||
import org.blender.dna.Link;
|
import org.blender.dna.Link;
|
||||||
import org.blender.dna.ListBase;
|
import org.blender.dna.ListBase;
|
||||||
import org.blender.utils.BlenderFactory;
|
import org.blender.utils.BlenderFactory;
|
||||||
import org.cakelab.blender.nio.CPointer;
|
import org.cakelab.blender.nio.CPointer;
|
||||||
|
import org.lwjgl.BufferUtils;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -39,7 +39,7 @@ public class Util {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static FloatBuffer floatBuffer = GlAllocationUtils.allocateByteBuffer(16 * 4).asFloatBuffer();
|
private static FloatBuffer floatBuffer = BufferUtils.createByteBuffer(16 * 4).asFloatBuffer();
|
||||||
public static Matrix4f getGlMatrix(int matrix) {
|
public static Matrix4f getGlMatrix(int matrix) {
|
||||||
floatBuffer.clear();
|
floatBuffer.clear();
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
|
|||||||
@@ -19,9 +19,11 @@ import java.io.IOException;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static de.johni0702.minecraft.gui.versions.MCVer.identifier;
|
||||||
|
|
||||||
public class ODSFrameCapturer implements FrameCapturer<ODSOpenGlFrame> {
|
public class ODSFrameCapturer implements FrameCapturer<ODSOpenGlFrame> {
|
||||||
private static final Identifier vertexResource = new Identifier("replaymod", "shader/ods.vert");
|
private static final Identifier vertexResource = identifier("replaymod", "shader/ods.vert");
|
||||||
private static final Identifier fragmentResource = new Identifier("replaymod", "shader/ods.frag");
|
private static final Identifier fragmentResource = identifier("replaymod", "shader/ods.frag");
|
||||||
|
|
||||||
private final CubicPboOpenGlFrameCapturer left, right;
|
private final CubicPboOpenGlFrameCapturer left, right;
|
||||||
private final Program shaderProgram;
|
private final Program shaderProgram;
|
||||||
|
|||||||
@@ -27,8 +27,10 @@ import net.minecraft.client.texture.NativeImage;
|
|||||||
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
|
||||||
|
import static de.johni0702.minecraft.gui.versions.MCVer.identifier;
|
||||||
|
|
||||||
public class GuiVideoRenderer extends GuiScreen implements Tickable {
|
public class GuiVideoRenderer extends GuiScreen implements Tickable {
|
||||||
private static final Identifier NO_PREVIEW_TEXTURE = new Identifier("replaymod", "logo.png");
|
private static final Identifier NO_PREVIEW_TEXTURE = identifier("replaymod", "logo.png");
|
||||||
|
|
||||||
private final VideoRenderer renderer;
|
private final VideoRenderer renderer;
|
||||||
|
|
||||||
|
|||||||
@@ -93,7 +93,9 @@ public class EntityRendererHandler extends EventRegistrations implements WorldRe
|
|||||||
gameRenderer.setRenderHand(false); // makes no sense, we wouldn't even know where to put it
|
gameRenderer.setRenderHand(false); // makes no sense, we wouldn't even know where to put it
|
||||||
}
|
}
|
||||||
|
|
||||||
//#if MC>=11400
|
//#if MC>=12100
|
||||||
|
//$$ mc.gameRenderer.render(mc.getRenderTickCounter(), true);
|
||||||
|
//#elseif MC>=11400
|
||||||
mc.gameRenderer.render(partialTicks, finishTimeNano, true);
|
mc.gameRenderer.render(partialTicks, finishTimeNano, true);
|
||||||
//#else
|
//#else
|
||||||
//$$ mc.setIngameNotInFocus(); // this should already be the case but it somehow still sometimes is not
|
//$$ mc.setIngameNotInFocus(); // this should already be the case but it somehow still sometimes is not
|
||||||
|
|||||||
@@ -36,7 +36,11 @@ public abstract class Mixin_Omnidirectional_Rotation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//#if MC>=12005
|
//#if MC>=12005
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ @ModifyExpressionValue(method = "renderWorld", at = @At(value = "INVOKE", target = "Lorg/joml/Matrix4f;rotation(Lorg/joml/Quaternionfc;)Lorg/joml/Matrix4f;"))
|
||||||
|
//#else
|
||||||
//$$ @ModifyExpressionValue(method = "renderWorld", at = @At(value = "INVOKE", target = "Lorg/joml/Matrix4f;rotationXYZ(FFF)Lorg/joml/Matrix4f;"))
|
//$$ @ModifyExpressionValue(method = "renderWorld", at = @At(value = "INVOKE", target = "Lorg/joml/Matrix4f;rotationXYZ(FFF)Lorg/joml/Matrix4f;"))
|
||||||
|
//#endif
|
||||||
//$$ private Matrix4f replayModRender_setupCubicFrameRotation(Matrix4f matrix) {
|
//$$ private Matrix4f replayModRender_setupCubicFrameRotation(Matrix4f matrix) {
|
||||||
//#else
|
//#else
|
||||||
//#if MC>=11500
|
//#if MC>=11500
|
||||||
|
|||||||
@@ -35,7 +35,11 @@ public abstract class Mixin_Stereoscopic_Camera implements EntityRendererHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
//#if MC>=12005
|
//#if MC>=12005
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ @ModifyExpressionValue(method = "renderWorld", at = @At(value = "INVOKE", target = "Lorg/joml/Matrix4f;rotation(Lorg/joml/Quaternionfc;)Lorg/joml/Matrix4f;"))
|
||||||
|
//#else
|
||||||
//$$ @ModifyExpressionValue(method = "renderWorld", at = @At(value = "INVOKE", target = "Lorg/joml/Matrix4f;rotationXYZ(FFF)Lorg/joml/Matrix4f;"))
|
//$$ @ModifyExpressionValue(method = "renderWorld", at = @At(value = "INVOKE", target = "Lorg/joml/Matrix4f;rotationXYZ(FFF)Lorg/joml/Matrix4f;"))
|
||||||
|
//#endif
|
||||||
//$$ private Matrix4f replayModRender_setupStereoscopicProjection(Matrix4f matrix) {
|
//$$ private Matrix4f replayModRender_setupStereoscopicProjection(Matrix4f matrix) {
|
||||||
//#else
|
//#else
|
||||||
@Inject(method = "renderWorld", at = @At("HEAD"))
|
@Inject(method = "renderWorld", at = @At("HEAD"))
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.replaymod.core.mixin.MinecraftAccessor;
|
|||||||
import com.replaymod.core.mixin.TimerAccessor;
|
import com.replaymod.core.mixin.TimerAccessor;
|
||||||
import com.replaymod.core.versions.MCVer;
|
import com.replaymod.core.versions.MCVer;
|
||||||
import com.replaymod.pathing.player.AbstractTimelinePlayer;
|
import com.replaymod.pathing.player.AbstractTimelinePlayer;
|
||||||
|
import com.replaymod.pathing.player.ReplayTimer;
|
||||||
import com.replaymod.pathing.properties.TimestampProperty;
|
import com.replaymod.pathing.properties.TimestampProperty;
|
||||||
import com.replaymod.render.CameraPathExporter;
|
import com.replaymod.render.CameraPathExporter;
|
||||||
import com.replaymod.render.EXRWriter;
|
import com.replaymod.render.EXRWriter;
|
||||||
@@ -37,7 +38,6 @@ import net.minecraft.sound.SoundEvent;
|
|||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
import net.minecraft.util.crash.CrashException;
|
import net.minecraft.util.crash.CrashException;
|
||||||
import net.minecraft.sound.SoundCategory;
|
import net.minecraft.sound.SoundCategory;
|
||||||
import net.minecraft.client.render.RenderTickCounter;
|
|
||||||
import org.lwjgl.glfw.GLFW;
|
import org.lwjgl.glfw.GLFW;
|
||||||
|
|
||||||
//#if MC>=12000
|
//#if MC>=12000
|
||||||
@@ -87,11 +87,12 @@ import static com.google.common.collect.Iterables.getLast;
|
|||||||
import static com.replaymod.core.utils.Utils.DEFAULT_MS_PER_TICK;
|
import static com.replaymod.core.utils.Utils.DEFAULT_MS_PER_TICK;
|
||||||
import static com.replaymod.core.versions.MCVer.*;
|
import static com.replaymod.core.versions.MCVer.*;
|
||||||
import static com.replaymod.render.ReplayModRender.LOGGER;
|
import static com.replaymod.render.ReplayModRender.LOGGER;
|
||||||
|
import static de.johni0702.minecraft.gui.versions.MCVer.identifier;
|
||||||
import static org.lwjgl.opengl.GL11.GL_COLOR_BUFFER_BIT;
|
import static org.lwjgl.opengl.GL11.GL_COLOR_BUFFER_BIT;
|
||||||
import static org.lwjgl.opengl.GL11.GL_DEPTH_BUFFER_BIT;
|
import static org.lwjgl.opengl.GL11.GL_DEPTH_BUFFER_BIT;
|
||||||
|
|
||||||
public class VideoRenderer implements RenderInfo {
|
public class VideoRenderer implements RenderInfo {
|
||||||
private static final Identifier SOUND_RENDER_SUCCESS = new Identifier("replaymod", "render_success");
|
private static final Identifier SOUND_RENDER_SUCCESS = identifier("replaymod", "render_success");
|
||||||
private final MinecraftClient mc = MCVer.getMinecraft();
|
private final MinecraftClient mc = MCVer.getMinecraft();
|
||||||
private final RenderSettings settings;
|
private final RenderSettings settings;
|
||||||
private final ReplayHandler replayHandler;
|
private final ReplayHandler replayHandler;
|
||||||
@@ -191,7 +192,7 @@ public class VideoRenderer implements RenderInfo {
|
|||||||
// Because this might take some time to prepare we'll render the GUI at least once to not confuse the user
|
// Because this might take some time to prepare we'll render the GUI at least once to not confuse the user
|
||||||
drawGui();
|
drawGui();
|
||||||
|
|
||||||
RenderTickCounter timer = ((MinecraftAccessor) mc).getTimer();
|
ReplayTimer timer = (ReplayTimer) ((MinecraftAccessor) mc).getTimer();
|
||||||
|
|
||||||
// Play up to one second before starting to render
|
// Play up to one second before starting to render
|
||||||
// This is necessary in order to ensure that all entities have at least two position packets
|
// This is necessary in order to ensure that all entities have at least two position packets
|
||||||
@@ -268,7 +269,7 @@ public class VideoRenderer implements RenderInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Updating the timer will cause the timeline player to update the game state
|
// Updating the timer will cause the timeline player to update the game state
|
||||||
RenderTickCounter timer = ((MinecraftAccessor) mc).getTimer();
|
ReplayTimer timer = (ReplayTimer) ((MinecraftAccessor) mc).getTimer();
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
int elapsedTicks =
|
int elapsedTicks =
|
||||||
//#endif
|
//#endif
|
||||||
@@ -276,6 +277,9 @@ public class VideoRenderer implements RenderInfo {
|
|||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
MCVer.milliTime()
|
MCVer.milliTime()
|
||||||
//#endif
|
//#endif
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ , true
|
||||||
|
//#endif
|
||||||
);
|
);
|
||||||
//#if MC<11600
|
//#if MC<11600
|
||||||
//$$ int elapsedTicks = timer.ticksThisFrame;
|
//$$ int elapsedTicks = timer.ticksThisFrame;
|
||||||
|
|||||||
@@ -11,6 +11,10 @@ import net.minecraft.client.util.ScreenshotUtils;
|
|||||||
import static com.replaymod.core.versions.MCVer.popMatrix;
|
import static com.replaymod.core.versions.MCVer.popMatrix;
|
||||||
import static com.replaymod.core.versions.MCVer.pushMatrix;
|
import static com.replaymod.core.versions.MCVer.pushMatrix;
|
||||||
|
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ import net.minecraft.client.render.RenderTickCounter;
|
||||||
|
//#endif
|
||||||
|
|
||||||
//#if MC>=11500
|
//#if MC>=11500
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
//#endif
|
//#endif
|
||||||
@@ -73,6 +77,9 @@ public class NoGuiScreenshot {
|
|||||||
GlStateManager.enableTexture();
|
GlStateManager.enableTexture();
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ mc.gameRenderer.renderWorld(RenderTickCounter.ONE);
|
||||||
|
//#else
|
||||||
float tickDelta = mc.getTickDelta();
|
float tickDelta = mc.getTickDelta();
|
||||||
//#if MC>=12006
|
//#if MC>=12006
|
||||||
//$$ mc.gameRenderer.renderWorld(tickDelta, System.nanoTime());
|
//$$ mc.gameRenderer.renderWorld(tickDelta, System.nanoTime());
|
||||||
@@ -89,6 +96,7 @@ public class NoGuiScreenshot {
|
|||||||
//#endif
|
//#endif
|
||||||
//#endif
|
//#endif
|
||||||
//#endif
|
//#endif
|
||||||
|
//#endif
|
||||||
|
|
||||||
mc.getFramebuffer().endWrite();
|
mc.getFramebuffer().endWrite();
|
||||||
popMatrix();
|
popMatrix();
|
||||||
|
|||||||
@@ -22,7 +22,11 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||||||
public class MixinCamera {
|
public class MixinCamera {
|
||||||
@Shadow @Final private MinecraftClient client;
|
@Shadow @Final private MinecraftClient client;
|
||||||
//#if MC>=12005
|
//#if MC>=12005
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ @ModifyExpressionValue(method = "renderWorld", at = @At(value = "INVOKE", target = "Lorg/joml/Matrix4f;rotation(Lorg/joml/Quaternionfc;)Lorg/joml/Matrix4f;"))
|
||||||
|
//#else
|
||||||
//$$ @ModifyExpressionValue(method = "renderWorld", at = @At(value = "INVOKE", target = "Lorg/joml/Matrix4f;rotationXYZ(FFF)Lorg/joml/Matrix4f;"))
|
//$$ @ModifyExpressionValue(method = "renderWorld", at = @At(value = "INVOKE", target = "Lorg/joml/Matrix4f;rotationXYZ(FFF)Lorg/joml/Matrix4f;"))
|
||||||
|
//#endif
|
||||||
//$$ private Matrix4f applyRoll(Matrix4f matrix) {
|
//$$ private Matrix4f applyRoll(Matrix4f matrix) {
|
||||||
//#else
|
//#else
|
||||||
@Inject(
|
@Inject(
|
||||||
|
|||||||
@@ -153,8 +153,12 @@ public class GuiKeyframeTimeline extends AbstractGuiTimeline<GuiKeyframeTimeline
|
|||||||
|
|
||||||
final int color = 0xff0000ff;
|
final int color = 0xff0000ff;
|
||||||
Tessellator tessellator = Tessellator.getInstance();
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ BufferBuilder buffer = tessellator.begin(net.minecraft.client.render.VertexFormat.DrawMode.LINE_STRIP, VertexFormats.LINES);
|
||||||
|
//#else
|
||||||
BufferBuilder buffer = tessellator.getBuffer();
|
BufferBuilder buffer = tessellator.getBuffer();
|
||||||
buffer.begin(GL11.GL_LINE_STRIP, VertexFormats.POSITION_COLOR);
|
buffer.begin(GL11.GL_LINE_STRIP, VertexFormats.POSITION_COLOR);
|
||||||
|
//#endif
|
||||||
|
|
||||||
// Start just below the top border of the replay timeline
|
// Start just below the top border of the replay timeline
|
||||||
Vector2f p1 = new Vector2f(replayTimelineLeft + positionXReplayTimeline, replayTimelineTop + BORDER_TOP);
|
Vector2f p1 = new Vector2f(replayTimelineLeft + positionXReplayTimeline, replayTimelineTop + BORDER_TOP);
|
||||||
@@ -178,7 +182,13 @@ public class GuiKeyframeTimeline extends AbstractGuiTimeline<GuiKeyframeTimeline
|
|||||||
pushScissorState();
|
pushScissorState();
|
||||||
setScissorDisabled();
|
setScissorDisabled();
|
||||||
GL11.glLineWidth(2);
|
GL11.glLineWidth(2);
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ try (var builtBuffer = buffer.end()) {
|
||||||
|
//$$ net.minecraft.client.render.BufferRenderer.drawWithGlobalProgram(builtBuffer);
|
||||||
|
//$$ }
|
||||||
|
//#else
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
|
//#endif
|
||||||
popScissorState();
|
popScissorState();
|
||||||
//#if MC<11700
|
//#if MC<11700
|
||||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||||
|
|||||||
@@ -46,9 +46,10 @@ import static com.replaymod.core.versions.MCVer.bindTexture;
|
|||||||
import static com.replaymod.core.versions.MCVer.emitLine;
|
import static com.replaymod.core.versions.MCVer.emitLine;
|
||||||
import static com.replaymod.core.versions.MCVer.popMatrix;
|
import static com.replaymod.core.versions.MCVer.popMatrix;
|
||||||
import static com.replaymod.core.versions.MCVer.pushMatrix;
|
import static com.replaymod.core.versions.MCVer.pushMatrix;
|
||||||
|
import static de.johni0702.minecraft.gui.versions.MCVer.identifier;
|
||||||
|
|
||||||
public class PathPreviewRenderer extends EventRegistrations {
|
public class PathPreviewRenderer extends EventRegistrations {
|
||||||
private static final Identifier CAMERA_HEAD = new Identifier("replaymod", "camera_head.png");
|
private static final Identifier CAMERA_HEAD = identifier("replaymod", "camera_head.png");
|
||||||
private static final MinecraftClient mc = MCVer.getMinecraft();
|
private static final MinecraftClient mc = MCVer.getMinecraft();
|
||||||
|
|
||||||
private static final int SLOW_PATH_COLOR = 0xffcccc;
|
private static final int SLOW_PATH_COLOR = 0xffcccc;
|
||||||
@@ -246,8 +247,12 @@ public class PathPreviewRenderer extends EventRegistrations {
|
|||||||
if (distanceSquared(view, pos2) > renderDistanceSquared) return;
|
if (distanceSquared(view, pos2) > renderDistanceSquared) return;
|
||||||
|
|
||||||
Tessellator tessellator = Tessellator.getInstance();
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ BufferBuilder buffer = tessellator.begin(net.minecraft.client.render.VertexFormat.DrawMode.LINES, VertexFormats.LINES);
|
||||||
|
//#else
|
||||||
BufferBuilder buffer = tessellator.getBuffer();
|
BufferBuilder buffer = tessellator.getBuffer();
|
||||||
buffer.begin(GL11.GL_LINES, VertexFormats.POSITION_COLOR);
|
buffer.begin(GL11.GL_LINES, VertexFormats.POSITION_COLOR);
|
||||||
|
//#endif
|
||||||
|
|
||||||
emitLine(buffer, Vector3f.sub(pos1, view, null), Vector3f.sub(pos2, view, null), color);
|
emitLine(buffer, Vector3f.sub(pos1, view, null), Vector3f.sub(pos2, view, null), color);
|
||||||
|
|
||||||
@@ -256,7 +261,13 @@ public class PathPreviewRenderer extends EventRegistrations {
|
|||||||
//$$ RenderSystem.disableCull();
|
//$$ RenderSystem.disableCull();
|
||||||
//#endif
|
//#endif
|
||||||
GL11.glLineWidth(3);
|
GL11.glLineWidth(3);
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ try (var builtBuffer = buffer.end()) {
|
||||||
|
//$$ net.minecraft.client.render.BufferRenderer.drawWithGlobalProgram(builtBuffer);
|
||||||
|
//$$ }
|
||||||
|
//#else
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
|
//#endif
|
||||||
//#if MC>=11700
|
//#if MC>=11700
|
||||||
//$$ RenderSystem.enableCull();
|
//$$ RenderSystem.enableCull();
|
||||||
//#endif
|
//#endif
|
||||||
@@ -284,8 +295,12 @@ public class PathPreviewRenderer extends EventRegistrations {
|
|||||||
float maxY = 0.5f;
|
float maxY = 0.5f;
|
||||||
|
|
||||||
Tessellator tessellator = Tessellator.getInstance();
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ BufferBuilder buffer = tessellator.begin(net.minecraft.client.render.VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE);
|
||||||
|
//#else
|
||||||
BufferBuilder buffer = tessellator.getBuffer();
|
BufferBuilder buffer = tessellator.getBuffer();
|
||||||
buffer.begin(GL11.GL_QUADS, VertexFormats.POSITION_TEXTURE);
|
buffer.begin(GL11.GL_QUADS, VertexFormats.POSITION_TEXTURE);
|
||||||
|
//#endif
|
||||||
|
|
||||||
buffer.vertex(minX, minY, 0).texture(posX + size, posY + size).next();
|
buffer.vertex(minX, minY, 0).texture(posX + size, posY + size).next();
|
||||||
buffer.vertex(minX, maxY, 0).texture(posX + size, posY).next();
|
buffer.vertex(minX, maxY, 0).texture(posX + size, posY).next();
|
||||||
@@ -303,7 +318,13 @@ public class PathPreviewRenderer extends EventRegistrations {
|
|||||||
//$$ RenderSystem.applyModelViewMatrix();
|
//$$ RenderSystem.applyModelViewMatrix();
|
||||||
//$$ RenderSystem.setShader(GameRenderer::getPositionTexShader);
|
//$$ RenderSystem.setShader(GameRenderer::getPositionTexShader);
|
||||||
//#endif
|
//#endif
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ try (var builtBuffer = buffer.end()) {
|
||||||
|
//$$ net.minecraft.client.render.BufferRenderer.drawWithGlobalProgram(builtBuffer);
|
||||||
|
//$$ }
|
||||||
|
//#else
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
|
//#endif
|
||||||
|
|
||||||
popMatrix();
|
popMatrix();
|
||||||
}
|
}
|
||||||
@@ -322,8 +343,12 @@ public class PathPreviewRenderer extends EventRegistrations {
|
|||||||
|
|
||||||
//draw the position line
|
//draw the position line
|
||||||
Tessellator tessellator = Tessellator.getInstance();
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ BufferBuilder buffer = tessellator.begin(net.minecraft.client.render.VertexFormat.DrawMode.LINES, VertexFormats.LINES);
|
||||||
|
//#else
|
||||||
BufferBuilder buffer = tessellator.getBuffer();
|
BufferBuilder buffer = tessellator.getBuffer();
|
||||||
buffer.begin(GL11.GL_LINES, VertexFormats.POSITION_COLOR);
|
buffer.begin(GL11.GL_LINES, VertexFormats.POSITION_COLOR);
|
||||||
|
//#endif
|
||||||
|
|
||||||
emitLine(buffer, new Vector3f(0, 0, 0), new Vector3f(0, 0, 2), 0x00ff00aa);
|
emitLine(buffer, new Vector3f(0, 0, 0), new Vector3f(0, 0, 2), 0x00ff00aa);
|
||||||
|
|
||||||
@@ -334,7 +359,13 @@ public class PathPreviewRenderer extends EventRegistrations {
|
|||||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ try (var builtBuffer = buffer.end()) {
|
||||||
|
//$$ net.minecraft.client.render.BufferRenderer.drawWithGlobalProgram(builtBuffer);
|
||||||
|
//$$ }
|
||||||
|
//#else
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
|
//#endif
|
||||||
|
|
||||||
//#if MC<11700
|
//#if MC<11700
|
||||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||||
@@ -344,9 +375,17 @@ public class PathPreviewRenderer extends EventRegistrations {
|
|||||||
|
|
||||||
float cubeSize = 0.5f;
|
float cubeSize = 0.5f;
|
||||||
|
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ float r = -cubeSize/2;
|
||||||
|
//#else
|
||||||
double r = -cubeSize/2;
|
double r = -cubeSize/2;
|
||||||
|
//#endif
|
||||||
|
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ buffer = tessellator.begin(net.minecraft.client.render.VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE_COLOR);
|
||||||
|
//#else
|
||||||
buffer.begin(GL11.GL_QUADS, VertexFormats.POSITION_TEXTURE_COLOR);
|
buffer.begin(GL11.GL_QUADS, VertexFormats.POSITION_TEXTURE_COLOR);
|
||||||
|
//#endif
|
||||||
|
|
||||||
//back
|
//back
|
||||||
buffer.vertex(r, r + cubeSize, r).texture(3 * 8 / 64f, 8 / 64f).color(255, 255, 255, 200).next();
|
buffer.vertex(r, r + cubeSize, r).texture(3 * 8 / 64f, 8 / 64f).color(255, 255, 255, 200).next();
|
||||||
@@ -388,7 +427,13 @@ public class PathPreviewRenderer extends EventRegistrations {
|
|||||||
//$$ RenderSystem.applyModelViewMatrix();
|
//$$ RenderSystem.applyModelViewMatrix();
|
||||||
//$$ RenderSystem.setShader(GameRenderer::getPositionTexColorShader);
|
//$$ RenderSystem.setShader(GameRenderer::getPositionTexColorShader);
|
||||||
//#endif
|
//#endif
|
||||||
|
//#if MC>=12100
|
||||||
|
//$$ try (var builtBuffer = buffer.end()) {
|
||||||
|
//$$ net.minecraft.client.render.BufferRenderer.drawWithGlobalProgram(builtBuffer);
|
||||||
|
//$$ }
|
||||||
|
//#else
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
|
//#endif
|
||||||
|
|
||||||
popMatrix();
|
popMatrix();
|
||||||
}
|
}
|
||||||
|
|||||||
0
versions/1.21/.gitkeep
Normal file
0
versions/1.21/.gitkeep
Normal file
Reference in New Issue
Block a user