From 3c40981e33362d67aa03aa8a06d8af8b3829bad2 Mon Sep 17 00:00:00 2001 From: trinsdar <30245301+Trinsdar@users.noreply.github.com> Date: Sun, 1 Sep 2024 13:41:50 -0400 Subject: [PATCH] started work on updating gradle stuff --- build.gradle | 13 +++-- forge/build.gradle | 13 +---- .../mixin/GTCapabilityProviderAccessor.java | 16 ------ .../forge/QuantumChestItemHandlerImpl.java | 53 ------------------- .../src/main/resources/gt4r.mixins.forge.json | 9 ---- gradle.properties | 12 ++--- gradle/wrapper/gradle-wrapper.properties | 5 +- 7 files changed, 16 insertions(+), 105 deletions(-) delete mode 100644 forge/src/main/java/trinsdar/gt4r/forge/mixin/GTCapabilityProviderAccessor.java delete mode 100644 forge/src/main/java/trinsdar/gt4r/machine/forge/QuantumChestItemHandlerImpl.java delete mode 100644 forge/src/main/resources/gt4r.mixins.forge.json diff --git a/build.gradle b/build.gradle index 8c040296..d7f0fe9c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ plugins { id "maven-publish" id "architectury-plugin" version "3.4-SNAPSHOT" - id "dev.architectury.loom" version "0.12.0-SNAPSHOT" apply(false) + id "dev.architectury.loom" version "1.6-SNAPSHOT" apply(false) id "com.github.johnrengelman.shadow" version "7.0.0" apply(false) } @@ -49,12 +49,11 @@ allprojects { apply plugin: "maven-publish" apply plugin: "java" apply plugin: "architectury-plugin" + apply from: 'https://raw.githubusercontent.com/GregTech-Intergalactical/GradleSripts/main/repositories.gradle' group = rootProject.maven_group - apply from: 'https://raw.githubusercontent.com/GregTech-Intergalactical/GradleSripts/main/repositories.gradle' - java { withSourcesJar() } @@ -87,20 +86,20 @@ subprojects{ shadowJar { configurations = [project.configurations.shadowCommon] - classifier "dev-shadow" + archiveClassifier.set "dev-shadow" } remapJar { input.set shadowJar.archiveFile dependsOn shadowJar - classifier null + archiveClassifier.set null } jar { - classifier "dev" + archiveClassifier.set "dev" } - components.java { + components.java { withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) { skip() } diff --git a/forge/build.gradle b/forge/build.gradle index 39ae5d3a..80b9d1b1 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -8,18 +8,7 @@ architectury { loom{ accessWidenerPath = project(":antimatter-common").file("src/main/resources/antimatter.accesswidener") forge { - mixinConfigs = [ - "gt4r.mixins.json", "gt4r.mixins.forge.json" - ] - dataGen { - mod project.modid - } - - launches { - data { - arg "--existing", file("src/main/resources").absolutePath - } - } + mixinConfigs("gt4r.mixins.json") } } diff --git a/forge/src/main/java/trinsdar/gt4r/forge/mixin/GTCapabilityProviderAccessor.java b/forge/src/main/java/trinsdar/gt4r/forge/mixin/GTCapabilityProviderAccessor.java deleted file mode 100644 index c2eb54f7..00000000 --- a/forge/src/main/java/trinsdar/gt4r/forge/mixin/GTCapabilityProviderAccessor.java +++ /dev/null @@ -1,16 +0,0 @@ -package trinsdar.gt4r.forge.mixin; - -import net.minecraftforge.common.capabilities.CapabilityDispatcher; -import net.minecraftforge.common.capabilities.CapabilityProvider; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.gen.Accessor; - -import javax.annotation.Nullable; - -@Mixin(CapabilityProvider.class) -public interface GTCapabilityProviderAccessor { - - @Accessor(value = "capabilities", remap = false) - @Nullable - CapabilityDispatcher getCapabilitiesGT(); -} diff --git a/forge/src/main/java/trinsdar/gt4r/machine/forge/QuantumChestItemHandlerImpl.java b/forge/src/main/java/trinsdar/gt4r/machine/forge/QuantumChestItemHandlerImpl.java deleted file mode 100644 index 00ec4b8f..00000000 --- a/forge/src/main/java/trinsdar/gt4r/machine/forge/QuantumChestItemHandlerImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -package trinsdar.gt4r.machine.forge; - -import muramasa.antimatter.Antimatter; -import net.minecraft.core.Registry; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraftforge.common.capabilities.CapabilityDispatcher; -import trinsdar.gt4r.forge.mixin.GTCapabilityProviderAccessor; - -public class QuantumChestItemHandlerImpl { - public static CompoundTag save(CompoundTag pCompoundTag, ItemStack stack) { - ResourceLocation resourcelocation = stack.getItem().getRegistryName(); - pCompoundTag.putString("id", resourcelocation == null ? "minecraft:air" : resourcelocation.toString()); - pCompoundTag.putInt("Count", stack.getCount()); - if (stack.getTag() != null) { - pCompoundTag.put("tag", stack.getTag().copy()); - } - final CapabilityDispatcher disp = ((GTCapabilityProviderAccessor)(Object)stack).getCapabilitiesGT(); - if (disp != null) - { - CompoundTag cnbt = disp.serializeNBT(); - if (!cnbt.isEmpty()) { - pCompoundTag.put("ForgeCaps", cnbt); - } - } - - return pCompoundTag; - } - - public static ItemStack of(CompoundTag pCompoundTag) { - try { - CompoundTag capNBT = pCompoundTag.contains("ForgeCaps") ? pCompoundTag.getCompound("ForgeCaps") : null; - Item rawItem = Registry.ITEM.get(new ResourceLocation(pCompoundTag.getString("id"))); - int count = pCompoundTag.getInt("Count"); - ItemStack stack = new ItemStack(rawItem, count, capNBT); - if (pCompoundTag.contains("tag", 10)) { - CompoundTag tag = pCompoundTag.getCompound("tag"); - stack.setTag(tag); - stack.getItem().verifyTagAfterLoad(pCompoundTag); - } - - if (stack.getItem().isDamageable(stack)) { - stack.setDamageValue(stack.getDamageValue()); - } - return stack; - } catch (RuntimeException runtimeexception) { - Antimatter.LOGGER.debug("Tried to load invalid item: {}", pCompoundTag, runtimeexception); - return ItemStack.EMPTY; - } - } -} diff --git a/forge/src/main/resources/gt4r.mixins.forge.json b/forge/src/main/resources/gt4r.mixins.forge.json deleted file mode 100644 index 8514e4a5..00000000 --- a/forge/src/main/resources/gt4r.mixins.forge.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "required": true, - "package": "trinsdar.gt4r.forge.mixin", - "compatibilityLevel": "JAVA_8", - "mixins": [ - "GTCapabilityProviderAccessor" - ], - "minVersion": "0.8" -} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 37b3cd15..a07092d7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ org.gradle.jvmargs=-Xmx5G org.gradle.daemon=false org.gradle.parallel=true -mod_version=0.1-alpha-15 +mod_version=0.1-alpha-16 archive_base_name=gt4r modid=gt4r @@ -15,10 +15,10 @@ fabric_api_version=0.76.0+1.18.2 fabric_transfer_api_version=1.6.+ fabric_loader_version=0.14.6 -gt_core_version=0.1.1-pre32 +gt_core_version=0.1.1-pre38 terraform_version=3.1.4 -jei_version=10.1.0.223 -crafttweaker_version=9.1.90 +jei_version=10.2.1.1004 +crafttweaker_version=9.1.207 kubejs_version=1802.5.1-build.329 nightconfig_version=3.6.5 port_lib_version=1.2.575 @@ -31,9 +31,9 @@ energy_version=2.2.0 top_forge_file=3671753 structurelib_version=2.0.0-pre10 carbon_config_fabric_version=ec9yfAHJ -carbon_config_forge_version=L3ipBBnb +carbon_config_forge_version=u2cqt0OR -maven_group=com.github.gregtech-intergalactical +maven_group=io.github.gregtechintergalactical antimatter_mod_version=0.1 antimatter_archive_base_name=AntimatterAPI diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ffed3a25..d6af8c3a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Thu Aug 20 17:56:19 CEST 2020 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip -zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME \ No newline at end of file