Complete all currently actionable 1.13.2 FIXMEs
This commit is contained in:
2
jGui
2
jGui
Submodule jGui updated: fe5d344be4...31fecfa0d6
@@ -1,13 +1,13 @@
|
|||||||
/* FIXME
|
|
||||||
package com.replaymod.core;
|
package com.replaymod.core;
|
||||||
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
//#if MC<11300
|
||||||
import org.spongepowered.asm.launch.MixinBootstrap;
|
//$$ import org.apache.logging.log4j.LogManager;
|
||||||
import org.spongepowered.asm.mixin.Mixins;
|
//$$ import org.spongepowered.asm.launch.MixinBootstrap;
|
||||||
|
//$$ import org.spongepowered.asm.mixin.Mixins;
|
||||||
|
//$$
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
import net.minecraftforge.fml.relauncher.CoreModManager;
|
//$$ import net.minecraftforge.fml.relauncher.CoreModManager;
|
||||||
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
|
//$$ import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
|
||||||
//#else
|
//#else
|
||||||
//$$ import com.replaymod.core.asm.GLErrorTransformer;
|
//$$ import com.replaymod.core.asm.GLErrorTransformer;
|
||||||
//$$ import com.replaymod.core.asm.GLStateTrackerTransformer;
|
//$$ import com.replaymod.core.asm.GLStateTrackerTransformer;
|
||||||
@@ -17,56 +17,56 @@ import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
|
|||||||
//$$ import java.util.ArrayList;
|
//$$ import java.util.ArrayList;
|
||||||
//$$ import java.util.List;
|
//$$ import java.util.List;
|
||||||
//#endif
|
//#endif
|
||||||
|
//$$
|
||||||
import java.io.File;
|
//$$ import java.io.File;
|
||||||
import java.net.URISyntaxException;
|
//$$ import java.net.URISyntaxException;
|
||||||
import java.net.URL;
|
//$$ import java.net.URL;
|
||||||
import java.security.CodeSource;
|
//$$ import java.security.CodeSource;
|
||||||
import java.util.Map;
|
//$$ import java.util.Map;
|
||||||
|
//$$
|
||||||
@IFMLLoadingPlugin.TransformerExclusions("com.replaymod.core.asm.")
|
//$$ @IFMLLoadingPlugin.TransformerExclusions("com.replaymod.core.asm.")
|
||||||
public class LoadingPlugin implements IFMLLoadingPlugin {
|
//$$ public class LoadingPlugin implements IFMLLoadingPlugin {
|
||||||
|
//$$
|
||||||
public LoadingPlugin() {
|
//$$ public LoadingPlugin() {
|
||||||
MixinBootstrap.init();
|
//$$ MixinBootstrap.init();
|
||||||
Mixins.addConfiguration("mixins.recording.replaymod.json");
|
//$$ Mixins.addConfiguration("mixins.recording.replaymod.json");
|
||||||
Mixins.addConfiguration("mixins.render.replaymod.json");
|
//$$ Mixins.addConfiguration("mixins.render.replaymod.json");
|
||||||
Mixins.addConfiguration("mixins.replay.replaymod.json");
|
//$$ Mixins.addConfiguration("mixins.replay.replaymod.json");
|
||||||
Mixins.addConfiguration("mixins.compat.mapwriter.replaymod.json");
|
//$$ Mixins.addConfiguration("mixins.compat.mapwriter.replaymod.json");
|
||||||
Mixins.addConfiguration("mixins.compat.shaders.replaymod.json");
|
//$$ Mixins.addConfiguration("mixins.compat.shaders.replaymod.json");
|
||||||
Mixins.addConfiguration("mixins.extras.playeroverview.replaymod.json");
|
//$$ Mixins.addConfiguration("mixins.extras.playeroverview.replaymod.json");
|
||||||
|
//$$
|
||||||
CodeSource codeSource = getClass().getProtectionDomain().getCodeSource();
|
//$$ CodeSource codeSource = getClass().getProtectionDomain().getCodeSource();
|
||||||
if (codeSource != null) {
|
//$$ if (codeSource != null) {
|
||||||
URL location = codeSource.getLocation();
|
//$$ URL location = codeSource.getLocation();
|
||||||
try {
|
//$$ try {
|
||||||
File file = new File(location.toURI());
|
//$$ File file = new File(location.toURI());
|
||||||
if (file.isFile()) {
|
//$$ if (file.isFile()) {
|
||||||
// This forces forge to reexamine the jar file for FML mods
|
//$$ // This forces forge to reexamine the jar file for FML mods
|
||||||
// Should eventually be handled by Mixin itself, maybe?
|
//$$ // Should eventually be handled by Mixin itself, maybe?
|
||||||
//#if MC>=10809
|
//#if MC>=10809
|
||||||
CoreModManager.getIgnoredMods().remove(file.getName());
|
//$$ CoreModManager.getIgnoredMods().remove(file.getName());
|
||||||
//#else
|
//#else
|
||||||
//$$ CoreModManager.getLoadedCoremods().remove(file.getName());
|
//$$ CoreModManager.getLoadedCoremods().remove(file.getName());
|
||||||
//#if MC<=10710
|
//#if MC<=10710
|
||||||
//$$ CoreModManager.getReparseableCoremods().add(file.getName());
|
//$$ CoreModManager.getReparseableCoremods().add(file.getName());
|
||||||
//#endif
|
//#endif
|
||||||
//#endif
|
//#endif
|
||||||
}
|
//$$ }
|
||||||
} catch (URISyntaxException e) {
|
//$$ } catch (URISyntaxException e) {
|
||||||
e.printStackTrace();
|
//$$ e.printStackTrace();
|
||||||
}
|
//$$ }
|
||||||
} else {
|
//$$ } else {
|
||||||
LogManager.getLogger().warn("No CodeSource, if this is not a development environment we might run into problems!");
|
//$$ LogManager.getLogger().warn("No CodeSource, if this is not a development environment we might run into problems!");
|
||||||
LogManager.getLogger().warn(getClass().getProtectionDomain());
|
//$$ LogManager.getLogger().warn(getClass().getProtectionDomain());
|
||||||
}
|
//$$ }
|
||||||
}
|
//$$ }
|
||||||
|
//$$
|
||||||
@Override
|
//$$ @Override
|
||||||
public String[] getASMTransformerClass() {
|
//$$ public String[] getASMTransformerClass() {
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
return new String[]{
|
//$$ return new String[]{
|
||||||
};
|
//$$ };
|
||||||
//#else
|
//#else
|
||||||
//$$ List<String> transformers = new ArrayList<>();
|
//$$ List<String> transformers = new ArrayList<>();
|
||||||
//$$ if ("true".equals(System.getProperty("replaymod.glerrors", "false"))) {
|
//$$ if ("true".equals(System.getProperty("replaymod.glerrors", "false"))) {
|
||||||
@@ -75,26 +75,26 @@ public class LoadingPlugin implements IFMLLoadingPlugin {
|
|||||||
//$$ transformers.add(GLStateTrackerTransformer.class.getName());
|
//$$ transformers.add(GLStateTrackerTransformer.class.getName());
|
||||||
//$$ return transformers.stream().toArray(String[]::new);
|
//$$ return transformers.stream().toArray(String[]::new);
|
||||||
//#endif
|
//#endif
|
||||||
}
|
//$$ }
|
||||||
|
//$$
|
||||||
@Override
|
//$$ @Override
|
||||||
public String getModContainerClass() {
|
//$$ public String getModContainerClass() {
|
||||||
return null;
|
//$$ return null;
|
||||||
}
|
//$$ }
|
||||||
|
//$$
|
||||||
@Override
|
//$$ @Override
|
||||||
public String getSetupClass() {
|
//$$ public String getSetupClass() {
|
||||||
return null;
|
//$$ return null;
|
||||||
}
|
//$$ }
|
||||||
|
//$$
|
||||||
@Override
|
//$$ @Override
|
||||||
public void injectData(Map<String, Object> data) {
|
//$$ public void injectData(Map<String, Object> data) {
|
||||||
}
|
//$$ }
|
||||||
|
//$$
|
||||||
@Override
|
//$$ @Override
|
||||||
public String getAccessTransformerClass() {
|
//$$ public String getAccessTransformerClass() {
|
||||||
return null;
|
//$$ return null;
|
||||||
}
|
//$$ }
|
||||||
|
//$$
|
||||||
}
|
//$$ }
|
||||||
*/
|
//#endif
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import com.google.common.util.concurrent.ListenableFutureTask;
|
|||||||
import com.replaymod.core.gui.GuiReplaySettings;
|
import com.replaymod.core.gui.GuiReplaySettings;
|
||||||
import com.replaymod.core.gui.RestoreReplayGui;
|
import com.replaymod.core.gui.RestoreReplayGui;
|
||||||
import com.replaymod.core.handler.MainMenuHandler;
|
import com.replaymod.core.handler.MainMenuHandler;
|
||||||
import com.replaymod.core.utils.OpenGLUtils;
|
|
||||||
import com.replaymod.core.versions.MCVer;
|
import com.replaymod.core.versions.MCVer;
|
||||||
import com.replaymod.editor.ReplayModEditor;
|
import com.replaymod.editor.ReplayModEditor;
|
||||||
import com.replaymod.extras.ReplayModExtras;
|
import com.replaymod.extras.ReplayModExtras;
|
||||||
@@ -156,14 +155,6 @@ public class ReplayMod implements Module {
|
|||||||
public ReplayMod() {
|
public ReplayMod() {
|
||||||
I18n.setI18n(net.minecraft.client.resources.I18n::format);
|
I18n.setI18n(net.minecraft.client.resources.I18n::format);
|
||||||
|
|
||||||
// Initialize the static OpenGL info field from the minecraft main thread
|
|
||||||
// Unfortunately lwjgl uses static methods so we have to make use of magic init calls as well
|
|
||||||
//#if MC>=11300
|
|
||||||
DeferredWorkQueue.runLater(OpenGLUtils::init);
|
|
||||||
//#else
|
|
||||||
//$$ OpenGLUtils.init();
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
DeferredWorkQueue.runLater(() -> MCVer.getMinecraft().resourcePackRepository.addPackFinder(new LangResourcePack.Finder()));
|
DeferredWorkQueue.runLater(() -> MCVer.getMinecraft().resourcePackRepository.addPackFinder(new LangResourcePack.Finder()));
|
||||||
//#endif
|
//#endif
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.replaymod.core.handler;
|
package com.replaymod.core.handler;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.client.gui.GuiMainMenu;
|
import net.minecraft.client.gui.GuiMainMenu;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
@@ -18,8 +19,6 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|||||||
//$$ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
//$$ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import static com.replaymod.core.versions.MCVer.*;
|
import static com.replaymod.core.versions.MCVer.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -45,10 +44,9 @@ public class MainMenuHandler {
|
|||||||
// and then move back down by 10 to compensate for the space to the exit button that was already there
|
// and then move back down by 10 to compensate for the space to the exit button that was already there
|
||||||
int offset = -2 * 24 + 10;
|
int offset = -2 * 24 + 10;
|
||||||
y(button, y(button) + offset);
|
y(button, y(button) + offset);
|
||||||
}
|
|
||||||
/* FIXME
|
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
if (button == gui.realmsButton) {
|
if (button.id == 14) {
|
||||||
realmsOffset = offset;
|
realmsOffset = offset;
|
||||||
}
|
}
|
||||||
//#endif
|
//#endif
|
||||||
@@ -58,11 +56,9 @@ public class MainMenuHandler {
|
|||||||
gui.realmsNotification = new RealmsNotificationProxy((GuiScreenRealmsProxy) gui.realmsNotification, realmsOffset);
|
gui.realmsNotification = new RealmsNotificationProxy((GuiScreenRealmsProxy) gui.realmsNotification, realmsOffset);
|
||||||
}
|
}
|
||||||
//#endif
|
//#endif
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME
|
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
private static class RealmsNotificationProxy extends GuiScreen {
|
private static class RealmsNotificationProxy extends GuiScreen {
|
||||||
private final GuiScreenRealmsProxy proxy;
|
private final GuiScreenRealmsProxy proxy;
|
||||||
@@ -74,30 +70,25 @@ public class MainMenuHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setGuiSize(int w, int h) {
|
public void setWorldAndResolution(Minecraft mc, int width, int height) {
|
||||||
proxy.setGuiSize(w, h);
|
proxy.setWorldAndResolution(mc, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initGui() {
|
public void tick() {
|
||||||
proxy.initGui();
|
proxy.tick();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateScreen() {
|
public void render(int mouseX, int mouseY, float partialTicks) {
|
||||||
proxy.updateScreen();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
|
|
||||||
GL11.glTranslated(0, offset, 0);
|
GL11.glTranslated(0, offset, 0);
|
||||||
proxy.drawScreen(mouseX, mouseY - offset, partialTicks);
|
proxy.render(mouseX, mouseY - offset, partialTicks);
|
||||||
GL11.glTranslated(0, -offset, 0);
|
GL11.glTranslated(0, -offset, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
|
public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) {
|
||||||
proxy.mouseClicked(mouseX, mouseY - offset, mouseButton);
|
return proxy.mouseClicked(mouseX, mouseY - offset, mouseButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -106,5 +97,4 @@ public class MainMenuHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//#endif
|
//#endif
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,11 +11,12 @@ import net.minecraftforge.registries.RegistryManager;
|
|||||||
//#else
|
//#else
|
||||||
//$$ import cpw.mods.fml.common.registry.GameData;
|
//$$ import cpw.mods.fml.common.registry.GameData;
|
||||||
//#endif
|
//#endif
|
||||||
|
//$$ import java.util.stream.Stream;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
// FIXME
|
import net.minecraftforge.fml.ModList;
|
||||||
//#else
|
//#else
|
||||||
//$$ import net.minecraftforge.fml.common.Loader;
|
//$$ import net.minecraftforge.fml.common.Loader;
|
||||||
//$$ import net.minecraftforge.fml.common.ModContainer;
|
//$$ import net.minecraftforge.fml.common.ModContainer;
|
||||||
@@ -28,13 +29,20 @@ import net.minecraftforge.registries.RegistryManager;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
|
||||||
|
|
||||||
public class ModCompat {
|
public class ModCompat {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public static Collection<ModInfo> getInstalledNetworkMods() {
|
public static Collection<ModInfo> getInstalledNetworkMods() {
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
return Stream.<ModInfo>empty().collect(Collectors.toList());
|
Map<String, ModInfo> modInfoMap = ModList.get().getMods().stream()
|
||||||
|
.map(m -> new ModInfo(m.getModId(), m.getDisplayName(), m.getVersion().toString()))
|
||||||
|
.collect(Collectors.toMap(ModInfo::getId, Function.identity()));
|
||||||
|
return RegistryManager.ACTIVE.takeSnapshot(false).keySet().stream()
|
||||||
|
.map(RegistryManager.ACTIVE::getRegistry)
|
||||||
|
.map(ForgeRegistry::getKeys).flatMap(Set::stream)
|
||||||
|
.map(ResourceLocation::getNamespace).filter(s -> !s.equals("minecraft")).distinct()
|
||||||
|
.map(modInfoMap::get).filter(Objects::nonNull)
|
||||||
|
.collect(Collectors.toList());
|
||||||
//#else
|
//#else
|
||||||
//$$ Map<String, ModContainer> ignoreCaseMap = Loader.instance().getModList().stream()
|
//$$ Map<String, ModContainer> ignoreCaseMap = Loader.instance().getModList().stream()
|
||||||
//$$ .collect(Collectors.toMap(m -> m.getModId().toLowerCase(), Function.identity()));
|
//$$ .collect(Collectors.toMap(m -> m.getModId().toLowerCase(), Function.identity()));
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
package com.replaymod.core.utils;
|
|
||||||
|
|
||||||
import org.lwjgl.BufferUtils;
|
|
||||||
import org.lwjgl.opengl.GL11;
|
|
||||||
|
|
||||||
import java.nio.IntBuffer;
|
|
||||||
|
|
||||||
public class OpenGLUtils {
|
|
||||||
public static final int VIEWPORT_MAX_WIDTH;
|
|
||||||
public static final int VIEWPORT_MAX_HEIGHT;
|
|
||||||
|
|
||||||
static {
|
|
||||||
IntBuffer buffer = BufferUtils.createIntBuffer(16);
|
|
||||||
//#if MC>=11300
|
|
||||||
// FIXME GL11.glGetIntegerv(GL11.GL_MAX_VIEWPORT_DIMS, buffer);
|
|
||||||
buffer.put(0xffff);
|
|
||||||
buffer.put(0xffff);
|
|
||||||
//#else
|
|
||||||
//$$ GL11.glGetInteger(GL11.GL_MAX_VIEWPORT_DIMS, buffer);
|
|
||||||
//#endif
|
|
||||||
VIEWPORT_MAX_WIDTH = buffer.get();
|
|
||||||
VIEWPORT_MAX_HEIGHT = buffer.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Magic init method which has to be called from the OpenGL thread so the variables in this class
|
|
||||||
* can be initialized successfully.
|
|
||||||
* Does not perform any work on its own.
|
|
||||||
*/
|
|
||||||
public static void init() {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -20,6 +20,7 @@ import de.johni0702.minecraft.gui.popup.GuiInfoPopup;
|
|||||||
import de.johni0702.minecraft.gui.utils.Colors;
|
import de.johni0702.minecraft.gui.utils.Colors;
|
||||||
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.versions.MCVer;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraft.crash.CrashReport;
|
import net.minecraft.crash.CrashReport;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
@@ -284,8 +285,8 @@ public class Utils {
|
|||||||
l -> new GuiLabel().setText(l).setColor(Colors.BLACK)).toArray(GuiElement[]::new)));
|
l -> new GuiLabel().setText(l).setColor(Colors.BLACK)).toArray(GuiElement[]::new)));
|
||||||
|
|
||||||
// Replace close button with panel containing close and copy buttons
|
// Replace close button with panel containing close and copy buttons
|
||||||
GuiButton copyToClipboardButton = new GuiButton().setI18nLabel("chat.copy")/* FIXME .onClick(() ->
|
GuiButton copyToClipboardButton = new GuiButton().setI18nLabel("chat.copy").onClick(() ->
|
||||||
//GuiScreen.setClipboardString(crashReport))*/.setSize(150, 20);
|
MCVer.setClipboardString(crashReport)).setSize(150, 20);
|
||||||
GuiButton closeButton = getCloseButton();
|
GuiButton closeButton = getCloseButton();
|
||||||
popup.removeElement(closeButton);
|
popup.removeElement(closeButton);
|
||||||
popup.addElements(new VerticalLayout.Data(1),
|
popup.addElements(new VerticalLayout.Data(1),
|
||||||
|
|||||||
@@ -433,11 +433,14 @@ public class MCVer {
|
|||||||
//$$ }
|
//$$ }
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
/* FIXME
|
public static ListenableFuture setServerResourcePack(File file) {
|
||||||
public static ListenableFuture setServerResourcePack(ResourcePackRepository repo, File file) {
|
//#if MC>=11300
|
||||||
|
return getMinecraft().getPackFinder().func_195741_a(file);
|
||||||
|
//#else
|
||||||
|
//$$ ResourcePackRepository repo = getMinecraft().getResourcePackRepository();
|
||||||
//#if MC>=10809
|
//#if MC>=10809
|
||||||
//#if MC>=11200
|
//#if MC>=11200
|
||||||
return repo.setServerResourcePack(file);
|
//$$ return repo.setServerResourcePack(file);
|
||||||
//#else
|
//#else
|
||||||
//$$ return repo.setResourcePackInstance(file);
|
//$$ return repo.setResourcePackInstance(file);
|
||||||
//#endif
|
//#endif
|
||||||
@@ -451,8 +454,8 @@ public class MCVer {
|
|||||||
//$$ return Futures.immediateFuture(null);
|
//$$ return Futures.immediateFuture(null);
|
||||||
//#endif
|
//#endif
|
||||||
//#endif
|
//#endif
|
||||||
|
//#endif
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
public static boolean isKeyDown(KeyBinding keyBinding) {
|
public static boolean isKeyDown(KeyBinding keyBinding) {
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public class FullBrightness implements Extra {
|
|||||||
public void run() {
|
public void run() {
|
||||||
active = !active;
|
active = !active;
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
// FIXME check if this is no longer required (especially when replay is paused)
|
mod.getMinecraft().entityRenderer.tick(); // need to tick once to update lightmap when replay is paused
|
||||||
//#else
|
//#else
|
||||||
//$$ mod.getMinecraft().entityRenderer.lightmapUpdateNeeded = true;
|
//$$ mod.getMinecraft().entityRenderer.lightmapUpdateNeeded = true;
|
||||||
//#endif
|
//#endif
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.replaymod.extras;
|
package com.replaymod.extras;
|
||||||
|
|
||||||
import com.replaymod.core.ReplayMod;
|
import com.replaymod.core.ReplayMod;
|
||||||
import com.replaymod.core.Setting;
|
|
||||||
import com.replaymod.core.versions.MCVer;
|
import com.replaymod.core.versions.MCVer;
|
||||||
import de.johni0702.minecraft.gui.container.AbstractGuiScreen;
|
import de.johni0702.minecraft.gui.container.AbstractGuiScreen;
|
||||||
import de.johni0702.minecraft.gui.container.GuiContainer;
|
import de.johni0702.minecraft.gui.container.GuiContainer;
|
||||||
@@ -40,7 +39,6 @@ import static com.replaymod.extras.ReplayModExtras.LOGGER;
|
|||||||
|
|
||||||
public class OpenEyeExtra implements Extra {
|
public class OpenEyeExtra implements Extra {
|
||||||
private static final String DOWNLOAD_URL = "https://www.replaymod.com/dl/openeye/" + ReplayMod.getMinecraftVersion();
|
private static final String DOWNLOAD_URL = "https://www.replaymod.com/dl/openeye/" + ReplayMod.getMinecraftVersion();
|
||||||
private static final Setting<Boolean> ASK_FOR_OPEN_EYE = new Setting<>("advanced", "askForOpenEye", null, true);
|
|
||||||
|
|
||||||
private ReplayMod mod;
|
private ReplayMod mod;
|
||||||
|
|
||||||
@@ -53,7 +51,7 @@ public class OpenEyeExtra implements Extra {
|
|||||||
//#else
|
//#else
|
||||||
//$$ boolean isOpenEyeLoaded = Loader.isModLoaded("OpenEye");
|
//$$ boolean isOpenEyeLoaded = Loader.isModLoaded("OpenEye");
|
||||||
//#endif
|
//#endif
|
||||||
if (!isOpenEyeLoaded && mod.getSettingsRegistry().get(ASK_FOR_OPEN_EYE)) {
|
if (!isOpenEyeLoaded && mod.getSettingsRegistry().get(Setting.ASK_FOR_OPEN_EYE)) {
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
try {
|
try {
|
||||||
LOGGER.trace("Checking for OpenEye availability");
|
LOGGER.trace("Checking for OpenEye availability");
|
||||||
@@ -121,7 +119,7 @@ public class OpenEyeExtra implements Extra {
|
|||||||
}).start();
|
}).start();
|
||||||
});
|
});
|
||||||
noButton.onClick(() -> {
|
noButton.onClick(() -> {
|
||||||
mod.getSettingsRegistry().set(ASK_FOR_OPEN_EYE, false);
|
mod.getSettingsRegistry().set(Setting.ASK_FOR_OPEN_EYE, false);
|
||||||
mod.getSettingsRegistry().save();
|
mod.getSettingsRegistry().save();
|
||||||
parent.display();
|
parent.display();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package com.replaymod.extras;
|
|||||||
import com.replaymod.core.SettingsRegistry;
|
import com.replaymod.core.SettingsRegistry;
|
||||||
|
|
||||||
public final class Setting<T> {
|
public final class Setting<T> {
|
||||||
|
public static final SettingsRegistry.SettingKey<Boolean> ASK_FOR_OPEN_EYE =
|
||||||
|
new SettingsRegistry.SettingKeys<>("advanced", "askForOpenEye", null, true);
|
||||||
public static final SettingsRegistry.SettingKey<Boolean> SKIP_POST_SCREENSHOT_GUI =
|
public static final SettingsRegistry.SettingKey<Boolean> SKIP_POST_SCREENSHOT_GUI =
|
||||||
new SettingsRegistry.SettingKeys<>("advanced", "skipPostScreenshotGui", null, false);
|
new SettingsRegistry.SettingKeys<>("advanced", "skipPostScreenshotGui", null, false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ public class ScreenshotRenderer implements RenderInfo {
|
|||||||
public boolean renderScreenshot() throws Throwable {
|
public boolean renderScreenshot() throws Throwable {
|
||||||
try {
|
try {
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
// FIXME
|
int displayWidthBefore = mc.mainWindow.framebufferWidth;
|
||||||
|
int displayHeightBefore = mc.mainWindow.framebufferHeight;
|
||||||
//#else
|
//#else
|
||||||
//$$ int displayWidthBefore = mc.displayWidth;
|
//$$ int displayWidthBefore = mc.displayWidth;
|
||||||
//$$ int displayHeightBefore = mc.displayHeight;
|
//$$ int displayHeightBefore = mc.displayHeight;
|
||||||
@@ -48,7 +49,9 @@ public class ScreenshotRenderer implements RenderInfo {
|
|||||||
|
|
||||||
mc.gameSettings.hideGUI = hideGUIBefore;
|
mc.gameSettings.hideGUI = hideGUIBefore;
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
// FIXME
|
mc.mainWindow.framebufferWidth = displayWidthBefore;
|
||||||
|
mc.mainWindow.framebufferHeight = displayHeightBefore;
|
||||||
|
mc.getFramebuffer().createBindFramebuffer(displayWidthBefore, displayHeightBefore);
|
||||||
//#else
|
//#else
|
||||||
//$$ mc.resize(displayWidthBefore, displayHeightBefore);
|
//$$ mc.resize(displayWidthBefore, displayHeightBefore);
|
||||||
//#endif
|
//#endif
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ public class ReplayModRecording implements Module {
|
|||||||
new GuiHandler(core).register();
|
new GuiHandler(core).register();
|
||||||
|
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
// FIXME
|
NetworkRegistry.newEventChannel(Restrictions.PLUGIN_CHANNEL, () -> "0", any -> true, any -> true);
|
||||||
//#else
|
//#else
|
||||||
//$$ NetworkRegistry.INSTANCE.newChannel(Restrictions.PLUGIN_CHANNEL, new RestrictionsChannelHandler());
|
//$$ NetworkRegistry.INSTANCE.newChannel(Restrictions.PLUGIN_CHANNEL, new RestrictionsChannelHandler());
|
||||||
//#endif
|
//#endif
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
//#if MC>=11300
|
||||||
|
package com.replaymod.recording.mixin;
|
||||||
|
|
||||||
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
|
import com.replaymod.recording.packet.ResourcePackRecorder;
|
||||||
|
import de.johni0702.minecraft.gui.utils.Consumer;
|
||||||
|
import net.minecraft.client.resources.DownloadingPackFinder;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
@Mixin(DownloadingPackFinder.class)
|
||||||
|
public abstract class MixinDownloadingPackFinder implements ResourcePackRecorder.IDownloadingPackFinder {
|
||||||
|
private Consumer<File> requestCallback;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setRequestCallback(Consumer<File> callback) {
|
||||||
|
requestCallback = callback;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
public abstract ListenableFuture<Object> func_195741_a(File file);
|
||||||
|
|
||||||
|
@Redirect(method = "downloadResourcePack", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/resources/DownloadingPackFinder;func_195741_a(Ljava/io/File;)Lcom/google/common/util/concurrent/ListenableFuture;"))
|
||||||
|
private ListenableFuture<Object> recordDownloadedPack(DownloadingPackFinder downloadingPackFinder, File file) {
|
||||||
|
if (requestCallback != null) {
|
||||||
|
requestCallback.consume(file);
|
||||||
|
requestCallback = null;
|
||||||
|
}
|
||||||
|
return func_195741_a(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//#endif
|
||||||
@@ -1,34 +1,32 @@
|
|||||||
package com.replaymod.recording.mixin;
|
package com.replaymod.recording.mixin;
|
||||||
|
|
||||||
//#if MC>=10904
|
//#if MC>=10904 && MC<11300
|
||||||
import com.replaymod.recording.handler.RecordingEventHandler;
|
//$$ import com.replaymod.recording.handler.RecordingEventHandler;
|
||||||
import net.minecraft.client.Minecraft;
|
//$$ import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.multiplayer.PlayerControllerMP;
|
//$$ import net.minecraft.client.multiplayer.PlayerControllerMP;
|
||||||
import net.minecraft.util.math.BlockPos;
|
//$$ import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
//$$ import net.minecraft.world.World;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
//$$ import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
//$$ import org.spongepowered.asm.mixin.Shadow;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
//$$ import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
//$$ import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
//$$
|
||||||
import static com.replaymod.core.versions.MCVer.*;
|
//$$ import static com.replaymod.core.versions.MCVer.*;
|
||||||
|
//$$
|
||||||
@Mixin(PlayerControllerMP.class)
|
//$$ @Mixin(PlayerControllerMP.class)
|
||||||
public abstract class MixinPlayerControllerMP implements RecordingEventHandler.RecordingEventSender {
|
//$$ public abstract class MixinPlayerControllerMP implements RecordingEventHandler.RecordingEventSender {
|
||||||
|
//$$
|
||||||
@Shadow
|
//$$ @Shadow
|
||||||
private Minecraft mc;
|
//$$ private Minecraft mc;
|
||||||
|
//$$
|
||||||
// Redirects the call to playEvent without the initial player argument to the method with that argument
|
//$$ // Redirects the call to playEvent without the initial player argument to the method with that argument
|
||||||
// The new method will then play it and (if applicable) record it. (See MixinWorldClient)
|
//$$ // The new method will then play it and (if applicable) record it. (See MixinWorldClient)
|
||||||
// This is necessary for the block break event (particles and sound) to be recorded. Otherwise it looks like the
|
//$$ // This is necessary for the block break event (particles and sound) to be recorded. Otherwise it looks like the
|
||||||
// event was emitted because of a packet (player will be null) and not as it actually was (by the player).
|
//$$ // event was emitted because of a packet (player will be null) and not as it actually was (by the player).
|
||||||
/* FIXME test if this is still an issue (the call seems to be gone)
|
//$$ @Redirect(method = "onPlayerDestroyBlock", at = @At(value = "INVOKE",
|
||||||
@Redirect(method = "onPlayerDestroyBlock", at = @At(value = "INVOKE",
|
//$$ target = "Lnet/minecraft/world/World;playEvent(ILnet/minecraft/util/math/BlockPos;I)V"))
|
||||||
target = "Lnet/minecraft/world/World;playEvent(ILnet/minecraft/util/math/BlockPos;I)V"))
|
//$$ public void replayModRecording_playEvent_fixed(World world, int type, BlockPos pos, int data) {
|
||||||
public void replayModRecording_playEvent_fixed(World world, int type, BlockPos pos, int data) {
|
//$$ world.playEvent(player(mc), type, pos, data);
|
||||||
world.playEvent(player(mc), type, pos, data);
|
//$$ }
|
||||||
}
|
//$$ }
|
||||||
*/
|
|
||||||
}
|
|
||||||
//#endif
|
//#endif
|
||||||
|
|||||||
@@ -33,7 +33,9 @@ import net.minecraft.util.text.TextComponentString;
|
|||||||
|
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
import net.minecraft.network.EnumPacketDirection;
|
import net.minecraft.network.EnumPacketDirection;
|
||||||
// FIXME import net.minecraftforge.fml.common.network.internal.FMLProxyPacket;
|
//#if MC<11300
|
||||||
|
//$$ import net.minecraftforge.fml.common.network.internal.FMLProxyPacket;
|
||||||
|
//#endif
|
||||||
//#else
|
//#else
|
||||||
//$$ import cpw.mods.fml.common.network.internal.FMLProxyPacket;
|
//$$ import cpw.mods.fml.common.network.internal.FMLProxyPacket;
|
||||||
//#endif
|
//#endif
|
||||||
@@ -244,18 +246,18 @@ public class PacketListener extends ChannelInboundHandlerAdapter {
|
|||||||
//#endif
|
//#endif
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
/* FIXME
|
//#if MC<11300
|
||||||
if (packet instanceof FMLProxyPacket) {
|
//$$ if (packet instanceof FMLProxyPacket) {
|
||||||
// This packet requires special handling
|
//$$ // This packet requires special handling
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
((FMLProxyPacket) packet).toS3FPackets().forEach(this::save);
|
//$$ ((FMLProxyPacket) packet).toS3FPackets().forEach(this::save);
|
||||||
//#else
|
//#else
|
||||||
//$$ save(((FMLProxyPacket) packet).toS3FPacket());
|
//$$ save(((FMLProxyPacket) packet).toS3FPacket());
|
||||||
//#endif
|
//#endif
|
||||||
super.channelRead(ctx, msg);
|
//$$ super.channelRead(ctx, msg);
|
||||||
return;
|
//$$ return;
|
||||||
}
|
//$$ }
|
||||||
*/
|
//#endif
|
||||||
|
|
||||||
save(packet);
|
save(packet);
|
||||||
|
|
||||||
|
|||||||
@@ -4,19 +4,20 @@ import com.google.common.hash.Hashing;
|
|||||||
import com.google.common.io.Files;
|
import com.google.common.io.Files;
|
||||||
import com.replaymod.replaystudio.replay.ReplayFile;
|
import com.replaymod.replaystudio.replay.ReplayFile;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiScreenWorking;
|
|
||||||
import net.minecraft.client.gui.GuiYesNo;
|
import net.minecraft.client.gui.GuiYesNo;
|
||||||
import net.minecraft.client.gui.GuiYesNoCallback;
|
import net.minecraft.client.gui.GuiYesNoCallback;
|
||||||
import net.minecraft.client.multiplayer.ServerData;
|
import net.minecraft.client.multiplayer.ServerData;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.util.HttpUtil;
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
// FIXME
|
import de.johni0702.minecraft.gui.utils.Consumer;
|
||||||
|
import net.minecraft.client.resources.DownloadingPackFinder;
|
||||||
//#else
|
//#else
|
||||||
|
//$$ import net.minecraft.client.gui.GuiScreenWorking;
|
||||||
//$$ import net.minecraft.client.resources.ResourcePackRepository;
|
//$$ import net.minecraft.client.resources.ResourcePackRepository;
|
||||||
|
//$$ import net.minecraft.util.HttpUtil;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=10904
|
//#if MC>=10904
|
||||||
@@ -38,7 +39,9 @@ import com.google.common.util.concurrent.Futures;
|
|||||||
import com.google.common.util.concurrent.ListenableFuture;
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
import net.minecraft.client.network.NetHandlerPlayClient;
|
import net.minecraft.client.network.NetHandlerPlayClient;
|
||||||
import net.minecraft.network.NetworkManager;
|
import net.minecraft.network.NetworkManager;
|
||||||
import org.apache.commons.io.FileUtils;
|
//#if MC<11300
|
||||||
|
//$$ import org.apache.commons.io.FileUtils;
|
||||||
|
//#endif
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
//#else
|
//#else
|
||||||
@@ -141,8 +144,7 @@ public class ResourcePackRecorder {
|
|||||||
|
|
||||||
if (levelDir.isFile()) {
|
if (levelDir.isFile()) {
|
||||||
netManager.sendPacket(makeStatusPacket(hash, Action.ACCEPTED));
|
netManager.sendPacket(makeStatusPacket(hash, Action.ACCEPTED));
|
||||||
/* FIXME
|
Futures.addCallback(setServerResourcePack(levelDir), new FutureCallback<Object>() {
|
||||||
Futures.addCallback(setServerResourcePack(mc.getResourcePackRepository(), levelDir), new FutureCallback<Object>() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Object result) {
|
public void onSuccess(Object result) {
|
||||||
recordResourcePack(levelDir, requestId);
|
recordResourcePack(levelDir, requestId);
|
||||||
@@ -154,7 +156,6 @@ public class ResourcePackRecorder {
|
|||||||
netManager.sendPacket(makeStatusPacket(hash, Action.FAILED_DOWNLOAD));
|
netManager.sendPacket(makeStatusPacket(hash, Action.FAILED_DOWNLOAD));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
*/
|
|
||||||
} else {
|
} else {
|
||||||
netManager.sendPacket(makeStatusPacket(hash, Action.FAILED_DOWNLOAD));
|
netManager.sendPacket(makeStatusPacket(hash, Action.FAILED_DOWNLOAD));
|
||||||
}
|
}
|
||||||
@@ -162,7 +163,7 @@ public class ResourcePackRecorder {
|
|||||||
final ServerData serverData = mc.getCurrentServerData();
|
final ServerData serverData = mc.getCurrentServerData();
|
||||||
if (serverData != null && serverData.getResourceMode() == ServerData.ServerResourceMode.ENABLED) {
|
if (serverData != null && serverData.getResourceMode() == ServerData.ServerResourceMode.ENABLED) {
|
||||||
netManager.sendPacket(makeStatusPacket(hash, Action.ACCEPTED));
|
netManager.sendPacket(makeStatusPacket(hash, Action.ACCEPTED));
|
||||||
// FIXME downloadResourcePackFuture(requestId, url, hash);
|
downloadResourcePackFuture(requestId, url, hash);
|
||||||
} else if (serverData != null && serverData.getResourceMode() != ServerData.ServerResourceMode.PROMPT) {
|
} else if (serverData != null && serverData.getResourceMode() != ServerData.ServerResourceMode.PROMPT) {
|
||||||
netManager.sendPacket(makeStatusPacket(hash, Action.DECLINED));
|
netManager.sendPacket(makeStatusPacket(hash, Action.DECLINED));
|
||||||
} else {
|
} else {
|
||||||
@@ -180,7 +181,7 @@ public class ResourcePackRecorder {
|
|||||||
}
|
}
|
||||||
if (result) {
|
if (result) {
|
||||||
netManager.sendPacket(makeStatusPacket(hash, Action.ACCEPTED));
|
netManager.sendPacket(makeStatusPacket(hash, Action.ACCEPTED));
|
||||||
// FIXME downloadResourcePackFuture(requestId, url, hash);
|
downloadResourcePackFuture(requestId, url, hash);
|
||||||
} else {
|
} else {
|
||||||
netManager.sendPacket(makeStatusPacket(hash, Action.DECLINED));
|
netManager.sendPacket(makeStatusPacket(hash, Action.DECLINED));
|
||||||
}
|
}
|
||||||
@@ -199,7 +200,6 @@ public class ResourcePackRecorder {
|
|||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME
|
|
||||||
private void downloadResourcePackFuture(int requestId, String url, final String hash) {
|
private void downloadResourcePackFuture(int requestId, String url, final String hash) {
|
||||||
Futures.addCallback(downloadResourcePack(requestId, url, hash), new FutureCallback() {
|
Futures.addCallback(downloadResourcePack(requestId, url, hash), new FutureCallback() {
|
||||||
@Override
|
@Override
|
||||||
@@ -214,101 +214,112 @@ public class ResourcePackRecorder {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//#if MC>=11300
|
||||||
private ListenableFuture downloadResourcePack(final int requestId, String url, String hash) {
|
private ListenableFuture downloadResourcePack(final int requestId, String url, String hash) {
|
||||||
final ResourcePackRepository repo = mc.mcResourcePackRepository;
|
DownloadingPackFinder packFinder = mc.getPackFinder();
|
||||||
String fileName;
|
((IDownloadingPackFinder) packFinder).setRequestCallback(file -> recordResourcePack(file, requestId));
|
||||||
if (hash.matches("^[a-f0-9]{40}$")) {
|
return packFinder.downloadResourcePack(url, hash);
|
||||||
fileName = hash;
|
}
|
||||||
} else {
|
|
||||||
fileName = url.substring(url.lastIndexOf("/") + 1);
|
|
||||||
|
|
||||||
if (fileName.contains("?")) {
|
public interface IDownloadingPackFinder {
|
||||||
fileName = fileName.substring(0, fileName.indexOf("?"));
|
void setRequestCallback(Consumer<File> callback);
|
||||||
}
|
}
|
||||||
|
//#else
|
||||||
if (!fileName.endsWith(".zip")) {
|
//$$ private ListenableFuture downloadResourcePack(final int requestId, String url, String hash) {
|
||||||
return Futures.immediateFailedFuture(new IllegalArgumentException("Invalid filename; must end in .zip"));
|
//$$ final ResourcePackRepository repo = mc.mcResourcePackRepository;
|
||||||
}
|
//$$ String fileName;
|
||||||
|
//$$ if (hash.matches("^[a-f0-9]{40}$")) {
|
||||||
fileName = "legacy_" + fileName.replaceAll("\\W", "");
|
//$$ fileName = hash;
|
||||||
}
|
//$$ } else {
|
||||||
|
//$$ fileName = url.substring(url.lastIndexOf("/") + 1);
|
||||||
final File file = new File(repo.dirServerResourcepacks, fileName);
|
//$$
|
||||||
|
//$$ if (fileName.contains("?")) {
|
||||||
|
//$$ fileName = fileName.substring(0, fileName.indexOf("?"));
|
||||||
|
//$$ }
|
||||||
|
//$$
|
||||||
|
//$$ if (!fileName.endsWith(".zip")) {
|
||||||
|
//$$ return Futures.immediateFailedFuture(new IllegalArgumentException("Invalid filename; must end in .zip"));
|
||||||
|
//$$ }
|
||||||
|
//$$
|
||||||
|
//$$ fileName = "legacy_" + fileName.replaceAll("\\W", "");
|
||||||
|
//$$ }
|
||||||
|
//$$
|
||||||
|
//$$ final File file = new File(repo.dirServerResourcepacks, fileName);
|
||||||
//#if MC>=10809
|
//#if MC>=10809
|
||||||
repo.lock.lock();
|
//$$ repo.lock.lock();
|
||||||
//#else
|
//#else
|
||||||
//$$ repo.field_177321_h.lock();
|
//$$ repo.field_177321_h.lock();
|
||||||
//#endif
|
//#endif
|
||||||
try {
|
//$$ try {
|
||||||
//#if MC>=10809
|
//#if MC>=10809
|
||||||
repo.clearResourcePack();
|
//$$ repo.clearResourcePack();
|
||||||
//#else
|
//#else
|
||||||
//$$ repo.func_148529_f();
|
//$$ repo.func_148529_f();
|
||||||
//#endif
|
//#endif
|
||||||
|
//$$
|
||||||
if (file.exists() && hash.length() == 40) {
|
//$$ if (file.exists() && hash.length() == 40) {
|
||||||
try {
|
//$$ try {
|
||||||
String fileHash = Hashing.sha1().hashBytes(Files.toByteArray(file)).toString();
|
//$$ String fileHash = Hashing.sha1().hashBytes(Files.toByteArray(file)).toString();
|
||||||
if (fileHash.equals(hash)) {
|
//$$ if (fileHash.equals(hash)) {
|
||||||
recordResourcePack(file, requestId);
|
//$$ recordResourcePack(file, requestId);
|
||||||
return setServerResourcePack(repo, file);
|
//$$ return setServerResourcePack(file);
|
||||||
}
|
//$$ }
|
||||||
|
//$$
|
||||||
logger.warn("File " + file + " had wrong hash (expected " + hash + ", found " + fileHash + "). Deleting it.");
|
//$$ logger.warn("File " + file + " had wrong hash (expected " + hash + ", found " + fileHash + "). Deleting it.");
|
||||||
FileUtils.deleteQuietly(file);
|
//$$ FileUtils.deleteQuietly(file);
|
||||||
} catch (IOException ioexception) {
|
//$$ } catch (IOException ioexception) {
|
||||||
logger.warn("File " + file + " couldn\'t be hashed. Deleting it.", ioexception);
|
//$$ logger.warn("File " + file + " couldn\'t be hashed. Deleting it.", ioexception);
|
||||||
FileUtils.deleteQuietly(file);
|
//$$ FileUtils.deleteQuietly(file);
|
||||||
}
|
//$$ }
|
||||||
}
|
//$$ }
|
||||||
|
//$$
|
||||||
final GuiScreenWorking guiScreen = new GuiScreenWorking();
|
//$$ final GuiScreenWorking guiScreen = new GuiScreenWorking();
|
||||||
final Minecraft mc = Minecraft.getMinecraft();
|
//$$ final Minecraft mc = Minecraft.getMinecraft();
|
||||||
|
//$$
|
||||||
Futures.getUnchecked(mc.addScheduledTask(() -> mc.displayGuiScreen(guiScreen)));
|
//$$ Futures.getUnchecked(mc.addScheduledTask(() -> mc.displayGuiScreen(guiScreen)));
|
||||||
|
//$$
|
||||||
//#if MC>=10809
|
//#if MC>=10809
|
||||||
//#if MC>=11002
|
//#if MC>=11002
|
||||||
//#if MC>=11100
|
//#if MC>=11100
|
||||||
Map<String, String> sessionInfo = ResourcePackRepository.getDownloadHeaders();
|
//$$ Map<String, String> sessionInfo = ResourcePackRepository.getDownloadHeaders();
|
||||||
//#else
|
//#else
|
||||||
//$$ Map<String, String> sessionInfo = ResourcePackRepository.func_190115_a();
|
//$$ Map<String, String> sessionInfo = ResourcePackRepository.func_190115_a();
|
||||||
//#endif
|
//#endif
|
||||||
//#else
|
//#else
|
||||||
//$$ Map<String, String> sessionInfo = Minecraft.getSessionInfo();
|
//$$ Map<String, String> sessionInfo = Minecraft.getSessionInfo();
|
||||||
//#endif
|
//#endif
|
||||||
repo.downloadingPacks = HttpUtil.downloadResourcePack(file, url, sessionInfo, 50 * 1024 * 1024, guiScreen, mc.getProxy());
|
//$$ repo.downloadingPacks = HttpUtil.downloadResourcePack(file, url, sessionInfo, 50 * 1024 * 1024, guiScreen, mc.getProxy());
|
||||||
Futures.addCallback(repo.downloadingPacks, new FutureCallback<Object>() {
|
//$$ Futures.addCallback(repo.downloadingPacks, new FutureCallback<Object>() {
|
||||||
//#else
|
//#else
|
||||||
//$$ Map sessionInfo = Minecraft.getSessionInfo();
|
//$$ Map sessionInfo = Minecraft.getSessionInfo();
|
||||||
//$$ repo.field_177322_i = HttpUtil.func_180192_a(file, url, sessionInfo, 50 * 1024 * 1024, guiScreen, mc.getProxy());
|
//$$ repo.field_177322_i = HttpUtil.func_180192_a(file, url, sessionInfo, 50 * 1024 * 1024, guiScreen, mc.getProxy());
|
||||||
//$$ Futures.addCallback(repo.field_177322_i, new FutureCallback() {
|
//$$ Futures.addCallback(repo.field_177322_i, new FutureCallback() {
|
||||||
//#endif
|
//#endif
|
||||||
@Override
|
//$$ @Override
|
||||||
public void onSuccess(Object value) {
|
//$$ public void onSuccess(Object value) {
|
||||||
recordResourcePack(file, requestId);
|
//$$ recordResourcePack(file, requestId);
|
||||||
setServerResourcePack(repo, file);
|
//$$ setServerResourcePack(file);
|
||||||
}
|
//$$ }
|
||||||
|
//$$
|
||||||
@Override
|
//$$ @Override
|
||||||
public void onFailure(@Nonnull Throwable throwable) {
|
//$$ public void onFailure(@Nonnull Throwable throwable) {
|
||||||
throwable.printStackTrace();
|
//$$ throwable.printStackTrace();
|
||||||
}
|
//$$ }
|
||||||
});
|
//$$ });
|
||||||
//#if MC>=10809
|
//#if MC>=10809
|
||||||
return repo.downloadingPacks;
|
//$$ return repo.downloadingPacks;
|
||||||
//#else
|
//#else
|
||||||
//$$ return repo.field_177322_i;
|
//$$ return repo.field_177322_i;
|
||||||
//#endif
|
//#endif
|
||||||
} finally {
|
//$$ } finally {
|
||||||
//#if MC>=10809
|
//#if MC>=10809
|
||||||
repo.lock.unlock();
|
//$$ repo.lock.unlock();
|
||||||
//#else
|
//#else
|
||||||
//$$ repo.field_177321_h.unlock();
|
//$$ repo.field_177321_h.unlock();
|
||||||
//#endif
|
//#endif
|
||||||
}
|
//$$ }
|
||||||
}
|
//$$ }
|
||||||
*/
|
//#endif
|
||||||
//#else
|
//#else
|
||||||
//$$ public synchronized S3FPacketCustomPayload handleResourcePack(S3FPacketCustomPayload packet) {
|
//$$ public synchronized S3FPacketCustomPayload handleResourcePack(S3FPacketCustomPayload packet) {
|
||||||
//$$ final int requestId = nextRequestId++;
|
//$$ final int requestId = nextRequestId++;
|
||||||
|
|||||||
@@ -582,7 +582,7 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
IOUtils.copy(replayFile.getResourcePack(hash).get(), new FileOutputStream(file));
|
IOUtils.copy(replayFile.getResourcePack(hash).get(), new FileOutputStream(file));
|
||||||
}
|
}
|
||||||
// FIXME setServerResourcePack(mc.getResourcePackRepository(), file);
|
setServerResourcePack(file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -690,10 +690,9 @@ public class ReplayHandler {
|
|||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
if (entity instanceof EntityLivingBase) {
|
if (entity instanceof EntityLivingBase) {
|
||||||
EntityLivingBase e = (EntityLivingBase) entity;
|
EntityLivingBase e = (EntityLivingBase) entity;
|
||||||
// FIXME
|
e.setPosition(e.interpTargetX, e.interpTargetY, e.interpTargetZ);
|
||||||
// e.setPosition(e.otherPlayerMPX, e.otherPlayerMPY, e.otherPlayerMPZ);
|
e.rotationYaw = (float) e.interpTargetYaw;
|
||||||
// e.rotationYaw = (float) e.otherPlayerMPYaw;
|
e.rotationPitch = (float) e.interpTargetPitch;
|
||||||
// e.rotationPitch = (float) e.otherPlayerMPPitch;
|
|
||||||
}
|
}
|
||||||
//#else
|
//#else
|
||||||
//$$ if (entity instanceof EntityOtherPlayerMP) {
|
//$$ if (entity instanceof EntityOtherPlayerMP) {
|
||||||
|
|||||||
@@ -10,14 +10,12 @@ import com.replaymod.replay.events.ReplayChatMessageEvent;
|
|||||||
import com.replaymod.replaystudio.util.Location;
|
import com.replaymod.replaystudio.util.Location;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||||
import net.minecraft.client.network.NetHandlerPlayClient;
|
import net.minecraft.client.network.NetHandlerPlayClient;
|
||||||
import net.minecraft.client.settings.KeyBinding;
|
import net.minecraft.client.settings.KeyBinding;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLiving;
|
import net.minecraft.entity.EntityLiving;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
|
||||||
import net.minecraft.entity.item.EntityItemFrame;
|
import net.minecraft.entity.item.EntityItemFrame;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
@@ -29,6 +27,9 @@ import net.minecraftforge.common.MinecraftForge;
|
|||||||
|
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
import net.minecraft.util.math.RayTraceFluidMode;
|
import net.minecraft.util.math.RayTraceFluidMode;
|
||||||
|
//#else
|
||||||
|
//$$ import net.minecraft.block.material.Material;
|
||||||
|
//$$ import net.minecraft.entity.EntityLivingBase;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=10904
|
//#if MC>=10904
|
||||||
@@ -289,12 +290,12 @@ public class CameraEntity
|
|||||||
return falseUnlessSpectating(Entity::isEntityInsideOpaqueBlock); // Make sure no suffocation overlay is rendered
|
return falseUnlessSpectating(Entity::isEntityInsideOpaqueBlock); // Make sure no suffocation overlay is rendered
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME
|
//#if MC<11300
|
||||||
@Override
|
//$$ @Override
|
||||||
public boolean isInsideOfMaterial(Material materialIn) {
|
//$$ public boolean isInsideOfMaterial(Material materialIn) {
|
||||||
return falseUnlessSpectating(e -> e.isInsideOfMaterial(materialIn)); // Make sure no overlays are rendered
|
//$$ return falseUnlessSpectating(e -> e.isInsideOfMaterial(materialIn)); // Make sure no overlays are rendered
|
||||||
}
|
//$$ }
|
||||||
*/
|
//#endif
|
||||||
|
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
@Override
|
@Override
|
||||||
@@ -473,13 +474,13 @@ public class CameraEntity
|
|||||||
//$$ }
|
//$$ }
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
/* FIXME
|
//#if MC<11300
|
||||||
@Override
|
//$$ @Override
|
||||||
public void openGui(Object mod, int modGuiId, World world, int x, int y, int z) {
|
//$$ public void openGui(Object mod, int modGuiId, World world, int x, int y, int z) {
|
||||||
// Do not open any block GUIs for the camera entities
|
//$$ // Do not open any block GUIs for the camera entities
|
||||||
// Note: Vanilla GUIs are filtered out on a packet level, this only applies to mod GUIs
|
//$$ // Note: Vanilla GUIs are filtered out on a packet level, this only applies to mod GUIs
|
||||||
}
|
//$$ }
|
||||||
*/
|
//#endif
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
@@ -618,14 +619,12 @@ public class CameraEntity
|
|||||||
lastHandRendered = player;
|
lastHandRendered = player;
|
||||||
|
|
||||||
//#if MC>=10904
|
//#if MC>=10904
|
||||||
/* FIXME needs AT
|
|
||||||
mc.entityRenderer.itemRenderer.prevEquippedProgressMainHand = 1;
|
mc.entityRenderer.itemRenderer.prevEquippedProgressMainHand = 1;
|
||||||
mc.entityRenderer.itemRenderer.prevEquippedProgressOffHand = 1;
|
mc.entityRenderer.itemRenderer.prevEquippedProgressOffHand = 1;
|
||||||
mc.entityRenderer.itemRenderer.equippedProgressMainHand = 1;
|
mc.entityRenderer.itemRenderer.equippedProgressMainHand = 1;
|
||||||
mc.entityRenderer.itemRenderer.equippedProgressOffHand = 1;
|
mc.entityRenderer.itemRenderer.equippedProgressOffHand = 1;
|
||||||
mc.entityRenderer.itemRenderer.itemStackMainHand = player.getItemStackFromSlot(EntityEquipmentSlot.MAINHAND);
|
mc.entityRenderer.itemRenderer.itemStackMainHand = player.getItemStackFromSlot(EntityEquipmentSlot.MAINHAND);
|
||||||
mc.entityRenderer.itemRenderer.itemStackOffHand = player.getItemStackFromSlot(EntityEquipmentSlot.OFFHAND);
|
mc.entityRenderer.itemRenderer.itemStackOffHand = player.getItemStackFromSlot(EntityEquipmentSlot.OFFHAND);
|
||||||
*/
|
|
||||||
//#else
|
//#else
|
||||||
//$$ mc.entityRenderer.itemRenderer.prevEquippedProgress = 1;
|
//$$ mc.entityRenderer.itemRenderer.prevEquippedProgress = 1;
|
||||||
//$$ mc.entityRenderer.itemRenderer.equippedProgress = 1;
|
//$$ mc.entityRenderer.itemRenderer.equippedProgress = 1;
|
||||||
|
|||||||
@@ -33,6 +33,11 @@ public net.minecraft.client.MainWindow field_198131_r # framebufferWidth
|
|||||||
public net.minecraft.client.MainWindow field_198132_s # framebufferHeight
|
public net.minecraft.client.MainWindow field_198132_s # framebufferHeight
|
||||||
##endif
|
##endif
|
||||||
|
|
||||||
|
##if MC>=11300
|
||||||
|
# FirstPersonRenderer
|
||||||
|
public net.minecraft.client.renderer.FirstPersonRenderer *
|
||||||
|
##endif
|
||||||
|
|
||||||
# Packets
|
# Packets
|
||||||
##if MC>=11300
|
##if MC>=11300
|
||||||
public net.minecraft.network.play.server.SPacketJoinGame field_149200_f # maxPlayers
|
public net.minecraft.network.play.server.SPacketJoinGame field_149200_f # maxPlayers
|
||||||
@@ -181,6 +186,13 @@ public net.minecraft.client.renderer.GlStateManager$BooleanState *
|
|||||||
# EntityLivingBase
|
# EntityLivingBase
|
||||||
public net.minecraft.entity.EntityLivingBase field_184621_as # HAND_STATES
|
public net.minecraft.entity.EntityLivingBase field_184621_as # HAND_STATES
|
||||||
public net.minecraft.entity.EntityLivingBase field_184628_bn # activeItemStackUseCount
|
public net.minecraft.entity.EntityLivingBase field_184628_bn # activeItemStackUseCount
|
||||||
|
##if MC>=11300
|
||||||
|
public net.minecraft.entity.EntityLivingBase field_184623_bh # interpTargetX
|
||||||
|
public net.minecraft.entity.EntityLivingBase field_184624_bi # interpTargetY
|
||||||
|
public net.minecraft.entity.EntityLivingBase field_184625_bj # interpTargetZ
|
||||||
|
public net.minecraft.entity.EntityLivingBase field_184626_bk # interpTargetYaw
|
||||||
|
public net.minecraft.entity.EntityLivingBase field_70709_bj # interpTargetPitch
|
||||||
|
##endif
|
||||||
##endif
|
##endif
|
||||||
|
|
||||||
# Particles
|
# Particles
|
||||||
|
|||||||
@@ -5,11 +5,14 @@
|
|||||||
"server": [],
|
"server": [],
|
||||||
"client": [
|
"client": [
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
|
"MixinDownloadingPackFinder",
|
||||||
"MixinKeyboardListener",
|
"MixinKeyboardListener",
|
||||||
"MixinMouseHelper",
|
"MixinMouseHelper",
|
||||||
//#endif
|
//#endif
|
||||||
//#if MC>=10904
|
//#if MC>=10904
|
||||||
"MixinPlayerControllerMP",
|
//#if MC<11300
|
||||||
|
//$$ "MixinPlayerControllerMP",
|
||||||
|
//#endif
|
||||||
"MixinWorldClient",
|
"MixinWorldClient",
|
||||||
//#endif
|
//#endif
|
||||||
//#if MC<=10710
|
//#if MC<=10710
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ configurations {
|
|||||||
dependencies {
|
dependencies {
|
||||||
if (FG3) {
|
if (FG3) {
|
||||||
minecraft 'net.minecraftforge:forge:' + [
|
minecraft 'net.minecraftforge:forge:' + [
|
||||||
11302: '1.13.2-25.0.63',
|
11302: '1.13.2-25.0.76',
|
||||||
][mcVersion]
|
][mcVersion]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user