Skip to content

Commit

Permalink
update: 1.20.2
Browse files Browse the repository at this point in the history
  • Loading branch information
bconlon1 committed Mar 20, 2024
1 parent 0897697 commit bbc144c
Show file tree
Hide file tree
Showing 49 changed files with 187 additions and 196 deletions.
105 changes: 43 additions & 62 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
plugins {
id 'eclipse'
id 'maven-publish'
id 'net.neoforged.gradle' version '[6.0.13, 6.2)'
id 'org.spongepowered.mixin' version '[0.7,0.8)'
id 'org.parchmentmc.librarian.forgegradle' version '[1,2)'
id 'org.moddingx.modgradle.mapping' version '[4,5)'
id 'org.moddingx.modgradle.sourcejar' version '[4,5)' apply false
id 'net.neoforged.gradle.userdev' version '7.0.+'
id 'io.github.0ffz.github-packages' version '[1,2)'
id 'com.matthewprenger.cursegradle' version '[1.4,1.5)'
id 'com.modrinth.minotaur' version '[2,3)'
Expand All @@ -20,66 +16,54 @@ base {

java.toolchain.languageVersion = JavaLanguageVersion.of(17)

apply plugin: 'org.moddingx.modgradle.sourcejar'
minecraft.accessTransformers.file rootProject.file('src/main/resources/META-INF/accesstransformer.cfg')

minecraft {
mappings channel: 'sugarcane', version: project.mappings
runs {
configureEach {
workingDirectory project.file('run')
systemProperty "${mod_id}.iside", 'true'
systemProperty 'forge.logging.console.level', 'info'

copyIdeResources = true
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')

runs {
configureEach {
workingDirectory project.file('run')

property "${mod_id}.iside", 'true'
property 'forge.logging.console.level', 'info'
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"

mods {
"${mod_id}" {
source sourceSets.main
}
}
}
modSource project.sourceSets.main
}

client {
property 'forge.enabledGameTestNamespaces', mod_id
}
client {
systemProperty 'forge.enabledGameTestNamespaces', mod_id
}

server {
property 'forge.enabledGameTestNamespaces', mod_id
args '--nogui'
}
server {
systemProperty 'forge.enabledGameTestNamespaces', mod_id
programArgument '--nogui'
}

gameTestServer {
property 'forge.enabledGameTestNamespaces', mod_id
}
gameTestServer {
systemProperty 'forge.enabledGameTestNamespaces', mod_id
}

data {
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/'), '--existing', file('src/generated/resources/'), '--existing-mod', 'aether'
environment 'target', 'fmluserdevdata'
}
data {
programArguments.addAll '--mod', mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath(), '--existing', file('src/generated/resources/').getAbsolutePath(), '--existing-mod', 'aether'
}
}

sourceSets.main.resources {
srcDir 'src/generated/resources'
}

dependencies {
minecraft "net.neoforged:forge:${project.mc_version}-${project.neoforge_version}"
subsystems {
parchment {
minecraftVersion = project.mc_version
mappingsVersion = project.mappings
}
}

implementation(annotationProcessor("com.github.llamalad7.mixinextras:mixinextras-common:0.2.0-beta.9"))
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
implementation('com.github.llamalad7.mixinextras:mixinextras-forge:0.2.0-beta.9')
dependencies {
implementation "net.neoforged:neoforge:${project.neoforge_version}"

implementation fg.deobf("com.aetherteam.aether:aether:${project.aether_version}")
implementation "com.aetherteam.aether:aether:${project.aether_version}"

implementation fg.deobf("com.aetherteam.nitrogen:nitrogen_internals:${project.nitrogen_version}")
implementation fg.deobf("com.aetherteam.cumulus:cumulus_menus:${project.cumulus_version}")
implementation fg.deobf("top.theillusivec4.curios:curios-forge:${project.curios_version}+${project.mc_version}")
implementation "com.aetherteam.nitrogen:nitrogen_internals:${project.nitrogen_version}"
implementation "com.aetherteam.cumulus:cumulus_menus:${project.cumulus_version}"
implementation "top.theillusivec4.curios:curios-neoforge:${project.curios_version}+${project.mc_version}"
}

repositories {
Expand All @@ -102,23 +86,24 @@ tasks.named('jar', Jar).configure {
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
finalizedBy 'reobfJar'
}

tasks.named(sourceSets.main.compileJavaTaskName) {
outputs.file("${it.temporaryDir}/${it.name}-refmap.json").withPropertyName("mixin refmap")
}

compileJava {
options.incremental = false
}

tasks.register('sourceJar', Jar) {
dependsOn 'classes'
from sourceSets.main.allSource
archiveClassifier = 'sources'
}

publishing {
publications {
mavenJava(MavenPublication) {
artifactId project.archivesBaseName
artifact jar
artifact sourceJar
artifact project.jar
artifact project.sourceJar
}
}
repositories {
Expand All @@ -141,6 +126,7 @@ curseforge {
changelog = file("$rootDir/docs/CHANGELOG.md")
changelogType = "markdown"
addGameVersion("${project.mc_version}")
addGameVersion("NeoForge")
mainArtifact(tasks.jar) {
displayName = "${project.mod_name} - ${version}"
relations {
Expand All @@ -159,13 +145,8 @@ modrinth {
changelog = new File("$rootDir/docs/CHANGELOG.md").text
uploadFile = tasks.jar
gameVersions = ["${project.mc_version}"]
loaders = ["forge", "neoforge"]
loaders = ["neoforge"]
dependencies {
required.version "aether", "${project.aether_version}"
}
}

mixin {
config "${project.mod_id}.mixins.json"
add sourceSets.main, "${project.mod_id}.refmap.json"
}
5 changes: 2 additions & 3 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Emissivity - Forge - 1.19.4-1.0.0

Additions
# Emissivity - NeoForge - 1.0.0-1.20.2

- Port to 1.20.2
6 changes: 3 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ If you're interested in sponsoring Emissivity or The Aether Team, please [contac
[![Modrinth Version](https://img.shields.io/modrinth/game-versions/sKHHynnb?color=00AF5C&label=latest&logo=modrinth&last=true)](https://modrinth.com/mod/aether-emissivity)
[![CurseForge Downloads](http://cf.way2muchnoise.eu/916028.svg)](https://www.curseforge.com/minecraft/mc-mods/aether-emissivity)
[![CurseForge Version](http://cf.way2muchnoise.eu/versions/916028_latest.svg)](https://www.curseforge.com/minecraft/mc-mods/aether-emissivity)
[![CircleCI](https://circleci.com/gh/The-Aether-Team/Emissivity/tree/1.19.4-develop.svg?style=shield)](https://app.circleci.com/pipelines/github/The-Aether-Team/Emissivity?branch=1.19.4-develop)
[![CircleCI](https://circleci.com/gh/The-Aether-Team/Emissivity/tree/1.20.2-develop.svg?style=shield)](https://app.circleci.com/pipelines/github/The-Aether-Team/Emissivity?branch=1.20.2-develop)
### Release builds
Emissivity has stable release builds available on [Modrinth](https://modrinth.com/mod/aether-emissivity) and [CurseForge](https://www.curseforge.com/minecraft/mc-mods/aether-emissivity).

Expand Down Expand Up @@ -97,13 +97,13 @@ dependencies {
If you're running into bugs or other problems, feel free to open an issue on our [issue tracker](https://github.com/The-Aether-Team/Emissivity/issues). When doing so, make sure to use one of the provided templates and fill out all the requested information. Make sure to keep your issue's description clear and concise. Your issue's title should also be easy to digest, giving our developers and reporters a good idea of what's wrong without including too many details. Failure to follow any of the above may result in your issue being closed.

## :wrench: Contribute to the project
Looking to contribute to the project? We ask that you read over our [Contributor's Guide](https://github.com/The-Aether-Team/Emissivity/blob/1.19.4-develop/docs/CONTRIBUTING.md) for more details as well as our [Contributor License Agreement (CLA)](https://github.com/The-Aether-Team/Emissivity/blob/1.19.4-develop/docs/AGREEMENT.md) before getting started.
Looking to contribute to the project? We ask that you read over our [Contributor's Guide](https://github.com/The-Aether-Team/Emissivity/blob/1.20.2-develop/docs/CONTRIBUTING.md) for more details as well as our [Contributor License Agreement (CLA)](https://github.com/The-Aether-Team/Emissivity/blob/1.20.2-develop/docs/AGREEMENT.md) before getting started.

Not sure what to help with? Take a look at our issue tracker for some ideas! [Here's a quick link](https://github.com/The-Aether-Team/Emissivity/labels/status%2Fhelp-wanted) which shows all the currently open issues that we'd love some help on.

## :scroll: License information
[![Asset license (Unlicensed)](https://img.shields.io/badge/assets%20license-All%20Rights%20Reserved-red.svg?style=flat-square)](https://en.wikipedia.org/wiki/All_rights_reserved)
[![Code license (LGPL v3.0)](https://img.shields.io/badge/code%20license-LGPL%20v3.0-green.svg?style=flat-square)](https://github.com/The-Aether-Team/Emissivity/blob/1.19.4-develop/LICENSE.txt)
[![Code license (LGPL v3.0)](https://img.shields.io/badge/code%20license-LGPL%20v3.0-green.svg?style=flat-square)](https://github.com/The-Aether-Team/Emissivity/blob/1.20.2-develop/LICENSE.txt)

If you're wanting to create a gameplay video/review, extension or addon, parody, or any other fan work of your own for Emissivity, go for it! We love seeing the content our community creates, and we hope to make it as welcoming as possible for everyone. We ask however that you please don't advertise using our brand (our specific logo assets, team name, official social media posts).

Expand Down
15 changes: 7 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ org.gradle.daemon=false
mod_id=aether_emissivity
mod_name=Emissivity
mod_version=1.0.0
mc_version=1.20.1
neoforge_version=47.1.70
mappings=2023.08.20-1.20.1
mc_version=1.20.2
neoforge_version=20.2.88
mappings=2023.12.10

# Dependencies
aether_version=1.20.1-1.0.0-beta.1.2-neoforge
nitrogen_version=1.20.1-0.1.3-neoforge
cumulus_version=1.20.1-0.1.4-neoforge
curios_version=5.3.1
mixinextras_version=0.2.0-beta.9
aether_version=1.20.2-1.3.1-neoforge
nitrogen_version=1.20.2-1.0.23-neoforge
cumulus_version=1.20.2-1.0.0-neoforge
curios_version=6.1.0

# Publishing
curseforge_id=916028
Expand Down
15 changes: 0 additions & 15 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
pluginManagement {
resolutionStrategy {
eachPlugin {
var plugin = requested.id.toString()

// ModGradle
if (plugin.startsWith('org.moddingx.modgradle.')) {
useModule "org.moddingx:ModGradle:${requested.version}"
}
}
}
repositories {
gradlePluginPortal()
maven { url = 'https://maven.neoforged.net/releases/' }
maven { url = 'https://repo.spongepowered.org/maven' }
maven { url = 'https://maven.parchmentmc.org' }
maven { url = 'https://maven.moddingx.org' }
}
}

plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0'
}
2 changes: 1 addition & 1 deletion src/generated/resources/pack.mcmeta
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": {
"translate": "pack.aether_emissivity.mod.description"
},
"forge:server_data_pack_format": 12,
"neoforge:server_data_pack_format": 12,
"pack_format": 13
}
}
33 changes: 16 additions & 17 deletions src/main/java/com/aetherteam/emissivity/Emissivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,34 @@
import net.minecraft.data.metadata.PackMetadataGenerator;
import net.minecraft.network.chat.Component;
import net.minecraft.server.packs.PackType;
import net.minecraft.server.packs.PathPackResources;
import net.minecraft.server.packs.metadata.pack.PackMetadataSection;
import net.minecraft.server.packs.repository.Pack;
import net.minecraft.server.packs.repository.PackCompatibility;
import net.minecraft.server.packs.repository.PackSource;
import net.minecraft.world.flag.FeatureFlagSet;
import net.minecraftforge.data.event.GatherDataEvent;
import net.minecraftforge.event.AddPackFindersEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.ModList;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.config.ModConfig;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.resource.PathPackResources;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.fml.ModList;
import net.neoforged.fml.ModLoadingContext;
import net.neoforged.fml.common.Mod;
import net.neoforged.fml.config.ModConfig;
import net.neoforged.neoforge.data.event.GatherDataEvent;
import net.neoforged.neoforge.event.AddPackFindersEvent;
import org.slf4j.Logger;

import java.nio.file.Path;
import java.util.List;
import java.util.Map;

@Mod(Emissivity.MODID)
public class Emissivity {
public static final String MODID = "aether_emissivity";
public static final Logger LOGGER = LogUtils.getLogger();

public Emissivity() {
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
modEventBus.addListener(this::dataSetup);
modEventBus.addListener(this::packSetup);
public Emissivity(IEventBus bus, Dist dist) {
bus.addListener(this::dataSetup);
bus.addListener(this::packSetup);
ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, EmissivityConfig.CLIENT_SPEC);
}

Expand All @@ -60,16 +61,14 @@ public void packSetup(AddPackFindersEvent event) {
private void setupRecipeOverridePack(AddPackFindersEvent event) {
if (event.getPackType() == PackType.CLIENT_RESOURCES) {
Path resourcePath = ModList.get().getModFileById(Emissivity.MODID).getFile().findResource("packs/model_override");
PathPackResources pack = new PathPackResources(ModList.get().getModFileById(Emissivity.MODID).getFile().getFileName() + ":" + resourcePath, true, resourcePath);
PackMetadataSection metadata = new PackMetadataSection(Component.literal(""), SharedConstants.getCurrentVersion().getPackVersion(PackType.CLIENT_RESOURCES));
event.addRepositorySource((source) ->
source.accept(Pack.create(
"builtin/emissivity_model_override",
Component.literal(""),
true,
(string) -> pack,
new Pack.Info(metadata.getDescription(), metadata.getPackFormat(PackType.SERVER_DATA), metadata.getPackFormat(PackType.CLIENT_RESOURCES), FeatureFlagSet.of(), true),
PackType.SERVER_DATA,
new PathPackResources.PathResourcesSupplier(resourcePath, true),
new Pack.Info(metadata.description(), metadata.packFormat(PackType.SERVER_DATA), metadata.packFormat(PackType.CLIENT_RESOURCES), PackCompatibility.COMPATIBLE, FeatureFlagSet.of(), List.of(), true),
Pack.Position.TOP,
false,
PackSource.BUILT_IN)
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/com/aetherteam/emissivity/EmissivityConfig.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.aetherteam.emissivity;

import net.minecraftforge.common.ForgeConfigSpec;
import net.neoforged.neoforge.common.ModConfigSpec;
import org.apache.commons.lang3.tuple.Pair;

public class EmissivityConfig {
public static class Client {
public final ForgeConfigSpec.ConfigValue<Boolean> emissive_sentry_boots;
public final ForgeConfigSpec.ConfigValue<Boolean> emissive_phoenix_armor;
public final ForgeConfigSpec.ConfigValue<Boolean> emissive_shield_of_repulsion;
public final ModConfigSpec.ConfigValue<Boolean> emissive_sentry_boots;
public final ModConfigSpec.ConfigValue<Boolean> emissive_phoenix_armor;
public final ModConfigSpec.ConfigValue<Boolean> emissive_shield_of_repulsion;

public Client(ForgeConfigSpec.Builder builder) {
public Client(ModConfigSpec.Builder builder) {
builder.push("Emissives");
emissive_sentry_boots = builder
.comment("Enables emissivity for Sentry Boots")
Expand All @@ -27,11 +27,11 @@ public Client(ForgeConfigSpec.Builder builder) {
}
}

public static final ForgeConfigSpec CLIENT_SPEC;
public static final ModConfigSpec CLIENT_SPEC;
public static final Client CLIENT;

static {
final Pair<Client, ForgeConfigSpec> clientSpecPair = new ForgeConfigSpec.Builder().configure(Client::new);
final Pair<Client, ModConfigSpec> clientSpecPair = new ModConfigSpec.Builder().configure(Client::new);
CLIENT_SPEC = clientSpecPair.getRight();
CLIENT = clientSpecPair.getLeft();
}
Expand Down
Loading

0 comments on commit bbc144c

Please sign in to comment.