9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2025-12-28 11:19:08 +00:00
Files
SakuraMC/patches/server/0062-Add-outline-colliison-to-enderpearls.patch
Samsuik e51eb03769 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly
2024-07-15 13:07:44 +01:00

28 lines
1.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samsuik <kfian294ma4@gmail.com>
Date: Thu, 14 Mar 2024 18:13:24 +0000
Subject: [PATCH] Add outline colliison to enderpearls
diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrowableProjectile.java b/src/main/java/net/minecraft/world/entity/projectile/ThrowableProjectile.java
index bf4c1883a1257af89428d6580a177f3af3759ee7..426c128805e5d40d4402e2b385d1a39f71b708a1 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/ThrowableProjectile.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/ThrowableProjectile.java
@@ -43,7 +43,15 @@ public abstract class ThrowableProjectile extends Projectile {
@Override
public void tick() {
super.tick();
- HitResult movingobjectposition = ProjectileUtil.getHitResultOnMoveVector(this, this::canHitEntity);
+ // Sakura start - enderpearls use outline for collision
+ final net.minecraft.world.level.ClipContext.Block type;
+ if (level().sakuraConfig().entity.enderPearl.useOutlineForCollision && this instanceof ThrownEnderpearl) {
+ type = net.minecraft.world.level.ClipContext.Block.OUTLINE;
+ } else {
+ type = net.minecraft.world.level.ClipContext.Block.COLLIDER;
+ }
+ HitResult movingobjectposition = ProjectileUtil.getHitResultOnMoveVector(this, this::canHitEntity, type);
+ // Sakura end - enderpearls use outline for collision
if (movingobjectposition.getType() != HitResult.Type.MISS) {
this.preHitTargetOrDeflectSelf(movingobjectposition); // CraftBukkit - projectile hit event