Skip to content

Commit 6cf18a9

Browse files
authored
Gradle refactor to get rid of Loom (#45)
* Remove loom and use forge gradle * Loom is gone
1 parent 8d1ee0c commit 6cf18a9

8 files changed

Lines changed: 449 additions & 232 deletions

File tree

build.gradle

Lines changed: 140 additions & 185 deletions
Large diffs are not rendered by default.

gradle.properties

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
11
# Done to increase the memory available to gradle.
22
org.gradle.jvmargs=-Xmx4G
33

4-
# tell architectury loom that this project is a forge project.
5-
# this will enable us to use the "forge" dependency.
6-
# using archloom without this is possible and will give you a
7-
# "standard" loom installation with some extra features.
8-
loom.platform=forge
9-
104
# Base properties
115
# minecraft version
126
minecraft_version=1.20.1
137
# forge version, latest version can be found on https://files.minecraftforge.net/
14-
forge_version=47.2.17
15-
# yarn, latest version can be found on https://fabricmc.net/develop/
16-
parchment_mappings=2023.09.03
17-
quilt_mappings=23
8+
forge_version=47.3.0
9+
mapping_channel=parchment
10+
mapping_version=2023.09.03-1.20.1
1811

1912
# Mod Properties
2013
mod_version=0.6.0
2114
maven_group=com.ghostipedia.frontiers
2215
archives_base_name=cosmic-core
2316
mod_id=cosmiccore
17+
mod_name=Cosmic Core
18+
mod_url=
2419
mod_author=Ghostipedia
20+
mod_license=All rights reserved
2521

2622
# Dependencies
23+
architectury_version=9.2.14
2724
gtceu_version=1.6.4
2825
ldlib_version=1.0.34
29-
registrate_version=MC1.20-1.3.3
30-
kubejs_version=2001.6.4-build.120
31-
patchouli_version=81
32-
curios_version=5.9.0
26+
registrate_version=MC1.20-1.3.11
27+
rhino_version=2001.2.3-build.6
28+
kubejs_version=2001.6.5-build.14
3329
configuration_version=2.2.0
3430
jei_version=15.20.0.105
35-
emi_version=1.1.13+1.20.1
31+
emi_version=1.1.13
32+
jade_version=11.12.3
33+
patchouli_version=81
34+
curios_version=5.9.0
3635
mixinextras_version=0.2.0
36+
blood_magic_version=3.3.3-45
3737

3838
# Ad Astra
3939
ad_astra_version=1.15.18

settings.gradle

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ pluginManagement {
22
// when using additional gradle plugins like shadow,
33
// add their repositories to this list!
44
repositories {
5-
maven { url "https://maven.fabricmc.net/" }
6-
maven { url "https://maven.architectury.dev/" }
7-
maven { url "https://files.minecraftforge.net/maven/" }
8-
gradlePluginPortal()
5+
gradlePluginPortal() // Needed for spotless
6+
maven { url = 'https://maven.minecraftforge.net/' }
7+
maven { url = 'https://maven.parchmentmc.org' }
98
}
109
}

src/main/java/com/ghostipedia/cosmiccore/mixin/GTRecipeModifiersMixin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import com.gregtechceu.gtceu.api.recipe.GTRecipe;
99
import com.gregtechceu.gtceu.common.data.GTRecipeModifiers;
1010

11-
import dev.architectury.patchedmixin.staticmixin.spongepowered.asm.mixin.injection.At;
12-
import dev.architectury.patchedmixin.staticmixin.spongepowered.asm.mixin.injection.ModifyVariable;
11+
import org.spongepowered.asm.mixin.injection.At;
12+
import org.spongepowered.asm.mixin.injection.ModifyVariable;
1313
import org.jetbrains.annotations.NotNull;
1414
import org.spongepowered.asm.mixin.Debug;
1515
import org.spongepowered.asm.mixin.Mixin;

src/main/java/com/ghostipedia/cosmiccore/mixin/accessor/LootTableAccessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
@Mixin(LootTable.class)
1212
public interface LootTableAccessor {
1313

14-
@Accessor(value = "f_79109_", remap = false)
14+
@Accessor(value = "pools", remap = false)
1515
List<LootPool> getPools();
1616
}

src/main/java/com/ghostipedia/cosmiccore/mixin/client/SoundManagerMixin.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ public abstract class SoundManagerMixin {
2727
@Final
2828
private SoundEngine soundEngine;
2929

30-
@Inject(
31-
method = "play",
32-
at = @At("HEAD"),
33-
cancellable = true)
30+
@Inject(method = "play", at = @At("HEAD"), cancellable = true)
3431
private void onPlay(SoundInstance sound, CallbackInfo callbackInfo) {
3532
if (cosmicCore$checkForSpaceRadio()) {
3633
callbackInfo.cancel(); // Early exits Ad Astra's mixin from being called. Hopefully
@@ -49,10 +46,7 @@ private void onPlay(SoundInstance sound, CallbackInfo callbackInfo) {
4946
}
5047
}
5148

52-
@Inject(
53-
method = "playDelayed",
54-
at = @At("HEAD"),
55-
cancellable = true)
49+
@Inject(method = "playDelayed", at = @At("HEAD"), cancellable = true)
5650
private void onPlayDelayed(SoundInstance sound, int delay, CallbackInfo callbackInfo) {
5751
if (cosmicCore$checkForSpaceRadio()) {
5852
callbackInfo.cancel();

src/main/resources/META-INF/mods.toml

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
# Any fields that aren't annotated with #optional are *required*!
33
modLoader = "javafml"
44
loaderVersion = "[47,)"
5-
license = "All rights reserved" # Want to make your mod open source? Check out https://choosealicense.com/!
5+
license = "${mod_license}" # Want to make your mod open source? Check out https://choosealicense.com/!
66

77
# This is a URL to e.g. your GitHub or CurseForge issues page.
88
# It will appear in any crash reports this mod is directly involved in.
99
# issueTrackerURL="https://github.com/invalid/pleasechangeme/issues" #optional
1010
# A list of mods - how many allowed here is determined by the individual mod loader
1111

1212
[[mods]]
13-
modId = "cosmiccore"
13+
modId = "${mod_id}"
1414
# The version number of the mod - unlike in the Forge MDK,
1515
# we'll use the processResources task to replace this for us
1616
version = "${version}"
17-
displayName = "Cosmic Core"
17+
displayName = "${mod_name}"
1818
# This URL will be queried by the Forge update checker in order to find the latest version of your mod.
1919
# If an update is found, you'll see a little blinking "emerald" symbol on your Mods button!
2020
# updateJSONURL="https://changeme.dev/updates.json" #optional
@@ -25,7 +25,7 @@ displayName = "Cosmic Core"
2525
# Some more fluff displayed in the Mods panel. Feel free to issue your special thanks here!
2626
# credits="Thanks to Mojang for making this great game" #optional
2727
# Some more fluff displayed in the Mods panel. Plug your stuff here!
28-
# authors="Me!" #optional
28+
authors = "${mod_author}"
2929
# A multi-line description for your mod. This has no minimum length, but it *is* required!
3030
description = '''
3131
This is a very cool mod that does... things.
@@ -38,34 +38,32 @@ Have I reached 280 characters yet?
3838
# An (optional) dependency for your mod. Though technically not required,
3939
# it's always helpful to add these to stop your mod from loading when something is missing
4040
# rather than erroring out later
41-
[[dependencies.cosmiccore]]
42-
modId = "forge"
43-
mandatory = true # do you **need** this mod to be able to launch?
44-
# A version range using interval notation.
45-
# Brackets mean "inclusive" bounds, while parentheses mean "exclusive".
46-
versionRange = "[47,)" # This essentially means any forge >= 47
47-
ordering = "NONE" # Use this if you want your mod to be loaded specifically BEFORE or AFTER another mod
48-
side = "BOTH" # Specify where this mod is required: can be BOTH, CLIENT or SERVER
41+
[[dependencies.${mod_id}]]
42+
modId = "forge"
43+
mandatory = true # do you **need** this mod to be able to launch?
44+
versionRange = "[${forge_version},)" # This essentially means any forge >= 47
45+
ordering = "NONE" # Use this if you want your mod to be loaded specifically BEFORE or AFTER another mod
46+
side = "BOTH" # Specify where this mod is required: can be BOTH, CLIENT or SERVER
4947

5048
# And another dependency, use this if you want to require a certain Minecraft version.
51-
[[dependencies.cosmiccore]]
49+
[[dependencies.${mod_id}]]
5250
modId = "minecraft"
5351
mandatory = true
5452
# See above for how to read this notation, this essentially means any
5553
# version of Minecraft from 1.20.1 (inclusive).
56-
versionRange = "[1.20.1]"
54+
versionRange = "[${minecraft_version}]"
5755
ordering = "NONE"
5856
side = "BOTH"
5957

60-
[[dependencies.cosmiccore]]
58+
[[dependencies.${mod_id}]]
6159
modId="gtceu"
6260
mandatory=true
63-
versionRange="[1.5.0,)"
61+
versionRange="[${gtceu_version},)"
6462
ordering="AFTER"
6563
side="BOTH"
6664

6765

68-
[[dependencies.cosmiccore]]
66+
[[dependencies.${mod_id}]]
6967
modId="legendarysurvivaloverhaul"
7068
mandatory=true
7169
versionRange="[1.20.1-1.20.1-2.0.15,)"

0 commit comments

Comments
 (0)