-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
552 additions
and
540 deletions.
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,91 +1,103 @@ | ||
plugins { | ||
id "java" | ||
id "com.github.johnrengelman.shadow" version "6.1.0" | ||
id "net.minecraftforge.gradle.forge" version "6f53277" | ||
id 'org.jetbrains.kotlin.jvm' version '1.6.10' | ||
} | ||
|
||
version = "0.5.0" | ||
group = "it.kada49.fpsDisplay" | ||
archivesBaseName = "FPS-Display" | ||
|
||
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8 | ||
compileJava.options.encoding = 'UTF-8' | ||
|
||
/** | ||
* This task simply moves resources so they can be accessed at runtime, Forge is quite weird isn't it | ||
*/ | ||
sourceSets { | ||
main { | ||
output.resourcesDir = java.outputDir | ||
} | ||
} | ||
|
||
minecraft { | ||
version = "1.8.9-11.15.1.2318-1.8.9" | ||
runDir = "run" | ||
mappings = "stable_22" | ||
makeObfSourceJar = false | ||
} | ||
|
||
repositories { | ||
maven { url = "https://repo.sk1er.club/repository/maven-public" } | ||
} | ||
|
||
configurations { | ||
// Creates an extra configuration that implements `implementation` to be used later as the configuration that shades libraries | ||
include | ||
implementation.extendsFrom(include) | ||
} | ||
|
||
dependencies { | ||
include "com.squareup.okhttp3:okhttp:4.9.3" | ||
include "gg.essential:loader-launchwrapper:1.1.3" | ||
implementation "gg.essential:essential-1.8.9-forge:1884" | ||
} | ||
|
||
/** | ||
* This task simply replaces the `${version}` and `${mcversion}` properties in the mcmod.info with the data from Gradle | ||
*/ | ||
processResources { | ||
// this will ensure that this task is redone when the versions change. | ||
inputs.property "version", project.version | ||
inputs.property "mcversion", project.minecraft.version | ||
|
||
// replace stuff in mcmod.info, nothing else | ||
from(sourceSets.main.resources.srcDirs) { | ||
include 'mcmod.info' | ||
|
||
// replace version and mcversion | ||
expand 'version': project.version, 'mcversion': project.minecraft.version | ||
} | ||
|
||
// copy everything else, thats not the mcmod.info | ||
from(sourceSets.main.resources.srcDirs) { | ||
exclude 'mcmod.info' | ||
} | ||
} | ||
|
||
// This adds support to ("embed", "shade", "include") libraries into our JAR | ||
shadowJar { | ||
archiveClassifier.set('') | ||
configurations = [project.configurations.include] | ||
duplicatesStrategy DuplicatesStrategy.EXCLUDE | ||
|
||
manifest.attributes( | ||
"ForceLoadAsMod": true, | ||
"ModSide": "CLIENT", | ||
"TweakClass": "gg.essential.loader.stage0.EssentialSetupTweaker" | ||
) | ||
|
||
("com.squareup.okhttp3:okhttp:4.9.3") | ||
} | ||
|
||
build.dependsOn shadowJar | ||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
reobf { | ||
shadowJar {} | ||
} | ||
plugins { | ||
id "java" | ||
id "com.github.johnrengelman.shadow" version "6.1.0" | ||
id "net.minecraftforge.gradle.forge" version "6f53277" | ||
id 'org.jetbrains.kotlin.jvm' version '1.6.10' | ||
} | ||
|
||
version = "0.5.1" | ||
group = "it.kada49.fpsDisplay" | ||
archivesBaseName = "FPS-Display" | ||
|
||
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8 | ||
compileJava.options.encoding = 'UTF-8' | ||
|
||
sourceSets { | ||
main { | ||
output.resourcesDir = java.outputDir | ||
} | ||
} | ||
|
||
minecraft { | ||
version = "1.8.9-11.15.1.2318-1.8.9" | ||
runDir = "run" | ||
mappings = "stable_22" | ||
makeObfSourceJar = false | ||
} | ||
|
||
repositories { | ||
maven { url = "https://repo.sk1er.club/repository/maven-public" } | ||
} | ||
|
||
configurations { | ||
// Creates an extra configuration that implements `implementation` to be used later as the configuration that shades libraries | ||
include | ||
implementation.extendsFrom(include) | ||
} | ||
|
||
dependencies { | ||
include "com.squareup.okhttp3:okhttp:4.9.3" | ||
include "gg.essential:loader-launchwrapper:1.1.3" | ||
implementation "gg.essential:essential-1.8.9-forge:1884" | ||
} | ||
|
||
/** | ||
* This task simply replaces the `${version}` and `${mcversion}` properties in the mcmod.info with the data from Gradle | ||
*/ | ||
processResources { | ||
// this will ensure that this task is redone when the versions change. | ||
inputs.property "version", project.version | ||
inputs.property "mcversion", project.minecraft.version | ||
|
||
// replace stuff in mcmod.info, nothing else | ||
from(sourceSets.main.resources.srcDirs) { | ||
include 'mcmod.info' | ||
|
||
// replace version and mcversion | ||
expand 'version': project.version, 'mcversion': project.minecraft.version | ||
} | ||
|
||
// copy everything else, thats not the mcmod.info | ||
from(sourceSets.main.resources.srcDirs) { | ||
exclude 'mcmod.info' | ||
} | ||
} | ||
|
||
/** | ||
* This task simply moves resources so they can be accessed at runtime, Forge is quite weird isn't it | ||
*/ | ||
|
||
/* | ||
task moveResources { | ||
doLast { | ||
ant.move file: "${buildDir}/resources/main", | ||
todir: "${buildDir}/classes/java" | ||
} | ||
} | ||
moveResources.dependsOn processResources | ||
classes.dependsOn moveResources | ||
*/ | ||
// This adds support to ("embed", "shade", "include") libraries into our JAR | ||
shadowJar { | ||
archiveClassifier.set('') | ||
configurations = [project.configurations.include] | ||
duplicatesStrategy DuplicatesStrategy.EXCLUDE | ||
|
||
manifest.attributes( | ||
"ForceLoadAsMod": true, | ||
"ModSide": "CLIENT", | ||
"TweakClass": "gg.essential.loader.stage0.EssentialSetupTweaker" | ||
) | ||
|
||
("com.squareup.okhttp3:okhttp:4.9.3") | ||
} | ||
|
||
build.dependsOn shadowJar | ||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
reobf { | ||
shadowJar {} | ||
} |
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,17 +1,17 @@ | ||
package it.kada49.fpsDisplay | ||
|
||
import net.minecraft.command.CommandBase | ||
import net.minecraft.command.ICommandSender | ||
|
||
class Command: CommandBase() { | ||
override fun getCommandName() = "fps" | ||
override fun getRequiredPermissionLevel(): Int = 0 | ||
override fun getCommandUsage(sender: ICommandSender?): String = "/fps = Setup for the ${Constants.Data.NAME} Mod configuration" | ||
override fun processCommand(sender: ICommandSender?, args: Array<String>) { | ||
if (args.isEmpty()) { FpsMod.vigilantGui = Configuration.gui() } | ||
if (args.isNotEmpty()) { | ||
if (args[0] == "update") Update().checkForModUpdates(true) | ||
} | ||
|
||
} | ||
package it.kada49.fpsDisplay | ||
|
||
import net.minecraft.command.CommandBase | ||
import net.minecraft.command.ICommandSender | ||
|
||
class Command: CommandBase() { | ||
override fun getCommandName() = "fps" | ||
override fun getRequiredPermissionLevel(): Int = 0 | ||
override fun getCommandUsage(sender: ICommandSender?): String = "/fps = Setup for the ${Constants.Data.NAME} Mod configuration" | ||
override fun processCommand(sender: ICommandSender?, args: Array<String>) { | ||
if (args.isEmpty()) { FpsMod.vigilantGui = Configuration.gui() } | ||
if (args.isNotEmpty()) { | ||
if (args[0] == "update") Update().checkForModUpdates(true) | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.