Re-enable and fix building for older MC versions
This commit is contained in:
BIN
.gitignore
vendored
BIN
.gitignore
vendored
Binary file not shown.
@@ -8,6 +8,10 @@ After the initial clone, running `./gradlew setupDecompWorkspace` is necessary.
|
|||||||
This will also be necessary if the `replaymod_at.cfg` file has been changed (getting errors about code that is trying
|
This will also be necessary if the `replaymod_at.cfg` file has been changed (getting errors about code that is trying
|
||||||
to access private fields is a good indication that this has happened).
|
to access private fields is a good indication that this has happened).
|
||||||
|
|
||||||
|
**Note**: ForgeGradle 1.2 (used for 1.7.10) is not compatible with Gradle 4.
|
||||||
|
As such, you need to use an older version (Gradle 3.x) to build the ReplayMod for 1.7.10.
|
||||||
|
An easy way to do that is to pass `--old-gradle` as the first argument to the Gradle wrapper shell script: `./gradlew --old-gradle build`
|
||||||
|
|
||||||
### No IDE
|
### No IDE
|
||||||
You can build the mod by running `./gradlew build`. You can then find the final jar files in `versions/$MCVERSION/build/libs/`.
|
You can build the mod by running `./gradlew build`. You can then find the final jar files in `versions/$MCVERSION/build/libs/`.
|
||||||
You can also build single versions by running `./gradlew :1.8:build` (builds the MC 1.8 version).
|
You can also build single versions by running `./gradlew :1.8:build` (builds the MC 1.8 version).
|
||||||
|
|||||||
12
build.gradle
12
build.gradle
@@ -26,18 +26,6 @@ subprojects {
|
|||||||
repositories {
|
repositories {
|
||||||
maven { url 'https://jitpack.io' }
|
maven { url 'https://jitpack.io' }
|
||||||
}
|
}
|
||||||
configurations.classpath.resolutionStrategy.eachDependency { dep ->
|
|
||||||
if (System.getenv('REPRODUCIBLE_BUILD') == '1') return
|
|
||||||
def req = dep.target
|
|
||||||
// Substitute FG 2.0 with custom fork that works with Gradle 3
|
|
||||||
if (req.group == 'net.minecraftforge.gradle' && req.name == 'ForgeGradle' && req.version == '2.0-SNAPSHOT') {
|
|
||||||
dep.useTarget 'com.github.ReplayMod:ForgeGradle:dd521d0'
|
|
||||||
}
|
|
||||||
// Substitute FG 2.1 with custom fork that works with Gradle 3
|
|
||||||
if (req.group == 'net.minecraftforge.gradle' && req.name == 'ForgeGradle' && req.version == '2.1-SNAPSHOT') {
|
|
||||||
dep.useTarget 'com.github.ReplayMod:ForgeGradle:9c2f79c'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Thanks for wasting my time gradle...
|
// Thanks for wasting my time gradle...
|
||||||
|
|||||||
BIN
gradle/wrapper/gradle-wrapper-old.jar
vendored
Executable file
BIN
gradle/wrapper/gradle-wrapper-old.jar
vendored
Executable file
Binary file not shown.
6
gradle/wrapper/gradle-wrapper-old.properties
vendored
Executable file
6
gradle/wrapper/gradle-wrapper-old.properties
vendored
Executable file
@@ -0,0 +1,6 @@
|
|||||||
|
distributionBase=GRADLE_USER_HOME
|
||||||
|
distributionPath=wrapper/dists
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
zipStorePath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5.1-all.zip
|
||||||
|
distributionSha256Sum=69d99ade952de3727b65a88f3188ee72231ff4e28c2d00aacfc96a42c6d6f303
|
||||||
7
gradlew
vendored
7
gradlew
vendored
@@ -65,7 +65,12 @@ cd "`dirname \"$PRG\"`/" >/dev/null
|
|||||||
APP_HOME="`pwd -P`"
|
APP_HOME="`pwd -P`"
|
||||||
cd "$SAVED" >/dev/null
|
cd "$SAVED" >/dev/null
|
||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
if [ "$1" == "--old-gradle" ]; then
|
||||||
|
shift
|
||||||
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper-old.jar
|
||||||
|
else
|
||||||
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
fi
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
if [ -n "$JAVA_HOME" ] ; then
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
|
|||||||
2
jGui
2
jGui
Submodule jGui updated: e89934d686...fe5d344be4
@@ -1,13 +1,47 @@
|
|||||||
|
def f = file('versions/core/mcVersion')
|
||||||
|
def coreMcVersion = f.exists() ? f.readLines().first() as int : 11302
|
||||||
|
|
||||||
|
def jGuiVersions = []
|
||||||
|
def replayModVersions = []
|
||||||
|
if (gradle.gradleVersion.startsWith('3.')) {
|
||||||
|
if (coreMcVersion <= 10710) {
|
||||||
|
jGuiVersions += ['core']
|
||||||
|
replayModVersions += ['core']
|
||||||
|
}
|
||||||
|
jGuiVersions += [
|
||||||
|
'1.7.10',
|
||||||
|
]
|
||||||
|
replayModVersions += [
|
||||||
|
'1.7.10',
|
||||||
|
]
|
||||||
|
} else {
|
||||||
|
if (coreMcVersion > 10710) {
|
||||||
|
jGuiVersions += ['core']
|
||||||
|
replayModVersions += ['core']
|
||||||
|
}
|
||||||
|
jGuiVersions += [
|
||||||
|
'1.8',
|
||||||
|
'1.8.9',
|
||||||
|
'1.9.4',
|
||||||
|
'1.12',
|
||||||
|
'1.13.2'
|
||||||
|
]
|
||||||
|
replayModVersions += [
|
||||||
|
'1.8',
|
||||||
|
'1.8.9',
|
||||||
|
'1.9.4',
|
||||||
|
'1.10.2',
|
||||||
|
'1.11',
|
||||||
|
'1.11.2',
|
||||||
|
'1.12',
|
||||||
|
'1.12.1',
|
||||||
|
'1.12.2',
|
||||||
|
'1.13.2'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
include ':jGui'
|
include ':jGui'
|
||||||
[
|
jGuiVersions.each { version ->
|
||||||
'core',
|
|
||||||
//'1.7.10', FIXME
|
|
||||||
//'1.8', FIXME
|
|
||||||
//'1.8.9', FIXME
|
|
||||||
//'1.9.4',
|
|
||||||
//'1.12',
|
|
||||||
'1.13.2'
|
|
||||||
].each { version ->
|
|
||||||
include ":jGui:$version"
|
include ":jGui:$version"
|
||||||
project(":jGui:$version").with {
|
project(":jGui:$version").with {
|
||||||
projectDir = file("jGui/versions/$version")
|
projectDir = file("jGui/versions/$version")
|
||||||
@@ -15,21 +49,7 @@ include ':jGui'
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def versions = [
|
replayModVersions.each { version ->
|
||||||
'core',
|
|
||||||
//'1.7.10', FIXME
|
|
||||||
//'1.8', FIXME
|
|
||||||
//'1.8.9', FIXME
|
|
||||||
//'1.9.4',
|
|
||||||
//'1.10.2',
|
|
||||||
//'1.11',
|
|
||||||
//'1.11.2',
|
|
||||||
//'1.12',
|
|
||||||
//'1.12.1',
|
|
||||||
//'1.12.2',
|
|
||||||
'1.13.2'
|
|
||||||
]
|
|
||||||
versions.each { version ->
|
|
||||||
include ":$version"
|
include ":$version"
|
||||||
project(":$version").with {
|
project(":$version").with {
|
||||||
projectDir = file("versions/$version")
|
projectDir = file("versions/$version")
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ import net.minecraftforge.fml.ModList;
|
|||||||
//$$ import net.minecraftforge.fml.common.Mod.Instance;
|
//$$ import net.minecraftforge.fml.common.Mod.Instance;
|
||||||
//$$ import net.minecraftforge.fml.common.ModContainer;
|
//$$ import net.minecraftforge.fml.common.ModContainer;
|
||||||
//$$ import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
//$$ import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||||
//$$ import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
|
||||||
//$$ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
//$$ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||||
//$$ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
//$$ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
//#endif
|
//#endif
|
||||||
@@ -74,7 +73,6 @@ import net.minecraftforge.fml.common.gameevent.TickEvent;
|
|||||||
//$$ import cpw.mods.fml.common.Mod.Instance;
|
//$$ import cpw.mods.fml.common.Mod.Instance;
|
||||||
//$$ import cpw.mods.fml.common.ModContainer;
|
//$$ import cpw.mods.fml.common.ModContainer;
|
||||||
//$$ import cpw.mods.fml.common.event.FMLInitializationEvent;
|
//$$ import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||||
//$$ import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
|
||||||
//$$ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
//$$ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||||
//$$ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
//$$ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
//$$ import cpw.mods.fml.common.gameevent.TickEvent;
|
//$$ import cpw.mods.fml.common.gameevent.TickEvent;
|
||||||
@@ -158,7 +156,11 @@ public class ReplayMod implements Module {
|
|||||||
|
|
||||||
// Initialize the static OpenGL info field from the minecraft main thread
|
// 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
|
// Unfortunately lwjgl uses static methods so we have to make use of magic init calls as well
|
||||||
|
//#if MC>=11300
|
||||||
DeferredWorkQueue.runLater(OpenGLUtils::init);
|
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()));
|
||||||
@@ -177,14 +179,19 @@ public class ReplayMod implements Module {
|
|||||||
|
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
settingsRegistry.register();
|
settingsRegistry.register();
|
||||||
//#else
|
|
||||||
//$$ config = new Configuration(event.getSuggestedConfigurationFile());
|
|
||||||
//$$ config.load();
|
|
||||||
//$$ settingsRegistry.setConfiguration(config);
|
|
||||||
//$$ settingsRegistry.save(); // Save default values to disk
|
|
||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//#if MC<=11300
|
||||||
|
//$$ @EventHandler
|
||||||
|
//$$ public void init(FMLPreInitializationEvent event) {
|
||||||
|
//$$ config = new Configuration(event.getSuggestedConfigurationFile());
|
||||||
|
//$$ config.load();
|
||||||
|
//$$ settingsRegistry.setConfiguration(config);
|
||||||
|
//$$ settingsRegistry.save(); // Save default values to disk
|
||||||
|
//$$ }
|
||||||
|
//#endif
|
||||||
|
|
||||||
public KeyBindingRegistry getKeyBindingRegistry() {
|
public KeyBindingRegistry getKeyBindingRegistry() {
|
||||||
return keyBindingRegistry;
|
return keyBindingRegistry;
|
||||||
}
|
}
|
||||||
@@ -424,7 +431,6 @@ public class ReplayMod implements Module {
|
|||||||
|
|
||||||
private void printToChat(boolean warning, String message, Object... args) {
|
private void printToChat(boolean warning, String message, Object... args) {
|
||||||
if (getSettingsRegistry().get(Setting.NOTIFICATIONS)) {
|
if (getSettingsRegistry().get(Setting.NOTIFICATIONS)) {
|
||||||
/* FIXME: needs RuntimeInvisibleParameterAnnotations workaround
|
|
||||||
// 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
|
||||||
Style coloredDarkGray = new Style().setColor(TextFormatting.DARK_GRAY);
|
Style coloredDarkGray = new Style().setColor(TextFormatting.DARK_GRAY);
|
||||||
@@ -445,8 +451,7 @@ public class ReplayMod implements Module {
|
|||||||
//#endif
|
//#endif
|
||||||
// Send message to chat GUI
|
// Send message to chat GUI
|
||||||
// The ingame GUI is initialized at startup, therefore this is possible before the client is connected
|
// The ingame GUI is initialized at startup, therefore this is possible before the client is connected
|
||||||
*/
|
mc.ingameGUI.getChatGUI().printChatMessage(text);
|
||||||
mc.ingameGUI.getChatGUI().printChatMessage(new TextComponentTranslation(message, args));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
|||||||
|
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
// FIXME import net.minecraft.client.renderer.GlStateManager.BooleanState;
|
import net.minecraft.client.renderer.GlStateManager.BooleanState;
|
||||||
import net.minecraft.world.WorldType;
|
import net.minecraft.world.WorldType;
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
import net.minecraftforge.eventbus.api.IEventBus;
|
import net.minecraftforge.eventbus.api.IEventBus;
|
||||||
@@ -346,7 +346,7 @@ public class MCVer {
|
|||||||
return world.playerEntities;
|
return world.playerEntities;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static GlStateManager.BooleanState fog() {
|
public static BooleanState fog() {
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
return GlStateManager.FOG.fog;
|
return GlStateManager.FOG.fog;
|
||||||
//#else
|
//#else
|
||||||
@@ -362,7 +362,7 @@ public class MCVer {
|
|||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void fog(GlStateManager.BooleanState fog) {
|
public static void fog(BooleanState fog) {
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
GlStateManager.FOG.fog = fog;
|
GlStateManager.FOG.fog = fog;
|
||||||
//#else
|
//#else
|
||||||
@@ -378,7 +378,7 @@ public class MCVer {
|
|||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public static GlStateManager.BooleanState texture2DState(int index) {
|
public static BooleanState texture2DState(int index) {
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
return GlStateManager.TEXTURES[index].texture2DState;
|
return GlStateManager.TEXTURES[index].texture2DState;
|
||||||
//#else
|
//#else
|
||||||
@@ -390,7 +390,7 @@ public class MCVer {
|
|||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void texture2DState(int index, GlStateManager.BooleanState texture2DState) {
|
public static void texture2DState(int index, BooleanState texture2DState) {
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
GlStateManager.TEXTURES[index].texture2DState = texture2DState;
|
GlStateManager.TEXTURES[index].texture2DState = texture2DState;
|
||||||
//#else
|
//#else
|
||||||
|
|||||||
@@ -18,16 +18,16 @@ import de.johni0702.minecraft.gui.container.GuiScreen;
|
|||||||
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>=10800
|
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
//#else
|
//#else
|
||||||
//$$ import net.minecraftforge.common.config.Configuration;
|
//$$ import net.minecraftforge.common.config.Configuration;
|
||||||
|
//#if MC>=10800
|
||||||
//$$ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
//$$ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
//#endif
|
|
||||||
//#else
|
//#else
|
||||||
//$$ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
//$$ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
//#endif
|
//#endif
|
||||||
|
//#endif
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|||||||
@@ -36,7 +36,9 @@ import static com.replaymod.core.versions.MCVer.*;
|
|||||||
public class ReplayModRecording implements Module {
|
public class ReplayModRecording implements Module {
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger();
|
private static final Logger LOGGER = LogManager.getLogger();
|
||||||
|
//#if MC>=11300
|
||||||
private static final AttributeKey<Void> ATTR_CHECKED = AttributeKey.newInstance("ReplayModRecording_checked");
|
private static final AttributeKey<Void> ATTR_CHECKED = AttributeKey.newInstance("ReplayModRecording_checked");
|
||||||
|
//#endif
|
||||||
|
|
||||||
{ instance = this; }
|
{ instance = this; }
|
||||||
public static ReplayModRecording instance;
|
public static ReplayModRecording instance;
|
||||||
@@ -84,8 +86,10 @@ public class ReplayModRecording implements Module {
|
|||||||
public void initiateRecording(NetworkManager networkManager) {
|
public void initiateRecording(NetworkManager networkManager) {
|
||||||
Channel channel = networkManager.channel();
|
Channel channel = networkManager.channel();
|
||||||
if (channel.pipeline().get("ReplayModReplay_replaySender") != null) return;
|
if (channel.pipeline().get("ReplayModReplay_replaySender") != null) return;
|
||||||
|
//#if MC>=11300
|
||||||
if (channel.hasAttr(ATTR_CHECKED)) return;
|
if (channel.hasAttr(ATTR_CHECKED)) return;
|
||||||
channel.attr(ATTR_CHECKED).set(null);
|
channel.attr(ATTR_CHECKED).set(null);
|
||||||
|
//#endif
|
||||||
connectionEventHandler.onConnectedToServerEvent(networkManager);
|
connectionEventHandler.onConnectedToServerEvent(networkManager);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|||||||
import static net.minecraft.client.renderer.GlStateManager.*;
|
import static net.minecraft.client.renderer.GlStateManager.*;
|
||||||
//#else
|
//#else
|
||||||
//$$ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
//$$ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
//$$ import static com.replaymod.core.versions.MCVer.GlStateManager.*;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
import static com.replaymod.core.ReplayMod.TEXTURE;
|
import static com.replaymod.core.ReplayMod.TEXTURE;
|
||||||
|
|||||||
@@ -9,11 +9,16 @@ 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;
|
||||||
// FIXME import net.minecraft.client.resources.ResourcePackRepository;
|
|
||||||
import net.minecraft.util.HttpUtil;
|
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
|
||||||
|
// FIXME
|
||||||
|
//#else
|
||||||
|
//$$ import net.minecraft.client.resources.ResourcePackRepository;
|
||||||
|
//#endif
|
||||||
|
|
||||||
//#if MC>=10904
|
//#if MC>=10904
|
||||||
import net.minecraft.network.play.client.CPacketResourcePackStatus;
|
import net.minecraft.network.play.client.CPacketResourcePackStatus;
|
||||||
import net.minecraft.network.play.client.CPacketResourcePackStatus.Action;
|
import net.minecraft.network.play.client.CPacketResourcePackStatus.Action;
|
||||||
@@ -303,6 +308,7 @@ public class ResourcePackRecorder {
|
|||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
//#else
|
//#else
|
||||||
//$$ public synchronized S3FPacketCustomPayload handleResourcePack(S3FPacketCustomPayload packet) {
|
//$$ public synchronized S3FPacketCustomPayload handleResourcePack(S3FPacketCustomPayload packet) {
|
||||||
//$$ final int requestId = nextRequestId++;
|
//$$ final int requestId = nextRequestId++;
|
||||||
@@ -377,5 +383,4 @@ public class ResourcePackRecorder {
|
|||||||
//$$ }
|
//$$ }
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,7 +121,6 @@ public abstract class OpenGlFrameCapturer<F extends Frame, D extends CaptureData
|
|||||||
}
|
}
|
||||||
//#else
|
//#else
|
||||||
//$$ if (width != mc.displayWidth || height != mc.displayHeight) {
|
//$$ if (width != mc.displayWidth || height != mc.displayHeight) {
|
||||||
//$$ setWindowSize(width, height);
|
|
||||||
//$$ mc.resize(width, height);
|
//$$ mc.resize(width, height);
|
||||||
//$$ }
|
//$$ }
|
||||||
//#endif
|
//#endif
|
||||||
|
|||||||
@@ -18,10 +18,13 @@ 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 net.minecraft.client.renderer.texture.DynamicTexture;
|
import net.minecraft.client.renderer.texture.DynamicTexture;
|
||||||
import net.minecraft.client.renderer.texture.NativeImage;
|
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
//#if MC>=11300
|
||||||
|
import net.minecraft.client.renderer.texture.NativeImage;
|
||||||
|
//#endif
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
|
||||||
public class GuiVideoRenderer extends GuiScreen implements Tickable {
|
public class GuiVideoRenderer extends GuiScreen implements Tickable {
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import com.replaymod.render.hooks.EntityRendererHandler;
|
|||||||
import com.replaymod.replay.camera.CameraEntity;
|
import com.replaymod.replay.camera.CameraEntity;
|
||||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableColor;
|
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableColor;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.Matrix4f;
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
@@ -20,13 +19,15 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
|||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
import net.minecraft.client.renderer.GameRenderer;
|
|
||||||
import net.minecraft.client.renderer.WorldRenderer;
|
|
||||||
import net.minecraft.client.GameSettings;
|
import net.minecraft.client.GameSettings;
|
||||||
|
import net.minecraft.client.renderer.GameRenderer;
|
||||||
|
import net.minecraft.client.renderer.Matrix4f;
|
||||||
|
import net.minecraft.client.renderer.WorldRenderer;
|
||||||
//#else
|
//#else
|
||||||
//$$ import net.minecraft.client.renderer.EntityRenderer;
|
//$$ import net.minecraft.client.renderer.EntityRenderer;
|
||||||
//$$ import net.minecraft.client.renderer.RenderGlobal;
|
//$$ import net.minecraft.client.renderer.RenderGlobal;
|
||||||
//$$ import net.minecraft.client.settings.GameSettings;
|
//$$ import net.minecraft.client.settings.GameSettings;
|
||||||
|
//$$ import org.lwjgl.util.glu.Project;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=10904
|
//#if MC>=10904
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import net.minecraft.util.Timer;
|
|||||||
import org.lwjgl.glfw.GLFW;
|
import org.lwjgl.glfw.GLFW;
|
||||||
//#else
|
//#else
|
||||||
//$$ import net.minecraft.client.gui.ScaledResolution;
|
//$$ import net.minecraft.client.gui.ScaledResolution;
|
||||||
|
//$$ import org.lwjgl.input.Mouse;
|
||||||
//$$ import org.lwjgl.opengl.Display;
|
//$$ import org.lwjgl.opengl.Display;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
|
|||||||
@@ -506,16 +506,22 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
//$$ if (p instanceof S3FPacketCustomPayload) {
|
//$$ if (p instanceof S3FPacketCustomPayload) {
|
||||||
//$$ S3FPacketCustomPayload packet = (S3FPacketCustomPayload) p;
|
//$$ S3FPacketCustomPayload packet = (S3FPacketCustomPayload) p;
|
||||||
//#endif
|
//#endif
|
||||||
/* FIXME
|
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
String channelName = packet.getChannelName();
|
//#if MC>=11300
|
||||||
|
ResourceLocation channelName = packet.getChannelName();
|
||||||
|
//#else
|
||||||
|
//$$ String channelName = packet.getChannelName();
|
||||||
|
//#endif
|
||||||
//#else
|
//#else
|
||||||
//$$ String channelName = packet.func_149169_c();
|
//$$ String channelName = packet.func_149169_c();
|
||||||
//#endif
|
//#endif
|
||||||
if ("MC|BOpen".equals(channelName)) {
|
//#if MC>=11300
|
||||||
|
if (SPacketCustomPayload.BOOK_OPEN.equals(channelName)) {
|
||||||
|
//#else
|
||||||
|
//$$ if ("MC|BOpen".equals(channelName)) {
|
||||||
|
//#endif
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* FIXME
|
|
||||||
package com.replaymod.replay;
|
package com.replaymod.replay;
|
||||||
|
|
||||||
import com.replaymod.core.utils.WrappedTimer;
|
import com.replaymod.core.utils.WrappedTimer;
|
||||||
@@ -7,20 +6,21 @@ import com.replaymod.replay.camera.CameraEntity;
|
|||||||
import com.replaymod.replay.events.ReplayDispatchKeypressesEvent;
|
import com.replaymod.replay.events.ReplayDispatchKeypressesEvent;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraft.client.settings.GameSettings;
|
|
||||||
import net.minecraft.client.settings.KeyBinding;
|
import net.minecraft.client.settings.KeyBinding;
|
||||||
import net.minecraft.crash.CrashReport;
|
import net.minecraft.crash.CrashReport;
|
||||||
import net.minecraft.util.ReportedException;
|
|
||||||
import net.minecraft.util.Timer;
|
import net.minecraft.util.Timer;
|
||||||
import net.minecraftforge.client.ForgeHooksClient;
|
import net.minecraftforge.client.ForgeHooksClient;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import org.lwjgl.input.Keyboard;
|
|
||||||
import org.lwjgl.input.Mouse;
|
|
||||||
|
|
||||||
|
//#if MC>=11300
|
||||||
|
//#else
|
||||||
|
//$$ import net.minecraft.client.settings.GameSettings;
|
||||||
|
//$$ import org.lwjgl.input.Keyboard;
|
||||||
|
//$$ import org.lwjgl.input.Mouse;
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
//$$ import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||||
|
//$$
|
||||||
import java.io.IOException;
|
//$$ import java.io.IOException;
|
||||||
//#else
|
//#else
|
||||||
//$$ import cpw.mods.fml.common.FMLCommonHandler;
|
//$$ import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
//$$ import cpw.mods.fml.common.eventhandler.Event;
|
//$$ import cpw.mods.fml.common.eventhandler.Event;
|
||||||
@@ -28,6 +28,7 @@ import java.io.IOException;
|
|||||||
//$$
|
//$$
|
||||||
//$$ import static com.replaymod.core.versions.MCVer.FML_BUS;
|
//$$ import static com.replaymod.core.versions.MCVer.FML_BUS;
|
||||||
//#endif
|
//#endif
|
||||||
|
//#endif
|
||||||
|
|
||||||
public class InputReplayTimer extends WrappedTimer {
|
public class InputReplayTimer extends WrappedTimer {
|
||||||
private final ReplayModReplay mod;
|
private final ReplayModReplay mod;
|
||||||
@@ -39,6 +40,7 @@ public class InputReplayTimer extends WrappedTimer {
|
|||||||
this.mc = mod.getCore().getMinecraft();
|
this.mc = mod.getCore().getMinecraft();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* FIXME
|
||||||
@Override
|
@Override
|
||||||
public void updateTimer() {
|
public void updateTimer() {
|
||||||
super.updateTimer();
|
super.updateTimer();
|
||||||
@@ -260,9 +262,9 @@ public class InputReplayTimer extends WrappedTimer {
|
|||||||
|
|
||||||
FMLCommonHandler.instance().fireKeyInput();
|
FMLCommonHandler.instance().fireKeyInput();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
//#if MC<=10710
|
//#if MC<=10710
|
||||||
//$$ public static class RunScheduledTasks extends Event {}
|
//$$ public static class RunScheduledTasks extends Event {}
|
||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public class ReplayModReplay implements Module {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerKeyBindings(KeyBindingRegistry registry) {
|
public void registerKeyBindings(KeyBindingRegistry registry) {
|
||||||
registry.registerKeyBinding("replaymod.input.marker", MCVer.Keyboard.KEY_M, new Runnable() {
|
registry.registerKeyBinding("replaymod.input.marker", Keyboard.KEY_M, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (replayHandler != null ) {
|
if (replayHandler != null ) {
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public class GuiHandler {
|
|||||||
// Replace "Exit Server" button with "Exit Replay" button
|
// Replace "Exit Server" button with "Exit Replay" button
|
||||||
case BUTTON_EXIT_SERVER:
|
case BUTTON_EXIT_SERVER:
|
||||||
removeButton(event, b);
|
removeButton(event, b);
|
||||||
addButton(event, new GuiButton(BUTTON_EXIT_REPLAY, b.x, b.y, b.width, b.height, I18n.format("replaymod.gui.exit")) {
|
addButton(event, new GuiButton(BUTTON_EXIT_REPLAY, x(b), y(b), b.width, b.height, I18n.format("replaymod.gui.exit")) {
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
@Override
|
@Override
|
||||||
public void onClick(double mouseX, double mouseY) {
|
public void onClick(double mouseX, double mouseY) {
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public abstract class MixinPlayerControllerMP {
|
|||||||
//$$ private NetHandlerPlayClient netClientHandler;
|
//$$ private NetHandlerPlayClient netClientHandler;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=11200
|
//#if MC>=11300
|
||||||
@Inject(method = "createPlayer", at=@At("HEAD"), cancellable = true)
|
@Inject(method = "createPlayer", at=@At("HEAD"), cancellable = true)
|
||||||
private void replayModReplay_createReplayCamera(World worldIn, StatisticsManager statisticsManager, RecipeBookClient recipeBookClient, CallbackInfoReturnable<EntityPlayerSP> ci) {
|
private void replayModReplay_createReplayCamera(World worldIn, StatisticsManager statisticsManager, RecipeBookClient recipeBookClient, CallbackInfoReturnable<EntityPlayerSP> ci) {
|
||||||
if (ReplayModReplay.instance.getReplayHandler() != null) {
|
if (ReplayModReplay.instance.getReplayHandler() != null) {
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ configurations {
|
|||||||
shade
|
shade
|
||||||
compile.extendsFrom shade
|
compile.extendsFrom shade
|
||||||
|
|
||||||
shade.exclude group: 'com.google.code.gson', module: 'gson' // provided by MC
|
// FIXME seems to be inherited now? shade.exclude group: 'com.google.code.gson', module: 'gson' // provided by MC
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
@@ -158,13 +158,19 @@ dependencies {
|
|||||||
][mcVersion]
|
][mcVersion]
|
||||||
}
|
}
|
||||||
|
|
||||||
annotationProcessor group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
|
if (FG3) {
|
||||||
compileOnly group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
|
// FIXME gson should be bundled with MC, not sure why forge doesn't add it (probably related to above shade.exclude)
|
||||||
|
annotationProcessor group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
|
||||||
|
compileOnly group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
|
||||||
|
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
|
||||||
|
}
|
||||||
|
|
||||||
// compile 'com.github.SpongePowered:Mixin:404f5da' // 0.7.5-SNAPSHOT
|
// compile 'com.github.SpongePowered:Mixin:404f5da' // 0.7.5-SNAPSHOT
|
||||||
// ^ mixin doesn't compile on jitpack, so we'll have to depend on the SNAPSHOT and build it manually for reprod
|
// ^ mixin doesn't compile on jitpack, so we'll have to depend on the SNAPSHOT and build it manually for reprod
|
||||||
annotationProcessor 'org.spongepowered:mixin:0.7.8-SNAPSHOT'
|
if (!gradle.gradleVersion.startsWith('3.')) {
|
||||||
compileOnly 'org.spongepowered:mixin:0.7.8-SNAPSHOT'
|
annotationProcessor 'org.spongepowered:mixin:0.7.8-SNAPSHOT'
|
||||||
|
compileOnly 'org.spongepowered:mixin:0.7.8-SNAPSHOT'
|
||||||
|
}
|
||||||
compile 'org.spongepowered:mixin:0.7.8-SNAPSHOT'
|
compile 'org.spongepowered:mixin:0.7.8-SNAPSHOT'
|
||||||
shade 'com.googlecode.mp4parser:isoparser:1.1.7'
|
shade 'com.googlecode.mp4parser:isoparser:1.1.7'
|
||||||
shade 'org.apache.commons:commons-exec:1.3'
|
shade 'org.apache.commons:commons-exec:1.3'
|
||||||
@@ -191,7 +197,9 @@ dependencies {
|
|||||||
exclude group: 'org.projectlombok', module: 'lombok' // runtime only for @SneakyThrows which isn't used
|
exclude group: 'org.projectlombok', module: 'lombok' // runtime only for @SneakyThrows which isn't used
|
||||||
}
|
}
|
||||||
|
|
||||||
annotationProcessor 'org.projectlombok:lombok:1.16.6'
|
if (!gradle.gradleVersion.startsWith('3.')) {
|
||||||
|
annotationProcessor 'org.projectlombok:lombok:1.16.6'
|
||||||
|
}
|
||||||
compile 'org.projectlombok:lombok:1.16.6' // runtime only for @SneakyThrows which isn't used
|
compile 'org.projectlombok:lombok:1.16.6' // runtime only for @SneakyThrows which isn't used
|
||||||
|
|
||||||
testCompile 'junit:junit:4.11'
|
testCompile 'junit:junit:4.11'
|
||||||
|
|||||||
Reference in New Issue
Block a user