Files

60 lines
3.5 KiB
Diff
Raw Permalink Normal View History

2026-07-09 00:03:09 +08:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <mrhua269@gmail.com>
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
2026-07-14 15:09:17 +08:00
index d5506bfc84912ec50cd5391225b9b5291435d3aa..52a061fd6684c4c77681bbb04206237e6cda54de 100644
2026-07-09 00:03:09 +08:00
--- 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();
2026-07-14 11:32:51 +08:00
+ if (this.handlePortal()) return; // Shiroha - Correct portal logic of some projectile entities (Should not be ticking anymore after portal logics)
2026-07-09 00:03:09 +08:00
}
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
2026-07-14 15:09:17 +08:00
index 88c2f0f927bd8376522eb9aed184abd6f09230f6..3072cff2809ad4d3756f403bbff760a7a84901b0 100644
2026-07-09 00:03:09 +08:00
--- 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);
2026-07-14 11:32:51 +08:00
+ if (this.stepMoveAndHit(blockHitResult)) return; // Shiroha - Correct portal logic of some projectile entities (Should not be ticking anymore after portal logics)
2026-07-09 00:03:09 +08:00
} 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) {
2026-07-14 11:32:51 +08:00
+ private boolean stepMoveAndHit(final BlockHitResult blockHitResult) { // Shiroha - Correct portal logic of some projectile entities
2026-07-09 00:03:09 +08:00
while (this.isAlive()) {
Vec3 initialPosition = this.position();
ArrayList<EntityHitResult> 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();
2026-07-14 11:32:51 +08:00
+ if (this.handlePortal()) return true; // Shiroha - Correct portal logic of some projectile entities (Should not be ticking anymore after portal logics)
2026-07-09 00:03:09 +08:00
}
if (entitiesHit.isEmpty()) {
@@ -327,6 +327,7 @@ public abstract class AbstractArrow extends Projectile {
break;
}
}
2026-07-14 11:32:51 +08:00
+ return false; // Shiroha - Correct portal logic of some projectile entities
2026-07-09 00:03:09 +08:00
}
private ProjectileDeflection hitTargetsOrDeflectSelf(final Collection<EntityHitResult> entityHitResults) {