9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-28 19:39:17 +00:00
Files
Leaf/leaf-server/minecraft-patches/features/0083-For-collision-check-has-physics-before-same-vehicle.patch
Dreeam 3c25377465 Drop some unused patches
ClassInstanceMultiMap belongs to Minecraft vanilla entity storage.
And is unused, since replaced by spottedleaf's entity storage (rewrite chunk system).
However these patches might be useful for vanilla entity storage if is used.
2025-07-09 04:20:02 +08:00

32 lines
1.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
Date: Tue, 29 Nov 2022 00:30:17 +0100
Subject: [PATCH] For collision check has physics before same vehicle
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
This patch is based on the following patch:
"Swaps the predicate order of collision"
By: ㄗㄠˋ ㄑㄧˊ <tsao-chi@the-lingo.org>
As part of: Akarin (https://github.com/Akarin-project/Akarin)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 41279a276622062338bef685491cc2959ecb2ff4..4a18c7d890cc10d5bb31610df62d20e80bf87aca 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -2231,8 +2231,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
public void push(Entity entity) {
+ if (!entity.noPhysics && !this.noPhysics) { // Gale - Akarin - collision physics check before vehicle check
if (!this.isPassengerOfSameVehicle(entity)) {
- if (!entity.noPhysics && !this.noPhysics) {
if (this.level.paperConfig().collisions.onlyPlayersCollide && !(entity instanceof ServerPlayer || this instanceof ServerPlayer)) return; // Paper - Collision option for requiring a player participant
double d = entity.getX() - this.getX();
double d1 = entity.getZ() - this.getZ();