From d64bd208689e203d7d156ae6554e499104f6f3fc Mon Sep 17 00:00:00 2001 From: gamma-delta <29877714+gamma-delta@users.noreply.github.com> Date: Sun, 15 May 2022 11:49:28 -0500 Subject: [PATCH] IT LAUNCHES and then immediately crashes --- Common/build.gradle | 4 ++-- .../items/colorizer/ItemUUIDColorizer.java | 1 - Fabric/build.gradle | 4 ++-- .../FabricVillagerTurnIntoWitchMixin.java | 9 +++++--- Fabric/src/main/resources/fabric.mod.json | 2 +- Forge/build.gradle | 6 ++--- build.gradle | 22 +++++++++---------- gradle.properties | 2 +- 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Common/build.gradle b/Common/build.gradle index f1e48352..ec7049b4 100644 --- a/Common/build.gradle +++ b/Common/build.gradle @@ -5,7 +5,7 @@ plugins { id 'org.jetbrains.kotlin.jvm' version '1.6.21' } -version = getVersion("common") +archivesBaseName = getArtifactID("common") minecraft { version(minecraftVersion) @@ -27,7 +27,7 @@ dependencies { implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" - compileOnly "at.petra-k.paucal:paucal-$minecraftVersion:$paucalVersion-common" + compileOnly "at.petra-k.paucal:paucal-common-$minecraftVersion:$paucalVersion" compileOnly "vazkii.patchouli:Patchouli-xplat:$minecraftVersion-$patchouliVersion" } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/items/colorizer/ItemUUIDColorizer.java b/Common/src/main/java/at/petrak/hexcasting/common/items/colorizer/ItemUUIDColorizer.java index eae58fa9..a0d0250c 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/items/colorizer/ItemUUIDColorizer.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/items/colorizer/ItemUUIDColorizer.java @@ -13,7 +13,6 @@ import java.util.Random; import java.util.UUID; public class ItemUUIDColorizer extends Item implements ColorizerItem { - public ItemUUIDColorizer(Properties pProperties) { super(pProperties); } diff --git a/Fabric/build.gradle b/Fabric/build.gradle index 54b078e0..5e667591 100644 --- a/Fabric/build.gradle +++ b/Fabric/build.gradle @@ -2,7 +2,7 @@ plugins { id 'fabric-loom' version "$loomVersion" } -version = getVersion("fabric") +archivesBaseName = getArtifactID("fabric") loom { mixin.defaultRefmapName = "hexcasting.refmap.json" @@ -46,7 +46,7 @@ dependencies { implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1' compileOnly project(":Common") - modImplementation "at.petra-k.paucal:paucal-$minecraftVersion:$paucalVersion-fabric" + modImplementation "at.petra-k.paucal:paucal-fabric-$minecraftVersion:$paucalVersion" modImplementation "vazkii.patchouli:Patchouli:$minecraftVersion-$patchouliVersion-FABRIC" modImplementation "me.zeroeightsix:fiber:$fiberVersion" diff --git a/Fabric/src/main/java/at/petrak/hexcasting/fabric/mixin/FabricVillagerTurnIntoWitchMixin.java b/Fabric/src/main/java/at/petrak/hexcasting/fabric/mixin/FabricVillagerTurnIntoWitchMixin.java index 83efdb33..49c01404 100644 --- a/Fabric/src/main/java/at/petrak/hexcasting/fabric/mixin/FabricVillagerTurnIntoWitchMixin.java +++ b/Fabric/src/main/java/at/petrak/hexcasting/fabric/mixin/FabricVillagerTurnIntoWitchMixin.java @@ -1,5 +1,7 @@ package at.petrak.hexcasting.fabric.mixin; +import at.petrak.hexcasting.common.misc.Brainsweeping; +import net.minecraft.world.entity.monster.Witch; import net.minecraft.world.entity.npc.Villager; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; @@ -9,8 +11,9 @@ import org.spongepowered.asm.mixin.injection.callback.LocalCapture; @Mixin(Villager.class) public class FabricVillagerTurnIntoWitchMixin { - @Inject(method = "thunderHit", locals = LocalCapture.PRINT, at = @At(value = "INVOKE", target = "Lnet/minecraft/server/level/ServerLevel;addFreshEntityWithPassengers(Lnet/minecraft/world/entity/Entity;)V")) - public void onThunderHit(CallbackInfo cb) { - // todo + @Inject(method = "thunderHit", locals = LocalCapture.CAPTURE_FAILHARD, at = @At(value = "INVOKE", target = "Lnet/minecraft/server/level/ServerLevel;addFreshEntityWithPassengers(Lnet/minecraft/world/entity/Entity;)V")) + public void onThunderHit(CallbackInfo cb, Witch newWitch) { + var self = (Villager) (Object) this; + Brainsweeping.copyBrainsweepFromVillager(self, newWitch); } } diff --git a/Fabric/src/main/resources/fabric.mod.json b/Fabric/src/main/resources/fabric.mod.json index 228a0d59..ccaa8bd1 100644 --- a/Fabric/src/main/resources/fabric.mod.json +++ b/Fabric/src/main/resources/fabric.mod.json @@ -40,7 +40,7 @@ "java": ">=17", "fabric-language-kotlin": ">=1.7.4+kotlin.1.6.21", "patchouli": ">=1.18.2-66", - "paucal": ">=0.4.0" + "paucal": "*" }, "custom": { diff --git a/Forge/build.gradle b/Forge/build.gradle index 5c9e4a75..33491ddd 100644 --- a/Forge/build.gradle +++ b/Forge/build.gradle @@ -21,7 +21,7 @@ apply plugin: 'eclipse' apply plugin: 'maven-publish' apply plugin: 'org.spongepowered.mixin' -version = getVersion("forge") +archivesBaseName = getArtifactID("forge") // Adds the Kotlin Gradle plugin buildscript { @@ -150,8 +150,8 @@ dependencies { annotationProcessor 'org.spongepowered:mixin:0.8.5:processor' - compileOnly fg.deobf("at.petra-k.paucal:paucal-$minecraftVersion:$paucalVersion-forge") - runtimeOnly fg.deobf("at.petra-k.paucal:paucal-$minecraftVersion:$paucalVersion-forge") + compileOnly fg.deobf("at.petra-k.paucal:paucal-forge-$minecraftVersion:$paucalVersion") + runtimeOnly fg.deobf("at.petra-k.paucal:paucal-forge-$minecraftVersion:$paucalVersion") compileOnly fg.deobf("vazkii.patchouli:Patchouli:$minecraftVersion-$patchouliVersion:api") runtimeOnly fg.deobf("vazkii.patchouli:Patchouli:$minecraftVersion-$patchouliVersion") diff --git a/build.gradle b/build.gradle index cd2e5f1a..f3e358a7 100644 --- a/build.gradle +++ b/build.gradle @@ -38,16 +38,8 @@ def isRelease() { } } -String getVersion(String platform) { - def v = "${modVersion}" - if (!isRelease() && System.getenv('BUILD_NUMBER') != null) { - v += "-prerelease-" + System.getenv('BUILD_NUMBER') - } else if (System.getenv('TAG_NAME') != null) { - v = System.getenv('TAG_NAME').substring(1) - println 'Version overridden to tag version ' + version - } - v += "-" + platform - return v +String getArtifactID(String platform) { + return "${modID}-${platform}-${minecraftVersion}" } subprojects { @@ -57,8 +49,14 @@ subprojects { apply plugin: 'maven-publish' group = "at.petra-k.$modID" // http://maven.apache.org/guides/mini/guide-naming-conventions.html - archivesBaseName = "${modID}-${minecraftVersion}" - // Version is fixed up in each gradle + version = "${modVersion}" + if (!isRelease() && System.getenv('BUILD_NUMBER') != null) { + version += "-prerelease-" + System.getenv('BUILD_NUMBER') + } else if (System.getenv('TAG_NAME') != null) { + version = System.getenv('TAG_NAME').substring(1) + println 'Version overridden to tag version ' + version + } + // archivesBaseName set in each gradle java.toolchain.languageVersion = JavaLanguageVersion.of(17) java.withSourcesJar() diff --git a/gradle.properties b/gradle.properties index fb966211..8c737ef6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,6 +9,6 @@ modName=Hex Casting minecraftVersion=1.18.2 modVersion=0.9.0 -paucalVersion=0.4.0-prerelease-17 +paucalVersion=0.4.0-prerelease-23 patchouliVersion=67 jeiVersion=9.5.3.143