Skip to content

Handle entity collision during teleportation - #1088

Open
JasperLorelai wants to merge 5 commits into
TheComputerGeek2:mainfrom
JasperLorelai:entity-collision
Open

Handle entity collision during teleportation#1088
JasperLorelai wants to merge 5 commits into
TheComputerGeek2:mainfrom
JasperLorelai:entity-collision

Conversation

@JasperLorelai

Copy link
Copy Markdown
Collaborator

Addition:

  • EntombSpell - Added center-target (Boolean, defaulting to true) - If set to false, the Spell will not teleport the entity to center them in a symmetric bounding box. Instead, the blocks will be placed asymmetrically beyond the bounding box the entity occupies.
  • Added configuration for safer mid-air teleportation of certain spells.
    • Spells affected:
      • BlinkSpell, ShadowstepSpell, and PhaseSpell:
        • Added require-ground-distance, defaulting to 0.
        • Added snap-to-ground defaults to false.
      • SummonSpell - Added require-ground-distance, defaulting to 2 to preserve old behaviour.
      • TeleportSpell - Added require-ground-distance, defaulting to 0.
    • require-ground-distance (Integer) - Enforces that there are non-passable blocks within the configured distance. 0 disables this requirement.
    • snap-to-ground (Boolean) - When true, the destination will be adjusted to be on the surface instead of mid-air.
  • PhaseSpell:
    • Added ignore-transparent-blocks (Boolean, false by default), which configures whether to ignore all [transparent blocks](https://github.com/TheComputerGeek2/MagicSpells/wiki/Spell-Configuration#block-target) or just air.
    • Added enter-blocks material list, which tells the spell to pass to the "exit" stage after entering specific blocks. This is useful when you want to enter passable blocks, such as cobweb, while ignore-transparent-blocks is true.
    • Added air-only-exit (Boolean, true by default), which only allows air to be the exit location; otherwise it keeps phasing. When false, all passable blocks are valid exits.
    • Added non-exit-blocks (material list) of explicitly disallowed passable exit blocks.

Changes:

  • EntombSpell will now surround the whole entity with blocks regardless of bounding box size, instead of always surrounding entities in a Player-sized box.
  • Improved ground collision checks when teleporting entities with certain spells. Instead of the spell checking if the teleportation destination block and the block above are "passable" (has no colliding parts that would prevent players from moving through it), the spell will now check for any hard collisions the entity has (not just Player-sized), including entities like boats and shulkers. If the destination is within a block, or the collision of the block extends from below the block to be within the destination (fences), the destination Y component will be adjusted to be on the surface. Spells affected: DodgeSpell, GateSpell, BlinkSpell, ShadowstepSpell, SummonSpell, TeleportSpell, and PhaseSpell.

Fixes:

  • Fixed an issue where EntombSpell would teleport the player within a block if the target is not on a full block, causing them to clip into the block.

Also added support to disable entity centering with "center-target".
This migration was added 10 years ago in
87364b2, but it can be removed now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant