From 06180560a939d95d4f243c366a9b67b967f23897 Mon Sep 17 00:00:00 2001 From: Drex Date: Thu, 22 Aug 2024 21:58:33 +0200 Subject: [PATCH] Update to 24w34a --- build.gradle | 2 +- gradle.properties | 10 ++++---- gradle/wrapper/gradle-wrapper.properties | 2 +- .../interaction/VanishEntitySelector.java | 23 +++++++++++++++---- src/main/resources/vanish.mixins.json | 3 ++- 5 files changed, 27 insertions(+), 13 deletions(-) diff --git a/build.gradle b/build.gradle index 814155d..6417bab 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ import org.jetbrains.changelog.Changelog plugins { - id 'fabric-loom' version '1.6-SNAPSHOT' + id 'fabric-loom' version '1.7-SNAPSHOT' id 'io.github.goooler.shadow' version '8.1.7' id 'maven-publish' id "me.modmuss50.mod-publish-plugin" version "0.5.1" diff --git a/gradle.properties b/gradle.properties index 7214032..8e78303 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,17 +2,17 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/develop -minecraft_version=1.21 -curseforge_minecraft_version=1.21 -loader_version=0.15.11 +minecraft_version=24w34a +curseforge_minecraft_version=1.21.2-Snapshot +loader_version=0.16.2 # Mod Properties mod_version=1.5.6 maven_group=me.drex archives_base_name=vanish # Dependencies -fabric_version=0.100.1+1.21 +fabric_version=0.102.3+1.21.2 permission_api_version=0.3.1 -placeholder_api_version=2.4.0-pre.2+1.21 +placeholder_api_version=2.4.1+1.21 player_data_api_version=0.6.0+1.21 translations_version=2.3.1+1.21-pre2 configurate_hocon_version=4.1.2 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 48c0a02..e1adfb4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/me/drex/vanish/mixin/interaction/VanishEntitySelector.java b/src/main/java/me/drex/vanish/mixin/interaction/VanishEntitySelector.java index 95071fe..d224ee0 100644 --- a/src/main/java/me/drex/vanish/mixin/interaction/VanishEntitySelector.java +++ b/src/main/java/me/drex/vanish/mixin/interaction/VanishEntitySelector.java @@ -9,7 +9,8 @@ import net.minecraft.world.entity.EntitySelector; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; -import net.minecraft.world.entity.vehicle.AbstractMinecart; +import net.minecraft.world.entity.vehicle.NewMinecartBehavior; +import net.minecraft.world.entity.vehicle.OldMinecartBehavior; import net.minecraft.world.item.ArmorItem; import net.minecraft.world.level.EntityGetter; import net.minecraft.world.level.Level; @@ -107,11 +108,10 @@ private static Predicate vanish_preventArmorItemEquip(Operation vanish_preventMinecartColision(Level instance, Entity entity, AABB aABB, Operation> original) { return ConfigManager.vanish().interaction.entityCollisions ? instance.getEntities(entity, aABB, VanishMod.NO_SPECTATORS_AND_NO_VANISH) : original.call(instance, entity, aABB); } + } + @Mixin(NewMinecartBehavior.class) + public abstract static class NewMinecartBehaviorMixin { + @WrapOperation( + method = "pushEntities", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/world/level/Level;getEntities(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/world/phys/AABB;)Ljava/util/List;" + ) + ) + private List vanish_preventMinecartColision(Level instance, Entity entity, AABB aABB, Operation> original) { + return ConfigManager.vanish().interaction.entityCollisions ? instance.getEntities(entity, aABB, VanishMod.NO_SPECTATORS_AND_NO_VANISH) : original.call(instance, entity, aABB); + } } @Mixin(Player.class) diff --git a/src/main/resources/vanish.mixins.json b/src/main/resources/vanish.mixins.json index abc082f..f02fd48 100644 --- a/src/main/resources/vanish.mixins.json +++ b/src/main/resources/vanish.mixins.json @@ -39,12 +39,13 @@ "interaction.PlayerMixin", "interaction.SimpleCriterionTriggerMixin", "interaction.StepOnBlockMixin", - "interaction.VanishEntitySelector$AbstractMinecartMixin", "interaction.VanishEntitySelector$ArmorItemMixin", "interaction.VanishEntitySelector$BasePressurePlateBlockMixin", "interaction.VanishEntitySelector$BeehiveBlockMixin", "interaction.VanishEntitySelector$EntityGetterMixin", "interaction.VanishEntitySelector$EntitySelectorMixin", + "interaction.VanishEntitySelector$NewMinecartBehaviorMixin", + "interaction.VanishEntitySelector$OldMinecartBehaviorMixin", "interaction.VanishEntitySelector$PlayerMixin", "interaction.VibrationSystemMixin" ]