Files
AkarinMC/patches/server/0012-Swaps-the-predicate-order-of-collision.patch
ㄗㄠˋ ㄑㄧˊ 173fa1ee6d Updated Upstream (Paper)
Upstream has released updates that appears to apply and compile correctly

Paper Changes:
bc17ce69d Delay unsafe actions until after entity ticking is done - Fixes #3114
5553e6b3e Disable Sync Events firing Async errors during shutdown
e12c51d9b Use better variable for isStopping() API
586ee2bb1 Remove patch for MC-111480, fixed in 1.14
09a942155 Remove streams from Mob AI System
bb5c294ec Fix Disabling Asynchronous Chunks
089d83568 Implement Chunk Priority / Urgency System for World Gen
fce69af70 Use dedicated thread for main thread blocking chunk loads
588b62e47 Add tick times API and /mspt command (#3102)
11de41c77 Add API MinecraftServer#isStopping (#3129)
942ff3c28 My patches are under MIT (#3130)
2020-04-12 12:13:51 +08:00

79 lines
3.0 KiB
Diff

From 0000000000000000000000000000000000000000 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 147c5288a567bd7e4a262cc67dbae9c4164b23b8..6cf3eb12b07e32344ac975eaecfcfdbbff786233 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -1402,38 +1402,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
}
}