-
-
Notifications
You must be signed in to change notification settings - Fork 6
FG Legacy Bulk tests #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
LexManos
wants to merge
2
commits into
MinecraftForge:master
Choose a base branch
from
LexManos:FGLegacy
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| plugins { | ||
| id 'java' | ||
| id 'net.minecraftforge.gradle' version "${gradle_version}" | ||
| } | ||
|
|
||
| java.toolchain.languageVersion = JavaLanguageVersion.of(8) | ||
|
|
||
| minecraft { | ||
| mappings channel: 'snapshot', version: mapping_version | ||
| runs { | ||
| register('client') { | ||
| workingDir = file('runs/main/client/') | ||
| } | ||
| register('server') { | ||
| args '--nogui', 'fml_bug', '--port', 25565 + 1102 | ||
| workingDir = file('runs/main/server/') | ||
| } | ||
| } | ||
| } | ||
|
|
||
| apply from: file('../shared.gradle') | ||
|
|
||
| dependencies { | ||
| implementation minecraft.dependency("net.minecraftforge:forge:${minecraft_version}-${forge_version}") | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| minecraft_version=1.10.2 | ||
| forge_version=12.18.3.2511 | ||
| mapping_version=20161111-1.10.2 |
39 changes: 39 additions & 0 deletions
39
_internal/fg7/minecraft/1.10.2/src/main/java/net/miencraftforge/test/TestMod.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| package net.miencraftforge.test; | ||
|
|
||
| import net.minecraftforge.common.ForgeModContainer; | ||
| import net.minecraftforge.common.MinecraftForge; | ||
| import net.minecraftforge.common.config.Property; | ||
| import net.minecraftforge.fml.common.FMLCommonHandler; | ||
| import net.minecraftforge.fml.common.Mod; | ||
| import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; | ||
| import net.minecraftforge.fml.common.gameevent.TickEvent; | ||
| import net.minecraftforge.fml.relauncher.Side; | ||
|
|
||
| import java.io.File; | ||
| import java.io.IOException; | ||
| import java.nio.charset.StandardCharsets; | ||
| import java.nio.file.Files; | ||
|
|
||
| @Mod(modid = "test") | ||
| public class TestMod { | ||
| public TestMod() { | ||
| Property update_check = ForgeModContainer.getConfig().get(ForgeModContainer.VERSION_CHECK_CAT, "Global", true); | ||
| update_check.set(false); | ||
| // Only register out handler on the server so i can test loading into the full world | ||
| if (FMLCommonHandler.instance().getSide() == Side.SERVER) | ||
| MinecraftForge.EVENT_BUS.register(this); | ||
| } | ||
|
|
||
| @SubscribeEvent | ||
| public void onServerTick(TickEvent.ServerTickEvent event) { | ||
| if (event.phase != TickEvent.Phase.END) return; | ||
| System.out.println("SERVER_TICK_SUCCESS"); | ||
| try { | ||
| Files.write(new File("test_marker.txt").toPath(), "SERVER_TICK_SUCCESS".getBytes(StandardCharsets.UTF_8)); | ||
| } catch (IOException e) { | ||
| throw new RuntimeException(e); | ||
| } finally { | ||
| FMLCommonHandler.instance().getMinecraftServerInstance().initiateShutdown(); | ||
| } | ||
| } | ||
| } |
9 changes: 9 additions & 0 deletions
9
_internal/fg7/minecraft/1.10.2/src/main/resources/META-INF/mods.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| modLoader="javafml" | ||
| loaderVersion="*" | ||
| license="Example" | ||
|
|
||
| [[mods]] | ||
| modId="test" | ||
| version="0.0" | ||
| displayName="" | ||
| description="" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| plugins { | ||
| id 'java' | ||
| id 'net.minecraftforge.gradle' version "${gradle_version}" | ||
| } | ||
|
|
||
| java.toolchain.languageVersion = JavaLanguageVersion.of(8) | ||
|
|
||
| minecraft { | ||
| mappings channel: 'snapshot', version: mapping_version | ||
| runs { | ||
| register('client') { | ||
| workingDir = file('runs/main/client/') | ||
| } | ||
| register('server') { | ||
| args '--nogui', 'fml_bug', '--port', 25565 + 1112 | ||
| workingDir = file('runs/main/server/') | ||
| } | ||
| } | ||
| } | ||
|
|
||
| apply from: file('../shared.gradle') | ||
|
|
||
| dependencies { | ||
| implementation minecraft.dependency("net.minecraftforge:forge:${minecraft_version}-${forge_version}") | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| minecraft_version=1.11.2 | ||
| forge_version=13.20.1.2588 | ||
| mapping_version=20161220-1.11 |
39 changes: 39 additions & 0 deletions
39
_internal/fg7/minecraft/1.11.2/src/main/java/net/miencraftforge/test/TestMod.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| package net.miencraftforge.test; | ||
|
|
||
| import net.minecraftforge.common.ForgeModContainer; | ||
| import net.minecraftforge.common.MinecraftForge; | ||
| import net.minecraftforge.common.config.Property; | ||
| import net.minecraftforge.fml.common.FMLCommonHandler; | ||
| import net.minecraftforge.fml.common.Mod; | ||
| import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; | ||
| import net.minecraftforge.fml.common.gameevent.TickEvent; | ||
| import net.minecraftforge.fml.relauncher.Side; | ||
|
|
||
| import java.io.File; | ||
| import java.io.IOException; | ||
| import java.nio.charset.StandardCharsets; | ||
| import java.nio.file.Files; | ||
|
|
||
| @Mod(modid = "test") | ||
| public class TestMod { | ||
| public TestMod() { | ||
| Property update_check = ForgeModContainer.getConfig().get(ForgeModContainer.VERSION_CHECK_CAT, "Global", true); | ||
| update_check.set(false); | ||
| // Only register out handler on the server so i can test loading into the full world | ||
| if (FMLCommonHandler.instance().getSide() == Side.SERVER) | ||
| MinecraftForge.EVENT_BUS.register(this); | ||
| } | ||
|
|
||
| @SubscribeEvent | ||
| public void onServerTick(TickEvent.ServerTickEvent event) { | ||
| if (event.phase != TickEvent.Phase.END) return; | ||
| System.out.println("SERVER_TICK_SUCCESS"); | ||
| try { | ||
| Files.write(new File("test_marker.txt").toPath(), "SERVER_TICK_SUCCESS".getBytes(StandardCharsets.UTF_8)); | ||
| } catch (IOException e) { | ||
| throw new RuntimeException(e); | ||
| } finally { | ||
| FMLCommonHandler.instance().getMinecraftServerInstance().initiateShutdown(); | ||
| } | ||
| } | ||
| } |
9 changes: 9 additions & 0 deletions
9
_internal/fg7/minecraft/1.11.2/src/main/resources/META-INF/mods.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| modLoader="javafml" | ||
| loaderVersion="*" | ||
| license="Example" | ||
|
|
||
| [[mods]] | ||
| modId="test" | ||
| version="0.0" | ||
| displayName="" | ||
| description="" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| plugins { | ||
| id 'java' | ||
| id 'net.minecraftforge.gradle' version "${gradle_version}" | ||
| } | ||
|
|
||
| java.toolchain.languageVersion = JavaLanguageVersion.of(8) | ||
|
|
||
| minecraft { | ||
| mappings channel: 'snapshot', version: mapping_version | ||
| runs { | ||
| register('client') { | ||
| workingDir = file('runs/main/client/') | ||
| } | ||
| register('server') { | ||
| args '--nogui', 'fml_bug', '--port', 25565 + 1122 + 1 // we have 2 1.12.2 versions, FG2/3 | ||
| workingDir = file('runs/main/server/') | ||
| } | ||
| } | ||
| } | ||
|
|
||
| apply from: file('../shared.gradle') | ||
|
|
||
| dependencies { | ||
| implementation minecraft.dependency("net.minecraftforge:forge:${minecraft_version}-${forge_version}") | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| minecraft_version=1.12.2 | ||
| forge_version=14.23.5.2847 | ||
| mapping_version=20171003-1.12 |
39 changes: 39 additions & 0 deletions
39
_internal/fg7/minecraft/1.12.2-fg2/src/main/java/net/miencraftforge/test/TestMod.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| package net.miencraftforge.test; | ||
|
|
||
| import net.minecraftforge.common.ForgeModContainer; | ||
| import net.minecraftforge.common.MinecraftForge; | ||
| import net.minecraftforge.common.config.Property; | ||
| import net.minecraftforge.fml.common.FMLCommonHandler; | ||
| import net.minecraftforge.fml.common.Mod; | ||
| import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; | ||
| import net.minecraftforge.fml.common.gameevent.TickEvent; | ||
| import net.minecraftforge.fml.relauncher.Side; | ||
|
|
||
| import java.io.File; | ||
| import java.io.IOException; | ||
| import java.nio.charset.StandardCharsets; | ||
| import java.nio.file.Files; | ||
|
|
||
| @Mod(modid = "test") | ||
| public class TestMod { | ||
| public TestMod() { | ||
| Property update_check = ForgeModContainer.getConfig().get(ForgeModContainer.VERSION_CHECK_CAT, "Global", true); | ||
| update_check.set(false); | ||
| // Only register out handler on the server so i can test loading into the full world | ||
| if (FMLCommonHandler.instance().getSide() == Side.SERVER) | ||
| MinecraftForge.EVENT_BUS.register(this); | ||
| } | ||
|
|
||
| @SubscribeEvent | ||
| public void onServerTick(TickEvent.ServerTickEvent event) { | ||
| if (event.phase != TickEvent.Phase.END) return; | ||
| System.out.println("SERVER_TICK_SUCCESS"); | ||
| try { | ||
| Files.write(new File("test_marker.txt").toPath(), "SERVER_TICK_SUCCESS".getBytes(StandardCharsets.UTF_8)); | ||
| } catch (IOException e) { | ||
| throw new RuntimeException(e); | ||
| } finally { | ||
| FMLCommonHandler.instance().getMinecraftServerInstance().initiateShutdown(); | ||
| } | ||
| } | ||
| } |
9 changes: 9 additions & 0 deletions
9
_internal/fg7/minecraft/1.12.2-fg2/src/main/resources/META-INF/mods.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| modLoader="javafml" | ||
| loaderVersion="*" | ||
| license="Example" | ||
|
|
||
| [[mods]] | ||
| modId="test" | ||
| version="0.0" | ||
| displayName="" | ||
| description="" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| plugins { | ||
| id 'java' | ||
| id 'net.minecraftforge.gradle' version "${gradle_version}" | ||
| } | ||
|
|
||
| java.toolchain.languageVersion = JavaLanguageVersion.of(8) | ||
| // Forge 1.6.4 ships ASM 4.1 which does not support java 8 | ||
| // Either we have to bump the libraries (which is fine) or compile our code for java 6 | ||
| tasks.withType(JavaCompile) { | ||
| options.fork = true | ||
| options.compilerArgs += ['-source', '1.6', '-target', '1.6'] | ||
| } | ||
|
|
||
| minecraft { | ||
| mappings channel: 'snapshot', version: mapping_version | ||
| runs { | ||
| register('client') { | ||
| workingDir = file('runs/main/client/') | ||
| } | ||
| register('server') { | ||
| args '--nogui', 'fml_bug', '--port', 25565 + 164 | ||
| workingDir = file('runs/main/server/') | ||
| } | ||
| } | ||
| } | ||
|
|
||
| apply from: file('../shared.gradle') | ||
|
|
||
| dependencies { | ||
| implementation minecraft.dependency("net.minecraftforge:forge:${minecraft_version}-${forge_version}") | ||
| // This is required by old Forge versions because Java 8u20 changed the sorting implementation for Lists | ||
| // And that causes a ConcurrentModificationException, this **could** be added by Mavenizer but i'm on the fence for doing that. | ||
| // https://github.com/MinecraftForge/LegacyJavaFixer/blob/master/src/main/java/net/minecraftforge/legacyjavafixer/sort/LegacyJavaSortTweaker.java | ||
| implementation('net.minecraftforge.lex:legacyjavafixer:1.0') | ||
| // This will bump ASM to a version that supports java 8, also possible to do in mavenizer, but wanted to verify things work on the users side | ||
| //implementation('org.ow2.asm:asm-debug-all:5.1') | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| minecraft_version=1.6.4 | ||
| forge_version=9.11.1.964 | ||
| mapping_version=20130918-1.6.3 |
53 changes: 53 additions & 0 deletions
53
_internal/fg7/minecraft/1.6.4/src/main/java/net/miencraftforge/test/TestMod.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| package net.miencraftforge.test; | ||
|
|
||
| import cpw.mods.fml.common.FMLCommonHandler; | ||
| import cpw.mods.fml.common.ITickHandler; | ||
| import cpw.mods.fml.common.Mod; | ||
| import cpw.mods.fml.common.TickType; | ||
| import cpw.mods.fml.common.registry.TickRegistry; | ||
| import cpw.mods.fml.relauncher.Side; | ||
|
|
||
| import java.io.File; | ||
| import java.io.IOException; | ||
| import java.nio.charset.StandardCharsets; | ||
| import java.nio.file.Files; | ||
| import java.util.EnumSet; | ||
| import java.util.logging.LogManager; | ||
| import java.util.logging.Logger; | ||
|
|
||
| @Mod(modid = "test") | ||
| public class TestMod implements ITickHandler { | ||
| private static final Logger LOG = LogManager.getLogManager().getLogger("test"); | ||
| public TestMod() { | ||
| LOG.info("Loaded: " + FMLCommonHandler.instance().getSide()); | ||
| // Only register out handler on the server so I can test loading into the full world | ||
| if (FMLCommonHandler.instance().getSide() == Side.SERVER) | ||
| TickRegistry.registerTickHandler(this, Side.SERVER); | ||
| } | ||
|
|
||
| @Override | ||
| public void tickStart(EnumSet<TickType> type, Object... tickData) { | ||
| } | ||
|
|
||
| @Override | ||
| public void tickEnd(EnumSet<TickType> type, Object... tickData) { | ||
| LOG.info("SERVER_TICK_SUCCESS " + new File("test_marker.txt").getAbsolutePath()); | ||
| try { | ||
| Files.write(new File("test_marker.txt").toPath(), "SERVER_TICK_SUCCESS".getBytes(StandardCharsets.UTF_8)); | ||
| } catch (IOException e) { | ||
| throw new RuntimeException(e); | ||
| } finally { | ||
| FMLCommonHandler.instance().getMinecraftServerInstance().initiateShutdown(); | ||
| } | ||
| } | ||
|
|
||
| @Override | ||
| public EnumSet<TickType> ticks() { | ||
| return EnumSet.of(TickType.SERVER); | ||
| } | ||
|
|
||
| @Override | ||
| public String getLabel() { | ||
| return "test"; | ||
| } | ||
| } |
9 changes: 9 additions & 0 deletions
9
_internal/fg7/minecraft/1.6.4/src/main/resources/META-INF/mods.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| modLoader="javafml" | ||
| loaderVersion="*" | ||
| license="Example" | ||
|
|
||
| [[mods]] | ||
| modId="test" | ||
| version="0.0" | ||
| displayName="" | ||
| description="" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding LegacyFixer this way doesn't work, possibly because the game launches before it's applied. We can only add it manually to the working directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ill double check when im back at a computer. I might of added it to my mods folder and forgot while working on other things.
If that is the case. Then it is most likely due to FML not scanning the classpath for tweakers.
Would you happen to know off hand what FML for 1.6.4 DOES scan for tweakers? Im sure itnscans more then just the mods folder as how else would it find in-dev tweakers. Perhaps it just needs an environemt variable of something.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand these underlying things, but I can search the FML source code to try to get relevant information.
I even discovered by reading the source code that AccessTransformer in version 1.6.4 is not automatically applied in the runtime environment; a separate Coremod plugin needs to be written to add a class that inherits from AccessTransformer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to find it on my phone. need to provide fml.coreMods.load
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/MinecraftForge/LegacyJavaFixer/blob/6d7b866821fe12da4778fda247c1a6af09dd254d/src/main/java/net/minecraftforge/legacyjavafixer/sort/LegacyJavaSortDummyLoadingPlugin.java#L22
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's strange that the JAR file I got from Forge Maven doesn't have this namespace and class, but the reference still works.
EDIT:Actually, there were too many irrelevant error codes, and CNF exceptions were pushed to the top. I misread it.