Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix minecart/boat stopping on collide with vanished player #25

Merged
merged 3 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed
- Projectiles colliding/hitting players
- Boat and Minecart collisions

## [1.4.3] - 2023-10-04
### Added
Expand Down
22 changes: 22 additions & 0 deletions src/main/java/me/drex/vanish/mixin/interaction/BoatMixin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package me.drex.vanish.mixin.interaction;

import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import me.drex.vanish.api.VanishAPI;
import me.drex.vanish.config.ConfigManager;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.vehicle.Boat;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

@Mixin(Boat.class)
public class BoatMixin {

@ModifyReturnValue(method = "canVehicleCollide", at = @At("RETURN"))
private static boolean vanish_preventCollision(boolean original, Entity vehicle, Entity other) {
if (ConfigManager.vanish().interaction.entityCollisions && VanishAPI.isVanished(other)) {
return false;
}
return original;
}

}
1 change: 1 addition & 0 deletions src/main/resources/vanish.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"SleepStatusMixin",
"WardenMixin",
"compat.expandedstorage.ContainerMixin",
"interaction.BoatMixin",
"interaction.EntitySelectorMixin",
"interaction.FallOnBlockMixin",
"interaction.InsideBlockMixin",
Expand Down
Loading