Release 2.4.4
This commit is contained in:
2
jGui
2
jGui
Submodule jGui updated: bf00dcf2ce...e9387ad003
@@ -8,8 +8,8 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ import net.minecraft.client.render.Camera;
|
import net.minecraft.client.render.Camera;
|
||||||
//$$ import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
@@ -30,12 +30,12 @@ public abstract class MixinShadersRender {
|
|||||||
private static void replayModCompat_disableRenderHand0(
|
private static void replayModCompat_disableRenderHand0(
|
||||||
GameRenderer er,
|
GameRenderer er,
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ MatrixStack stack,
|
MatrixStack stack,
|
||||||
//$$ Camera camera,
|
Camera camera,
|
||||||
//#endif
|
//#endif
|
||||||
float partialTicks,
|
float partialTicks,
|
||||||
//#if MC<11600
|
//#if MC<11600
|
||||||
int renderPass,
|
//$$ int renderPass,
|
||||||
//#endif
|
//#endif
|
||||||
CallbackInfo ci) {
|
CallbackInfo ci) {
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import com.replaymod.replaystudio.util.I18n;
|
|||||||
import com.replaymod.replaystudio.viaversion.ViaVersionPacketConverter;
|
import com.replaymod.replaystudio.viaversion.ViaVersionPacketConverter;
|
||||||
import com.replaymod.simplepathing.ReplayModSimplePathing;
|
import com.replaymod.simplepathing.ReplayModSimplePathing;
|
||||||
import de.johni0702.minecraft.gui.container.GuiScreen;
|
import de.johni0702.minecraft.gui.container.GuiScreen;
|
||||||
import lombok.Getter;
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
import net.minecraft.resource.DirectoryResourcePack;
|
import net.minecraft.resource.DirectoryResourcePack;
|
||||||
@@ -33,8 +32,6 @@ import org.apache.commons.io.FileUtils;
|
|||||||
|
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
import net.minecraft.client.options.Option;
|
import net.minecraft.client.options.Option;
|
||||||
import net.minecraft.resource.ResourcePackProvider;
|
|
||||||
import net.minecraft.resource.ResourcePackProfile;
|
|
||||||
import net.minecraft.util.thread.ReentrantThreadExecutor;
|
import net.minecraft.util.thread.ReentrantThreadExecutor;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
@@ -123,16 +120,17 @@ public class ReplayMod implements
|
|||||||
Module
|
Module
|
||||||
{
|
{
|
||||||
|
|
||||||
@Getter(lazy = true)
|
public static String getMinecraftVersion() {
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
private static final String minecraftVersion = MinecraftClient.getInstance().getGame().getVersion().getName();
|
return MinecraftClient.getInstance().getGame().getVersion().getName();
|
||||||
//#else
|
//#else
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
//$$ private static final String minecraftVersion = MCPVersion.getMCVersion();
|
//$$ return MCPVersion.getMCVersion();
|
||||||
//#else
|
//#else
|
||||||
//$$ private static final String minecraftVersion = Loader.MC_VERSION;
|
//$$ return Loader.MC_VERSION;
|
||||||
//#endif
|
//#endif
|
||||||
//#endif
|
//#endif
|
||||||
|
}
|
||||||
|
|
||||||
public static final String MOD_ID = "replaymod";
|
public static final String MOD_ID = "replaymod";
|
||||||
|
|
||||||
@@ -184,14 +182,6 @@ public class ReplayMod implements
|
|||||||
}
|
}
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=11400
|
|
||||||
// Not needed on fabric, using MixinModResourcePackUtil instead. Could in theory also use it on 1.13 but it already works as is.
|
|
||||||
//#else
|
|
||||||
//#if MC>=11400
|
|
||||||
//$$ DeferredWorkQueue.runLater(() -> MCVer.getMinecraft().getResourcePackList().addPackFinder(new LangResourcePack.Finder()));
|
|
||||||
//#endif
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
// Register all RM modules
|
// Register all RM modules
|
||||||
modules.add(this);
|
modules.add(this);
|
||||||
modules.add(new ReplayModRecording(this));
|
modules.add(new ReplayModRecording(this));
|
||||||
@@ -234,6 +224,7 @@ public class ReplayMod implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static final DirectoryResourcePack jGuiResourcePack;
|
public static final DirectoryResourcePack jGuiResourcePack;
|
||||||
|
public static final String JGUI_RESOURCE_PACK_NAME = "replaymod_jgui";
|
||||||
static { // Note: even preInit is too late and we'd have to issue another resource reload
|
static { // Note: even preInit is too late and we'd have to issue another resource reload
|
||||||
jGuiResourcePack = initJGuiResourcePack();
|
jGuiResourcePack = initJGuiResourcePack();
|
||||||
}
|
}
|
||||||
@@ -245,6 +236,15 @@ public class ReplayMod implements
|
|||||||
}
|
}
|
||||||
//noinspection UnnecessaryLocalVariable
|
//noinspection UnnecessaryLocalVariable
|
||||||
DirectoryResourcePack jGuiResourcePack = new DirectoryResourcePack(folder) {
|
DirectoryResourcePack jGuiResourcePack = new DirectoryResourcePack(folder) {
|
||||||
|
@Override
|
||||||
|
//#if MC>=11400
|
||||||
|
public String getName() {
|
||||||
|
//#else
|
||||||
|
//$$ public String getPackName() {
|
||||||
|
//#endif
|
||||||
|
return JGUI_RESOURCE_PACK_NAME;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected InputStream openFile(String resourceName) throws IOException {
|
protected InputStream openFile(String resourceName) throws IOException {
|
||||||
try {
|
try {
|
||||||
@@ -657,13 +657,13 @@ public class ReplayMod implements
|
|||||||
// Some nostalgia: "§8[§6Replay Mod§8]§r Your message goes here"
|
// Some nostalgia: "§8[§6Replay Mod§8]§r Your message goes here"
|
||||||
//#if MC>=10904
|
//#if MC>=10904
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ Style coloredDarkGray = Style.EMPTY.withColor(Formatting.DARK_GRAY);
|
Style coloredDarkGray = Style.EMPTY.withColor(Formatting.DARK_GRAY);
|
||||||
//$$ Style coloredGold = Style.EMPTY.withColor(Formatting.GOLD);
|
Style coloredGold = Style.EMPTY.withColor(Formatting.GOLD);
|
||||||
//$$ Style alert = Style.EMPTY.withColor(warning ? Formatting.RED : Formatting.DARK_GREEN);
|
Style alert = Style.EMPTY.withColor(warning ? Formatting.RED : Formatting.DARK_GREEN);
|
||||||
//#else
|
//#else
|
||||||
Style coloredDarkGray = new Style().setColor(Formatting.DARK_GRAY);
|
//$$ Style coloredDarkGray = new Style().setColor(Formatting.DARK_GRAY);
|
||||||
Style coloredGold = new Style().setColor(Formatting.GOLD);
|
//$$ Style coloredGold = new Style().setColor(Formatting.GOLD);
|
||||||
Style alert = new Style().setColor(warning ? Formatting.RED : Formatting.DARK_GREEN);
|
//$$ Style alert = new Style().setColor(warning ? Formatting.RED : Formatting.DARK_GREEN);
|
||||||
//#endif
|
//#endif
|
||||||
Text text = new LiteralText("[").setStyle(coloredDarkGray)
|
Text text = new LiteralText("[").setStyle(coloredDarkGray)
|
||||||
.append(new TranslatableText("replaymod.title").setStyle(coloredGold))
|
.append(new TranslatableText("replaymod.title").setStyle(coloredGold))
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import de.johni0702.minecraft.gui.layout.VerticalLayout;
|
|||||||
import de.johni0702.minecraft.gui.utils.Consumer;
|
import de.johni0702.minecraft.gui.utils.Consumer;
|
||||||
import de.johni0702.minecraft.gui.utils.lwjgl.Dimension;
|
import de.johni0702.minecraft.gui.utils.lwjgl.Dimension;
|
||||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import net.minecraft.client.resource.language.I18n;
|
import net.minecraft.client.resource.language.I18n;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -115,11 +114,15 @@ public class GuiReplaySettings extends AbstractGuiScreen<GuiReplaySettings> {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
private static class MultipleChoiceDropdownEntry {
|
private static class MultipleChoiceDropdownEntry {
|
||||||
private final Object value;
|
private final Object value;
|
||||||
private final String text;
|
private final String text;
|
||||||
|
|
||||||
|
public MultipleChoiceDropdownEntry(Object value, String text) {
|
||||||
|
this.value = value;
|
||||||
|
this.text = text;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return text;
|
return text;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import java.util.List;
|
|||||||
import static com.replaymod.core.versions.MCVer.*;
|
import static com.replaymod.core.versions.MCVer.*;
|
||||||
|
|
||||||
//#if MC>=11400 && MC<11600
|
//#if MC>=11400 && MC<11600
|
||||||
import net.minecraft.realms.RealmsScreenProxy;
|
//$$ import net.minecraft.realms.RealmsScreenProxy;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if FABRIC>=1
|
//#if FABRIC>=1
|
||||||
@@ -72,53 +72,53 @@ public class MainMenuHandler extends EventRegistrations {
|
|||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
//#if MC>=11400 && MC<11600
|
//#if MC>=11400 && MC<11600
|
||||||
GuiMainMenuAccessor guiA = (GuiMainMenuAccessor) gui;
|
//$$ GuiMainMenuAccessor guiA = (GuiMainMenuAccessor) gui;
|
||||||
if (realmsOffset != 0 && guiA.getRealmsNotification() instanceof RealmsScreenProxy) {
|
//$$ if (realmsOffset != 0 && guiA.getRealmsNotification() instanceof RealmsScreenProxy) {
|
||||||
guiA.setRealmsNotification(new RealmsNotificationProxy((RealmsScreenProxy) guiA.getRealmsNotification(), realmsOffset));
|
//$$ guiA.setRealmsNotification(new RealmsNotificationProxy((RealmsScreenProxy) guiA.getRealmsNotification(), realmsOffset));
|
||||||
}
|
//$$ }
|
||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//#if MC>=11400 && MC<11600
|
//#if MC>=11400 && MC<11600
|
||||||
private static class RealmsNotificationProxy extends Screen {
|
//$$ private static class RealmsNotificationProxy extends Screen {
|
||||||
private final RealmsScreenProxy proxy;
|
//$$ private final RealmsScreenProxy proxy;
|
||||||
private final int offset;
|
//$$ private final int offset;
|
||||||
|
//$$
|
||||||
private RealmsNotificationProxy(RealmsScreenProxy proxy, int offset) {
|
//$$ private RealmsNotificationProxy(RealmsScreenProxy proxy, int offset) {
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
super(null);
|
//$$ super(null);
|
||||||
//#endif
|
//#endif
|
||||||
this.proxy = proxy;
|
//$$ this.proxy = proxy;
|
||||||
this.offset = offset;
|
//$$ this.offset = offset;
|
||||||
}
|
//$$ }
|
||||||
|
//$$
|
||||||
@Override
|
//$$ @Override
|
||||||
public void init(MinecraftClient mc, int width, int height) {
|
//$$ public void init(MinecraftClient mc, int width, int height) {
|
||||||
proxy.init(mc, width, height);
|
//$$ proxy.init(mc, width, height);
|
||||||
}
|
//$$ }
|
||||||
|
//$$
|
||||||
@Override
|
//$$ @Override
|
||||||
public void tick() {
|
//$$ public void tick() {
|
||||||
proxy.tick();
|
//$$ proxy.tick();
|
||||||
}
|
//$$ }
|
||||||
|
//$$
|
||||||
@Override
|
//$$ @Override
|
||||||
public void render(int mouseX, int mouseY, float partialTicks) {
|
//$$ public void render(int mouseX, int mouseY, float partialTicks) {
|
||||||
GL11.glTranslated(0, offset, 0);
|
//$$ GL11.glTranslated(0, offset, 0);
|
||||||
proxy.render(mouseX, mouseY - offset, partialTicks);
|
//$$ proxy.render(mouseX, mouseY - offset, partialTicks);
|
||||||
GL11.glTranslated(0, -offset, 0);
|
//$$ GL11.glTranslated(0, -offset, 0);
|
||||||
}
|
//$$ }
|
||||||
|
//$$
|
||||||
@Override
|
//$$ @Override
|
||||||
public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) {
|
//$$ public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) {
|
||||||
return proxy.mouseClicked(mouseX, mouseY - offset, mouseButton);
|
//$$ return proxy.mouseClicked(mouseX, mouseY - offset, mouseButton);
|
||||||
}
|
//$$ }
|
||||||
|
//$$
|
||||||
@Override
|
//$$ @Override
|
||||||
public void removed() {
|
//$$ public void removed() {
|
||||||
proxy.removed();
|
//$$ proxy.removed();
|
||||||
}
|
//$$ }
|
||||||
}
|
//$$ }
|
||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||||||
|
|
||||||
@Mixin(Keyboard.class)
|
@Mixin(Keyboard.class)
|
||||||
public class MixinKeyboardListener {
|
public class MixinKeyboardListener {
|
||||||
@Inject(method = "onKey", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/options/KeyBinding;onKeyPressed(Lnet/minecraft/client/util/InputUtil$KeyCode;)V", shift = At.Shift.AFTER))
|
@Inject(method = "onKey", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/options/KeyBinding;onKeyPressed(Lnet/minecraft/client/util/InputUtil$Key;)V", shift = At.Shift.AFTER))
|
||||||
private void afterKeyBindingTick(long windowPointer, int key, int scanCode, int action, int modifiers, CallbackInfo ci) {
|
private void afterKeyBindingTick(long windowPointer, int key, int scanCode, int action, int modifiers, CallbackInfo ci) {
|
||||||
KeyBindingEventCallback.EVENT.invoker().onKeybindingEvent();
|
KeyBindingEventCallback.EVENT.invoker().onKeybindingEvent();
|
||||||
KeyEventCallback.EVENT.invoker().onKeyEvent(key, scanCode, action, modifiers);
|
KeyEventCallback.EVENT.invoker().onKeyEvent(key, scanCode, action, modifiers);
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
//#if FABRIC>=1
|
|
||||||
package com.replaymod.core.mixin;
|
|
||||||
|
|
||||||
import com.replaymod.core.ReplayMod;
|
|
||||||
import com.replaymod.core.versions.LangResourcePack;
|
|
||||||
import net.fabricmc.fabric.api.resource.ModResourcePack;
|
|
||||||
import net.fabricmc.fabric.impl.resource.loader.ModResourcePackUtil;
|
|
||||||
import net.fabricmc.loader.api.FabricLoader;
|
|
||||||
import net.fabricmc.loader.api.ModContainer;
|
|
||||||
import net.minecraft.resource.ResourcePack;
|
|
||||||
import net.minecraft.resource.ResourceType;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Mixin(value = ModResourcePackUtil.class, remap = false)
|
|
||||||
public class MixinModResourcePackUtil {
|
|
||||||
@Inject(method = "appendModResourcePacks", at = @At("RETURN"), remap = false)
|
|
||||||
private static void injectRMLangPack(List<ResourcePack> packList, ResourceType type, CallbackInfo ci) {
|
|
||||||
if (type != ResourceType.CLIENT_RESOURCES) return;
|
|
||||||
|
|
||||||
for (int i = 0; i < packList.size(); i++) {
|
|
||||||
ResourcePack pack = packList.get(i);
|
|
||||||
if (pack instanceof ModResourcePack && ((ModResourcePack) pack).getFabricModMetadata().getId().equals(ReplayMod.MOD_ID)) {
|
|
||||||
ModContainer container = FabricLoader.getInstance().getModContainer(ReplayMod.MOD_ID).orElseThrow(IllegalAccessError::new);
|
|
||||||
packList.add(i, new LangResourcePack(container.getRootPath()));
|
|
||||||
if (ReplayMod.jGuiResourcePack != null) {
|
|
||||||
packList.add(i, ReplayMod.jGuiResourcePack);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new IllegalStateException("Could not find ReplayMod resource pack.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//#endif
|
|
||||||
@@ -12,7 +12,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||||||
|
|
||||||
@Mixin(Mouse.class)
|
@Mixin(Mouse.class)
|
||||||
public class MixinMouse {
|
public class MixinMouse {
|
||||||
@Inject(method = "onMouseButton", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/options/KeyBinding;onKeyPressed(Lnet/minecraft/client/util/InputUtil$KeyCode;)V", shift = At.Shift.AFTER))
|
@Inject(method = "onMouseButton", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/options/KeyBinding;onKeyPressed(Lnet/minecraft/client/util/InputUtil$Key;)V", shift = At.Shift.AFTER))
|
||||||
private void afterKeyBindingTick(CallbackInfo ci) {
|
private void afterKeyBindingTick(CallbackInfo ci) {
|
||||||
KeyBindingEventCallback.EVENT.invoker().onKeybindingEvent();
|
KeyBindingEventCallback.EVENT.invoker().onKeybindingEvent();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public class Mixin_ContextualKeyBindings {
|
|||||||
} else {
|
} else {
|
||||||
// Not in a replay, remove all replay-exclusive keybindings
|
// Not in a replay, remove all replay-exclusive keybindings
|
||||||
for (KeyBinding keyBinding : onlyInReplay) {
|
for (KeyBinding keyBinding : onlyInReplay) {
|
||||||
if (Mixin_ContextualKeyBindings.keysById.remove(keyBinding.getId()) != null) {
|
if (Mixin_ContextualKeyBindings.keysById.remove(keyBinding.getTranslationKey()) != null) {
|
||||||
temporarilyRemoved.add(keyBinding);
|
temporarilyRemoved.add(keyBinding);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -55,7 +55,7 @@ public class Mixin_ContextualKeyBindings {
|
|||||||
@Inject(method = "updateKeysByCode", at = @At("RETURN"))
|
@Inject(method = "updateKeysByCode", at = @At("RETURN"))
|
||||||
private static void postContextualKeyBindings(CallbackInfo ci) {
|
private static void postContextualKeyBindings(CallbackInfo ci) {
|
||||||
for (KeyBinding keyBinding : temporarilyRemoved) {
|
for (KeyBinding keyBinding : temporarilyRemoved) {
|
||||||
Mixin_ContextualKeyBindings.keysById.put(keyBinding.getId(), keyBinding);
|
Mixin_ContextualKeyBindings.keysById.put(keyBinding.getTranslationKey(), keyBinding);
|
||||||
}
|
}
|
||||||
temporarilyRemoved.clear();
|
temporarilyRemoved.clear();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
//#if FABRIC>=1
|
||||||
|
package com.replaymod.core.mixin;
|
||||||
|
|
||||||
|
import net.minecraft.client.gui.screen.pack.PackListWidget;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
//#if MC>=11600
|
||||||
|
import net.minecraft.client.gui.screen.pack.PackScreen;
|
||||||
|
import net.minecraft.client.gui.screen.pack.ResourcePackOrganizer;
|
||||||
|
//#else
|
||||||
|
//$$ import net.minecraft.client.resource.ClientResourcePackProfile;
|
||||||
|
//#endif
|
||||||
|
|
||||||
|
//#if MC>=11600
|
||||||
|
@Mixin(PackScreen.class)
|
||||||
|
//#else
|
||||||
|
//$$ @Mixin(ResourcePackListWidget.class)
|
||||||
|
//#endif
|
||||||
|
public abstract class Mixin_HideDynamicResourcePacks {
|
||||||
|
//#if MC>=11600
|
||||||
|
@Inject(method = "method_29672", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void hideInternalPacks(PackListWidget packListWidget, ResourcePackOrganizer.Pack pack, CallbackInfo info) {
|
||||||
|
//#else
|
||||||
|
//$$ @Inject(method = "add", at = @At("HEAD"), cancellable = true)
|
||||||
|
//$$ private void hideInternalPacks(ResourcePackListWidget.ResourcePackEntry entry, CallbackInfo info) {
|
||||||
|
//$$ ClientResourcePackProfile pack = entry.getPack();
|
||||||
|
//#endif
|
||||||
|
String name = pack.getDisplayName().asString();
|
||||||
|
if (name.equals("replaymod_lang") || name.equals("replaymod_jgui")) {
|
||||||
|
info.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//#endif
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
//#if FABRIC>=1
|
||||||
|
package com.replaymod.core.mixin;
|
||||||
|
|
||||||
|
import com.replaymod.core.ReplayMod;
|
||||||
|
import com.replaymod.core.versions.LangResourcePack;
|
||||||
|
import net.minecraft.client.resource.ClientBuiltinResourcePackProvider;
|
||||||
|
import net.minecraft.resource.ResourcePackProfile;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
//#if MC>=11600
|
||||||
|
import net.minecraft.resource.ResourcePackSource;
|
||||||
|
//#else
|
||||||
|
//$$ import java.util.Map;
|
||||||
|
//#endif
|
||||||
|
|
||||||
|
@Mixin(ClientBuiltinResourcePackProvider.class)
|
||||||
|
public class Mixin_RegisterDynamicResourcePacks {
|
||||||
|
@Inject(method = "register", at = @At("RETURN"))
|
||||||
|
//#if MC>=11600
|
||||||
|
private void registerReplayMod(Consumer<ResourcePackProfile> consumer, ResourcePackProfile.Factory factory, CallbackInfo ci) {
|
||||||
|
//#else
|
||||||
|
//$$ private <T extends ResourcePackProfile> void registerReplayMod(Map<String, T> map, ResourcePackProfile.Factory<T> factory, CallbackInfo ci) {
|
||||||
|
//$$ Consumer<T> consumer = (pack) -> map.put(pack.getName(), pack);
|
||||||
|
//#endif
|
||||||
|
|
||||||
|
consumer.accept(ResourcePackProfile.of(
|
||||||
|
LangResourcePack.NAME,
|
||||||
|
true,
|
||||||
|
LangResourcePack::new,
|
||||||
|
factory,
|
||||||
|
ResourcePackProfile.InsertionPosition.BOTTOM
|
||||||
|
//#if MC>=11600
|
||||||
|
, ResourcePackSource.PACK_SOURCE_BUILTIN
|
||||||
|
//#endif
|
||||||
|
));
|
||||||
|
|
||||||
|
if (ReplayMod.jGuiResourcePack != null) {
|
||||||
|
consumer.accept(ResourcePackProfile.of(
|
||||||
|
ReplayMod.JGUI_RESOURCE_PACK_NAME,
|
||||||
|
true,
|
||||||
|
() -> ReplayMod.jGuiResourcePack,
|
||||||
|
factory,
|
||||||
|
ResourcePackProfile.InsertionPosition.BOTTOM
|
||||||
|
//#if MC>=11600
|
||||||
|
, ResourcePackSource.PACK_SOURCE_BUILTIN
|
||||||
|
//#endif
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//#endif
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.replaymod.core.utils;
|
package com.replaymod.core.utils;
|
||||||
|
|
||||||
import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket;
|
import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket;
|
||||||
import net.minecraft.util.PacketByteBuf;
|
import net.minecraft.network.PacketByteBuf;
|
||||||
//#if MC>=10904
|
//#if MC>=10904
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
//#endif
|
//#endif
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ public class WrappedTimer extends RenderTickCounter {
|
|||||||
@Override
|
@Override
|
||||||
public
|
public
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ int
|
int
|
||||||
//#else
|
//#else
|
||||||
void
|
//$$ void
|
||||||
//#endif
|
//#endif
|
||||||
beginRenderTick(
|
beginRenderTick(
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
@@ -33,7 +33,7 @@ public class WrappedTimer extends RenderTickCounter {
|
|||||||
copy(this, wrapped);
|
copy(this, wrapped);
|
||||||
try {
|
try {
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ return
|
return
|
||||||
//#endif
|
//#endif
|
||||||
wrapped.beginRenderTick(
|
wrapped.beginRenderTick(
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
@@ -50,7 +50,7 @@ public class WrappedTimer extends RenderTickCounter {
|
|||||||
TimerAccessor toA = (TimerAccessor) to;
|
TimerAccessor toA = (TimerAccessor) to;
|
||||||
|
|
||||||
//#if MC<11600
|
//#if MC<11600
|
||||||
to.ticksThisFrame = from.ticksThisFrame;
|
//$$ to.ticksThisFrame = from.ticksThisFrame;
|
||||||
//#endif
|
//#endif
|
||||||
to.tickDelta = from.tickDelta;
|
to.tickDelta = from.tickDelta;
|
||||||
toA.setLastSyncSysClock(fromA.getLastSyncSysClock());
|
toA.setLastSyncSysClock(fromA.getLastSyncSysClock());
|
||||||
|
|||||||
@@ -27,6 +27,12 @@ import java.util.regex.Matcher;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
//#if FABRIC>=1
|
||||||
|
import net.fabricmc.loader.api.FabricLoader;
|
||||||
|
import net.fabricmc.loader.api.ModContainer;
|
||||||
|
//#else
|
||||||
|
//#endif
|
||||||
|
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
//#else
|
//#else
|
||||||
//$$ import net.minecraft.resources.IPackFinder;
|
//$$ import net.minecraft.resources.IPackFinder;
|
||||||
@@ -42,7 +48,7 @@ import java.util.stream.Collectors;
|
|||||||
*/
|
*/
|
||||||
public class LangResourcePack extends AbstractFileResourcePack {
|
public class LangResourcePack extends AbstractFileResourcePack {
|
||||||
private static final Gson GSON = new Gson();
|
private static final Gson GSON = new Gson();
|
||||||
private static final String NAME = "replaymod_lang";
|
public static final String NAME = "replaymod_lang";
|
||||||
private static final Pattern JSON_FILE_PATTERN = Pattern.compile("^assets/" + ReplayMod.MOD_ID + "/lang/([a-z][a-z])_([a-z][a-z]).json$");
|
private static final Pattern JSON_FILE_PATTERN = Pattern.compile("^assets/" + ReplayMod.MOD_ID + "/lang/([a-z][a-z])_([a-z][a-z]).json$");
|
||||||
private static final Pattern LANG_FILE_NAME_PATTERN = Pattern.compile("^([a-z][a-z])_([a-z][a-z]).lang$");
|
private static final Pattern LANG_FILE_NAME_PATTERN = Pattern.compile("^([a-z][a-z])_([a-z][a-z]).lang$");
|
||||||
|
|
||||||
@@ -51,9 +57,15 @@ public class LangResourcePack extends AbstractFileResourcePack {
|
|||||||
private static final String FABRIC_KEY_FORMAT = "key." + ReplayMod.MOD_ID + ".%s";
|
private static final String FABRIC_KEY_FORMAT = "key." + ReplayMod.MOD_ID + ".%s";
|
||||||
|
|
||||||
private final Path basePath;
|
private final Path basePath;
|
||||||
public LangResourcePack(Path basePath) {
|
public LangResourcePack() {
|
||||||
super(new File(NAME));
|
super(new File(NAME));
|
||||||
this.basePath = basePath;
|
|
||||||
|
//#if FABRIC>=1
|
||||||
|
ModContainer container = FabricLoader.getInstance().getModContainer(ReplayMod.MOD_ID).orElseThrow(IllegalAccessError::new);
|
||||||
|
this.basePath = container.getRootPath();
|
||||||
|
//#else
|
||||||
|
//$$ this.basePath = null; // stub
|
||||||
|
//#endif
|
||||||
}
|
}
|
||||||
//#else
|
//#else
|
||||||
//$$ public LangResourcePack() {
|
//$$ public LangResourcePack() {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import net.minecraft.client.model.ModelPart;
|
|||||||
import net.minecraft.util.crash.CrashReportSection;
|
import net.minecraft.util.crash.CrashReportSection;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.util.PacketByteBuf;
|
import net.minecraft.network.PacketByteBuf;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
import net.minecraft.util.Util;
|
import net.minecraft.util.Util;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
@@ -24,7 +24,7 @@ import org.apache.logging.log4j.LogManager;
|
|||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ import net.minecraft.resource.ResourcePackSource;
|
import net.minecraft.resource.ResourcePackSource;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=11500
|
//#if MC>=11500
|
||||||
@@ -44,9 +44,9 @@ import net.minecraft.client.gui.widget.AbstractButtonWidget;
|
|||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ import net.minecraft.text.TranslatableText;
|
import net.minecraft.text.TranslatableText;
|
||||||
//#else
|
//#else
|
||||||
import net.minecraft.client.resource.language.I18n;
|
//$$ import net.minecraft.client.resource.language.I18n;
|
||||||
//#endif
|
//#endif
|
||||||
//#else
|
//#else
|
||||||
//$$ import com.google.common.util.concurrent.FutureCallback;
|
//$$ import com.google.common.util.concurrent.FutureCallback;
|
||||||
@@ -448,7 +448,7 @@ public class MCVer {
|
|||||||
return getMinecraft().getResourcePackDownloader().loadServerPack(
|
return getMinecraft().getResourcePackDownloader().loadServerPack(
|
||||||
file
|
file
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ , ResourcePackSource.PACK_SOURCE_SERVER
|
, ResourcePackSource.PACK_SOURCE_SERVER
|
||||||
//#endif
|
//#endif
|
||||||
);
|
);
|
||||||
//#else
|
//#else
|
||||||
@@ -574,7 +574,7 @@ public class MCVer {
|
|||||||
|
|
||||||
public static EntityRenderDispatcher getRenderManager() {
|
public static EntityRenderDispatcher getRenderManager() {
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
return getMinecraft().getEntityRenderManager();
|
return getMinecraft().getEntityRenderDispatcher();
|
||||||
//#else
|
//#else
|
||||||
//$$ return RenderManager.instance;
|
//$$ return RenderManager.instance;
|
||||||
//#endif
|
//#endif
|
||||||
@@ -613,9 +613,9 @@ public class MCVer {
|
|||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
public static Optional<AbstractButtonWidget> findButton(List<AbstractButtonWidget> buttonList, @SuppressWarnings("unused") String text, @SuppressWarnings("unused") int id) {
|
public static Optional<AbstractButtonWidget> findButton(List<AbstractButtonWidget> buttonList, @SuppressWarnings("unused") String text, @SuppressWarnings("unused") int id) {
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ final TranslatableText message = new TranslatableText(text);
|
final TranslatableText message = new TranslatableText(text);
|
||||||
//#else
|
//#else
|
||||||
final String message = I18n.translate(text);
|
//$$ final String message = I18n.translate(text);
|
||||||
//#endif
|
//#endif
|
||||||
for (AbstractButtonWidget b : buttonList) {
|
for (AbstractButtonWidget b : buttonList) {
|
||||||
if (message.equals(b.getMessage())) {
|
if (message.equals(b.getMessage())) {
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ public class HotkeyButtons extends EventRegistrations implements Extra {
|
|||||||
|
|
||||||
final KeyBindingRegistry keyBindingRegistry = mod.getKeyBindingRegistry();
|
final KeyBindingRegistry keyBindingRegistry = mod.getKeyBindingRegistry();
|
||||||
keyBindingRegistry.getKeyBindings().values().stream()
|
keyBindingRegistry.getKeyBindings().values().stream()
|
||||||
.sorted(Comparator.comparing(it -> I18n.translate(it.getId())))
|
.sorted(Comparator.comparing(it -> I18n.translate(it.getTranslationKey())))
|
||||||
.forEachOrdered(keyBinding -> {
|
.forEachOrdered(keyBinding -> {
|
||||||
GuiButton button = new GuiButton(){
|
GuiButton button = new GuiButton(){
|
||||||
@Override
|
@Override
|
||||||
@@ -83,10 +83,10 @@ public class HotkeyButtons extends EventRegistrations implements Extra {
|
|||||||
String keyName = "???";
|
String keyName = "???";
|
||||||
try {
|
try {
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ keyName = keyBinding.getBoundKeyLocalizedText().asString();
|
keyName = keyBinding.getBoundKeyLocalizedText().asString();
|
||||||
//#else
|
//#else
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
keyName = keyBinding.getLocalizedName();
|
//$$ keyName = keyBinding.getLocalizedName();
|
||||||
//#else
|
//#else
|
||||||
//$$ keyName = Keyboard.getKeyName(keyBinding.getKeyCode());
|
//$$ keyName = Keyboard.getKeyName(keyBinding.getKeyCode());
|
||||||
//#endif
|
//#endif
|
||||||
@@ -115,7 +115,7 @@ public class HotkeyButtons extends EventRegistrations implements Extra {
|
|||||||
return new Dimension(Math.max(10, button.getMinSize().getWidth()) + 10, 20);
|
return new Dimension(Math.max(10, button.getMinSize().getWidth()) + 10, 20);
|
||||||
}
|
}
|
||||||
}).addElements(null, button),
|
}).addElements(null, button),
|
||||||
new GuiLabel().setI18nText(keyBinding.getId())
|
new GuiLabel().setI18nText(keyBinding.getTranslationKey())
|
||||||
));
|
));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import com.replaymod.render.capturer.RenderInfo;
|
|||||||
import com.replaymod.render.rendering.Pipelines;
|
import com.replaymod.render.rendering.Pipelines;
|
||||||
import de.johni0702.minecraft.gui.utils.lwjgl.Dimension;
|
import de.johni0702.minecraft.gui.utils.lwjgl.Dimension;
|
||||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.util.crash.CrashReport;
|
import net.minecraft.util.crash.CrashReport;
|
||||||
|
|
||||||
@@ -22,7 +21,6 @@ import com.replaymod.render.hooks.ChunkLoadingRenderGlobal;
|
|||||||
|
|
||||||
import static com.replaymod.core.versions.MCVer.getRenderPartialTicks;
|
import static com.replaymod.core.versions.MCVer.getRenderPartialTicks;
|
||||||
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ScreenshotRenderer implements RenderInfo {
|
public class ScreenshotRenderer implements RenderInfo {
|
||||||
|
|
||||||
private final MinecraftClient mc = MCVer.getMinecraft();
|
private final MinecraftClient mc = MCVer.getMinecraft();
|
||||||
@@ -31,6 +29,10 @@ public class ScreenshotRenderer implements RenderInfo {
|
|||||||
|
|
||||||
private int framesDone;
|
private int framesDone;
|
||||||
|
|
||||||
|
public ScreenshotRenderer(RenderSettings settings) {
|
||||||
|
this.settings = settings;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean renderScreenshot() throws Throwable {
|
public boolean renderScreenshot() throws Throwable {
|
||||||
try {
|
try {
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import de.johni0702.minecraft.gui.popup.GuiFileChooserPopup;
|
|||||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
||||||
import de.johni0702.minecraft.gui.versions.Image;
|
import de.johni0702.minecraft.gui.versions.Image;
|
||||||
import joptsimple.internal.Strings;
|
import joptsimple.internal.Strings;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import net.minecraft.client.resource.language.I18n;
|
import net.minecraft.client.resource.language.I18n;
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
|
|
||||||
@@ -46,7 +45,6 @@ import java.security.GeneralSecurityException;
|
|||||||
import static com.replaymod.extras.ReplayModExtras.LOGGER;
|
import static com.replaymod.extras.ReplayModExtras.LOGGER;
|
||||||
import static java.util.Arrays.asList;
|
import static java.util.Arrays.asList;
|
||||||
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class GuiYoutubeUpload extends GuiScreen {
|
public class GuiYoutubeUpload extends GuiScreen {
|
||||||
private final GuiScreen previousScreen;
|
private final GuiScreen previousScreen;
|
||||||
private final File videoFile;
|
private final File videoFile;
|
||||||
@@ -185,6 +183,13 @@ public class GuiYoutubeUpload extends GuiScreen {
|
|||||||
inputValidation.run();
|
inputValidation.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GuiYoutubeUpload(GuiScreen previousScreen, File videoFile, int videoFrames, RenderSettings settings) {
|
||||||
|
this.previousScreen = previousScreen;
|
||||||
|
this.videoFile = videoFile;
|
||||||
|
this.videoFrames = videoFrames;
|
||||||
|
this.settings = settings;
|
||||||
|
}
|
||||||
|
|
||||||
private void setState(boolean uploading) {
|
private void setState(boolean uploading) {
|
||||||
forEach(GuiElement.class).setEnabled(!uploading);
|
forEach(GuiElement.class).setEnabled(!uploading);
|
||||||
uploadButton.setEnabled();
|
uploadButton.setEnabled();
|
||||||
|
|||||||
@@ -26,8 +26,7 @@ import com.google.common.util.concurrent.ListenableFuture;
|
|||||||
import com.google.common.util.concurrent.SettableFuture;
|
import com.google.common.util.concurrent.SettableFuture;
|
||||||
import com.replaymod.render.RenderSettings;
|
import com.replaymod.render.RenderSettings;
|
||||||
import com.replaymod.render.metadata.MetadataInjector;
|
import com.replaymod.render.metadata.MetadataInjector;
|
||||||
import lombok.Getter;
|
import de.johni0702.minecraft.gui.utils.NonNull;
|
||||||
import lombok.NonNull;
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import org.apache.commons.exec.CommandLine;
|
import org.apache.commons.exec.CommandLine;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
@@ -60,10 +59,8 @@ public class YoutubeUploader {
|
|||||||
@NonNull
|
@NonNull
|
||||||
private Supplier<Double> progress = Suppliers.ofInstance(0d);
|
private Supplier<Double> progress = Suppliers.ofInstance(0d);
|
||||||
|
|
||||||
@Getter
|
|
||||||
private State state;
|
private State state;
|
||||||
|
|
||||||
@Getter
|
|
||||||
private volatile boolean cancelled;
|
private volatile boolean cancelled;
|
||||||
|
|
||||||
public YoutubeUploader(MinecraftClient minecraft, File videoFile, int videoFrames,
|
public YoutubeUploader(MinecraftClient minecraft, File videoFile, int videoFrames,
|
||||||
@@ -252,6 +249,14 @@ public class YoutubeUploader {
|
|||||||
return progress.get();
|
return progress.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public State getState() {
|
||||||
|
return this.state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isCancelled() {
|
||||||
|
return this.cancelled;
|
||||||
|
}
|
||||||
|
|
||||||
public enum State {
|
public enum State {
|
||||||
AUTH, PREPARE_VIDEO, UPLOAD, CLEANUP
|
AUTH, PREPARE_VIDEO, UPLOAD, CLEANUP
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public class ReplayTimer extends WrappedTimer {
|
|||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ public int ticksThisFrame;
|
public int ticksThisFrame;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
public ReplayTimer(RenderTickCounter wrapped) {
|
public ReplayTimer(RenderTickCounter wrapped) {
|
||||||
@@ -27,9 +27,9 @@ public class ReplayTimer extends WrappedTimer {
|
|||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
public
|
public
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ int
|
int
|
||||||
//#else
|
//#else
|
||||||
void
|
//$$ void
|
||||||
//#endif
|
//#endif
|
||||||
beginRenderTick(
|
beginRenderTick(
|
||||||
//#else
|
//#else
|
||||||
@@ -42,7 +42,7 @@ public class ReplayTimer extends WrappedTimer {
|
|||||||
copy(this, state); // Save our current state
|
copy(this, state); // Save our current state
|
||||||
try {
|
try {
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ ticksThisFrame =
|
ticksThisFrame =
|
||||||
//#endif
|
//#endif
|
||||||
wrapped.beginRenderTick(
|
wrapped.beginRenderTick(
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
@@ -54,7 +54,7 @@ public class ReplayTimer extends WrappedTimer {
|
|||||||
UpdatedCallback.EVENT.invoker().onUpdate();
|
UpdatedCallback.EVENT.invoker().onUpdate();
|
||||||
}
|
}
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ return ticksThisFrame;
|
return ticksThisFrame;
|
||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import com.replaymod.replaystudio.pathing.property.AbstractProperty;
|
|||||||
import com.replaymod.replaystudio.pathing.property.AbstractPropertyGroup;
|
import com.replaymod.replaystudio.pathing.property.AbstractPropertyGroup;
|
||||||
import com.replaymod.replaystudio.pathing.property.PropertyPart;
|
import com.replaymod.replaystudio.pathing.property.PropertyPart;
|
||||||
import com.replaymod.replaystudio.pathing.property.PropertyParts;
|
import com.replaymod.replaystudio.pathing.property.PropertyParts;
|
||||||
import lombok.NonNull;
|
import de.johni0702.minecraft.gui.utils.NonNull;
|
||||||
import org.apache.commons.lang3.tuple.Triple;
|
import org.apache.commons.lang3.tuple.Triple;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import com.replaymod.replay.ReplaySender;
|
|||||||
import com.replaymod.replaystudio.pathing.property.AbstractProperty;
|
import com.replaymod.replaystudio.pathing.property.AbstractProperty;
|
||||||
import com.replaymod.replaystudio.pathing.property.PropertyPart;
|
import com.replaymod.replaystudio.pathing.property.PropertyPart;
|
||||||
import com.replaymod.replaystudio.pathing.property.PropertyParts;
|
import com.replaymod.replaystudio.pathing.property.PropertyParts;
|
||||||
import lombok.NonNull;
|
import de.johni0702.minecraft.gui.utils.NonNull;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public class GuiRecordingOverlay extends EventRegistrations {
|
|||||||
String text = guiControls.isPaused() ? I18n.translate("replaymod.gui.paused") : I18n.translate("replaymod.gui.recording");
|
String text = guiControls.isPaused() ? I18n.translate("replaymod.gui.paused") : I18n.translate("replaymod.gui.recording");
|
||||||
fontRenderer.draw(
|
fontRenderer.draw(
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ stack,
|
stack,
|
||||||
//#endif
|
//#endif
|
||||||
text.toUpperCase(), 30, 18 - (fontRenderer.fontHeight / 2), 0xffffffff);
|
text.toUpperCase(), 30, 18 - (fontRenderer.fontHeight / 2), 0xffffffff);
|
||||||
bindTexture(TEXTURE);
|
bindTexture(TEXTURE);
|
||||||
|
|||||||
@@ -19,14 +19,14 @@ import net.minecraft.network.ClientConnection;
|
|||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
//#else
|
//#else
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
import net.minecraft.world.dimension.DimensionType;
|
//$$ import net.minecraft.world.dimension.DimensionType;
|
||||||
//#endif
|
//#endif
|
||||||
|
//$$
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
import net.minecraft.world.level.LevelGeneratorType;
|
//$$ import net.minecraft.world.level.LevelGeneratorType;
|
||||||
//#endif
|
//#endif
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
@@ -65,10 +65,10 @@ public class ConnectionEventHandler {
|
|||||||
if (local) {
|
if (local) {
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ if (mc.getServer().getWorld(World.OVERWORLD).isDebugWorld()) {
|
if (mc.getServer().getWorld(World.OVERWORLD).isDebugWorld()) {
|
||||||
//#else
|
//#else
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
if (mc.getServer().getWorld(DimensionType.OVERWORLD).getGeneratorType() == LevelGeneratorType.DEBUG_ALL_BLOCK_STATES) {
|
//$$ if (mc.getServer().getWorld(DimensionType.OVERWORLD).getGeneratorType() == LevelGeneratorType.DEBUG_ALL_BLOCK_STATES) {
|
||||||
//#else
|
//#else
|
||||||
//$$ if (mc.getIntegratedServer().getEntityWorld().getWorldType() == WorldType.DEBUG_ALL_BLOCK_STATES) {
|
//$$ if (mc.getIntegratedServer().getEntityWorld().getWorldType() == WorldType.DEBUG_ALL_BLOCK_STATES) {
|
||||||
//#endif
|
//#endif
|
||||||
@@ -91,9 +91,9 @@ public class ConnectionEventHandler {
|
|||||||
String worldName;
|
String worldName;
|
||||||
if (local) {
|
if (local) {
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ worldName = mc.getServer().getSaveProperties().getLevelName();
|
worldName = mc.getServer().getSaveProperties().getLevelName();
|
||||||
//#else
|
//#else
|
||||||
worldName = mc.getServer().getLevelName();
|
//$$ worldName = mc.getServer().getLevelName();
|
||||||
//#endif
|
//#endif
|
||||||
} else if (mc.getCurrentServerEntry() != null) {
|
} else if (mc.getCurrentServerEntry() != null) {
|
||||||
worldName = mc.getCurrentServerEntry().address;
|
worldName = mc.getCurrentServerEntry().address;
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ import de.johni0702.minecraft.gui.versions.callbacks.PreTickCallback;
|
|||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ import com.mojang.datafixers.util.Pair;
|
import com.mojang.datafixers.util.Pair;
|
||||||
//$$ import java.util.Collections;
|
import java.util.Collections;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
@@ -210,10 +210,10 @@ public class RecordingEventHandler extends EventRegistrations {
|
|||||||
//#endif
|
//#endif
|
||||||
newYaw, newPitch
|
newYaw, newPitch
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ , player.isOnGround()
|
, player.isOnGround()
|
||||||
//#else
|
//#else
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
, player.onGround
|
//$$ , player.onGround
|
||||||
//#endif
|
//#endif
|
||||||
//#endif
|
//#endif
|
||||||
);
|
);
|
||||||
@@ -239,7 +239,7 @@ public class RecordingEventHandler extends EventRegistrations {
|
|||||||
|
|
||||||
//Animation Packets
|
//Animation Packets
|
||||||
//Swing Animation
|
//Swing Animation
|
||||||
if (player.isHandSwinging && player.handSwingTicks == 0) {
|
if (player.handSwinging && player.handSwingTicks == 0) {
|
||||||
packetListener.save(new EntityAnimationS2CPacket(
|
packetListener.save(new EntityAnimationS2CPacket(
|
||||||
player,
|
player,
|
||||||
//#if MC>=10904
|
//#if MC>=10904
|
||||||
@@ -277,9 +277,9 @@ public class RecordingEventHandler extends EventRegistrations {
|
|||||||
if (playerItems[slot.ordinal()] != stack) {
|
if (playerItems[slot.ordinal()] != stack) {
|
||||||
playerItems[slot.ordinal()] = stack;
|
playerItems[slot.ordinal()] = stack;
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ packetListener.save(new EntityEquipmentUpdateS2CPacket(player.getEntityId(), Collections.singletonList(Pair.of(slot, stack))));
|
packetListener.save(new EntityEquipmentUpdateS2CPacket(player.getEntityId(), Collections.singletonList(Pair.of(slot, stack))));
|
||||||
//#else
|
//#else
|
||||||
packetListener.save(new EntityEquipmentUpdateS2CPacket(player.getEntityId(), slot, stack));
|
//$$ packetListener.save(new EntityEquipmentUpdateS2CPacket(player.getEntityId(), slot, stack));
|
||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import org.spongepowered.asm.mixin.injection.At;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ import net.minecraft.resource.ResourcePackSource;
|
import net.minecraft.resource.ResourcePackSource;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
@@ -37,7 +37,7 @@ public abstract class MixinDownloadingPackFinder implements ResourcePackRecorder
|
|||||||
private void recordDownloadedPack(
|
private void recordDownloadedPack(
|
||||||
File file,
|
File file,
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ ResourcePackSource arg,
|
ResourcePackSource arg,
|
||||||
//#endif
|
//#endif
|
||||||
CallbackInfoReturnable ci
|
CallbackInfoReturnable ci
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -14,13 +14,13 @@ import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
|
|||||||
@Mixin(Mouse.class)
|
@Mixin(Mouse.class)
|
||||||
public abstract class MixinMouseHelper {
|
public abstract class MixinMouseHelper {
|
||||||
@Shadow
|
@Shadow
|
||||||
private boolean isCursorLocked;
|
private boolean cursorLocked;
|
||||||
|
|
||||||
@Inject(method = "lockCursor", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "lockCursor", at = @At("HEAD"), cancellable = true)
|
||||||
private void noGrab(CallbackInfo ci) {
|
private void noGrab(CallbackInfo ci) {
|
||||||
// Used to be provided by Forge for 1.12.2 and below
|
// Used to be provided by Forge for 1.12.2 and below
|
||||||
if (Boolean.valueOf(System.getProperty("fml.noGrab", "false"))) {
|
if (Boolean.valueOf(System.getProperty("fml.noGrab", "false"))) {
|
||||||
this.isCursorLocked = true;
|
this.cursorLocked = true;
|
||||||
ci.cancel();
|
ci.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import com.replaymod.replaystudio.protocol.PacketType;
|
|||||||
import com.replaymod.replaystudio.protocol.packets.PacketPlayerListEntry;
|
import com.replaymod.replaystudio.protocol.packets.PacketPlayerListEntry;
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import io.netty.buffer.Unpooled;
|
import io.netty.buffer.Unpooled;
|
||||||
import net.minecraft.util.PacketByteBuf;
|
import net.minecraft.network.PacketByteBuf;
|
||||||
import net.minecraft.network.packet.s2c.play.PlayerListS2CPacket;
|
import net.minecraft.network.packet.s2c.play.PlayerListS2CPacket;
|
||||||
import net.minecraft.client.network.PlayerListEntry;
|
import net.minecraft.client.network.PlayerListEntry;
|
||||||
|
|
||||||
|
|||||||
@@ -17,17 +17,17 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ import net.minecraft.util.registry.RegistryKey;
|
import net.minecraft.util.registry.RegistryKey;
|
||||||
//$$ import net.minecraft.world.MutableWorldProperties;
|
import net.minecraft.world.MutableWorldProperties;
|
||||||
//$$ import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
//#else
|
//#else
|
||||||
import net.minecraft.world.level.LevelProperties;
|
//$$ import net.minecraft.world.level.LevelProperties;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
import net.minecraft.world.chunk.ChunkManager;
|
import net.minecraft.world.chunk.ChunkManager;
|
||||||
//#if MC<11600
|
//#if MC<11600
|
||||||
import net.minecraft.world.dimension.Dimension;
|
//$$ import net.minecraft.world.dimension.Dimension;
|
||||||
//#endif
|
//#endif
|
||||||
import net.minecraft.world.dimension.DimensionType;
|
import net.minecraft.world.dimension.DimensionType;
|
||||||
import java.util.function.BiFunction;
|
import java.util.function.BiFunction;
|
||||||
@@ -48,22 +48,22 @@ public abstract class MixinWorldClient extends World implements RecordingEventHa
|
|||||||
private MinecraftClient client;
|
private MinecraftClient client;
|
||||||
|
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ protected MixinWorldClient(MutableWorldProperties mutableWorldProperties, RegistryKey<World> registryKey,
|
protected MixinWorldClient(MutableWorldProperties mutableWorldProperties, RegistryKey<World> registryKey,
|
||||||
//#if MC<11602
|
//#if MC<11602
|
||||||
//$$ RegistryKey<DimensionType> registryKey2,
|
//$$ RegistryKey<DimensionType> registryKey2,
|
||||||
//#endif
|
//#endif
|
||||||
//$$ DimensionType dimensionType, Supplier<Profiler> profiler, boolean bl, boolean bl2, long l) {
|
DimensionType dimensionType, Supplier<Profiler> profiler, boolean bl, boolean bl2, long l) {
|
||||||
//$$ super(mutableWorldProperties, registryKey,
|
super(mutableWorldProperties, registryKey,
|
||||||
//#if MC<11602
|
//#if MC<11602
|
||||||
//$$ registryKey2,
|
//$$ registryKey2,
|
||||||
//#endif
|
//#endif
|
||||||
//$$ dimensionType, profiler, bl, bl2, l);
|
dimensionType, profiler, bl, bl2, l);
|
||||||
//$$ }
|
}
|
||||||
//#else
|
//#else
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
protected MixinWorldClient(LevelProperties levelProperties_1, DimensionType dimensionType_1, BiFunction<World, Dimension, ChunkManager> biFunction_1, Profiler profiler_1, boolean boolean_1) {
|
//$$ protected MixinWorldClient(LevelProperties levelProperties_1, DimensionType dimensionType_1, BiFunction<World, Dimension, ChunkManager> biFunction_1, Profiler profiler_1, boolean boolean_1) {
|
||||||
super(levelProperties_1, dimensionType_1, biFunction_1, profiler_1, boolean_1);
|
//$$ super(levelProperties_1, dimensionType_1, biFunction_1, profiler_1, boolean_1);
|
||||||
}
|
//$$ }
|
||||||
//#else
|
//#else
|
||||||
//$$ protected MixinWorldClient(ISaveHandler saveHandlerIn,
|
//$$ protected MixinWorldClient(ISaveHandler saveHandlerIn,
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
@@ -118,9 +118,9 @@ public abstract class MixinWorldClient extends World implements RecordingEventHa
|
|||||||
// Same goes for level events (also called effects). E.g. door open, block break, etc.
|
// Same goes for level events (also called effects). E.g. door open, block break, etc.
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ @Inject(method = "syncWorldEvent", at = @At("HEAD"))
|
@Inject(method = "syncWorldEvent", at = @At("HEAD"))
|
||||||
//#else
|
//#else
|
||||||
@Inject(method = "playLevelEvent", at = @At("HEAD"))
|
//$$ @Inject(method = "playLevelEvent", at = @At("HEAD"))
|
||||||
//#endif
|
//#endif
|
||||||
private void playLevelEvent (PlayerEntity player, int type, BlockPos pos, int data, CallbackInfo ci) {
|
private void playLevelEvent (PlayerEntity player, int type, BlockPos pos, int data, CallbackInfo ci) {
|
||||||
//#else
|
//#else
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ import net.minecraft.entity.Entity;
|
|||||||
import net.minecraft.entity.data.DataTracker;
|
import net.minecraft.entity.data.DataTracker;
|
||||||
import net.minecraft.network.NetworkState;
|
import net.minecraft.network.NetworkState;
|
||||||
import net.minecraft.network.Packet;
|
import net.minecraft.network.Packet;
|
||||||
import net.minecraft.util.PacketByteBuf;
|
import net.minecraft.network.PacketByteBuf;
|
||||||
import net.minecraft.text.LiteralText;
|
import net.minecraft.text.LiteralText;
|
||||||
import net.minecraft.util.crash.CrashReport;
|
import net.minecraft.util.crash.CrashReport;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
|||||||
@@ -3,9 +3,6 @@ package com.replaymod.render;
|
|||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
import com.replaymod.core.versions.MCVer;
|
import com.replaymod.core.versions.MCVer;
|
||||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableColor;
|
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableColor;
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.Getter;
|
|
||||||
import net.minecraft.client.resource.language.I18n;
|
import net.minecraft.client.resource.language.I18n;
|
||||||
import net.minecraft.util.Util;
|
import net.minecraft.util.Util;
|
||||||
|
|
||||||
@@ -26,7 +23,6 @@ import org.apache.maven.artifact.versioning.ComparableVersion;
|
|||||||
//#endif
|
//#endif
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
@Data
|
|
||||||
public class RenderSettings {
|
public class RenderSettings {
|
||||||
public enum RenderMethod {
|
public enum RenderMethod {
|
||||||
DEFAULT, STEREOSCOPIC, CUBIC, EQUIRECTANGULAR, ODS, BLEND;
|
DEFAULT, STEREOSCOPIC, CUBIC, EQUIRECTANGULAR, ODS, BLEND;
|
||||||
@@ -119,13 +115,19 @@ public class RenderSettings {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@AllArgsConstructor
|
|
||||||
public enum AntiAliasing {
|
public enum AntiAliasing {
|
||||||
NONE(1), X2(2), X4(4), X8(8);
|
NONE(1), X2(2), X4(4), X8(8);
|
||||||
|
|
||||||
@Getter
|
|
||||||
private final int factor;
|
private final int factor;
|
||||||
|
|
||||||
|
AntiAliasing(int factor) {
|
||||||
|
this.factor = factor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getFactor() {
|
||||||
|
return factor;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return I18n.translate("replaymod.gui.rendersettings.antialiasing." + name().toLowerCase());
|
return I18n.translate("replaymod.gui.rendersettings.antialiasing." + name().toLowerCase());
|
||||||
@@ -162,6 +164,48 @@ public class RenderSettings {
|
|||||||
|
|
||||||
private final boolean highPerformance;
|
private final boolean highPerformance;
|
||||||
|
|
||||||
|
public RenderSettings(
|
||||||
|
RenderMethod renderMethod,
|
||||||
|
EncodingPreset encodingPreset,
|
||||||
|
int videoWidth,
|
||||||
|
int videoHeight,
|
||||||
|
int framesPerSecond,
|
||||||
|
int bitRate,
|
||||||
|
File outputFile,
|
||||||
|
boolean renderNameTags,
|
||||||
|
boolean stabilizeYaw,
|
||||||
|
boolean stabilizePitch,
|
||||||
|
boolean stabilizeRoll,
|
||||||
|
ReadableColor chromaKeyingColor,
|
||||||
|
int sphericalFovX,
|
||||||
|
int sphericalFovY,
|
||||||
|
boolean injectSphericalMetadata,
|
||||||
|
AntiAliasing antiAliasing,
|
||||||
|
String exportCommand,
|
||||||
|
String exportArguments,
|
||||||
|
boolean highPerformance
|
||||||
|
) {
|
||||||
|
this.renderMethod = renderMethod;
|
||||||
|
this.encodingPreset = encodingPreset;
|
||||||
|
this.videoWidth = videoWidth;
|
||||||
|
this.videoHeight = videoHeight;
|
||||||
|
this.framesPerSecond = framesPerSecond;
|
||||||
|
this.bitRate = bitRate;
|
||||||
|
this.outputFile = outputFile;
|
||||||
|
this.renderNameTags = renderNameTags;
|
||||||
|
this.stabilizeYaw = stabilizeYaw;
|
||||||
|
this.stabilizePitch = stabilizePitch;
|
||||||
|
this.stabilizeRoll = stabilizeRoll;
|
||||||
|
this.chromaKeyingColor = chromaKeyingColor;
|
||||||
|
this.sphericalFovX = sphericalFovX;
|
||||||
|
this.sphericalFovY = sphericalFovY;
|
||||||
|
this.injectSphericalMetadata = injectSphericalMetadata;
|
||||||
|
this.antiAliasing = antiAliasing;
|
||||||
|
this.exportCommand = exportCommand;
|
||||||
|
this.exportArguments = exportArguments;
|
||||||
|
this.highPerformance = highPerformance;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the width of the output video during rendering, including the upscale for Anti-Aliasing.
|
* @return the width of the output video during rendering, including the upscale for Anti-Aliasing.
|
||||||
*/
|
*/
|
||||||
@@ -253,4 +297,71 @@ public class RenderSettings {
|
|||||||
return "ffmpeg";
|
return "ffmpeg";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public RenderMethod getRenderMethod() {
|
||||||
|
return renderMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EncodingPreset getEncodingPreset() {
|
||||||
|
return encodingPreset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getFramesPerSecond() {
|
||||||
|
return framesPerSecond;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getBitRate() {
|
||||||
|
return bitRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public File getOutputFile() {
|
||||||
|
return outputFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isRenderNameTags() {
|
||||||
|
return renderNameTags;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isStabilizeYaw() {
|
||||||
|
return stabilizeYaw;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isStabilizePitch() {
|
||||||
|
return stabilizePitch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isStabilizeRoll() {
|
||||||
|
return stabilizeRoll;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReadableColor getChromaKeyingColor() {
|
||||||
|
return chromaKeyingColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSphericalFovX() {
|
||||||
|
return sphericalFovX;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSphericalFovY() {
|
||||||
|
return sphericalFovY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isInjectSphericalMetadata() {
|
||||||
|
return injectSphericalMetadata;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AntiAliasing getAntiAliasing() {
|
||||||
|
return antiAliasing;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExportCommand() {
|
||||||
|
return exportCommand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExportArguments() {
|
||||||
|
return exportArguments;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isHighPerformance() {
|
||||||
|
return highPerformance;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ public class Util {
|
|||||||
public static Vector3f getCameraPos() {
|
public static Vector3f getCameraPos() {
|
||||||
MinecraftClient mc = MinecraftClient.getInstance();
|
MinecraftClient mc = MinecraftClient.getInstance();
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
Vec3d pos = mc.getEntityRenderManager().camera.getPos();
|
Vec3d pos = mc.getEntityRenderDispatcher().camera.getPos();
|
||||||
return new Vector3f((float) pos.x, (float) pos.y, (float) pos.z);
|
return new Vector3f((float) pos.x, (float) pos.y, (float) pos.z);
|
||||||
//#else
|
//#else
|
||||||
//$$ return new Vector3f(
|
//$$ return new Vector3f(
|
||||||
|
|||||||
@@ -52,9 +52,9 @@ public class TileEntityExporter implements Exporter {
|
|||||||
// so we position it at 0/0/0 and instead have the tile entities themselves move more
|
// so we position it at 0/0/0 and instead have the tile entities themselves move more
|
||||||
Matrix4f.translate(new Vector3f(
|
Matrix4f.translate(new Vector3f(
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
(float) -mc.getEntityRenderManager().camera.getPos().x,
|
(float) -mc.getEntityRenderDispatcher().camera.getPos().x,
|
||||||
(float) -mc.getEntityRenderManager().camera.getPos().y,
|
(float) -mc.getEntityRenderDispatcher().camera.getPos().y,
|
||||||
(float) -mc.getEntityRenderManager().camera.getPos().z
|
(float) -mc.getEntityRenderDispatcher().camera.getPos().z
|
||||||
//#else
|
//#else
|
||||||
//$$ (float) -mc.getRenderManager().viewerPosX,
|
//$$ (float) -mc.getRenderManager().viewerPosX,
|
||||||
//$$ (float) -mc.getRenderManager().viewerPosY,
|
//$$ (float) -mc.getRenderManager().viewerPosY,
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import net.minecraft.client.render.entity.LivingEntityRenderer;
|
|||||||
//#endif
|
//#endif
|
||||||
public abstract class MixinRenderLivingBase {
|
public abstract class MixinRenderLivingBase {
|
||||||
//#if MC>=11500
|
//#if MC>=11500
|
||||||
@Inject(method = "render(Lnet/minecraft/entity/LivingEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", at = @At(
|
@Inject(method = "render", at = @At(
|
||||||
//#else
|
//#else
|
||||||
//#if FABRIC>=1
|
//#if FABRIC>=1
|
||||||
//$$ @Inject(method = "render(Lnet/minecraft/entity/LivingEntity;DDDFF)V", at = @At(
|
//$$ @Inject(method = "render(Lnet/minecraft/entity/LivingEntity;DDDFF)V", at = @At(
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
package com.replaymod.render.frame;
|
package com.replaymod.render.frame;
|
||||||
|
|
||||||
import com.replaymod.render.rendering.Frame;
|
import com.replaymod.render.rendering.Frame;
|
||||||
import lombok.Getter;
|
|
||||||
import org.apache.commons.lang3.Validate;
|
import org.apache.commons.lang3.Validate;
|
||||||
|
|
||||||
public class CubicOpenGlFrame implements Frame {
|
public class CubicOpenGlFrame implements Frame {
|
||||||
@Getter
|
|
||||||
private final OpenGlFrame left, right, front, back, top, bottom;
|
private final OpenGlFrame left, right, front, back, top, bottom;
|
||||||
|
|
||||||
public CubicOpenGlFrame(OpenGlFrame left, OpenGlFrame right, OpenGlFrame front, OpenGlFrame back, OpenGlFrame top, OpenGlFrame bottom) {
|
public CubicOpenGlFrame(OpenGlFrame left, OpenGlFrame right, OpenGlFrame front, OpenGlFrame back, OpenGlFrame top, OpenGlFrame bottom) {
|
||||||
@@ -31,4 +29,28 @@ public class CubicOpenGlFrame implements Frame {
|
|||||||
public int getFrameId() {
|
public int getFrameId() {
|
||||||
return left.getFrameId();
|
return left.getFrameId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public OpenGlFrame getLeft() {
|
||||||
|
return this.left;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OpenGlFrame getRight() {
|
||||||
|
return this.right;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OpenGlFrame getFront() {
|
||||||
|
return this.front;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OpenGlFrame getBack() {
|
||||||
|
return this.back;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OpenGlFrame getTop() {
|
||||||
|
return this.top;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OpenGlFrame getBottom() {
|
||||||
|
return this.bottom;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
package com.replaymod.render.frame;
|
package com.replaymod.render.frame;
|
||||||
|
|
||||||
import com.replaymod.render.rendering.Frame;
|
import com.replaymod.render.rendering.Frame;
|
||||||
import lombok.Getter;
|
|
||||||
import org.apache.commons.lang3.Validate;
|
import org.apache.commons.lang3.Validate;
|
||||||
|
|
||||||
public class ODSOpenGlFrame implements Frame {
|
public class ODSOpenGlFrame implements Frame {
|
||||||
@Getter
|
|
||||||
private final CubicOpenGlFrame left, right;
|
private final CubicOpenGlFrame left, right;
|
||||||
|
|
||||||
public ODSOpenGlFrame(CubicOpenGlFrame left, CubicOpenGlFrame right) {
|
public ODSOpenGlFrame(CubicOpenGlFrame left, CubicOpenGlFrame right) {
|
||||||
@@ -18,4 +16,12 @@ public class ODSOpenGlFrame implements Frame {
|
|||||||
public int getFrameId() {
|
public int getFrameId() {
|
||||||
return left.getFrameId();
|
return left.getFrameId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CubicOpenGlFrame getLeft() {
|
||||||
|
return this.left;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CubicOpenGlFrame getRight() {
|
||||||
|
return this.right;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,19 +2,31 @@ package com.replaymod.render.frame;
|
|||||||
|
|
||||||
import com.replaymod.render.rendering.Frame;
|
import com.replaymod.render.rendering.Frame;
|
||||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class OpenGlFrame implements Frame {
|
public class OpenGlFrame implements Frame {
|
||||||
@Getter
|
|
||||||
private final int frameId;
|
private final int frameId;
|
||||||
|
|
||||||
@Getter
|
|
||||||
private final ReadableDimension size;
|
private final ReadableDimension size;
|
||||||
|
|
||||||
@Getter
|
|
||||||
private final ByteBuffer byteBuffer;
|
private final ByteBuffer byteBuffer;
|
||||||
|
|
||||||
|
public OpenGlFrame(int frameId, ReadableDimension size, ByteBuffer byteBuffer) {
|
||||||
|
this.frameId = frameId;
|
||||||
|
this.size = size;
|
||||||
|
this.byteBuffer = byteBuffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getFrameId() {
|
||||||
|
return this.frameId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReadableDimension getSize() {
|
||||||
|
return this.size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ByteBuffer getByteBuffer() {
|
||||||
|
return this.byteBuffer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,19 +2,15 @@ package com.replaymod.render.frame;
|
|||||||
|
|
||||||
import com.replaymod.render.rendering.Frame;
|
import com.replaymod.render.rendering.Frame;
|
||||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
||||||
import lombok.Getter;
|
|
||||||
import org.apache.commons.lang3.Validate;
|
import org.apache.commons.lang3.Validate;
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
|
||||||
public class RGBFrame implements Frame {
|
public class RGBFrame implements Frame {
|
||||||
@Getter
|
|
||||||
private final int frameId;
|
private final int frameId;
|
||||||
|
|
||||||
@Getter
|
|
||||||
private final ReadableDimension size;
|
private final ReadableDimension size;
|
||||||
|
|
||||||
@Getter
|
|
||||||
private final ByteBuffer byteBuffer;
|
private final ByteBuffer byteBuffer;
|
||||||
|
|
||||||
public RGBFrame(int frameId, ReadableDimension size, ByteBuffer byteBuffer) {
|
public RGBFrame(int frameId, ReadableDimension size, ByteBuffer byteBuffer) {
|
||||||
@@ -25,4 +21,16 @@ public class RGBFrame implements Frame {
|
|||||||
this.size = size;
|
this.size = size;
|
||||||
this.byteBuffer = byteBuffer;
|
this.byteBuffer = byteBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getFrameId() {
|
||||||
|
return this.frameId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReadableDimension getSize() {
|
||||||
|
return this.size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ByteBuffer getByteBuffer() {
|
||||||
|
return this.byteBuffer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
package com.replaymod.render.frame;
|
package com.replaymod.render.frame;
|
||||||
|
|
||||||
import com.replaymod.render.rendering.Frame;
|
import com.replaymod.render.rendering.Frame;
|
||||||
import lombok.Getter;
|
|
||||||
import org.apache.commons.lang3.Validate;
|
import org.apache.commons.lang3.Validate;
|
||||||
|
|
||||||
public class StereoscopicOpenGlFrame implements Frame {
|
public class StereoscopicOpenGlFrame implements Frame {
|
||||||
@Getter
|
|
||||||
private final OpenGlFrame left, right;
|
private final OpenGlFrame left, right;
|
||||||
|
|
||||||
public StereoscopicOpenGlFrame(OpenGlFrame left, OpenGlFrame right) {
|
public StereoscopicOpenGlFrame(OpenGlFrame left, OpenGlFrame right) {
|
||||||
@@ -19,4 +17,12 @@ public class StereoscopicOpenGlFrame implements Frame {
|
|||||||
public int getFrameId() {
|
public int getFrameId() {
|
||||||
return left.getFrameId();
|
return left.getFrameId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public OpenGlFrame getLeft() {
|
||||||
|
return this.left;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OpenGlFrame getRight() {
|
||||||
|
return this.right;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,11 +13,9 @@ import de.johni0702.minecraft.gui.element.GuiLabel;
|
|||||||
import de.johni0702.minecraft.gui.layout.CustomLayout;
|
import de.johni0702.minecraft.gui.layout.CustomLayout;
|
||||||
import de.johni0702.minecraft.gui.layout.HorizontalLayout;
|
import de.johni0702.minecraft.gui.layout.HorizontalLayout;
|
||||||
import de.johni0702.minecraft.gui.layout.VerticalLayout;
|
import de.johni0702.minecraft.gui.layout.VerticalLayout;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class GuiRenderingDone extends GuiScreen {
|
public class GuiRenderingDone extends GuiScreen {
|
||||||
public final ReplayModRender mod;
|
public final ReplayModRender mod;
|
||||||
public final File videoFile;
|
public final File videoFile;
|
||||||
@@ -72,6 +70,13 @@ public class GuiRenderingDone extends GuiScreen {
|
|||||||
setBackground(Background.DIRT);
|
setBackground(Background.DIRT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GuiRenderingDone(ReplayModRender mod, File videoFile, int videoFrames, RenderSettings settings) {
|
||||||
|
this.mod = mod;
|
||||||
|
this.videoFile = videoFile;
|
||||||
|
this.videoFrames = videoFrames;
|
||||||
|
this.settings = settings;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void display() {
|
public void display() {
|
||||||
if (mod.getCore().getSettingsRegistry().get(Setting.SKIP_POST_RENDER_GUI)) {
|
if (mod.getCore().getSettingsRegistry().get(Setting.SKIP_POST_RENDER_GUI)) {
|
||||||
|
|||||||
@@ -289,7 +289,7 @@ public class GuiVideoRenderer extends GuiScreen implements Tickable {
|
|||||||
buffer.get(); // alpha
|
buffer.get(); // alpha
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
int value = 0xff << 24 | b << 16 | g << 8 | r;
|
int value = 0xff << 24 | b << 16 | g << 8 | r;
|
||||||
data.setPixelRgba(x, y, value); // actually takes ABGR, not RGBA
|
data.setPixelColor(x, y, value); // actually takes ABGR, not RGBA
|
||||||
//#else
|
//#else
|
||||||
//$$ int value = 0xff << 24 | r << 16 | g << 8 | b;
|
//$$ int value = 0xff << 24 | r << 16 | g << 8 | b;
|
||||||
//$$ data[y * width + x] = value;
|
//$$ data[y * width + x] = value;
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import com.replaymod.render.capturer.CaptureData;
|
|||||||
import com.replaymod.render.capturer.RenderInfo;
|
import com.replaymod.render.capturer.RenderInfo;
|
||||||
import com.replaymod.render.capturer.WorldRenderer;
|
import com.replaymod.render.capturer.WorldRenderer;
|
||||||
import de.johni0702.minecraft.gui.utils.EventRegistrations;
|
import de.johni0702.minecraft.gui.utils.EventRegistrations;
|
||||||
import lombok.Getter;
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
|
|
||||||
//#if MC>=11500
|
//#if MC>=11500
|
||||||
@@ -30,10 +29,8 @@ import java.io.IOException;
|
|||||||
public class EntityRendererHandler extends EventRegistrations implements WorldRenderer {
|
public class EntityRendererHandler extends EventRegistrations implements WorldRenderer {
|
||||||
public final MinecraftClient mc = MCVer.getMinecraft();
|
public final MinecraftClient mc = MCVer.getMinecraft();
|
||||||
|
|
||||||
@Getter
|
|
||||||
protected final RenderSettings settings;
|
protected final RenderSettings settings;
|
||||||
|
|
||||||
@Getter
|
|
||||||
private final RenderInfo renderInfo;
|
private final RenderInfo renderInfo;
|
||||||
|
|
||||||
public CaptureData data;
|
public CaptureData data;
|
||||||
@@ -99,6 +96,14 @@ public class EntityRendererHandler extends EventRegistrations implements WorldRe
|
|||||||
this.omnidirectional = omnidirectional;
|
this.omnidirectional = omnidirectional;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public RenderSettings getSettings() {
|
||||||
|
return this.settings;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RenderInfo getRenderInfo() {
|
||||||
|
return this.renderInfo;
|
||||||
|
}
|
||||||
|
|
||||||
public interface IEntityRenderer {
|
public interface IEntityRenderer {
|
||||||
void replayModRender_setHandler(EntityRendererHandler handler);
|
void replayModRender_setHandler(EntityRendererHandler handler);
|
||||||
EntityRendererHandler replayModRender_getHandler();
|
EntityRendererHandler replayModRender_getHandler();
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import net.minecraft.util.hit.HitResult;
|
|||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
import net.minecraft.client.options.GameOptions;
|
import net.minecraft.client.options.GameOptions;
|
||||||
import net.minecraft.client.render.GameRenderer;
|
import net.minecraft.client.render.GameRenderer;
|
||||||
import net.minecraft.client.util.math.Matrix4f;
|
import net.minecraft.util.math.Matrix4f;
|
||||||
import net.minecraft.client.render.WorldRenderer;
|
import net.minecraft.client.render.WorldRenderer;
|
||||||
//#else
|
//#else
|
||||||
//$$ import com.replaymod.replay.camera.CameraEntity;
|
//$$ import com.replaymod.replay.camera.CameraEntity;
|
||||||
@@ -217,7 +217,7 @@ public abstract class MixinEntityRenderer implements EntityRendererHandler.IEnti
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
@Redirect(method = "method_22973", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/math/Matrix4f;viewboxMatrix(DFFF)Lnet/minecraft/client/util/math/Matrix4f;"))
|
@Redirect(method = "method_22973", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/Matrix4f;viewboxMatrix(DFFF)Lnet/minecraft/util/math/Matrix4f;"))
|
||||||
private Matrix4f replayModRender_perspective$0(double fovY, float aspect, float zNear, float zFar) {
|
private Matrix4f replayModRender_perspective$0(double fovY, float aspect, float zNear, float zFar) {
|
||||||
return replayModRender_perspective((float) fovY, aspect, zNear, zFar);
|
return replayModRender_perspective((float) fovY, aspect, zNear, zFar);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public abstract class MixinParticleManager {
|
|||||||
|
|
||||||
buildGeometry(particle, vertexConsumer, camera, partialTicks);
|
buildGeometry(particle, vertexConsumer, camera, partialTicks);
|
||||||
} finally {
|
} finally {
|
||||||
rotation.set(org.getA(), org.getB(), org.getC(), org.getD());
|
rotation.set(org.getW(), org.getX(), org.getY(), org.getZ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import com.replaymod.render.frame.CubicOpenGlFrame;
|
|||||||
import com.replaymod.render.frame.RGBFrame;
|
import com.replaymod.render.frame.RGBFrame;
|
||||||
import com.replaymod.render.utils.ByteBufferPool;
|
import com.replaymod.render.utils.ByteBufferPool;
|
||||||
import de.johni0702.minecraft.gui.utils.lwjgl.Dimension;
|
import de.johni0702.minecraft.gui.utils.lwjgl.Dimension;
|
||||||
import lombok.Getter;
|
|
||||||
import org.apache.commons.lang3.Validate;
|
import org.apache.commons.lang3.Validate;
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
@@ -19,7 +18,6 @@ public class EquirectangularToRGBProcessor extends AbstractFrameProcessor<CubicO
|
|||||||
private static final byte IMAGE_TOP = 4;
|
private static final byte IMAGE_TOP = 4;
|
||||||
private static final byte IMAGE_BOTTOM = 5;
|
private static final byte IMAGE_BOTTOM = 5;
|
||||||
|
|
||||||
@Getter
|
|
||||||
private final int frameSize;
|
private final int frameSize;
|
||||||
private final int width;
|
private final int width;
|
||||||
private final int height;
|
private final int height;
|
||||||
@@ -138,4 +136,8 @@ public class EquirectangularToRGBProcessor extends AbstractFrameProcessor<CubicO
|
|||||||
ByteBufferPool.release(rawFrame.getBottom().getByteBuffer());
|
ByteBufferPool.release(rawFrame.getBottom().getByteBuffer());
|
||||||
return new RGBFrame(rawFrame.getFrameId(), new Dimension(width, height), result);
|
return new RGBFrame(rawFrame.getFrameId(), new Dimension(width, height), result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getFrameSize() {
|
||||||
|
return frameSize;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.replaymod.render.rendering;
|
|||||||
|
|
||||||
import com.replaymod.core.mixin.MinecraftAccessor;
|
import com.replaymod.core.mixin.MinecraftAccessor;
|
||||||
import com.replaymod.core.versions.MCVer;
|
import com.replaymod.core.versions.MCVer;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.util.crash.CrashReport;
|
import net.minecraft.util.crash.CrashReport;
|
||||||
import net.minecraft.util.crash.CrashException;
|
import net.minecraft.util.crash.CrashException;
|
||||||
@@ -95,10 +94,13 @@ public class Pipeline<R extends Frame, P extends Frame> implements Runnable {
|
|||||||
abort = true;
|
abort = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
private class ProcessTask implements Runnable {
|
private class ProcessTask implements Runnable {
|
||||||
private final R rawFrame;
|
private final R rawFrame;
|
||||||
|
|
||||||
|
public ProcessTask(R rawFrame) {
|
||||||
|
this.rawFrame = rawFrame;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -23,11 +23,7 @@ import com.replaymod.render.processor.ODSToRGBProcessor;
|
|||||||
import com.replaymod.render.processor.OpenGlToRGBProcessor;
|
import com.replaymod.render.processor.OpenGlToRGBProcessor;
|
||||||
import com.replaymod.render.processor.StereoscopicToRGBProcessor;
|
import com.replaymod.render.processor.StereoscopicToRGBProcessor;
|
||||||
import com.replaymod.render.utils.PixelBufferObject;
|
import com.replaymod.render.utils.PixelBufferObject;
|
||||||
import lombok.experimental.UtilityClass;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
@UtilityClass
|
|
||||||
public class Pipelines {
|
public class Pipelines {
|
||||||
public static Pipeline newPipeline(RenderSettings.RenderMethod method, RenderInfo renderInfo, FrameConsumer<RGBFrame> consumer) {
|
public static Pipeline newPipeline(RenderSettings.RenderMethod method, RenderInfo renderInfo, FrameConsumer<RGBFrame> consumer) {
|
||||||
switch (method) {
|
switch (method) {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import net.minecraft.sound.SoundCategory;
|
|||||||
import net.minecraft.client.render.RenderTickCounter;
|
import net.minecraft.client.render.RenderTickCounter;
|
||||||
|
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=11500
|
//#if MC>=11500
|
||||||
@@ -167,7 +167,7 @@ public class VideoRenderer implements RenderInfo {
|
|||||||
//#endif
|
//#endif
|
||||||
while (replayTime < videoStart) {
|
while (replayTime < videoStart) {
|
||||||
//#if MC<11600
|
//#if MC<11600
|
||||||
timer.ticksThisFrame = 1;
|
//$$ timer.ticksThisFrame = 1;
|
||||||
//#endif
|
//#endif
|
||||||
replayTime += 50;
|
replayTime += 50;
|
||||||
replayHandler.getReplaySender().sendPacketsTill(replayTime);
|
replayHandler.getReplaySender().sendPacketsTill(replayTime);
|
||||||
@@ -235,7 +235,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();
|
RenderTickCounter timer = ((MinecraftAccessor) mc).getTimer();
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ int elapsedTicks =
|
int elapsedTicks =
|
||||||
//#endif
|
//#endif
|
||||||
timer.beginRenderTick(
|
timer.beginRenderTick(
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
@@ -243,7 +243,7 @@ public class VideoRenderer implements RenderInfo {
|
|||||||
//#endif
|
//#endif
|
||||||
);
|
);
|
||||||
//#if MC<11600
|
//#if MC<11600
|
||||||
int elapsedTicks = timer.ticksThisFrame;
|
//$$ int elapsedTicks = timer.ticksThisFrame;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
executeTaskQueue();
|
executeTaskQueue();
|
||||||
@@ -541,7 +541,7 @@ public class VideoRenderer implements RenderInfo {
|
|||||||
mc.currentScreen = gui.toMinecraft();
|
mc.currentScreen = gui.toMinecraft();
|
||||||
mc.overlay.render(
|
mc.overlay.render(
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ new MatrixStack(),
|
new MatrixStack(),
|
||||||
//#endif
|
//#endif
|
||||||
mouseX, mouseY, 0);
|
mouseX, mouseY, 0);
|
||||||
} finally {
|
} finally {
|
||||||
@@ -551,7 +551,7 @@ public class VideoRenderer implements RenderInfo {
|
|||||||
gui.toMinecraft().tick();
|
gui.toMinecraft().tick();
|
||||||
gui.toMinecraft().render(
|
gui.toMinecraft().render(
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ new MatrixStack(),
|
new MatrixStack(),
|
||||||
//#endif
|
//#endif
|
||||||
mouseX, mouseY, 0);
|
mouseX, mouseY, 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.replaymod.render.utils;
|
|||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
import com.replaymod.core.ReplayMod;
|
import com.replaymod.core.ReplayMod;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
@@ -25,13 +24,17 @@ import static org.lwjgl.opengl.ARBVertexBufferObject.*;
|
|||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
public class PixelBufferObject {
|
public class PixelBufferObject {
|
||||||
@RequiredArgsConstructor
|
|
||||||
public enum Usage {
|
public enum Usage {
|
||||||
COPY(GL_STREAM_COPY_ARB, GL_STREAM_COPY),
|
COPY(GL_STREAM_COPY_ARB, GL_STREAM_COPY),
|
||||||
DRAW(GL_STREAM_DRAW_ARB, GL_STREAM_DRAW),
|
DRAW(GL_STREAM_DRAW_ARB, GL_STREAM_DRAW),
|
||||||
READ(GL_STREAM_READ_ARB, GL_STREAM_READ);
|
READ(GL_STREAM_READ_ARB, GL_STREAM_READ);
|
||||||
|
|
||||||
private final int arb, gl15;
|
private final int arb, gl15;
|
||||||
|
|
||||||
|
Usage(int arb, int gl15) {
|
||||||
|
this.arb = arb;
|
||||||
|
this.gl15 = gl15;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
|
|||||||
@@ -2,11 +2,62 @@ package com.replaymod.render.utils;
|
|||||||
|
|
||||||
import com.replaymod.render.RenderSettings;
|
import com.replaymod.render.RenderSettings;
|
||||||
import com.replaymod.replaystudio.pathing.path.Timeline;
|
import com.replaymod.replaystudio.pathing.path.Timeline;
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
import java.util.Objects;
|
||||||
|
|
||||||
public class RenderJob {
|
public class RenderJob {
|
||||||
private String name;
|
private String name;
|
||||||
private Timeline timeline;
|
private Timeline timeline;
|
||||||
private RenderSettings settings;
|
private RenderSettings settings;
|
||||||
|
|
||||||
|
public RenderJob() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Timeline getTimeline() {
|
||||||
|
return this.timeline;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RenderSettings getSettings() {
|
||||||
|
return this.settings;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTimeline(Timeline timeline) {
|
||||||
|
this.timeline = timeline;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSettings(RenderSettings settings) {
|
||||||
|
this.settings = settings;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) return true;
|
||||||
|
if (o == null || getClass() != o.getClass()) return false;
|
||||||
|
RenderJob renderJob = (RenderJob) o;
|
||||||
|
return name.equals(renderJob.name) &&
|
||||||
|
timeline.equals(renderJob.timeline) &&
|
||||||
|
settings.equals(renderJob.settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(name, timeline, settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "RenderJob{" +
|
||||||
|
"name='" + name + '\'' +
|
||||||
|
", timeline=" + timeline +
|
||||||
|
", settings=" + settings +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ import net.minecraft.entity.Entity;
|
|||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.network.NetworkState;
|
import net.minecraft.network.NetworkState;
|
||||||
import net.minecraft.network.Packet;
|
import net.minecraft.network.Packet;
|
||||||
import net.minecraft.util.PacketByteBuf;
|
import net.minecraft.network.PacketByteBuf;
|
||||||
import net.minecraft.network.packet.s2c.play.ChatMessageS2CPacket;
|
import net.minecraft.network.packet.s2c.play.GameMessageS2CPacket;
|
||||||
import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket;
|
import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket;
|
||||||
import net.minecraft.network.packet.s2c.play.DisconnectS2CPacket;
|
import net.minecraft.network.packet.s2c.play.DisconnectS2CPacket;
|
||||||
import net.minecraft.network.packet.s2c.play.EntitiesDestroyS2CPacket;
|
import net.minecraft.network.packet.s2c.play.EntitiesDestroyS2CPacket;
|
||||||
@@ -37,10 +37,10 @@ import net.minecraft.network.packet.s2c.play.ExperienceBarUpdateS2CPacket;
|
|||||||
import net.minecraft.network.packet.s2c.play.ExperienceOrbSpawnS2CPacket;
|
import net.minecraft.network.packet.s2c.play.ExperienceOrbSpawnS2CPacket;
|
||||||
import net.minecraft.network.packet.s2c.play.GameJoinS2CPacket;
|
import net.minecraft.network.packet.s2c.play.GameJoinS2CPacket;
|
||||||
import net.minecraft.network.packet.s2c.play.GameStateChangeS2CPacket;
|
import net.minecraft.network.packet.s2c.play.GameStateChangeS2CPacket;
|
||||||
import net.minecraft.network.packet.s2c.play.CloseContainerS2CPacket;
|
import net.minecraft.network.packet.s2c.play.CloseScreenS2CPacket;
|
||||||
import net.minecraft.network.packet.s2c.play.OpenHorseContainerS2CPacket;
|
import net.minecraft.network.packet.s2c.play.OpenHorseScreenS2CPacket;
|
||||||
import net.minecraft.network.packet.s2c.play.ContainerSlotUpdateS2CPacket;
|
import net.minecraft.network.packet.s2c.play.ScreenHandlerSlotUpdateS2CPacket;
|
||||||
import net.minecraft.network.packet.s2c.play.ContainerPropertyUpdateS2CPacket;
|
import net.minecraft.network.packet.s2c.play.ScreenHandlerPropertyUpdateS2CPacket;
|
||||||
import net.minecraft.network.packet.s2c.play.HealthUpdateS2CPacket;
|
import net.minecraft.network.packet.s2c.play.HealthUpdateS2CPacket;
|
||||||
import net.minecraft.network.packet.s2c.login.LoginSuccessS2CPacket;
|
import net.minecraft.network.packet.s2c.login.LoginSuccessS2CPacket;
|
||||||
import net.minecraft.network.packet.s2c.play.MobSpawnS2CPacket;
|
import net.minecraft.network.packet.s2c.play.MobSpawnS2CPacket;
|
||||||
@@ -66,14 +66,14 @@ import de.johni0702.minecraft.gui.versions.callbacks.PreTickCallback;
|
|||||||
|
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//#else
|
//#else
|
||||||
import net.minecraft.network.packet.s2c.play.EntitySpawnGlobalS2CPacket;
|
//$$ import net.minecraft.network.packet.s2c.play.EntitySpawnGlobalS2CPacket;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
import com.replaymod.core.versions.MCVer;
|
import com.replaymod.core.versions.MCVer;
|
||||||
import net.minecraft.network.packet.s2c.play.ChunkDataS2CPacket;
|
import net.minecraft.network.packet.s2c.play.ChunkDataS2CPacket;
|
||||||
import net.minecraft.network.packet.s2c.play.PlayerActionResponseS2CPacket;
|
import net.minecraft.network.packet.s2c.play.PlayerActionResponseS2CPacket;
|
||||||
import net.minecraft.network.packet.s2c.play.OpenContainerS2CPacket;
|
import net.minecraft.network.packet.s2c.play.OpenScreenS2CPacket;
|
||||||
import net.minecraft.network.packet.s2c.play.OpenWrittenBookS2CPacket;
|
import net.minecraft.network.packet.s2c.play.OpenWrittenBookS2CPacket;
|
||||||
import net.minecraft.entity.EntityType;
|
import net.minecraft.entity.EntityType;
|
||||||
import net.minecraft.text.TranslatableText;
|
import net.minecraft.text.TranslatableText;
|
||||||
@@ -150,7 +150,7 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
//#endif
|
//#endif
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
OpenWrittenBookS2CPacket.class,
|
OpenWrittenBookS2CPacket.class,
|
||||||
OpenContainerS2CPacket.class,
|
OpenScreenS2CPacket.class,
|
||||||
//#endif
|
//#endif
|
||||||
//#if MC>=11200
|
//#if MC>=11200
|
||||||
SynchronizeRecipesS2CPacket.class,
|
SynchronizeRecipesS2CPacket.class,
|
||||||
@@ -162,10 +162,10 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
TitleS2CPacket.class,
|
TitleS2CPacket.class,
|
||||||
//#endif
|
//#endif
|
||||||
HealthUpdateS2CPacket.class,
|
HealthUpdateS2CPacket.class,
|
||||||
OpenHorseContainerS2CPacket.class,
|
OpenHorseScreenS2CPacket.class,
|
||||||
CloseContainerS2CPacket.class,
|
CloseScreenS2CPacket.class,
|
||||||
ContainerSlotUpdateS2CPacket.class,
|
ScreenHandlerSlotUpdateS2CPacket.class,
|
||||||
ContainerPropertyUpdateS2CPacket.class,
|
ScreenHandlerPropertyUpdateS2CPacket.class,
|
||||||
SignEditorOpenS2CPacket.class,
|
SignEditorOpenS2CPacket.class,
|
||||||
StatisticsS2CPacket.class,
|
StatisticsS2CPacket.class,
|
||||||
ExperienceBarUpdateS2CPacket.class,
|
ExperienceBarUpdateS2CPacket.class,
|
||||||
@@ -427,7 +427,7 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
|| p instanceof EntitySpawnS2CPacket
|
|| p instanceof EntitySpawnS2CPacket
|
||||||
|| p instanceof MobSpawnS2CPacket
|
|| p instanceof MobSpawnS2CPacket
|
||||||
//#if MC<11600
|
//#if MC<11600
|
||||||
|| p instanceof EntitySpawnGlobalS2CPacket
|
//$$ || p instanceof EntitySpawnGlobalS2CPacket
|
||||||
//#endif
|
//#endif
|
||||||
|| p instanceof PaintingSpawnS2CPacket
|
|| p instanceof PaintingSpawnS2CPacket
|
||||||
|| p instanceof ExperienceOrbSpawnS2CPacket
|
|| p instanceof ExperienceOrbSpawnS2CPacket
|
||||||
@@ -617,27 +617,27 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
entId,
|
entId,
|
||||||
GameMode.SPECTATOR,
|
GameMode.SPECTATOR,
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ GameMode.SPECTATOR,
|
GameMode.SPECTATOR,
|
||||||
//#endif
|
//#endif
|
||||||
//#if MC>=11500
|
//#if MC>=11500
|
||||||
packet.getSeed(),
|
packet.getSha256Seed(),
|
||||||
//#endif
|
//#endif
|
||||||
false,
|
false,
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ packet.method_29443(),
|
packet.method_29443(),
|
||||||
//#if MC>=11602
|
//#if MC>=11602
|
||||||
//$$ (net.minecraft.util.registry.DynamicRegistryManager.Impl) packet.getRegistryManager(),
|
(net.minecraft.util.registry.DynamicRegistryManager.Impl) packet.getRegistryManager(),
|
||||||
//#else
|
//#else
|
||||||
//$$ (net.minecraft.util.registry.RegistryTracker.Modifiable) packet.getDimension(),
|
//$$ (net.minecraft.util.registry.RegistryTracker.Modifiable) packet.getDimension(),
|
||||||
//#endif
|
//#endif
|
||||||
//$$ packet.method_29444(),
|
packet.method_29444(),
|
||||||
//$$ packet.getDimensionId(),
|
packet.getDimensionId(),
|
||||||
//#else
|
//#else
|
||||||
packet.getDimension(),
|
//$$ packet.getDimension(),
|
||||||
//#endif
|
//#endif
|
||||||
0, // max players (has no getter -> never actually used)
|
0, // max players (has no getter -> never actually used)
|
||||||
//#if MC<11600
|
//#if MC<11600
|
||||||
packet.getGeneratorType(),
|
//$$ packet.getGeneratorType(),
|
||||||
//#endif
|
//#endif
|
||||||
packet.getChunkLoadDistance(),
|
packet.getChunkLoadDistance(),
|
||||||
packet.hasReducedDebugInfo()
|
packet.hasReducedDebugInfo()
|
||||||
@@ -645,8 +645,8 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
, packet.showsDeathScreen()
|
, packet.showsDeathScreen()
|
||||||
//#endif
|
//#endif
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ , packet.isDebugWorld()
|
, packet.isDebugWorld()
|
||||||
//$$ , packet.isFlatWorld()
|
, packet.isFlatWorld()
|
||||||
//#endif
|
//#endif
|
||||||
);
|
);
|
||||||
//#else
|
//#else
|
||||||
@@ -688,21 +688,21 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
p = new PlayerRespawnS2CPacket(
|
p = new PlayerRespawnS2CPacket(
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ respawn.method_29445(),
|
respawn.method_29445(),
|
||||||
//#endif
|
//#endif
|
||||||
respawn.getDimension(),
|
respawn.getDimension(),
|
||||||
//#if MC>=11500
|
//#if MC>=11500
|
||||||
respawn.getSha256Seed(),
|
respawn.getSha256Seed(),
|
||||||
//#endif
|
//#endif
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ GameMode.SPECTATOR,
|
GameMode.SPECTATOR,
|
||||||
//$$ GameMode.SPECTATOR,
|
GameMode.SPECTATOR,
|
||||||
//$$ respawn.isDebugWorld(),
|
respawn.isDebugWorld(),
|
||||||
//$$ respawn.isFlatWorld(),
|
respawn.isFlatWorld(),
|
||||||
//$$ respawn.isWritingErrorSkippable()
|
respawn.isWritingErrorSkippable()
|
||||||
//#else
|
//#else
|
||||||
respawn.getGeneratorType(),
|
//$$ respawn.getGeneratorType(),
|
||||||
GameMode.SPECTATOR
|
//$$ GameMode.SPECTATOR
|
||||||
//#endif
|
//#endif
|
||||||
);
|
);
|
||||||
//#else
|
//#else
|
||||||
@@ -792,22 +792,22 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
// 8 - Fade time
|
// 8 - Fade time
|
||||||
if (!Arrays.asList(
|
if (!Arrays.asList(
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ GameStateChangeS2CPacket.RAIN_STARTED,
|
GameStateChangeS2CPacket.RAIN_STARTED,
|
||||||
//$$ GameStateChangeS2CPacket.RAIN_STOPPED,
|
GameStateChangeS2CPacket.RAIN_STOPPED,
|
||||||
//$$ GameStateChangeS2CPacket.RAIN_GRADIENT_CHANGED,
|
GameStateChangeS2CPacket.RAIN_GRADIENT_CHANGED,
|
||||||
//$$ GameStateChangeS2CPacket.THUNDER_GRADIENT_CHANGED
|
GameStateChangeS2CPacket.THUNDER_GRADIENT_CHANGED
|
||||||
//#else
|
//#else
|
||||||
1,
|
//$$ 1,
|
||||||
2,
|
//$$ 2,
|
||||||
7,
|
//$$ 7,
|
||||||
8
|
//$$ 8
|
||||||
//#endif
|
//#endif
|
||||||
).contains(pg.getReason())) {
|
).contains(pg.getReason())) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p instanceof ChatMessageS2CPacket) {
|
if (p instanceof GameMessageS2CPacket) {
|
||||||
if (!ReplayModReplay.instance.getCore().getSettingsRegistry().get(Setting.SHOW_CHAT)) {
|
if (!ReplayModReplay.instance.getCore().getSettingsRegistry().get(Setting.SHOW_CHAT)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,9 +47,9 @@ public class InputReplayTimer extends WrappedTimer {
|
|||||||
@Override
|
@Override
|
||||||
public
|
public
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ int
|
int
|
||||||
//#else
|
//#else
|
||||||
void
|
//$$ void
|
||||||
//#endif
|
//#endif
|
||||||
beginRenderTick(
|
beginRenderTick(
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
@@ -57,7 +57,7 @@ public class InputReplayTimer extends WrappedTimer {
|
|||||||
//#endif
|
//#endif
|
||||||
) {
|
) {
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ int ticksThisFrame =
|
int ticksThisFrame =
|
||||||
//#endif
|
//#endif
|
||||||
super.beginRenderTick(
|
super.beginRenderTick(
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
@@ -124,7 +124,7 @@ public class InputReplayTimer extends WrappedTimer {
|
|||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ return ticksThisFrame;
|
return ticksThisFrame;
|
||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,6 @@ import com.google.common.util.concurrent.SettableFuture;
|
|||||||
import com.replaymod.core.ReplayMod;
|
import com.replaymod.core.ReplayMod;
|
||||||
import com.replaymod.core.versions.MCVer;
|
import com.replaymod.core.versions.MCVer;
|
||||||
import de.johni0702.minecraft.gui.versions.Image;
|
import de.johni0702.minecraft.gui.versions.Image;
|
||||||
import lombok.AccessLevel;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import com.mojang.blaze3d.platform.GlStateManager;
|
import com.mojang.blaze3d.platform.GlStateManager;
|
||||||
import net.minecraft.client.util.ScreenshotUtils;
|
import net.minecraft.client.util.ScreenshotUtils;
|
||||||
@@ -26,13 +23,29 @@ import static com.replaymod.core.versions.MCVer.getWindow;
|
|||||||
//$$ import java.io.File;
|
//$$ import java.io.File;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
|
|
||||||
@Getter
|
|
||||||
public class NoGuiScreenshot {
|
public class NoGuiScreenshot {
|
||||||
private final Image image;
|
private final Image image;
|
||||||
private final int width;
|
private final int width;
|
||||||
private final int height;
|
private final int height;
|
||||||
|
|
||||||
|
private NoGuiScreenshot(Image image, int width, int height) {
|
||||||
|
this.image = image;
|
||||||
|
this.width = width;
|
||||||
|
this.height = height;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Image getImage() {
|
||||||
|
return image;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getWidth() {
|
||||||
|
return width;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getHeight() {
|
||||||
|
return height;
|
||||||
|
}
|
||||||
|
|
||||||
public static ListenableFuture<NoGuiScreenshot> take(final MinecraftClient mc, final int width, final int height) {
|
public static ListenableFuture<NoGuiScreenshot> take(final MinecraftClient mc, final int width, final int height) {
|
||||||
final SettableFuture<NoGuiScreenshot> future = SettableFuture.create();
|
final SettableFuture<NoGuiScreenshot> future = SettableFuture.create();
|
||||||
Runnable runnable = new Runnable() {
|
Runnable runnable = new Runnable() {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import net.minecraft.network.packet.s2c.play.PlayerRespawnS2CPacket;
|
|||||||
import net.minecraft.network.NetworkState;
|
import net.minecraft.network.NetworkState;
|
||||||
import net.minecraft.network.NetworkSide;
|
import net.minecraft.network.NetworkSide;
|
||||||
import net.minecraft.network.Packet;
|
import net.minecraft.network.Packet;
|
||||||
import net.minecraft.util.PacketByteBuf;
|
import net.minecraft.network.PacketByteBuf;
|
||||||
|
|
||||||
//#if FABRIC>=1
|
//#if FABRIC>=1
|
||||||
import de.johni0702.minecraft.gui.versions.callbacks.PreTickCallback;
|
import de.johni0702.minecraft.gui.versions.callbacks.PreTickCallback;
|
||||||
@@ -40,14 +40,14 @@ import java.util.Collections;
|
|||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
//#if MC>=11602
|
//#if MC>=11602
|
||||||
//$$ import net.minecraft.util.registry.DynamicRegistryManager;
|
import net.minecraft.util.registry.DynamicRegistryManager;
|
||||||
//$$ import net.minecraft.util.registry.Registry;
|
import net.minecraft.util.registry.Registry;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
//#else
|
//#else
|
||||||
import net.minecraft.world.level.LevelGeneratorType;
|
//$$ import net.minecraft.world.level.LevelGeneratorType;
|
||||||
//#endif
|
//#endif
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
import net.minecraft.world.dimension.DimensionType;
|
import net.minecraft.world.dimension.DimensionType;
|
||||||
@@ -201,31 +201,31 @@ public class QuickReplaySender extends ChannelHandlerAdapter implements ReplaySe
|
|||||||
ctx.fireChannelRead(new PlayerRespawnS2CPacket(
|
ctx.fireChannelRead(new PlayerRespawnS2CPacket(
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//#if MC>=11602
|
//#if MC>=11602
|
||||||
//$$ DimensionType.addRegistryDefaults(new DynamicRegistryManager.Impl()).get(Registry.DIMENSION_TYPE_KEY).get(DimensionType.OVERWORLD_REGISTRY_KEY),
|
DimensionType.addRegistryDefaults(new DynamicRegistryManager.Impl()).get(Registry.DIMENSION_TYPE_KEY).get(DimensionType.OVERWORLD_REGISTRY_KEY),
|
||||||
//#else
|
//#else
|
||||||
//$$ DimensionType.OVERWORLD_REGISTRY_KEY,
|
//$$ DimensionType.OVERWORLD_REGISTRY_KEY,
|
||||||
//#endif
|
//#endif
|
||||||
//$$ World.OVERWORLD,
|
World.OVERWORLD,
|
||||||
//$$ 0,
|
0,
|
||||||
//$$ GameMode.SPECTATOR,
|
GameMode.SPECTATOR,
|
||||||
//$$ GameMode.SPECTATOR,
|
GameMode.SPECTATOR,
|
||||||
//$$ false,
|
false,
|
||||||
//$$ false,
|
false,
|
||||||
//$$ false
|
false
|
||||||
//#else
|
//#else
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
DimensionType.OVERWORLD,
|
//$$ DimensionType.OVERWORLD,
|
||||||
//#else
|
//#else
|
||||||
//$$ 0,
|
//$$ 0,
|
||||||
//#endif
|
//#endif
|
||||||
//#if MC>=11500
|
//#if MC>=11500
|
||||||
0,
|
//$$ 0,
|
||||||
//#endif
|
//#endif
|
||||||
//#if MC<11400
|
//#if MC<11400
|
||||||
//$$ EnumDifficulty.NORMAL,
|
//$$ EnumDifficulty.NORMAL,
|
||||||
//#endif
|
//#endif
|
||||||
LevelGeneratorType.DEFAULT,
|
//$$ LevelGeneratorType.DEFAULT,
|
||||||
GameMode.SPECTATOR
|
//$$ GameMode.SPECTATOR
|
||||||
//#endif
|
//#endif
|
||||||
));
|
));
|
||||||
ctx.fireChannelRead(new PlayerPositionLookS2CPacket(0, 0, 0, 0, 0, Collections.emptySet(), 0));
|
ctx.fireChannelRead(new PlayerPositionLookS2CPacket(0, 0, 0, 0, 0, Collections.emptySet(), 0));
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ import net.minecraft.network.ClientConnection;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
//#if MC>=11500
|
//#if MC>=11600
|
||||||
//$$ import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=11500
|
//#if MC>=11500
|
||||||
@@ -644,10 +644,10 @@ public class ReplayHandler {
|
|||||||
resolution = newScaledResolution(mc);
|
resolution = newScaledResolution(mc);
|
||||||
guiScreen.toMinecraft().init(mc, resolution.getScaledWidth(), resolution.getScaledHeight());
|
guiScreen.toMinecraft().init(mc, resolution.getScaledWidth(), resolution.getScaledHeight());
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ guiScreen.toMinecraft().render(new MatrixStack(), 0, 0, 0);
|
guiScreen.toMinecraft().render(new MatrixStack(), 0, 0, 0);
|
||||||
//#else
|
//#else
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
guiScreen.toMinecraft().render(0, 0, 0);
|
//$$ guiScreen.toMinecraft().render(0, 0, 0);
|
||||||
//#else
|
//#else
|
||||||
//$$ guiScreen.toMinecraft().drawScreen(0, 0, 0);
|
//$$ guiScreen.toMinecraft().drawScreen(0, 0, 0);
|
||||||
//#endif
|
//#endif
|
||||||
|
|||||||
@@ -10,8 +10,6 @@ import com.replaymod.replay.ReplayModReplay;
|
|||||||
import com.replaymod.replay.Setting;
|
import com.replaymod.replay.Setting;
|
||||||
import com.replaymod.replay.mixin.FirstPersonRendererAccessor;
|
import com.replaymod.replay.mixin.FirstPersonRendererAccessor;
|
||||||
import com.replaymod.replaystudio.util.Location;
|
import com.replaymod.replaystudio.util.Location;
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.client.network.AbstractClientPlayerEntity;
|
import net.minecraft.client.network.AbstractClientPlayerEntity;
|
||||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||||
@@ -66,7 +64,7 @@ import net.minecraft.util.hit.HitResult;
|
|||||||
import net.minecraft.entity.EquipmentSlot;
|
import net.minecraft.entity.EquipmentSlot;
|
||||||
//#if MC>=11200
|
//#if MC>=11200
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
import net.minecraft.client.recipe.book.ClientRecipeBook;
|
import net.minecraft.client.recipebook.ClientRecipeBook;
|
||||||
//#else
|
//#else
|
||||||
//$$ import net.minecraft.stats.RecipeBook;
|
//$$ import net.minecraft.stats.RecipeBook;
|
||||||
//#endif
|
//#endif
|
||||||
@@ -105,8 +103,6 @@ public class CameraEntity
|
|||||||
*/
|
*/
|
||||||
public float roll;
|
public float roll;
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
private CameraController cameraController;
|
private CameraController cameraController;
|
||||||
|
|
||||||
private long lastControllerUpdate = System.currentTimeMillis();
|
private long lastControllerUpdate = System.currentTimeMillis();
|
||||||
@@ -154,8 +150,8 @@ public class CameraEntity
|
|||||||
, recipeBook
|
, recipeBook
|
||||||
//#endif
|
//#endif
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ , false
|
, false
|
||||||
//$$ , false
|
, false
|
||||||
//#endif
|
//#endif
|
||||||
);
|
);
|
||||||
eventHandler.register();
|
eventHandler.register();
|
||||||
@@ -166,6 +162,14 @@ public class CameraEntity
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CameraController getCameraController() {
|
||||||
|
return cameraController;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCameraController(CameraController cameraController) {
|
||||||
|
this.cameraController = cameraController;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Moves the camera by the specified delta.
|
* Moves the camera by the specified delta.
|
||||||
* @param x Delta in X direction
|
* @param x Delta in X direction
|
||||||
@@ -317,8 +321,8 @@ public class CameraEntity
|
|||||||
|
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
@Override
|
@Override
|
||||||
public boolean isInFluid(Tag<Fluid> fluid) {
|
public boolean isSubmergedIn(Tag<Fluid> fluid) {
|
||||||
return falseUnlessSpectating(entity -> entity.isInFluid(fluid));
|
return falseUnlessSpectating(entity -> entity.isSubmergedIn(fluid));
|
||||||
}
|
}
|
||||||
//#else
|
//#else
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
|
|||||||
@@ -34,32 +34,32 @@ public class ClassicCameraController implements CameraController {
|
|||||||
speedup = false;
|
speedup = false;
|
||||||
for(KeyBinding kb : getMinecraft().options.keysAll) {
|
for(KeyBinding kb : getMinecraft().options.keysAll) {
|
||||||
if(!kb.isPressed()) continue;
|
if(!kb.isPressed()) continue;
|
||||||
if(kb.getId().equals("key.forward")) {
|
if(kb.getTranslationKey().equals("key.forward")) {
|
||||||
forward = true;
|
forward = true;
|
||||||
speedup = true;
|
speedup = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(kb.getId().equals("key.back")) {
|
if(kb.getTranslationKey().equals("key.back")) {
|
||||||
backward = true;
|
backward = true;
|
||||||
speedup = true;
|
speedup = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(kb.getId().equals("key.jump")) {
|
if(kb.getTranslationKey().equals("key.jump")) {
|
||||||
up = true;
|
up = true;
|
||||||
speedup = true;
|
speedup = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(kb.getId().equals("key.left")) {
|
if(kb.getTranslationKey().equals("key.left")) {
|
||||||
left = true;
|
left = true;
|
||||||
speedup = true;
|
speedup = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(kb.getId().equals("key.right")) {
|
if(kb.getTranslationKey().equals("key.right")) {
|
||||||
right = true;
|
right = true;
|
||||||
speedup = true;
|
speedup = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(kb.getId().equals("key.sneak")) {
|
if(kb.getTranslationKey().equals("key.sneak")) {
|
||||||
down = true;
|
down = true;
|
||||||
speedup = true;
|
speedup = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.replaymod.replay.camera;
|
|||||||
|
|
||||||
import com.replaymod.replay.ReplayModReplay;
|
import com.replaymod.replay.ReplayModReplay;
|
||||||
import com.replaymod.replay.mixin.EntityPlayerAccessor;
|
import com.replaymod.replay.mixin.EntityPlayerAccessor;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.client.options.KeyBinding;
|
import net.minecraft.client.options.KeyBinding;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
@@ -21,10 +20,13 @@ import java.util.Arrays;
|
|||||||
|
|
||||||
import static com.replaymod.core.versions.MCVer.*;
|
import static com.replaymod.core.versions.MCVer.*;
|
||||||
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class SpectatorCameraController implements CameraController {
|
public class SpectatorCameraController implements CameraController {
|
||||||
private final CameraEntity camera;
|
private final CameraEntity camera;
|
||||||
|
|
||||||
|
public SpectatorCameraController(CameraEntity camera) {
|
||||||
|
this.camera = camera;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(float partialTicksPassed) {
|
public void update(float partialTicksPassed) {
|
||||||
MinecraftClient mc = getMinecraft();
|
MinecraftClient mc = getMinecraft();
|
||||||
|
|||||||
@@ -2,15 +2,19 @@
|
|||||||
//$$ package com.replaymod.replay.events;
|
//$$ package com.replaymod.replay.events;
|
||||||
//$$
|
//$$
|
||||||
//$$ import com.replaymod.replay.camera.CameraEntity;
|
//$$ import com.replaymod.replay.camera.CameraEntity;
|
||||||
//$$ import lombok.Getter;
|
|
||||||
//$$ import lombok.RequiredArgsConstructor;
|
|
||||||
//$$ import net.minecraftforge.eventbus.api.Cancelable;
|
//$$ import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
//$$ import net.minecraftforge.eventbus.api.Event;
|
//$$ import net.minecraftforge.eventbus.api.Event;
|
||||||
//$$
|
//$$
|
||||||
//$$ @Cancelable
|
//$$ @Cancelable
|
||||||
//$$ @RequiredArgsConstructor
|
|
||||||
//$$ public class ReplayChatMessageEvent extends Event {
|
//$$ public class ReplayChatMessageEvent extends Event {
|
||||||
//$$ @Getter
|
|
||||||
//$$ private final CameraEntity cameraEntity;
|
//$$ private final CameraEntity cameraEntity;
|
||||||
|
//$$
|
||||||
|
//$$ public ReplayChatMessageEvent(CameraEntity cameraEntity) {
|
||||||
|
//$$ this.cameraEntity = cameraEntity;
|
||||||
|
//$$ }
|
||||||
|
//$$
|
||||||
|
//$$ public CameraEntity getCameraEntity() {
|
||||||
|
//$$ return cameraEntity;
|
||||||
|
//$$ }
|
||||||
//$$ }
|
//$$ }
|
||||||
//#endif
|
//#endif
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ import de.johni0702.minecraft.gui.utils.Consumer;
|
|||||||
import de.johni0702.minecraft.gui.utils.lwjgl.Dimension;
|
import de.johni0702.minecraft.gui.utils.lwjgl.Dimension;
|
||||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
||||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadablePoint;
|
import de.johni0702.minecraft.gui.utils.lwjgl.ReadablePoint;
|
||||||
import lombok.Getter;
|
|
||||||
import net.minecraft.client.gui.screen.NoticeScreen;
|
import net.minecraft.client.gui.screen.NoticeScreen;
|
||||||
import net.minecraft.util.crash.CrashReport;
|
import net.minecraft.util.crash.CrashReport;
|
||||||
import net.minecraft.util.crash.CrashException;
|
import net.minecraft.util.crash.CrashException;
|
||||||
@@ -252,16 +251,12 @@ public class GuiReplayViewer extends GuiScreen {
|
|||||||
return popup;
|
return popup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Getter
|
|
||||||
private final SettableFuture<File> future = SettableFuture.create();
|
private final SettableFuture<File> future = SettableFuture.create();
|
||||||
|
|
||||||
@Getter
|
|
||||||
private final GuiReplayList list = new GuiReplayList(popup);
|
private final GuiReplayList list = new GuiReplayList(popup);
|
||||||
|
|
||||||
@Getter
|
|
||||||
private final GuiButton acceptButton = new GuiButton(popup).setI18nLabel("gui.done").setSize(50, 20).setDisabled();
|
private final GuiButton acceptButton = new GuiButton(popup).setI18nLabel("gui.done").setSize(50, 20).setDisabled();
|
||||||
|
|
||||||
@Getter
|
|
||||||
private final GuiButton cancelButton = new GuiButton(popup).setI18nLabel("gui.cancel").setSize(50, 20);
|
private final GuiButton cancelButton = new GuiButton(popup).setI18nLabel("gui.cancel").setSize(50, 20);
|
||||||
|
|
||||||
|
|
||||||
@@ -301,6 +296,22 @@ public class GuiReplayViewer extends GuiScreen {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SettableFuture<File> getFuture() {
|
||||||
|
return future;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuiReplayList getList() {
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuiButton getAcceptButton() {
|
||||||
|
return acceptButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuiButton getCancelButton() {
|
||||||
|
return cancelButton;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected GuiSelectReplayPopup getThis() {
|
protected GuiSelectReplayPopup getThis() {
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ import net.minecraft.client.gui.widget.AbstractButtonWidget;
|
|||||||
import net.minecraft.client.resource.language.I18n;
|
import net.minecraft.client.resource.language.I18n;
|
||||||
|
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
//$$ import net.minecraft.text.TranslatableText;
|
import net.minecraft.text.TranslatableText;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if FABRIC>=1
|
//#if FABRIC>=1
|
||||||
@@ -62,18 +62,18 @@ public class GuiHandler extends EventRegistrations {
|
|||||||
mod.getReplayHandler().getReplaySender().setReplaySpeed(0);
|
mod.getReplayHandler().getReplaySender().setReplaySpeed(0);
|
||||||
|
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ final TranslatableText BUTTON_OPTIONS = new TranslatableText("menu.options");
|
final TranslatableText BUTTON_OPTIONS = new TranslatableText("menu.options");
|
||||||
//$$ final TranslatableText BUTTON_EXIT_SERVER = new TranslatableText("menu.disconnect");
|
final TranslatableText BUTTON_EXIT_SERVER = new TranslatableText("menu.disconnect");
|
||||||
//$$ final TranslatableText BUTTON_ADVANCEMENTS = new TranslatableText("gui.advancements");
|
final TranslatableText BUTTON_ADVANCEMENTS = new TranslatableText("gui.advancements");
|
||||||
//$$ final TranslatableText BUTTON_STATS = new TranslatableText("gui.stats");
|
final TranslatableText BUTTON_STATS = new TranslatableText("gui.stats");
|
||||||
//$$ final TranslatableText BUTTON_OPEN_TO_LAN = new TranslatableText("menu.shareToLan");
|
final TranslatableText BUTTON_OPEN_TO_LAN = new TranslatableText("menu.shareToLan");
|
||||||
//#else
|
//#else
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
final String BUTTON_OPTIONS = I18n.translate("menu.options");
|
//$$ final String BUTTON_OPTIONS = I18n.translate("menu.options");
|
||||||
final String BUTTON_EXIT_SERVER = I18n.translate("menu.disconnect");
|
//$$ final String BUTTON_EXIT_SERVER = I18n.translate("menu.disconnect");
|
||||||
final String BUTTON_ADVANCEMENTS = I18n.translate("gui.advancements");
|
//$$ final String BUTTON_ADVANCEMENTS = I18n.translate("gui.advancements");
|
||||||
final String BUTTON_STATS = I18n.translate("gui.stats");
|
//$$ final String BUTTON_STATS = I18n.translate("gui.stats");
|
||||||
final String BUTTON_OPEN_TO_LAN = I18n.translate("menu.shareToLan");
|
//$$ final String BUTTON_OPEN_TO_LAN = I18n.translate("menu.shareToLan");
|
||||||
//#else
|
//#else
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
//$$ final int BUTTON_OPTIONS = 0;
|
//$$ final int BUTTON_OPTIONS = 0;
|
||||||
@@ -99,9 +99,9 @@ public class GuiHandler extends EventRegistrations {
|
|||||||
boolean remove = false;
|
boolean remove = false;
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ Text id = b.getMessage();
|
Text id = b.getMessage();
|
||||||
//#else
|
//#else
|
||||||
String id = b.getMessage();
|
//$$ String id = b.getMessage();
|
||||||
//#endif
|
//#endif
|
||||||
if (id == null) {
|
if (id == null) {
|
||||||
// likely a button of some third-part mod
|
// likely a button of some third-part mod
|
||||||
@@ -301,9 +301,9 @@ public class GuiHandler extends EventRegistrations {
|
|||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ new TranslatableText(buttonText)
|
new TranslatableText(buttonText)
|
||||||
//#else
|
//#else
|
||||||
I18n.translate(buttonText)
|
//$$ I18n.translate(buttonText)
|
||||||
//#endif
|
//#endif
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
, self -> onClick.accept((InjectedButton) self)
|
, self -> onClick.accept((InjectedButton) self)
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ import net.minecraft.client.world.ClientWorld;
|
import net.minecraft.client.world.ClientWorld;
|
||||||
//#else
|
//#else
|
||||||
import net.minecraft.world.World;
|
//$$ import net.minecraft.world.World;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
import java.util.Queue;
|
import java.util.Queue;
|
||||||
@@ -37,9 +37,9 @@ public abstract class MixinParticleManager {
|
|||||||
@Inject(method = "setWorld", at = @At("HEAD"))
|
@Inject(method = "setWorld", at = @At("HEAD"))
|
||||||
public void replayModReplay_clearParticleQueue(
|
public void replayModReplay_clearParticleQueue(
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ ClientWorld world,
|
ClientWorld world,
|
||||||
//#else
|
//#else
|
||||||
World world,
|
//$$ World world,
|
||||||
//#endif
|
//#endif
|
||||||
CallbackInfo ci) {
|
CallbackInfo ci) {
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import net.minecraft.client.world.ClientWorld;
|
|||||||
|
|
||||||
//#if MC>=11200
|
//#if MC>=11200
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
import net.minecraft.client.recipe.book.ClientRecipeBook;
|
import net.minecraft.client.recipebook.ClientRecipeBook;
|
||||||
//#else
|
//#else
|
||||||
//$$ import net.minecraft.stats.RecipeBook;
|
//$$ import net.minecraft.stats.RecipeBook;
|
||||||
//#endif
|
//#endif
|
||||||
@@ -52,9 +52,9 @@ public abstract class MixinPlayerControllerMP {
|
|||||||
|
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
//#if MC>=11602
|
//#if MC>=11602
|
||||||
//$$ @Inject(method = "createPlayer(Lnet/minecraft/client/world/ClientWorld;Lnet/minecraft/stat/StatHandler;Lnet/minecraft/client/recipebook/ClientRecipeBook;ZZ)Lnet/minecraft/client/network/ClientPlayerEntity;", at=@At("HEAD"), cancellable = true)
|
@Inject(method = "createPlayer(Lnet/minecraft/client/world/ClientWorld;Lnet/minecraft/stat/StatHandler;Lnet/minecraft/client/recipebook/ClientRecipeBook;ZZ)Lnet/minecraft/client/network/ClientPlayerEntity;", at=@At("HEAD"), cancellable = true)
|
||||||
//#else
|
//#else
|
||||||
@Inject(method = "createPlayer", at=@At("HEAD"), cancellable = true)
|
//$$ @Inject(method = "createPlayer", at=@At("HEAD"), cancellable = true)
|
||||||
//#endif
|
//#endif
|
||||||
private void replayModReplay_createReplayCamera(
|
private void replayModReplay_createReplayCamera(
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
@@ -65,8 +65,8 @@ public abstract class MixinPlayerControllerMP {
|
|||||||
StatHandler statisticsManager,
|
StatHandler statisticsManager,
|
||||||
ClientRecipeBook recipeBookClient,
|
ClientRecipeBook recipeBookClient,
|
||||||
//#if MC>=11600
|
//#if MC>=11600
|
||||||
//$$ boolean lastIsHoldingSneakKey,
|
boolean lastIsHoldingSneakKey,
|
||||||
//$$ boolean lastSprinting,
|
boolean lastSprinting,
|
||||||
//#endif
|
//#endif
|
||||||
CallbackInfoReturnable<ClientPlayerEntity> ci
|
CallbackInfoReturnable<ClientPlayerEntity> ci
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -4,26 +4,31 @@ import com.replaymod.replaystudio.pathing.interpolation.CatmullRomSplineInterpol
|
|||||||
import com.replaymod.replaystudio.pathing.interpolation.CubicSplineInterpolator;
|
import com.replaymod.replaystudio.pathing.interpolation.CubicSplineInterpolator;
|
||||||
import com.replaymod.replaystudio.pathing.interpolation.Interpolator;
|
import com.replaymod.replaystudio.pathing.interpolation.Interpolator;
|
||||||
import com.replaymod.replaystudio.pathing.interpolation.LinearInterpolator;
|
import com.replaymod.replaystudio.pathing.interpolation.LinearInterpolator;
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
@AllArgsConstructor
|
|
||||||
public enum InterpolatorType {
|
public enum InterpolatorType {
|
||||||
DEFAULT("default", null, null),
|
DEFAULT("default", null, null),
|
||||||
CATMULL_ROM("catmullrom", CatmullRomSplineInterpolator.class, () -> new CatmullRomSplineInterpolator(0.5)),
|
CATMULL_ROM("catmullrom", CatmullRomSplineInterpolator.class, () -> new CatmullRomSplineInterpolator(0.5)),
|
||||||
CUBIC("cubic", CubicSplineInterpolator.class, CubicSplineInterpolator::new),
|
CUBIC("cubic", CubicSplineInterpolator.class, CubicSplineInterpolator::new),
|
||||||
LINEAR("linear", LinearInterpolator.class, LinearInterpolator::new);
|
LINEAR("linear", LinearInterpolator.class, LinearInterpolator::new);
|
||||||
|
|
||||||
@Getter
|
|
||||||
private String localizationKey;
|
private String localizationKey;
|
||||||
|
|
||||||
@Getter
|
|
||||||
private Class<? extends Interpolator> interpolatorClass;
|
private Class<? extends Interpolator> interpolatorClass;
|
||||||
|
|
||||||
private Supplier<Interpolator> interpolatorConstructor;
|
private Supplier<Interpolator> interpolatorConstructor;
|
||||||
|
|
||||||
|
InterpolatorType(String localizationKey, Class<? extends Interpolator> interpolatorClass, Supplier<Interpolator> interpolatorConstructor) {
|
||||||
|
this.localizationKey = localizationKey;
|
||||||
|
this.interpolatorClass = interpolatorClass;
|
||||||
|
this.interpolatorConstructor = interpolatorConstructor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLocalizationKey() {
|
||||||
|
return localizationKey;
|
||||||
|
}
|
||||||
|
|
||||||
public String getI18nName() {
|
public String getI18nName() {
|
||||||
return String.format("replaymod.gui.editkeyframe.interpolator.%1$s.name", localizationKey);
|
return String.format("replaymod.gui.editkeyframe.interpolator.%1$s.name", localizationKey);
|
||||||
}
|
}
|
||||||
@@ -32,6 +37,10 @@ public enum InterpolatorType {
|
|||||||
return String.format("replaymod.gui.editkeyframe.interpolator.%1$s.desc", localizationKey);
|
return String.format("replaymod.gui.editkeyframe.interpolator.%1$s.desc", localizationKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Class<? extends Interpolator> getInterpolatorClass() {
|
||||||
|
return interpolatorClass;
|
||||||
|
}
|
||||||
|
|
||||||
public static InterpolatorType fromString(String string) {
|
public static InterpolatorType fromString(String string) {
|
||||||
for (InterpolatorType t : values()) {
|
for (InterpolatorType t : values()) {
|
||||||
if (t.getI18nName().equals(string)) return t;
|
if (t.getI18nName().equals(string)) return t;
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import com.replaymod.replaystudio.replay.ReplayFile;
|
|||||||
import com.replaymod.simplepathing.SPTimeline.SPPath;
|
import com.replaymod.simplepathing.SPTimeline.SPPath;
|
||||||
import com.replaymod.simplepathing.gui.GuiPathing;
|
import com.replaymod.simplepathing.gui.GuiPathing;
|
||||||
import com.replaymod.simplepathing.preview.PathPreview;
|
import com.replaymod.simplepathing.preview.PathPreview;
|
||||||
import lombok.Getter;
|
|
||||||
import net.minecraft.util.crash.CrashReport;
|
import net.minecraft.util.crash.CrashReport;
|
||||||
import net.minecraft.util.crash.CrashException;
|
import net.minecraft.util.crash.CrashException;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
@@ -149,7 +148,6 @@ public class ReplayModSimplePathing extends EventRegistrations implements Module
|
|||||||
private SPTimeline currentTimeline;
|
private SPTimeline currentTimeline;
|
||||||
|
|
||||||
private SPPath selectedPath;
|
private SPPath selectedPath;
|
||||||
@Getter
|
|
||||||
private long selectedTime;
|
private long selectedTime;
|
||||||
|
|
||||||
public SPPath getSelectedPath() {
|
public SPPath getSelectedPath() {
|
||||||
@@ -160,6 +158,10 @@ public class ReplayModSimplePathing extends EventRegistrations implements Module
|
|||||||
return selectedPath;
|
return selectedPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long getSelectedTime() {
|
||||||
|
return selectedTime;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isSelected(Keyframe keyframe) {
|
public boolean isSelected(Keyframe keyframe) {
|
||||||
return getSelectedPath() != null && currentTimeline.getKeyframe(selectedPath, selectedTime) == keyframe;
|
return getSelectedPath() != null && currentTimeline.getKeyframe(selectedPath, selectedTime) == keyframe;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ import com.replaymod.replaystudio.pathing.property.Property;
|
|||||||
import com.replaymod.replaystudio.util.EntityPositionTracker;
|
import com.replaymod.replaystudio.util.EntityPositionTracker;
|
||||||
import com.replaymod.replaystudio.util.Location;
|
import com.replaymod.replaystudio.util.Location;
|
||||||
import com.replaymod.simplepathing.properties.ExplicitInterpolationProperty;
|
import com.replaymod.simplepathing.properties.ExplicitInterpolationProperty;
|
||||||
import lombok.Getter;
|
|
||||||
import net.minecraft.util.crash.CrashReport;
|
import net.minecraft.util.crash.CrashReport;
|
||||||
import net.minecraft.util.crash.CrashReportSection;
|
import net.minecraft.util.crash.CrashReportSection;
|
||||||
import net.minecraft.util.crash.CrashException;
|
import net.minecraft.util.crash.CrashException;
|
||||||
@@ -63,14 +62,10 @@ public class SPTimeline implements PathingRegistry {
|
|||||||
POSITION,
|
POSITION,
|
||||||
}
|
}
|
||||||
|
|
||||||
@Getter
|
|
||||||
private final Timeline timeline;
|
private final Timeline timeline;
|
||||||
@Getter
|
|
||||||
private final Path timePath;
|
private final Path timePath;
|
||||||
@Getter
|
|
||||||
private final Path positionPath;
|
private final Path positionPath;
|
||||||
|
|
||||||
@Getter
|
|
||||||
private EntityPositionTracker entityTracker;
|
private EntityPositionTracker entityTracker;
|
||||||
private InterpolatorType defaultInterpolatorType;
|
private InterpolatorType defaultInterpolatorType;
|
||||||
|
|
||||||
@@ -84,6 +79,22 @@ public class SPTimeline implements PathingRegistry {
|
|||||||
this.positionPath = timeline.getPaths().get(SPPath.POSITION.ordinal());
|
this.positionPath = timeline.getPaths().get(SPPath.POSITION.ordinal());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Timeline getTimeline() {
|
||||||
|
return timeline;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Path getTimePath() {
|
||||||
|
return timePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Path getPositionPath() {
|
||||||
|
return positionPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityPositionTracker getEntityTracker() {
|
||||||
|
return entityTracker;
|
||||||
|
}
|
||||||
|
|
||||||
public Path getPath(SPPath path) {
|
public Path getPath(SPPath path) {
|
||||||
switch (path) {
|
switch (path) {
|
||||||
case TIME:
|
case TIME:
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ import de.johni0702.minecraft.gui.popup.AbstractGuiPopup;
|
|||||||
import de.johni0702.minecraft.gui.utils.Colors;
|
import de.johni0702.minecraft.gui.utils.Colors;
|
||||||
import de.johni0702.minecraft.gui.utils.Consumer;
|
import de.johni0702.minecraft.gui.utils.Consumer;
|
||||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadablePoint;
|
import de.johni0702.minecraft.gui.utils.lwjgl.ReadablePoint;
|
||||||
import lombok.Getter;
|
|
||||||
import net.minecraft.client.resource.language.I18n;
|
import net.minecraft.client.resource.language.I18n;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
@@ -283,7 +282,6 @@ public abstract class GuiEditKeyframe<T extends GuiEditKeyframe<T>> extends Abst
|
|||||||
|
|
||||||
public class InterpolationPanel extends AbstractGuiContainer<InterpolationPanel> {
|
public class InterpolationPanel extends AbstractGuiContainer<InterpolationPanel> {
|
||||||
|
|
||||||
@Getter
|
|
||||||
private SettingsPanel settingsPanel;
|
private SettingsPanel settingsPanel;
|
||||||
|
|
||||||
private GuiDropdownMenu<InterpolatorType> dropdown;
|
private GuiDropdownMenu<InterpolatorType> dropdown;
|
||||||
@@ -330,6 +328,10 @@ public abstract class GuiEditKeyframe<T extends GuiEditKeyframe<T>> extends Abst
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SettingsPanel getSettingsPanel() {
|
||||||
|
return settingsPanel;
|
||||||
|
}
|
||||||
|
|
||||||
public void setSettingsPanel(InterpolatorType type) {
|
public void setSettingsPanel(InterpolatorType type) {
|
||||||
removeElement(this.settingsPanel);
|
removeElement(this.settingsPanel);
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import com.google.gson.stream.JsonReader;
|
|||||||
import com.google.gson.stream.JsonWriter;
|
import com.google.gson.stream.JsonWriter;
|
||||||
import com.replaymod.replaystudio.pathing.property.AbstractProperty;
|
import com.replaymod.replaystudio.pathing.property.AbstractProperty;
|
||||||
import com.replaymod.replaystudio.pathing.property.PropertyPart;
|
import com.replaymod.replaystudio.pathing.property.PropertyPart;
|
||||||
import lombok.NonNull;
|
import de.johni0702.minecraft.gui.utils.NonNull;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
"AbstractButtonWidgetAccessor",
|
"AbstractButtonWidgetAccessor",
|
||||||
"Mixin_ContextualKeyBindings",
|
"Mixin_ContextualKeyBindings",
|
||||||
"MixinGameRenderer",
|
"MixinGameRenderer",
|
||||||
"MixinModResourcePackUtil",
|
"Mixin_HideDynamicResourcePacks",
|
||||||
|
"Mixin_RegisterDynamicResourcePacks",
|
||||||
//#endif
|
//#endif
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
"MixinKeyboardListener",
|
"MixinKeyboardListener",
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
2.4.3
|
2.4.4
|
||||||
|
|||||||
@@ -217,7 +217,6 @@ def shadeExclusions = {
|
|||||||
exclude group: 'com.google.guava', module: 'guava-jdk5'
|
exclude group: 'com.google.guava', module: 'guava-jdk5'
|
||||||
exclude group: 'com.google.guava', module: 'guava' // provided by MC
|
exclude group: 'com.google.guava', module: 'guava' // provided by MC
|
||||||
exclude group: 'com.google.code.gson', module: 'gson' // provided by MC
|
exclude group: 'com.google.code.gson', module: 'gson' // provided by MC
|
||||||
exclude group: 'org.projectlombok', module: 'lombok' // runtime only for @SneakyThrows which isn't used
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
@@ -300,7 +299,6 @@ dependencies {
|
|||||||
|
|
||||||
implementation(jGui){
|
implementation(jGui){
|
||||||
transitive = false // FG 1.2 puts all MC deps into the compile configuration and we don't want to shade those
|
transitive = false // FG 1.2 puts all MC deps into the compile configuration and we don't want to shade those
|
||||||
exclude group: 'org.projectlombok', module: 'lombok' // runtime only for @SneakyThrows which isn't used
|
|
||||||
}
|
}
|
||||||
shadow 'com.github.ReplayMod:lwjgl-utils:27dcd66'
|
shadow 'com.github.ReplayMod:lwjgl-utils:27dcd66'
|
||||||
|
|
||||||
@@ -315,9 +313,6 @@ dependencies {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
annotationProcessor 'org.projectlombok:lombok:1.18.12'
|
|
||||||
compile 'org.projectlombok:lombok:1.18.12' // runtime only for @SneakyThrows which isn't used
|
|
||||||
|
|
||||||
testCompile 'junit:junit:4.11'
|
testCompile 'junit:junit:4.11'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
1.15.2
|
1.16.2
|
||||||
Reference in New Issue
Block a user