diff --git a/Changelog.md b/Changelog.md index acfa94d..53568e1 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,7 @@ +Flan 1.6.7 +====================== +- Yeet players off riding entities when teleporting + Flan 1.6.6 ====================== - Fix blockentity interaction not working diff --git a/common/src/main/java/io/github/flemmli97/flan/CrossPlatformStuff.java b/common/src/main/java/io/github/flemmli97/flan/CrossPlatformStuff.java index 1ebab77..1e055a7 100644 --- a/common/src/main/java/io/github/flemmli97/flan/CrossPlatformStuff.java +++ b/common/src/main/java/io/github/flemmli97/flan/CrossPlatformStuff.java @@ -4,6 +4,7 @@ import dev.architectury.injectables.annotations.ExpectPlatform; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.effect.MobEffect; import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntity; @@ -46,4 +47,8 @@ public class CrossPlatformStuff { public static boolean blockDataContains(CompoundTag nbt, String tag) { throw new AssertionError(); } + + public static boolean isRealPlayer(Player player) { + throw new AssertionError(); + } } diff --git a/common/src/main/java/io/github/flemmli97/flan/event/EntityInteractEvents.java b/common/src/main/java/io/github/flemmli97/flan/event/EntityInteractEvents.java index c951a52..6cb3a47 100644 --- a/common/src/main/java/io/github/flemmli97/flan/event/EntityInteractEvents.java +++ b/common/src/main/java/io/github/flemmli97/flan/event/EntityInteractEvents.java @@ -329,6 +329,8 @@ public class EntityInteractEvents { if (!currentClaim.canInteract(player, PermissionRegistry.CANSTAY, bPos, true)) { Claim sub = currentClaim.getSubClaim(bPos); Vec3 tp = TeleportUtils.getTeleportPos(player, pos, storage, sub != null ? sub.getDimensions() : currentClaim.getDimensions(), true, bPos, (claim, nPos) -> claim.canInteract(player, PermissionRegistry.CANSTAY, nPos, false)); + if(player.isPassenger()) + player.stopRiding(); player.teleportToWithTicket(tp.x(), tp.y(), tp.z()); } if (player.getAbilities().flying && !player.isCreative() && !currentClaim.canInteract(player, PermissionRegistry.FLIGHT, rounded, true)) { diff --git a/common/src/main/java/io/github/flemmli97/flan/player/PlayerClaimData.java b/common/src/main/java/io/github/flemmli97/flan/player/PlayerClaimData.java index 24be2cd..50f2d68 100644 --- a/common/src/main/java/io/github/flemmli97/flan/player/PlayerClaimData.java +++ b/common/src/main/java/io/github/flemmli97/flan/player/PlayerClaimData.java @@ -306,12 +306,16 @@ public class PlayerClaimData implements IPlayerData { tpTo.set(tpTo.getX(), tpTo.getY() + 1, tpTo.getZ()); } else tpTo.set(tpTo.getX(), yHighest, tpTo.getZ()); + if(this.player.isPassenger()) + this.player.stopRiding(); this.player.teleportToWithTicket(tpTo.getX() + 0.5, tpTo.getY(), tpTo.getZ() + 0.5); this.tpPos = null; } else { Vec3 tp = TeleportUtils.getTeleportPos(this.player, this.player.position(), ClaimStorage.get(this.player.getLevel()), ((IPlayerClaimImpl) this.player).getCurrentClaim().getDimensions(), TeleportUtils.roundedBlockPos(this.player.position()).mutable(), (claim, nPos) -> false); + if(this.player.isPassenger()) + this.player.stopRiding(); this.player.teleportToWithTicket(tp.x(), tp.y(), tp.z()); } } else if (this.player.position().distanceToSqr(this.trappedPos) > 0.15) { diff --git a/gradle.properties b/gradle.properties index 8ad9b13..7dee44b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ forge_version=38.0.8 loader_version=0.12.8 # Mod Properties -mod_version=1.6.6 +mod_version=1.6.7 maven_group=io.github.flemmli97 archives_base_name=flan