From e4689a7ea32f4a2dcdf5f73ebf3987cdb7f593dd Mon Sep 17 00:00:00 2001 From: C4 <29991504+TheIllusiveC4@users.noreply.github.com> Date: Sun, 29 Sep 2024 21:56:49 -0700 Subject: [PATCH] Remove MixinSquared, closes #135 --- common/build.gradle | 1 - .../aileron/LivingEntityMxMixin.java | 34 ------------ .../aileron/PlayerEntityMxMixin.java | 52 ------------------- .../elytraslot-integrations.mixins.json | 2 - neoforge/build.gradle | 4 -- .../elytrabounce/LivingEntityMxMixin.java | 34 ------------ .../resources/META-INF/neoforge.mods.toml | 2 - ...ytraslot-neoforge-integrations.mixins.json | 11 ---- 8 files changed, 140 deletions(-) delete mode 100644 common/src/main/java/com/illusivesoulworks/elytraslot/mixin/integration/aileron/LivingEntityMxMixin.java delete mode 100644 common/src/main/java/com/illusivesoulworks/elytraslot/mixin/integration/aileron/PlayerEntityMxMixin.java delete mode 100644 neoforge/src/main/java/com/illusivesoulworks/elytraslot/mixin/integration/elytrabounce/LivingEntityMxMixin.java delete mode 100644 neoforge/src/main/resources/elytraslot-neoforge-integrations.mixins.json diff --git a/common/build.gradle b/common/build.gradle index d091455..f9c2628 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -19,7 +19,6 @@ neoForge { dependencies { compileOnly group: 'org.spongepowered', name: 'mixin', version: '0.8.5' compileOnly group: 'org.ow2.asm', name: 'asm-tree', version: '9.3' - compileOnly(annotationProcessor("com.github.bawnorton.mixinsquared:mixinsquared-common:0.1.2-beta.6")) implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1' } diff --git a/common/src/main/java/com/illusivesoulworks/elytraslot/mixin/integration/aileron/LivingEntityMxMixin.java b/common/src/main/java/com/illusivesoulworks/elytraslot/mixin/integration/aileron/LivingEntityMxMixin.java deleted file mode 100644 index dacbe77..0000000 --- a/common/src/main/java/com/illusivesoulworks/elytraslot/mixin/integration/aileron/LivingEntityMxMixin.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.illusivesoulworks.elytraslot.mixin.integration.aileron; - -import com.bawnorton.mixinsquared.TargetHandler; -import com.illusivesoulworks.elytraslot.mixin.MixinHooks; -import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.entity.player.Player; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.ModifyVariable; - -@Mixin(value = LivingEntity.class, priority = 1500) -public class LivingEntityMxMixin { - - @TargetHandler( - mixin = "com.lodestar.aileron.mixin.LivingEntityMixin", - name = "modifyVelocity") - @ModifyVariable( - method = "@MixinSquared:Handler", - at = @At( - value = "INVOKE", - target = "Lnet/minecraft/world/entity/LivingEntity;position()Lnet/minecraft/world/phys/Vec3;" - ), - ordinal = 0 - ) - private int elytraslot$modifyVelocity(int cloudSkipper) { - LivingEntity livingEntity = (LivingEntity) (Object) this; - - if (livingEntity instanceof Player player) { - return Math.max(cloudSkipper, - MixinHooks.getEnchantmentLevel(livingEntity, "aileron:cloudskipper")); - } - return cloudSkipper; - } -} diff --git a/common/src/main/java/com/illusivesoulworks/elytraslot/mixin/integration/aileron/PlayerEntityMxMixin.java b/common/src/main/java/com/illusivesoulworks/elytraslot/mixin/integration/aileron/PlayerEntityMxMixin.java deleted file mode 100644 index 3333c4c..0000000 --- a/common/src/main/java/com/illusivesoulworks/elytraslot/mixin/integration/aileron/PlayerEntityMxMixin.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.illusivesoulworks.elytraslot.mixin.integration.aileron; - -import com.bawnorton.mixinsquared.TargetHandler; -import com.illusivesoulworks.elytraslot.platform.Services; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.ElytraItem; -import net.minecraft.world.item.ItemStack; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Unique; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(value = Player.class, priority = 1500) -public class PlayerEntityMxMixin { - - @Unique - private ItemStack elytraslot$stack = ItemStack.EMPTY; - - @TargetHandler( - mixin = "com.lodestar.aileron.mixin.PlayerEntityMixin", - name = "postTick") - @Inject( - method = "@MixinSquared:Handler", - at = @At("HEAD") - ) - private void elytraslot$prePostTick(CallbackInfo ci) { - Player player = (Player) (Object) this; - this.elytraslot$stack = player.getInventory().getArmor(2); - - if (!(this.elytraslot$stack.getItem() instanceof ElytraItem)) { - ItemStack elytra = Services.ELYTRA.getEquipped(player); - - if (!elytra.isEmpty()) { - player.getInventory().armor.set(2, elytra); - } - } - } - - @TargetHandler( - mixin = "com.lodestar.aileron.mixin.PlayerEntityMixin", - name = "postTick") - @Inject( - method = "@MixinSquared:Handler", - at = @At("RETURN") - ) - private void elytraslot$postPostTick(CallbackInfo ci) { - Player player = (Player) (Object) this; - player.getInventory().armor.set(2, this.elytraslot$stack); - this.elytraslot$stack = ItemStack.EMPTY; - } -} diff --git a/common/src/main/resources/elytraslot-integrations.mixins.json b/common/src/main/resources/elytraslot-integrations.mixins.json index ec1faf5..ed6d46a 100644 --- a/common/src/main/resources/elytraslot-integrations.mixins.json +++ b/common/src/main/resources/elytraslot-integrations.mixins.json @@ -3,8 +3,6 @@ "package": "com.illusivesoulworks.elytraslot.mixin.integration", "compatibilityLevel": "JAVA_16", "mixins": [ - "aileron.LivingEntityMxMixin", - "aileron.PlayerEntityMxMixin", "waveycapes.CustomCapeMixin" ], "plugin": "com.illusivesoulworks.elytraslot.mixin.IntegrationMixinPlugin", diff --git a/neoforge/build.gradle b/neoforge/build.gradle index 9703a97..1b1e946 100644 --- a/neoforge/build.gradle +++ b/neoforge/build.gradle @@ -44,16 +44,12 @@ sourceSets.main.resources { srcDir 'src/generated/resources' } dependencies { compileOnly "curse.maven:mccapes-359836:${mccapes_cf_file_id}" - implementation(annotationProcessor("com.github.bawnorton.mixinsquared:mixinsquared-common:0.1.2-beta.6")) annotationProcessor 'org.spongepowered:mixin:0.8.5:processor' implementation "top.theillusivec4.curios:curios-neoforge:${curios_version}" runtimeOnly "com.illusivesoulworks.caelus:caelus-neoforge:${caelus_version}" compileOnly "com.illusivesoulworks.caelus:caelus-neoforge:${caelus_version}:api" - - implementation("com.github.bawnorton.mixinsquared:mixinsquared-neoforge:0.1.2-beta.6") - jarJar("com.github.bawnorton.mixinsquared:mixinsquared-neoforge:0.1.2-beta.6") { version { prefer "0.1.2-beta.6" } } } task publishCurseForge(type: TaskPublishCurseForge) { diff --git a/neoforge/src/main/java/com/illusivesoulworks/elytraslot/mixin/integration/elytrabounce/LivingEntityMxMixin.java b/neoforge/src/main/java/com/illusivesoulworks/elytraslot/mixin/integration/elytrabounce/LivingEntityMxMixin.java deleted file mode 100644 index 021a76d..0000000 --- a/neoforge/src/main/java/com/illusivesoulworks/elytraslot/mixin/integration/elytrabounce/LivingEntityMxMixin.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.illusivesoulworks.elytraslot.mixin.integration.elytrabounce; - -import com.bawnorton.mixinsquared.TargetHandler; -import com.illusivesoulworks.caelus.api.CaelusApi; -import net.minecraft.world.effect.MobEffects; -import net.minecraft.world.entity.Entity; -import net.minecraft.world.entity.EntityType; -import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.level.Level; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.ModifyVariable; - -@Mixin(value = LivingEntity.class, priority = 1500) -public abstract class LivingEntityMxMixin extends Entity { - - public LivingEntityMxMixin(EntityType pEntityType, Level pLevel) { - super(pEntityType, pLevel); - } - - @TargetHandler( - mixin = "org.infernalstudios.elytrabounce.mixin.MixinLivingEntity", - name = "elytraBounce$updateFallFlying") - @ModifyVariable( - method = "@MixinSquared:Handler", - at = @At("HEAD") - ) - private boolean elytraslot$updateFallFlying(boolean flag) { - LivingEntity livingEntity = (LivingEntity) (Object) this; - return this.getSharedFlag(7) && !livingEntity.onGround() && !livingEntity.isPassenger() && - !livingEntity.hasEffect(MobEffects.LEVITATION) && - CaelusApi.getInstance().canFallFly(livingEntity) == CaelusApi.TriState.ALLOW; - } -} diff --git a/neoforge/src/main/resources/META-INF/neoforge.mods.toml b/neoforge/src/main/resources/META-INF/neoforge.mods.toml index bfd80ed..e52ad83 100644 --- a/neoforge/src/main/resources/META-INF/neoforge.mods.toml +++ b/neoforge/src/main/resources/META-INF/neoforge.mods.toml @@ -13,8 +13,6 @@ authors="${mod_author}" description=''' ${description} ''' -[[mixins]] - config = "${mod_id}-neoforge-integrations.mixins.json" [[mixins]] config = "${mod_id}-integrations.mixins.json" [[dependencies.${mod_id}]] diff --git a/neoforge/src/main/resources/elytraslot-neoforge-integrations.mixins.json b/neoforge/src/main/resources/elytraslot-neoforge-integrations.mixins.json deleted file mode 100644 index 2ac9fea..0000000 --- a/neoforge/src/main/resources/elytraslot-neoforge-integrations.mixins.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "required": false, - "package": "com.illusivesoulworks.elytraslot.mixin.integration", - "compatibilityLevel": "JAVA_16", - "mixins": [ - "elytrabounce.LivingEntityMxMixin" - ], - "plugin": "com.illusivesoulworks.elytraslot.mixin.IntegrationMixinPlugin", - "minVersion": "0.8", - "refmap": "elytraslot.refmap.json" -} \ No newline at end of file