-
-
Notifications
You must be signed in to change notification settings - Fork 23
CoreMods 5.2: ES6 language support, additional ASMAPI methods, and all-around cleanup #64
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
Closed
Jonathing
wants to merge
1
commit into
MinecraftForge:master
from
Jonathing:feat/jonathing/master/final-cleanup-for-real
Closed
Changes from all commits
Commits
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 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 |
---|---|---|
@@ -1,13 +1,23 @@ | ||
# CoreMods | ||
|
||
New JavaScript based system for implementing CoreMods. | ||
CoreMods is a JavaScript-based system that acts as a wrapper around ObjectWeb ASM. | ||
|
||
Why? | ||
## Purpose | ||
|
||
Because it means that it's a lot easier to manage the lifecycle correctly. We can isolate | ||
CoreMod logic to the proper ClassLoading contexts without effort on the part of the Modder. | ||
CoreMods need to be sandboxed, or otherwise isolated, in their own environments so that they are not able to cause early | ||
class-loading. They transform classes as only as they are loaded and do not have access to objects outside of the | ||
sandbox given to them. This helps prevent issues that would otherwise arise from CoreMods written traditionally in Java. | ||
|
||
It hopefully also communicates that CoreMods are strictly arms-length : they operate on | ||
classes as they load _only_ - changing structures and behaviours through that means. | ||
Since CoreMods integrates with ModLauncher's transformation system, it is easier to manage the lifecycle as CoreMods is | ||
only responsible for managing the transformation as ModLauncher is instead the one responsible for providing the class | ||
loading system. | ||
|
||
This is connected to Forge and FML through the CoreMod SPI being implemented in new Forge. | ||
## Usage | ||
|
||
CoreMods are JavaScript files that are sandboxed by the limitations provided within the CoreMod engine. It is only able | ||
to access a limited set of classes and packages. ASMAPI, included within CoreMods, exists to provide several helpful | ||
tools for writing CoreMods. You can view this class yourself to see its usages, or you can find examples of it in other | ||
CoreMods. | ||
|
||
The best way to find examples for CoreMods is to look at Forge itself, since it includes complex examples that utilize | ||
much of the functionality within the sandbox. |
This file contains 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 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 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 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 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 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 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 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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
/* | ||
* Copyright (c) Forge Development LLC | ||
* SPDX-License-Identifier: LGPL-2.1-only | ||
*/ | ||
function moreFunctions() { | ||
print("Poopy from more functions!"); | ||
} |
This file contains 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 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 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
1 change: 0 additions & 1 deletion
1
...test/src/test/resources/META-INF/services/cpw.mods.modlauncher.api.ITransformationService
This file was deleted.
Oops, something went wrong.
This file contains 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 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,20 @@ | ||
/* | ||
* Copyright (c) Forge Development LLC | ||
* SPDX-License-Identifier: LGPL-2.1-only | ||
*/ | ||
module net.minecraftforge.coremod { | ||
// CoreMods framework | ||
exports net.minecraftforge.coremod; | ||
// ASMAPI | ||
exports net.minecraftforge.coremod.api; | ||
|
||
requires cpw.mods.modlauncher; | ||
requires net.minecraftforge.forgespi; | ||
requires org.apache.logging.log4j; | ||
requires org.jetbrains.annotations; | ||
requires org.openjdk.nashorn; | ||
requires org.objectweb.asm.util; | ||
|
||
provides net.minecraftforge.forgespi.coremod.ICoreModProvider | ||
with net.minecraftforge.coremod.CoreModProvider; | ||
} |
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.
I would personally prefer if these licence headers were skipped for JS files, but leaving Lex to decide on that. Note that Nashorn has a fast-path for files under 512 bytes, so adding licence headers may slow down load times.
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.
Honestly I have no opinion on this, I don't think it matters tho especially for test scripts as they should be small and are only used for tests not production.
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.
What about the CoreMods in Forge itself?
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.
All of them are already over 512B so its a non-issue having the headers in there.