Skip to content

Commit

Permalink
chore: updates
Browse files Browse the repository at this point in the history
  • Loading branch information
WinDanesz committed Mar 30, 2024
1 parent a07974d commit 5043264
Show file tree
Hide file tree
Showing 92 changed files with 262 additions and 332 deletions.
92 changes: 50 additions & 42 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import groovy.json.JsonOutput
import org.apache.tools.ant.filters.ReplaceTokens
import groovy.json.*

buildscript {
repositories {
Expand All @@ -18,6 +18,9 @@ buildscript {
name 'Sponge'
url 'https://repo.spongepowered.org/repository/maven-public/'
}
maven {
url 'https://maven.cleanroommc.com'
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:5.+'
Expand Down Expand Up @@ -61,14 +64,13 @@ minecraft {
mappings channel: project.mappings_channel, version: "${project.mappings_version}-${project.mappings_mc_version}"
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.

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

def args = ["-Dmixin.debug.export=true",
'-Dmixin.hotSwap=true',
'-Dmixin.checks.interfaces=true',
'--username', 'WinDanesz', '--user', 'WinDanesz', '--uuid', '7faee354-8c60-4f5c-9862-fc0ce5f7f575',
'-Dfml.coreMods.load=' + coremod_plugin_class_name
]
'-Dfml.coreMods.load=' + coremod_plugin_class_name]
// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
runs {
Expand Down Expand Up @@ -119,6 +121,7 @@ repositories {
maven {
url = uri('https://m2.dv8tion.net/releases')
}
maven { url = 'https://maven.cleanroommc.com' }
maven {
url = uri('https://jitpack.io')
}
Expand Down Expand Up @@ -158,36 +161,38 @@ dependencies {
//// Dependencies ////
// For local development
// implementation fg.deobf("random_placeholder:ElectroblobsWizardry:4.3.12")
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'

implementation fg.deobf("curse.maven:ElectroblobsWizardry-${wizardry_projectid}:${wizardry_fileid}")
implementation fg.deobf("curse.maven:baubles-${baubles_projectid}:${baubles_fileid}")
implementation fg.deobf("mezz.jei:jei_${mc_version}:${jei_version}")
implementation fg.deobf("curse.maven:artemislib-${artemislib_projectid}:${artemislib_fileid}")
implementation fg.deobf("curse.maven:antique-atlas-${antiqueatlas_projectid}:${antiqueatlas_fileid}")
implementation fg.deobf("curse.maven:MixinBooter-${mixinbooter_projectid}:${mixinbooter_fileid}")
implementation fg.deobf("curse.maven:WizardryUtils-${wizardryutils_projectid}:${wizardryutils_fileid}")
}

mixin {
add sourceSets.main, "ancientspellcraft.refmap.json"
annotationProcessor 'org.ow2.asm:asm-debug-all:5.2'
annotationProcessor 'com.google.guava:guava:24.1.1-jre'
annotationProcessor 'com.google.code.gson:gson:2.8.6'
}

jar {
manifest {
attributes([
"Maven-Artifact": "${project.maven_group}:${project.archivesBaseName}:${project.version}",
"Specification-Title": archivesBaseName,
"Specification-Vendor": "WinDanesz",
"Specification-Version": "1", // We are version 1 of ourselves
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"WinDanesz",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"Built-On-Java": "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})",
"Built-On": "${project.mc_version}-${project.forge_version}",
"FMLCorePlugin": project.coremod_plugin_class_name,
"FMLCorePluginContainsFMLMod": true,
"ForceLoadAsMod": project.gradle.startParameter.taskNames[0] == "build",
])
attributes(["Maven-Artifact" : "${project.maven_group}:${project.archivesBaseName}:${project.version}",
"Specification-Title" : archivesBaseName,
"Specification-Vendor" : "WinDanesz",
"Specification-Version" : "1", // We are version 1 of ourselves
"Implementation-Title" : project.name,
"Implementation-Version" : "${version}",
"Implementation-Vendor" : "WinDanesz",
"Implementation-Timestamp" : new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"Built-On-Java" : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})",
'TweakClass' : "org.spongepowered.asm.launch.MixinTweaker",
"Built-On" : "${project.mc_version}-${project.forge_version}",
"FMLCorePlugin" : "com.windanesz.ancientspellcraft.core.ASLoadingPlugin",
"FMLCorePluginContainsFMLMod": true,
"FMLAT" : "ancientspellcraft_at.cfg",
"ForceLoadAsMod" : project.gradle.startParameter.taskNames[0] == "build",])
}
}

Expand All @@ -196,18 +201,16 @@ task sourceJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
manifest {
attributes([
"Maven-Artifact": "${project.maven_group}:${project.archivesBaseName}:${project.version}",
"Specification-Title": archivesBaseName,
"Specification-Vendor": "WinDanesz",
"Specification-Version": "1",
"Implementation-Title": archivesBaseName + '-sources',
"Implementation-Version": "${project.mod_version}",
"Implementation-Vendor": "WinDanesz",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"Built-On-Java": "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})",
"Built-On": "${project.mc_version}-${project.forge_version}"
])
attributes(["Maven-Artifact" : "${project.maven_group}:${project.archivesBaseName}:${project.version}",
"Specification-Title" : archivesBaseName,
"Specification-Vendor" : "${project.author}",
"Specification-Version" : "1",
"Implementation-Title" : archivesBaseName + '-sources',
"Implementation-Version" : "${project.mod_version}",
"Implementation-Vendor" : "${project.author}",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"Built-On-Java" : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})",
"Built-On" : "${project.mc_version}-${project.forge_version}"])
}
}

Expand All @@ -225,10 +228,10 @@ task downloadSources {
doLast {
mkdir "libs"
def wizardry = new File("libs/WizardrySrc-${wizardry_version}.zip")
new URL("https://github.com/Electroblob77/Wizardry/archive/v${wizardry_version}.zip").withInputStream{ i -> wizardry.withOutputStream{ it << i }}
new URL("https://github.com/Electroblob77/Wizardry/archive/v${wizardry_version}.zip").withInputStream { i -> wizardry.withOutputStream { it << i } }

def baubles = new File("libs/BaublesSrc-${baubles_version}.zip")
new URL("https://github.com/WinDanesz/Baubles/archive/${baubles_version}.zip").withInputStream{ i -> baubles.withOutputStream{ it << i }}
new URL("https://github.com/WinDanesz/Baubles/archive/${baubles_version}.zip").withInputStream { i -> baubles.withOutputStream { it << i } }
}
}

Expand Down Expand Up @@ -256,21 +259,21 @@ if (System.getenv('USE_ALPHAS').equals('true')) {
}
def rawLog = grgit.log(includes: ['HEAD'], excludes: [getLastTag()]);
def log = "";
for (org.ajoberstar.grgit.Commit commit: rawLog) {
for (org.ajoberstar.grgit.Commit commit : rawLog) {
log = log + "[`" + commit.abbreviatedId + "`](https://github.com/${project.github}/commit/" + commit.id + ") " + commit.shortMessage + " - " + commit.author.name + "\\n";
}
doLast {
exec {
commandLine "echo", "##[set-output name=jar_name;]${project.jar_name}";
}
if(project.hasProperty('curse_project_id')) {
if (project.hasProperty('curse_project_id')) {
exec {
commandLine "echo", "##[set-output name=curse_project_id;]${project.curse_project_id}";
}
exec {
commandLine "echo", "##[set-output name=curse_versions;]${project.curse_versions}";
}
if(project.hasProperty('curse_relations')) {
if (project.hasProperty('curse_relations')) {
exec {
commandLine "echo", "##[set-output name=curse_relations;]${project.curse_relations}";
}
Expand All @@ -296,14 +299,14 @@ if (System.getenv('USE_ALPHAS').equals('true')) {
exec {
commandLine "echo", "##[set-output name=jar_name;]${project.jar_name}";
}
if(project.hasProperty('curse_project_id')) {
if (project.hasProperty('curse_project_id')) {
exec {
commandLine "echo", "##[set-output name=curse_project_id;]${project.curse_project_id}";
}
exec {
commandLine "echo", "##[set-output name=curse_versions;]${project.curse_versions}";
}
if(project.hasProperty('curse_relations')) {
if (project.hasProperty('curse_relations')) {
exec {
commandLine "echo", "##[set-output name=curse_relations;]${project.curse_relations}";
}
Expand Down Expand Up @@ -351,7 +354,7 @@ processResources {
'description': project.description,
'url': project.url,
'update_url': project.update_url,
"credits" : credits
"credits": credits
}

duplicatesStrategy = 'include'
Expand Down Expand Up @@ -384,6 +387,11 @@ fancyGradle {
}
}

mixin {
add sourceSets.main, "ancientspellcraft.refmap.json"
disableAnnotationProcessorCheck()
}

publishing {
publications {
mavenJava(MavenPublication) {
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
mod_version=INDEV
mod_id=ancientspellcraft
maven_group=com.windanesz.ancientspellcraft
author=WinDanesz
name=Ancient Spellcraft
jar_name=AncientSpellcraft
description=Ancient Spellcraft is an addon mod for Electroblob's Wizardry, adding many new spells, mechanics, blocks and a new magical element to the game.
Expand Down Expand Up @@ -43,5 +44,5 @@
# Gradle
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

coremod_plugin_class_name
coremod_plugin_class_name=com.windanesz.ancientspellcraft.AncientSpellcraftMixinLoader
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,16 @@

import java.util.Random;

@Mod(modid = AncientSpellcraft.MODID, name = AncientSpellcraft.NAME, version = "@VERSION@", acceptedMinecraftVersions = "1.12.2",
dependencies = "required-after:ebwizardry@[@WIZARDRY_VERSION@,4.4);after:jei@[4.15.0,);after:artemislib;required-after:mixinbooter;required-after:wizardryutils@[1.2.2,)")
@Mod(modid = AncientSpellcraft.MODID, name = AncientSpellcraft.NAME, version = "@VERSION@", acceptedMinecraftVersions = "1.12.2", dependencies = AncientSpellcraft.DEPENDENCIES)
public class AncientSpellcraft {

public static final String MODID = "ancientspellcraft";
public static final String NAME = "Ancient Spellcraft by Dan";
public static final String DEPENDENCIES = "required-after:mixinbooter;"
+ "required-after:ebwizardry@[@WIZARDRY_VERSION@,4.4);"
+ "required-after:wizardryutils@[1.2.2,)"
+ "after:jei@[4.15.0,);"
+ "after:artemislib;";

public static final Random rand = new Random();
public static final Material DEVORITIUM = (new Material(MapColor.BLACK));
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import net.minecraft.block.state.BlockFaceShape;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Rotation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.NonNullList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.windanesz.ancientspellcraft.client.gui;

import com.windanesz.ancientspellcraft.item.IItemWithSlots;
import com.windanesz.ancientspellcraft.item.ItemGlyphArtefact;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import net.minecraft.client.renderer.entity.RenderBiped;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.layers.LayerBipedArmor;
import net.minecraft.item.EnumAction;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;

//@SideOnly(Side.CLIENT)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.windanesz.ancientspellcraft.core;

import com.google.common.eventbus.EventBus;
import net.minecraftforge.fml.common.DummyModContainer;
import net.minecraftforge.fml.common.LoadController;
import net.minecraftforge.fml.common.ModMetadata;

public class ASContainer extends DummyModContainer {
public ASContainer() {
super(new ModMetadata());
ModMetadata meta = this.getMetadata();
meta.modId = "ancientspellcraftcore";
meta.name = "Ancient Spellcraft Core";
meta.description = "Core functionality of Ancient Spellcraft";
meta.version = "1.12.2-1.0.0";
meta.authorList.add("WinDanesz");
}

@Override
public boolean registerBus(EventBus bus, LoadController controller) {
bus.register(this);
return true;
}
}
Loading

0 comments on commit 5043264

Please sign in to comment.