mirror of
https://github.com/Samsuik/Sakura.git
synced 2025-12-24 01:09:16 +00:00
49 lines
2.5 KiB
Diff
49 lines
2.5 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 c309198d092fdae6bdcc5d773b7b707bab2738bd..b0e15d97514da292a97d0bbfd0c522fa8b57ab0f 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/projectile/ThrowableProjectile.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/projectile/ThrowableProjectile.java
|
|
@@ -44,12 +44,18 @@ public abstract class ThrowableProjectile extends Projectile {
|
|
return true;
|
|
}
|
|
|
|
+ // Sakura start - enderpearls use outline for collision
|
|
+ protected net.minecraft.world.level.ClipContext.Block getClipType() {
|
|
+ return net.minecraft.world.level.ClipContext.Block.COLLIDER;
|
|
+ }
|
|
+ // Sakura end - enderpearls use outline for collision
|
|
+
|
|
@Override
|
|
public void tick() {
|
|
this.handleFirstTickBubbleColumn();
|
|
this.applyGravity();
|
|
this.applyInertia();
|
|
- HitResult movingobjectposition = ProjectileUtil.getHitResultOnMoveVector(this, this::canHitEntity);
|
|
+ HitResult movingobjectposition = ProjectileUtil.getHitResultOnMoveVector(this, this::canHitEntity, this.getClipType()); // Sakura - enderpearls use outline for collision
|
|
Vec3 vec3d;
|
|
|
|
if (movingobjectposition.getType() != HitResult.Type.MISS) {
|
|
diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownEnderpearl.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownEnderpearl.java
|
|
index bd2684528157f928460f2143dd71a48e11983123..59e55f1cd9a1bcfee657ec355007b1894301348c 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/projectile/ThrownEnderpearl.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownEnderpearl.java
|
|
@@ -210,6 +210,13 @@ public class ThrownEnderpearl extends ThrowableItemProjectile {
|
|
}
|
|
}
|
|
|
|
+ // Sakura start - enderpearls use outline for collision
|
|
+ @Override
|
|
+ protected net.minecraft.world.level.ClipContext.Block getClipType() {
|
|
+ return this.level().sakuraConfig().entity.enderPearl.useOutlineForCollision ? net.minecraft.world.level.ClipContext.Block.OUTLINE : super.getClipType();
|
|
+ }
|
|
+ // Sakura end - enderpearls use outline for collision
|
|
+
|
|
@Override
|
|
public void tick() {
|
|
int i;
|