From e7790de9a56bbaec69791c3f3bd7a86d5193d8ab Mon Sep 17 00:00:00 2001 From: Drex Date: Mon, 1 Jul 2024 00:26:18 +0200 Subject: [PATCH] Fix pressure plates remaining pressed in certain conditions fixes #43 --- CHANGELOG.md | 1 + .../mixin/interaction/VanishEntitySelector.java | 17 ++++++++++++++++- src/main/resources/vanish.mixins.json | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8b9299..570ec79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Containers remaining open by vanished players in certain conditions +- Pressure plates remaining pressed by vanished players in certain conditions ## [1.5.6] - 2024-06-20 ### Added 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 f154f8f..95071fe 100644 --- a/src/main/java/me/drex/vanish/mixin/interaction/VanishEntitySelector.java +++ b/src/main/java/me/drex/vanish/mixin/interaction/VanishEntitySelector.java @@ -13,6 +13,7 @@ import net.minecraft.world.item.ArmorItem; import net.minecraft.world.level.EntityGetter; import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.BasePressurePlateBlock; import net.minecraft.world.level.block.BeehiveBlock; import net.minecraft.world.phys.AABB; import org.spongepowered.asm.mixin.Mixin; @@ -117,7 +118,7 @@ public abstract static class AbstractMinecartMixin { ) ) private List vanish_preventMinecartColision(Level instance, Entity entity, AABB aABB, Operation> original) { - return true ? instance.getEntities(entity, aABB, VanishMod.NO_SPECTATORS_AND_NO_VANISH) : original.call(instance, entity, aABB); + return ConfigManager.vanish().interaction.entityCollisions ? instance.getEntities(entity, aABB, VanishMod.NO_SPECTATORS_AND_NO_VANISH) : original.call(instance, entity, aABB); } } @@ -152,4 +153,18 @@ private List vanish_preventBeeAnger(Level instance, Class vanish_preventPressurePlatePress(Operation> original) { + return ConfigManager.vanish().interaction.blocks ? VanishMod.NO_SPECTATORS_AND_NO_VANISH : original.call(); + } + } + } diff --git a/src/main/resources/vanish.mixins.json b/src/main/resources/vanish.mixins.json index 237cfe5..b4fbfbe 100644 --- a/src/main/resources/vanish.mixins.json +++ b/src/main/resources/vanish.mixins.json @@ -40,6 +40,7 @@ "interaction.StepOnBlockMixin", "interaction.VanishEntitySelector$AbstractMinecartMixin", "interaction.VanishEntitySelector$ArmorItemMixin", + "interaction.VanishEntitySelector$BasePressurePlateBlockMixin", "interaction.VanishEntitySelector$BeehiveBlockMixin", "interaction.VanishEntitySelector$EntityGetterMixin", "interaction.VanishEntitySelector$EntitySelectorMixin",