-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add outline collision to enderpearls
- Loading branch information
Showing
2 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
patches/server/0064-Add-outline-colliison-to-enderpearls.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Samsuik <[email protected]> | ||
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 ab777952bda1651796ed41e8a7fc6621f27db9aa..72676ea1458e91e46a62bb6fd88d7a425664d56a 100644 | ||
--- a/src/main/java/net/minecraft/world/entity/projectile/ThrowableProjectile.java | ||
+++ b/src/main/java/net/minecraft/world/entity/projectile/ThrowableProjectile.java | ||
@@ -44,7 +44,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 | ||
boolean flag = false; | ||
|
||
if (movingobjectposition.getType() == HitResult.Type.BLOCK) { |