1.17+ Support / Java Settings by Instance (#50)
* Initial 1.17 configuration, dep upgrade. * Enable 1.18 for initial tests. * Add lowcodelanguage for 1.18 (#49) * Set classpath flag for 1.17+ generated files. Enable 1.19 (not yet working). * Support 1.19. Co-authored-by: Matt Artist <me@mja00.dev>
This commit is contained in:
859
package-lock.json
generated
859
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
28
package.json
28
package.json
@@ -29,29 +29,29 @@
|
|||||||
"homepage": "https://github.com/dscalzi/Nebula#readme",
|
"homepage": "https://github.com/dscalzi/Nebula#readme",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/fs-extra": "^9.0.13",
|
"@types/fs-extra": "^9.0.13",
|
||||||
"@types/luxon": "^3.0.0",
|
"@types/luxon": "^3.1.0",
|
||||||
"@types/minimatch": "^3.0.5",
|
"@types/minimatch": "^5.1.2",
|
||||||
"@types/node": "^16.11.46",
|
"@types/node": "^16.18.3",
|
||||||
"@types/triple-beam": "^1.3.2",
|
"@types/triple-beam": "^1.3.2",
|
||||||
"@types/yargs": "^17.0.10",
|
"@types/yargs": "^17.0.14",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.31.0",
|
"@typescript-eslint/eslint-plugin": "^5.44.0",
|
||||||
"@typescript-eslint/parser": "^5.31.0",
|
"@typescript-eslint/parser": "^5.44.0",
|
||||||
"eslint": "^8.20.0",
|
"eslint": "^8.28.0",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"typescript": "^4.7.4"
|
"typescript": "^4.9.3"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"dotenv": "^16.0.1",
|
"dotenv": "^16.0.3",
|
||||||
"fs-extra": "^10.1.0",
|
"fs-extra": "^10.1.0",
|
||||||
"got": "^11.8.5",
|
"got": "^11.8.5",
|
||||||
"helios-distribution-types": "^1.0.0",
|
"helios-distribution-types": "^1.1.0",
|
||||||
"luxon": "^3.0.1",
|
"luxon": "^3.1.0",
|
||||||
"minimatch": "^5.1.0",
|
"minimatch": "^5.1.0",
|
||||||
"node-stream-zip": "^1.15.0",
|
"node-stream-zip": "^1.15.0",
|
||||||
"toml": "^3.0.0",
|
"toml": "^3.0.0",
|
||||||
"triple-beam": "^1.3.0",
|
"triple-beam": "^1.3.0",
|
||||||
"ts-json-schema-generator": "^1.0.0",
|
"ts-json-schema-generator": "^1.1.2",
|
||||||
"winston": "^3.8.1",
|
"winston": "^3.8.2",
|
||||||
"yargs": "^17.5.1"
|
"yargs": "^17.6.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ interface GeneratedFile {
|
|||||||
version: string
|
version: string
|
||||||
classifiers: string[] | [undefined]
|
classifiers: string[] | [undefined]
|
||||||
skipIfNotPresent?: boolean
|
skipIfNotPresent?: boolean
|
||||||
|
classpath?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ForgeGradle3Adapter extends ForgeResolver {
|
export class ForgeGradle3Adapter extends ForgeResolver {
|
||||||
@@ -31,7 +32,7 @@ export class ForgeGradle3Adapter extends ForgeResolver {
|
|||||||
if(version.getMinor() === 12 && VersionUtil.isOneDotTwelveFG2(libraryVersion)) {
|
if(version.getMinor() === 12 && VersionUtil.isOneDotTwelveFG2(libraryVersion)) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return VersionUtil.isVersionAcceptable(version, [12, 13, 14, 15, 16])
|
return VersionUtil.isVersionAcceptable(version, [12, 13, 14, 15, 16, 17, 18, 19])
|
||||||
}
|
}
|
||||||
|
|
||||||
private generatedFiles: GeneratedFile[] | undefined
|
private generatedFiles: GeneratedFile[] | undefined
|
||||||
@@ -51,33 +52,31 @@ export class ForgeGradle3Adapter extends ForgeResolver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private configure(): void {
|
private configure(): void {
|
||||||
// Configure for 13, 14, 15, 16
|
|
||||||
if(VersionUtil.isVersionAcceptable(this.minecraftVersion, [13, 14, 15, 16])) {
|
const is117OrGreater = this.minecraftVersion.getMinor() >= 17
|
||||||
|
|
||||||
|
// Configure for 13, 14, 15, 16, 17, 18, 19
|
||||||
|
if(VersionUtil.isVersionAcceptable(this.minecraftVersion, [13, 14, 15, 16, 17, 18, 19])) {
|
||||||
|
|
||||||
// https://github.com/MinecraftForge/MinecraftForge/commit/97d4652f5fe15931b980117efabdff332f9f6428
|
// https://github.com/MinecraftForge/MinecraftForge/commit/97d4652f5fe15931b980117efabdff332f9f6428
|
||||||
const mcpUnifiedVersion = `${this.minecraftVersion}-${ForgeGradle3Adapter.WILDCARD_MCP_VERSION}`
|
const mcpUnifiedVersion = `${this.minecraftVersion}-${ForgeGradle3Adapter.WILDCARD_MCP_VERSION}`
|
||||||
|
|
||||||
this.generatedFiles = [
|
this.generatedFiles = [
|
||||||
{
|
|
||||||
name: 'base jar',
|
|
||||||
group: LibRepoStructure.FORGE_GROUP,
|
|
||||||
artifact: LibRepoStructure.FORGE_ARTIFACT,
|
|
||||||
version: this.artifactVersion,
|
|
||||||
classifiers: [undefined]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'universal jar',
|
name: 'universal jar',
|
||||||
group: LibRepoStructure.FORGE_GROUP,
|
group: LibRepoStructure.FORGE_GROUP,
|
||||||
artifact: LibRepoStructure.FORGE_ARTIFACT,
|
artifact: LibRepoStructure.FORGE_ARTIFACT,
|
||||||
version: this.artifactVersion,
|
version: this.artifactVersion,
|
||||||
classifiers: ['universal']
|
classifiers: ['universal'],
|
||||||
|
classpath: !is117OrGreater
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'client jar',
|
name: 'client jar',
|
||||||
group: LibRepoStructure.FORGE_GROUP,
|
group: LibRepoStructure.FORGE_GROUP,
|
||||||
artifact: LibRepoStructure.FORGE_ARTIFACT,
|
artifact: LibRepoStructure.FORGE_ARTIFACT,
|
||||||
version: this.artifactVersion,
|
version: this.artifactVersion,
|
||||||
classifiers: ['client']
|
classifiers: ['client'],
|
||||||
|
classpath: !is117OrGreater
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'client data',
|
name: 'client data',
|
||||||
@@ -85,22 +84,85 @@ export class ForgeGradle3Adapter extends ForgeResolver {
|
|||||||
artifact: LibRepoStructure.MINECRAFT_CLIENT_ARTIFACT,
|
artifact: LibRepoStructure.MINECRAFT_CLIENT_ARTIFACT,
|
||||||
version: this.minecraftVersion.toString(),
|
version: this.minecraftVersion.toString(),
|
||||||
classifiers: ['data'],
|
classifiers: ['data'],
|
||||||
skipIfNotPresent: true
|
skipIfNotPresent: true,
|
||||||
|
classpath: !is117OrGreater
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'client srg',
|
name: 'client srg',
|
||||||
group: LibRepoStructure.MINECRAFT_GROUP,
|
group: LibRepoStructure.MINECRAFT_GROUP,
|
||||||
artifact: LibRepoStructure.MINECRAFT_CLIENT_ARTIFACT,
|
artifact: LibRepoStructure.MINECRAFT_CLIENT_ARTIFACT,
|
||||||
version: mcpUnifiedVersion,
|
version: mcpUnifiedVersion,
|
||||||
classifiers: ['srg']
|
classifiers: ['srg'],
|
||||||
|
classpath: !is117OrGreater
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
this.wildcardsInUse = [
|
this.wildcardsInUse = [
|
||||||
ForgeGradle3Adapter.WILDCARD_MCP_VERSION
|
ForgeGradle3Adapter.WILDCARD_MCP_VERSION
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if(VersionUtil.isVersionAcceptable(this.minecraftVersion, [13, 14, 15, 16])) {
|
||||||
|
|
||||||
|
// Base jar present for 1.13-1.16
|
||||||
|
|
||||||
|
this.generatedFiles.unshift(
|
||||||
|
{
|
||||||
|
name: 'base jar',
|
||||||
|
group: LibRepoStructure.FORGE_GROUP,
|
||||||
|
artifact: LibRepoStructure.FORGE_ARTIFACT,
|
||||||
|
version: this.artifactVersion,
|
||||||
|
classifiers: [undefined]
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if(VersionUtil.isVersionAcceptable(this.minecraftVersion, [17, 18, 19])) {
|
||||||
|
|
||||||
|
// Added in 1.17+
|
||||||
|
|
||||||
|
this.generatedFiles.unshift(
|
||||||
|
{
|
||||||
|
name: 'fmlcore',
|
||||||
|
group: LibRepoStructure.FORGE_GROUP,
|
||||||
|
artifact: LibRepoStructure.FMLCORE_ARTIFACT,
|
||||||
|
version: this.artifactVersion,
|
||||||
|
classifiers: [undefined]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'javafmllanguage',
|
||||||
|
group: LibRepoStructure.FORGE_GROUP,
|
||||||
|
artifact: LibRepoStructure.JAVAFMLLANGUAGE_ARTIFACT,
|
||||||
|
version: this.artifactVersion,
|
||||||
|
classifiers: [undefined]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'mclanguage',
|
||||||
|
group: LibRepoStructure.FORGE_GROUP,
|
||||||
|
artifact: LibRepoStructure.MCLANGUAGE_ARTIFACT,
|
||||||
|
version: this.artifactVersion,
|
||||||
|
classifiers: [undefined]
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (VersionUtil.isVersionAcceptable(this.minecraftVersion, [18, 19])) {
|
||||||
|
|
||||||
|
// Added in 1.18+
|
||||||
|
|
||||||
|
this.generatedFiles.unshift(
|
||||||
|
{
|
||||||
|
name: 'lowcodelanguage',
|
||||||
|
group: LibRepoStructure.FORGE_GROUP,
|
||||||
|
artifact: LibRepoStructure.LOWCODELANGUAGE_ARTIFACT,
|
||||||
|
version: this.artifactVersion,
|
||||||
|
classifiers: [undefined]
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
if(VersionUtil.isVersionAcceptable(this.minecraftVersion, [13, 14, 15])) {
|
if(VersionUtil.isVersionAcceptable(this.minecraftVersion, [13, 14, 15])) {
|
||||||
|
|
||||||
|
// 13, 14, 15 use just the MC version.
|
||||||
|
|
||||||
this.generatedFiles.push(
|
this.generatedFiles.push(
|
||||||
{
|
{
|
||||||
name: 'client slim',
|
name: 'client slim',
|
||||||
@@ -125,6 +187,8 @@ export class ForgeGradle3Adapter extends ForgeResolver {
|
|||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
// 16+ uses the mcp unified version.
|
||||||
|
|
||||||
this.generatedFiles.push(
|
this.generatedFiles.push(
|
||||||
{
|
{
|
||||||
name: 'client slim',
|
name: 'client slim',
|
||||||
@@ -134,7 +198,8 @@ export class ForgeGradle3Adapter extends ForgeResolver {
|
|||||||
classifiers: [
|
classifiers: [
|
||||||
'slim',
|
'slim',
|
||||||
'slim-stable'
|
'slim-stable'
|
||||||
]
|
],
|
||||||
|
classpath: !is117OrGreater
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'client extra',
|
name: 'client extra',
|
||||||
@@ -144,7 +209,8 @@ export class ForgeGradle3Adapter extends ForgeResolver {
|
|||||||
classifiers: [
|
classifiers: [
|
||||||
'extra',
|
'extra',
|
||||||
'extra-stable'
|
'extra-stable'
|
||||||
]
|
],
|
||||||
|
classpath: !is117OrGreater
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -345,6 +411,7 @@ export class ForgeGradle3Adapter extends ForgeResolver {
|
|||||||
),
|
),
|
||||||
name: `Minecraft Forge (${entry.name})`,
|
name: `Minecraft Forge (${entry.name})`,
|
||||||
type: Type.Library,
|
type: Type.Library,
|
||||||
|
classpath: entry.classpath ?? true,
|
||||||
artifact: this.generateArtifact(
|
artifact: this.generateArtifact(
|
||||||
await readFile(targetLocalPath),
|
await readFile(targetLocalPath),
|
||||||
await lstat(targetLocalPath),
|
await lstat(targetLocalPath),
|
||||||
|
|||||||
@@ -7,6 +7,10 @@ export class LibRepoStructure extends BaseMavenRepo {
|
|||||||
|
|
||||||
public static readonly FORGE_GROUP = 'net.minecraftforge'
|
public static readonly FORGE_GROUP = 'net.minecraftforge'
|
||||||
public static readonly FORGE_ARTIFACT = 'forge'
|
public static readonly FORGE_ARTIFACT = 'forge'
|
||||||
|
public static readonly FMLCORE_ARTIFACT = 'fmlcore'
|
||||||
|
public static readonly JAVAFMLLANGUAGE_ARTIFACT = 'javafmllanguage'
|
||||||
|
public static readonly MCLANGUAGE_ARTIFACT = 'mclanguage'
|
||||||
|
public static readonly LOWCODELANGUAGE_ARTIFACT = 'lowcodelanguage'
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
absoluteRoot: string,
|
absoluteRoot: string,
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ export class ForgeModStructure113 extends BaseForgeModStructure {
|
|||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
public static isForVersion(version: MinecraftVersion, libraryVersion: string): boolean {
|
public static isForVersion(version: MinecraftVersion, libraryVersion: string): boolean {
|
||||||
return VersionUtil.isVersionAcceptable(version, [13, 14, 15, 16])
|
return VersionUtil.isVersionAcceptable(version, [13, 14, 15, 16, 17, 18, 19])
|
||||||
}
|
}
|
||||||
|
|
||||||
private forgeModMetadata: {[property: string]: ModsToml | undefined} = {}
|
private forgeModMetadata: {[property: string]: ModsToml | undefined} = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user