82 lines
3.0 KiB
Diff
82 lines
3.0 KiB
Diff
From 5b7af710836342c5528e770fea35e2e873399f59 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?=E3=84=97=E3=84=A0=CB=8B=20=E3=84=91=E3=84=A7=CB=8A?=
|
|
<tsao-chi@the-lingo.org>
|
|
Date: Fri, 10 Apr 2020 15:47:15 +0800
|
|
Subject: [PATCH] Swaps the predicate order of collision
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
|
index 34aac6031..a4467199c 100644
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
|
@@ -1403,38 +1403,38 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
|
public void pickup(EntityHuman entityhuman) {}
|
|
|
|
public void collide(Entity entity) {
|
|
- if (!this.isSameVehicle(entity)) {
|
|
- if (!entity.noclip && !this.noclip) {
|
|
- double d0 = entity.locX() - this.locX();
|
|
- double d1 = entity.locZ() - this.locZ();
|
|
- double d2 = MathHelper.a(d0, d1);
|
|
-
|
|
- if (d2 >= 0.009999999776482582D) {
|
|
- d2 = (double) MathHelper.sqrt(d2);
|
|
- d0 /= d2;
|
|
- d1 /= d2;
|
|
- double d3 = 1.0D / d2;
|
|
-
|
|
- if (d3 > 1.0D) {
|
|
- d3 = 1.0D;
|
|
- }
|
|
-
|
|
- d0 *= d3;
|
|
- d1 *= d3;
|
|
- d0 *= 0.05000000074505806D;
|
|
- d1 *= 0.05000000074505806D;
|
|
- d0 *= (double) (1.0F - this.J);
|
|
- d1 *= (double) (1.0F - this.J);
|
|
- if (!this.isVehicle()) {
|
|
- this.h(-d0, 0.0D, -d1);
|
|
- }
|
|
+ if (!entity.noclip && !this.noclip && !this.isSameVehicle(entity)) { // Akarin - Swaps the predicate order of collision
|
|
+ //if (!entity.noclip && !this.noclip) { // Akarin - Swaps the predicate order of collision
|
|
+ double d0 = entity.locX() - this.locX();
|
|
+ double d1 = entity.locZ() - this.locZ();
|
|
+ double d2 = MathHelper.a(d0, d1);
|
|
+
|
|
+ if (d2 >= 0.009999999776482582D) {
|
|
+ d2 = (double) MathHelper.sqrt(d2);
|
|
+ d0 /= d2;
|
|
+ d1 /= d2;
|
|
+ double d3 = 1.0D / d2;
|
|
+
|
|
+ if (d3 > 1.0D) {
|
|
+ d3 = 1.0D;
|
|
+ }
|
|
|
|
- if (!entity.isVehicle()) {
|
|
- entity.h(d0, 0.0D, d1);
|
|
- }
|
|
+ d0 *= d3;
|
|
+ d1 *= d3;
|
|
+ d0 *= 0.05000000074505806D;
|
|
+ d1 *= 0.05000000074505806D;
|
|
+ d0 *= (double) (1.0F - this.J);
|
|
+ d1 *= (double) (1.0F - this.J);
|
|
+ if (!this.isVehicle()) {
|
|
+ this.h(-d0, 0.0D, -d1);
|
|
}
|
|
|
|
+ if (!entity.isVehicle()) {
|
|
+ entity.h(d0, 0.0D, d1);
|
|
+ }
|
|
}
|
|
+
|
|
+ //} // Akarin - Swaps the predicate order of collision
|
|
}
|
|
}
|
|
|
|
--
|
|
2.25.1.windows.1
|
|
|