plumygames / mgpp Goto Github PK
View Code? Open in Web Editor NEWThe next generation of Mindustry modding.
Home Page: https://plumygames.github.io/mgpp/
License: GNU General Public License v3.0
The next generation of Mindustry modding.
Home Page: https://plumygames.github.io/mgpp/
License: GNU General Public License v3.0
In addition, version
doesn't work with every number, including float and integer, but is fine with a string.
// Doesn't work
version: 4
// Can work
version : "4"
:runClient
task, the Json/JavaScript mod isn't involving the mod work with--fromTask
automatically as what jar
does, that is, users have to add something like:
add fromTask ":project:zip"
Please support Foo's Client.
Kinda like this, in build.gradle.kts
mindustry {
client {
mindustry foo "v8" // or latest notation
// or
mindustry fooV7 "1105" // or latest notation
}
}
mgpp.run.dataDir=default
runClient
In my build.gradle:
tasks.jar {
archiveBaseName.set("CyberIO")
}
* What went wrong:
Execution failed for task ':main:deploy'.
> Cannot expand ZIP '/home/runner/work/CyberIO/CyberIO/main/build/libs/main-4.0.jar' as it does not exist.
When I tried using the latest Mindustry client, I got this.
mindustry {
client {
mindustry be latest
}
}
Can't fetch latest be version, so use 22767 as default instead.
java.io.IOException: Server returned HTTP response code: 403 for URL: https://api.github.com/repos/Anuken/MindustryBuilds/releases/latest
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1900)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268)
at java.net.URL.openStream(URL.java:1067)
at kotlin.io.TextStreamsKt.readBytes(ReadWrite.kt:150)
at io.github.liplum.mindustry.IGameSpec$DefaultImpls.LatestBE(GameSpec.kt:110)
at io.github.liplum.mindustry.ServerSpec.LatestBE(GameSpec.kt:184)
at io.github.liplum.mindustry.IGameSpec$DefaultImpls.be(GameSpec.kt:70)
at io.github.liplum.mindustry.ServerSpec.be(GameSpec.kt:184)
at Build_gradle$2.execute(build.gradle.kts:29)
at Build_gradle$2.execute(build.gradle.kts:4)
at org.gradle.internal.extensibility.ExtensionsStorage$ExtensionHolder.configure(ExtensionsStorage.java:173)
at org.gradle.internal.extensibility.ExtensionsStorage.configureExtension(ExtensionsStorage.java:64)
at org.gradle.internal.extensibility.DefaultConvention.configure(DefaultConvention.java:194)
at io.github.liplum.mindustry.Extension.mindustry(Extensions.kt:23)
at Build_gradle.<init>(build.gradle.kts:24)
When I configured the assets batch, the content in jar
task output will be overwritten.
mindustryAssets {
sprites {
dir = rootDir.resolve("sprites")
dependsOn("antiAlias")
}
sprites {
dir = rootDir.resolve("sprites/data")
rootAt(rootDir.resolve("sprites"))
dependsOn("antiAlias")
genClass
}
sounds {
dir = rootDir.resolve("sounds")
genClass
}
}
It only needs the field without void load( )
method. Because users may have their own way to initialize those shaders.
To generate each i18n pair in bundles.
Sometimes, users would forget their mod name or would like to reference the content in mod.json.
So I think the additional function could be useful for them.
That's how I used.
mods {
worksWith {
add fromTask ":js:zip"
}
}
The excpetion:
* What went wrong:
Could not create task ':main:runClient'.
Task with name ':js:zip' not found in project ':main'.
* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Exception is:
com.intellij.openapi.externalSystem.model.ExternalSystemException: Could not create task ':main:runClient'.
Task with name ':js:zip' not found in project ':main'.
at org.jetbrains.plugins.gradle.model.ProjectImportAction.addBuildModels(ProjectImportAction.java:388)
at org.jetbrains.plugins.gradle.model.ProjectImportAction.execute(ProjectImportAction.java:137)
at org.jetbrains.plugins.gradle.model.ProjectImportAction.execute(ProjectImportAction.java:42)
at org.gradle.tooling.internal.consumer.connection.InternalBuildActionAdapter.execute(InternalBuildActionAdapter.java:64)
I want to test whether my mod could work on server side, but I can't start multiple debugging session, one for client, one for server.
As a workaround, I debug the server in intellij IDEA but start the game outside.
Is any way to debug both at the same time?
When I upgrade my mod, the game will be started up with duplicate mods, for example:
When I change the version
from v1.0
to v1.1
in mod.hjson
,
The mods
will contains both my-mod-v1.0.jar
and my-mod-v1.1.jar
It hasn't checked the latest version yet since I ran runClient
first time after the mgpp was upgraded to v1.1.1.
In my latest_cache.json
:
[
{
"name": "mindustry-client-be",
"lastValue": "22810",
"lastUpdatedTimeStamp": 1657982383132
},
{
"name": "mindustry-server-be",
"lastValue": "22810",
"lastUpdatedTimeStamp": 1657982383217
}
]
But as you see, the true latest version is 22850 now.
If anyone would like to make a json&js mod with mgpp gradle plugin, they may need:
mod.zip
.It's also used to build a Json mod, e.g. for testing purpose, in a multiple-mod project.
When java
plugin isn't applied, the these task should be added.
In some rare cases. users may want to start the Mindustry with arguments.
My Issues
When I set the game location only in the root project, the game would be downloaded several times, however, they have the same version, which is a definitely waste of network data.
My solutions/needs
So I want them to be downloaded once if they have the same version, in other words, the game can be shared among all modules.
I often make some mods that have many modules for decoupling and package management.
But in terms of my practice, I still have to configure the mindustry dependency and game version for each subproject. That's annoying and a bit difficult to keep them pace with other modules or the latest mindustry I'd like to work on.
When the :js:zip
had new output, the resolveMods
didn't copy it but displayed UP-TO-DATA
.
mods {
worksWith {
add fromTask ":js:zip"
}
}
Sometimes, other collaborators may be willing to use their own mod to debug.
Please support this workflow:
jar
taskjar
task outputted to my default data directoryrunServer
taskThis is a simple workaround for #8
I don't want to manually set all mods I want to work with in the build.gradle, and that will also need to be reloaded.
In its the build.gradle.kts, I added some dependencies from other modules in my while project.
plugins {
kotlin("jvm")
id("com.google.devtools.ksp") version "1.7.0-1.0.6"
`maven-publish`
id("io.github.liplum.mgpp")
}
...
dependencies {
implementation(project(":annotations"))
implementation(project(":lib"))
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2")
}
When I sync the gradle in my Intellij IDEA, the problem was ocurred.
Build file 'E:\MyProject\Mindustry\CyberIO\lib\build.gradle.kts' line: 2
An exception occurred applying plugin request [id: 'org.jetbrains.kotlin.jvm', version: '1.6.21']
> Failed to apply plugin 'org.jetbrains.kotlin.jvm'.
> Gradle#projectsEvaluated(Action) on build 'cyberio' cannot be executed in the current context.
* Exception is:
org.gradle.api.plugins.InvalidPluginException: An exception occurred applying plugin request [id: 'org.jetbrains.kotlin.jvm', version: '1.6.21']
...
at io.github.liplum.mindustry.MindustryJavaPlugin$apply$1$2$1.invoke(Plugins.kt:453)
at io.github.liplum.mindustry.MindustryJavaPlugin$apply$1$2$1.invoke(Plugins.kt:275)
at io.github.liplum.dsl.KtDslSupportKt$sam$i$org_gradle_api_Action$0.execute(KtDslSupport.kt)
at org.gradle.api.internal.DefaultMutationGuard$2.execute(DefaultMutationGuard.java:44)
at org.gradle.api.internal.DefaultMutationGuard$2.execute(DefaultMutationGuard.java:44)
at org.gradle.api.internal.DefaultNamedDomainObjectCollection$ExistingNamedDomainObjectProvider.configure(DefaultNamedDomainObjectCollection.java:853)
at org.gradle.api.internal.tasks.DefaultTaskCollection$ExistingTaskProvider.configure(DefaultTaskCollection.java:200)
at org.gradle.api.internal.DefaultNamedDomainObjectCollection.named(DefaultNamedDomainObjectCollection.java:391)
at org.gradle.api.internal.tasks.DefaultTaskCollection.named(DefaultTaskCollection.java:127)
at io.github.liplum.mindustry.MindustryJavaPlugin$apply$1$2.invoke(Plugins.kt:452)
at io.github.liplum.mindustry.MindustryJavaPlugin$apply$1$2.invoke(Plugins.kt:273)
at io.github.liplum.dsl.DslExtensionsKt.afterEvaluateThis$lambda-1(DslExtensions.kt:99)
at org.gradle.configuration.internal.DefaultUserCodeApplicationContext$CurrentApplication$1.execute(DefaultUserCodeApplicationContext.java:123)
Caused by: org.gradle.api.internal.AbstractMutationGuard$IllegalMutationException: Gradle#projectsEvaluated(Action) on build 'cyberio' cannot be executed in the current context.
at org.gradle.api.internal.AbstractMutationGuard.createIllegalStateException(AbstractMutationGuard.java:39)
at org.gradle.api.internal.AbstractMutationGuard.assertMutationAllowed(AbstractMutationGuard.java:34)
at org.gradle.invocation.DefaultGradle.assertProjectMutatingMethodAllow
When I comment, aka remove, all implementation dependencies of other modules, such as implementation(project(":annotations"))
, it's solved.
But it's unacceptable, I need them.
My Issues
Mgpp will remove all other mods when I working on the default data directory, %APPDATA%/Mindustry/mods.
My solutions/needs
mods.keepOtherMods
default.Mgpp has many useful functionalities but there is no instruction to explain them simply.
Build an instrcution.
dot
is confusing to represent a name rule.
As a convention, Java use reverse domain name notation
, like org.plumy.foo
.
By the way, matching name rule regardless of any letter case will be better.
Mgpp has many functionalities but there is no enough descriptive document of them.
When I tried to upgrade my dependency to v136
mindustry {
dependency {
mindustry version: 'v136'
arc version: 'v136'
}
}
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not find com.github.anuken.mindustry:desktop:v136.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/com/github/anuken/mindustry/desktop/v136/desktop-v136.pom
- https://www.jitpack.io/com/github/anuken/mindustry/desktop/v136/desktop-v136.pom
Required by:
project :
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
When I always test on two clients, one for the official
and one for the Foo's client
, but I have to edit my build.gradle
to switch version instead of two tasks.
So make a multiple-slot runClient
would be nice, such as runClientA
, runClientB
...
As the more and more features are introduced in mgpp, the guideline is essential for users.
The default --min-api is 14, although Mindustry can run on Android 4.0.1 which is the minimum.
But in some rare cases, we need the """new""" features from higher version.
Read the local game location and data dir path from local.properties.
When I work with someone on a project, we have diffierent opinions on where to save the data. For example:
They want to use the default data directory.
mindustry {
run {
setDataDefault()
}
}
But I don't want that, because it will mess up my other saves and settings.
[W] Applying -XstartOnFirstThread for macOS support.
Since Mindustry is a libGDX project, the -XstartOnFirstThread
is needed on macOS.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.