forked from maruohon/minihud
-
Notifications
You must be signed in to change notification settings - Fork 0
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
14 changed files
with
196 additions
and
187 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,130 +1,130 @@ | ||
plugins { | ||
id 'fabric-loom' version '1.4.5' | ||
id 'ploceus' version '1.4.2' | ||
id 'maven-publish' | ||
} | ||
|
||
buildscript { | ||
repositories { | ||
maven { | ||
name = 'forge' | ||
url = 'https://files.minecraftforge.net/maven' | ||
} | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
|
||
maven { | ||
name = 'sponge' | ||
url = 'https://repo.spongepowered.org/repository/maven-public' | ||
} | ||
} | ||
group = project.mod_id // http://maven.apache.org/guides/mini/guide-naming-conventions.html | ||
version = project.mod_version | ||
|
||
dependencies { | ||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT' | ||
classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT' | ||
} | ||
if (version.endsWith('-dev')) { | ||
version = version + "." + new Date().format('yyyyMMdd.HHmmss') | ||
} | ||
|
||
repositories { | ||
maven { | ||
url 'https://masa.dy.fi/maven' | ||
} | ||
base { | ||
archivesName = project.mod_file_name + '-' + project.minecraft_version_out | ||
} | ||
|
||
apply plugin: 'net.minecraftforge.gradle.liteloader' | ||
apply plugin: 'org.spongepowered.mixin' | ||
|
||
minecraft { | ||
version = project.minecraft_version | ||
mappings = project.mappings_version | ||
runDir = 'minecraft' | ||
makeObfSourceJar = false | ||
repositories { | ||
// Add repositories to retrieve artifacts from in here. | ||
// You should only use this when depending on other mods because | ||
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically. | ||
// See https://docs.gradle.org/current/userguide/declaring_repositories.html | ||
// for more information about repositories. | ||
// maven { url 'https://maven.terraformersmc.com/releases/' } | ||
|
||
maven { url 'https://masa.dy.fi/maven' } | ||
} | ||
|
||
ext.mod_version = project.mod_version | ||
dependencies { | ||
minecraft "com.mojang:minecraft:${project.minecraft_version}" | ||
|
||
if (mod_version.endsWith('-dev')) { | ||
mod_version = mod_version + "." + new Date().format('yyyyMMdd.HHmmss') | ||
mappings loom.layered { | ||
addLayer ploceus.mcpMappings('stable', '1.12', '39') | ||
//mappings "net.ornithemc:feather:${project.minecraft_version}+build.${project.feather_build}:v2" | ||
//addLayer ploceus.nestedMappings() // remove this line if not using nests | ||
} | ||
//nests "net.ornithemc:nests:${project.minecraft_version}+build.${project.nests_build}" // remove this line if not using nests | ||
|
||
replaceIn 'Reference.java' | ||
replace '@MOD_VERSION@', mod_version | ||
} | ||
modImplementation "net.fabricmc:fabric-loader:${project.fabric_loader_version}" | ||
modImplementation "com.terraformersmc:modmenu:${project.mod_menu_version}" | ||
implementation "com.google.code.findbugs:jsr305:3.0.2" | ||
|
||
dependencies { | ||
deobfCompile "malilib:malilib-liteloader-${project.minecraft_version_out}:${project.malilib_version}:deobf" | ||
//ploceus.addCommonLibraries() | ||
ploceus.dependOsl(project.osl_version) | ||
|
||
modImplementation "malilib:malilib-ornithe-${project.minecraft_version_out}:${project.malilib_version}" | ||
} | ||
|
||
sourceSets { | ||
main { | ||
ext.refMap = "mixins.${project.mod_id}.refmap.json" | ||
loom { | ||
decompilers { | ||
vineflower { | ||
options.put("ind", " ") | ||
//preferences { | ||
// ind = ' ' | ||
//} | ||
} | ||
} | ||
} | ||
|
||
group = project.mod_id // http://maven.apache.org/guides/mini/guide-naming-conventions.html | ||
archivesBaseName = "${project.mod_file_name}-${project.minecraft_version_out}" | ||
version = project.minecraft.mod_version | ||
|
||
/** | ||
* This section allows you to customise the generated litemod.json file | ||
*/ | ||
litemod { | ||
json { | ||
name = project.mod_id | ||
displayName = project.mod_name | ||
mcversion = project.minecraft_version | ||
version = project.minecraft.mod_version | ||
author = project.author | ||
|
||
// Uncomment any of the following lines and fill in your own details as required | ||
//requiredAPIs = [ 'someapi' ] | ||
//tweakClass = 'name.of.tweaker.here' | ||
dependsOn = [ 'malilib' ] | ||
mixinConfigs = [ "mixins.${project.mod_id}.json" ] | ||
processResources { | ||
// Exclude the GIMP image files | ||
exclude '**/*.xcf' | ||
exclude '**/xcf' | ||
|
||
// this will ensure that this task is redone when the versions change. | ||
//inputs.property "minecraft_version", project.config.minecraft_version | ||
|
||
inputs.property "mod_version", version | ||
|
||
filesMatching("fabric.mod.json") { | ||
expand "mod_version": version | ||
} | ||
} | ||
|
||
/** | ||
* This section allows you to customise your generated jar (litemod) file. By | ||
* default it includes the generated litemod.json file, however if you prefer to | ||
* include your own file from resources, simply remove the line below. | ||
*/ | ||
jar { | ||
// Remove the "-mc1.12" suffix from the file name | ||
classifier = "" | ||
// Don't append a 'mod-' filename prefix >_> | ||
baseName = archivesBaseName | ||
|
||
from litemod.outputs | ||
|
||
/* | ||
manifest.mainAttributes ( | ||
'Built-By': System.properties['user.name'], | ||
'Created-By': System.properties['java.vm.version'] + " (" + System.properties['java.vm.vendor'] + ")", | ||
'Implementation-Title': project.mod_id, | ||
'Implementation-Version': project.version | ||
) | ||
*/ | ||
} | ||
tasks.withType(JavaCompile).configureEach { | ||
// ensure that the encoding is set to UTF-8, no matter what the system default is | ||
// this fixes some edge cases with special characters not displaying correctly | ||
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html | ||
// If Javadoc is generated, this must be specified in that task too. | ||
it.options.encoding = "UTF-8" | ||
|
||
mixin { | ||
defaultObfuscationEnv notch | ||
it.options.release = 8 | ||
} | ||
|
||
//tasks.withType(Jar)*.baseName = archivesBaseName | ||
java { | ||
// Still required by IDEs such as Eclipse and Visual Studio Code | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
|
||
processResources | ||
{ | ||
// Exclude the GIMP image files | ||
exclude '**/*.xcf' | ||
exclude '**/xcf' | ||
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task if it is present. | ||
// If you remove this line, sources will not be generated. | ||
withSourcesJar() | ||
|
||
// this will ensure that this task is redone when the versions change. | ||
inputs.property 'mod_version', project.minecraft.mod_version | ||
inputs.property 'minecraft_version', project.minecraft_version | ||
// If this mod is going to be a library, then it should also generate Javadocs in order to aid with development. | ||
// Uncomment this line to generate them. | ||
// withJavadocJar() | ||
} | ||
|
||
// If you plan to use a different file for the license, don't forget to change the file name here! | ||
/* | ||
jar { | ||
from('LICENSE') { | ||
rename { "${it}_${base.archivesName.get()}" } | ||
} | ||
} | ||
*/ | ||
|
||
// replace stuff in mcmod.info, nothing else | ||
from(sourceSets.main.resources.srcDirs) { | ||
include 'mcmod.info' | ||
// Configure the maven publication | ||
tasks.publish.dependsOn build | ||
|
||
// replace version and mcversion | ||
expand 'mod_version': project.minecraft.mod_version, 'minecraft_version': project.minecraft_version | ||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
artifactId project.archivesBaseName | ||
|
||
// add all the jars that should be included when publishing to maven | ||
//artifact(jar) { builtBy remapJar } | ||
from components.java | ||
} | ||
} | ||
|
||
// copy everything else, thats not the mcmod.info | ||
from(sourceSets.main.resources.srcDirs) { | ||
exclude 'mcmod.info' | ||
repositories { | ||
maven { | ||
url "$projectDir/../../CommonMaven" | ||
} | ||
} | ||
} |
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
Binary file not shown.
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,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
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,17 @@ | ||
pluginManagement { | ||
repositories { | ||
maven { | ||
name = 'Fabric' | ||
url = 'https://maven.fabricmc.net/' | ||
} | ||
maven { | ||
name = 'Ornithe Releases' | ||
url = 'https://maven.ornithemc.net/releases' | ||
} | ||
maven { | ||
name = 'Ornithe Snapshots' | ||
url = 'https://maven.ornithemc.net/snapshots' | ||
} | ||
gradlePluginPortal() | ||
} | ||
} |
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 @@ | ||
package minihud.compat.modmenu; | ||
|
||
import com.terraformersmc.modmenu.api.ConfigScreenFactory; | ||
import com.terraformersmc.modmenu.api.ModMenuApi; | ||
|
||
import malilib.gui.BaseScreen; | ||
import minihud.gui.ConfigScreen; | ||
|
||
public class ModMenuImpl implements ModMenuApi | ||
{ | ||
@Override | ||
public ConfigScreenFactory<?> getModConfigScreenFactory() | ||
{ | ||
return (currentScreen) -> { | ||
BaseScreen screen = ConfigScreen.create(); | ||
screen.setParent(currentScreen); | ||
return screen; | ||
}; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.