Initial Commit with Torches. Missing LangKeys and Recipes
This commit is contained in:
125
Forge/build.gradle
Normal file
125
Forge/build.gradle
Normal file
@@ -0,0 +1,125 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
maven { url = 'https://maven.minecraftforge.net' }
|
||||
maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
|
||||
classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'net.minecraftforge.gradle'
|
||||
apply plugin: 'eclipse'
|
||||
apply plugin: 'org.spongepowered.mixin'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
archivesBaseName = "${mod_name}-forge-${minecraft_version}"
|
||||
|
||||
mixin {
|
||||
add sourceSets.main, "${mod_id}.refmap.json"
|
||||
|
||||
config "${mod_id}.mixins.json"
|
||||
config "${mod_id}.forge.mixins.json"
|
||||
}
|
||||
|
||||
minecraft {
|
||||
mappings channel: 'official', version: minecraft_version
|
||||
|
||||
if (project.hasProperty('forge_ats_enabled') && project.findProperty('forge_ats_enabled').toBoolean()) {
|
||||
// This location is hardcoded in Forge and can not be changed.
|
||||
// https://github.com/MinecraftForge/MinecraftForge/blob/be1698bb1554f9c8fa2f58e32b9ab70bc4385e60/fmlloader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/ModFile.java#L123
|
||||
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
|
||||
project.logger.debug('Forge Access Transformers are enabled for this project.')
|
||||
}
|
||||
|
||||
runs {
|
||||
client {
|
||||
workingDirectory project.file('run')
|
||||
ideaModule "${rootProject.name}.${project.name}.main"
|
||||
taskName 'Client'
|
||||
args "-mixin.config=${mod_id}.mixins.json", "-mixin.config=${mod_id}.forge.mixins.json"
|
||||
mods {
|
||||
modClientRun {
|
||||
source sourceSets.main
|
||||
source project(":Common").sourceSets.main
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
workingDirectory project.file('run')
|
||||
ideaModule "${rootProject.name}.${project.name}.main"
|
||||
taskName 'Server'
|
||||
args "-mixin.config=${mod_id}.mixins.json", "-mixin.config=${mod_id}.forge.mixins.json"
|
||||
mods {
|
||||
modServerRun {
|
||||
source sourceSets.main
|
||||
source project(":Common").sourceSets.main
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
data {
|
||||
workingDirectory project.file('run')
|
||||
ideaModule "${rootProject.name}.${project.name}.main"
|
||||
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
|
||||
taskName 'Data'
|
||||
args "-mixin.config=${mod_id}.mixins.json", "-mixin.config=${mod_id}.forge.mixins.json"
|
||||
mods {
|
||||
modDataRun {
|
||||
source sourceSets.main
|
||||
source project(":Common").sourceSets.main
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets.main.resources.srcDir 'src/generated/resources'
|
||||
|
||||
dependencies {
|
||||
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
||||
compileOnly project(":Common")
|
||||
annotationProcessor 'org.spongepowered:mixin:0.8.4-SNAPSHOT:processor'
|
||||
implementation fg.deobf("me.hypherionmc.craterlib:CraterLib-forge-1.19.1:${craterlib_version}")
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
source(project(":Common").sourceSets.main.allSource)
|
||||
}
|
||||
|
||||
processResources {
|
||||
from project(":Common").sourceSets.main.resources
|
||||
|
||||
filesMatching('*.mixins.json') {
|
||||
expand "refmap_target": "${mod_id}."
|
||||
}
|
||||
}
|
||||
|
||||
jar.finalizedBy('reobfJar')
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
groupId project.group
|
||||
artifactId project.archivesBaseName
|
||||
version project.version
|
||||
artifact jar
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
maven {
|
||||
url "file://" + System.getenv("local_maven")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task copyAllArtifacts(type: Copy) {
|
||||
from "$buildDir/libs"
|
||||
into "$rootDir/artifacts"
|
||||
include("*.jar")
|
||||
}
|
||||
|
||||
build.finalizedBy(copyAllArtifacts)
|
@@ -0,0 +1,24 @@
|
||||
package me.hypherionmc.hyperlighting;
|
||||
|
||||
import me.hypherionmc.craterlib.client.gui.config.CraterConfigScreen;
|
||||
import me.hypherionmc.hyperlighting.client.init.ClientRegistration;
|
||||
import me.hypherionmc.hyperlighting.common.init.CommonRegistration;
|
||||
import net.minecraftforge.client.ConfigScreenHandler;
|
||||
import net.minecraftforge.fml.ModLoadingContext;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
|
||||
@Mod(Constants.MOD_ID)
|
||||
public class HyperLightingForge {
|
||||
|
||||
public HyperLightingForge() {
|
||||
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientInit);
|
||||
CommonRegistration.registerAll();
|
||||
}
|
||||
|
||||
public void clientInit(FMLClientSetupEvent event) {
|
||||
new ClientRegistration().registerAll();
|
||||
ModLoadingContext.get().registerExtensionPoint(ConfigScreenHandler.ConfigScreenFactory.class, () -> new ConfigScreenHandler.ConfigScreenFactory((mc, screen) -> new CraterConfigScreen(CommonRegistration.config, screen)));
|
||||
}
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
package me.hypherionmc.hyperlighting.client;
|
||||
|
||||
import me.hypherionmc.hyperlighting.client.particles.ParticleRegistryHandler;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.client.event.RegisterParticleProvidersEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
|
||||
/**
|
||||
* @author HypherionSA
|
||||
* @date 03/07/2022
|
||||
*/
|
||||
@Mod.EventBusSubscriber(value = Dist.CLIENT, bus = Mod.EventBusSubscriber.Bus.MOD)
|
||||
public class ForgeClientEventHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public static void registerParticles(RegisterParticleProvidersEvent event) {
|
||||
ParticleRegistryHandler.registerParticles(Minecraft.getInstance().particleEngine::register);
|
||||
}
|
||||
|
||||
}
|
38
Forge/src/main/resources/META-INF/mods.toml
Normal file
38
Forge/src/main/resources/META-INF/mods.toml
Normal file
@@ -0,0 +1,38 @@
|
||||
modLoader="javafml"
|
||||
loaderVersion="[42,)"
|
||||
license="MIT"
|
||||
#issueTrackerURL="https://change.me.to.your.issue.tracker.example.invalid/"
|
||||
|
||||
[[mods]] #mandatory
|
||||
modId="hyperlighting"
|
||||
version="${file.jarVersion}"
|
||||
displayName="Hyper Lighting 2"
|
||||
#updateJSONURL="https://change.me.example.invalid/updates.json"
|
||||
#displayURL="https://change.me.to.your.mods.homepage.example.invalid/"
|
||||
logoFile="multiloader.png"
|
||||
#credits="Thanks for this example mod goes to Java"
|
||||
authors="HypherionSA"
|
||||
description='''
|
||||
Not your average Lighting & Decoration Mods
|
||||
'''
|
||||
|
||||
[[dependencies.hyperlighting]]
|
||||
modId="forge"
|
||||
mandatory=true
|
||||
versionRange="[42,)"
|
||||
ordering="NONE"
|
||||
side="BOTH"
|
||||
|
||||
[[dependencies.hyperlighting]]
|
||||
modId="minecraft"
|
||||
mandatory=true
|
||||
versionRange="[1.19.1,1.20)"
|
||||
ordering="NONE"
|
||||
side="BOTH"
|
||||
|
||||
[[dependencies.hyperlighting]]
|
||||
modId="craterlib"
|
||||
mandatory=true
|
||||
versionRange="1.0.x"
|
||||
ordering="AFTER"
|
||||
side="BOTH"
|
16
Forge/src/main/resources/hyperlighting.forge.mixins.json
Normal file
16
Forge/src/main/resources/hyperlighting.forge.mixins.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"required": true,
|
||||
"minVersion": "0.8",
|
||||
"package": "me.hypherionmc.hyperlighting.mixin",
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"mixins": [
|
||||
],
|
||||
"client": [
|
||||
],
|
||||
"server": [
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
},
|
||||
"refmap": "${refmap_target}refmap.json"
|
||||
}
|
Reference in New Issue
Block a user