From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: MrHua269 Date: Wed, 8 Jul 2026 21:01:20 +0800 Subject: [PATCH] Correct portal logic of some projectile entities (Should not be ticking anymore after portal logics) diff --git a/net/minecraft/world/entity/projectile/ShulkerBullet.java b/net/minecraft/world/entity/projectile/ShulkerBullet.java index d5506bfc84912ec50cd5391225b9b5291435d3aa..994c069b0bcb8f0f1d4269d7a74d6fe714246c50 100644 --- a/net/minecraft/world/entity/projectile/ShulkerBullet.java +++ b/net/minecraft/world/entity/projectile/ShulkerBullet.java @@ -229,7 +229,7 @@ public class ShulkerBullet extends Projectile { this.setPos(this.position().add(movement)); this.applyEffectsFromBlocks(); if (this.portalProcess != null && this.portalProcess.isInsidePortalThisTick()) { - this.handlePortal(); + if (this.handlePortal()) return; // Camellia - Correct portal logic of some projectile entities (Should not be ticking anymore after portal logics) } if (hitResult != null && this.isAlive() && hitResult.getType() != HitResult.Type.MISS) { diff --git a/net/minecraft/world/entity/projectile/arrow/AbstractArrow.java b/net/minecraft/world/entity/projectile/arrow/AbstractArrow.java index 88c2f0f927bd8376522eb9aed184abd6f09230f6..e54267ecf448a1b7fd6c433afba2d7ee122e07f5 100644 --- a/net/minecraft/world/entity/projectile/arrow/AbstractArrow.java +++ b/net/minecraft/world/entity/projectile/arrow/AbstractArrow.java @@ -276,7 +276,7 @@ public abstract class AbstractArrow extends Projectile { .clipIncludingBorder( new ClipContext(originalPosition, originalPosition.add(movement), ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, this) ); - this.stepMoveAndHit(blockHitResult); + if (this.stepMoveAndHit(blockHitResult)) return; // Camellia - Correct portal logic of some projectile entities (Should not be ticking anymore after portal logics) } else { this.setPos(originalPosition.add(movement)); this.applyEffectsFromBlocks(); @@ -299,7 +299,7 @@ public abstract class AbstractArrow extends Projectile { return 0.99F; } - private void stepMoveAndHit(final BlockHitResult blockHitResult) { + private boolean stepMoveAndHit(final BlockHitResult blockHitResult) { // Camellia - Correct portal logic of some projectile entities while (this.isAlive()) { Vec3 initialPosition = this.position(); ArrayList entitiesHit = new ArrayList<>(this.findHitEntities(initialPosition, blockHitResult.getLocation())); @@ -309,7 +309,7 @@ public abstract class AbstractArrow extends Projectile { this.setPos(nextLocation); this.applyEffectsFromBlocks(initialPosition, nextLocation); if (this.portalProcess != null && this.portalProcess.isInsidePortalThisTick()) { - this.handlePortal(); + if (this.handlePortal()) return true; // Camellia - Correct portal logic of some projectile entities (Should not be ticking anymore after portal logics) } if (entitiesHit.isEmpty()) { @@ -327,6 +327,7 @@ public abstract class AbstractArrow extends Projectile { break; } } + return false; // Camellia - Correct portal logic of some projectile entities } private ProjectileDeflection hitTargetsOrDeflectSelf(final Collection entityHitResults) {