Update Upstream (Pufferfish)
Also drop merged PRs and patches replaced by the new chunk system
This commit is contained in:
54
patches/server/0068-Fast-speed-check.patch
Normal file
54
patches/server/0068-Fast-speed-check.patch
Normal file
@@ -0,0 +1,54 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jacob <jacob@stellardev.org>
|
||||
Date: Wed, 19 Jan 2022 16:55:38 -0700
|
||||
Subject: [PATCH] Fast speed check
|
||||
|
||||
Original code by NFT-Worlds, licensed under GNU General Public License v3.0
|
||||
You can find the original code on https://github.com/NFT-Worlds/Server
|
||||
|
||||
etil2jz's note:
|
||||
NFT-Worlds is related to Stellar devs, known for countless paid forks mostly taking open source patches,
|
||||
doing questionable/buggy ones, and claiming breathtaking performance improvements. Never ever pay for
|
||||
any of those Spigot forks!
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 4e92962cc351bf3abcf51b8952eff5686eda5ea9..6153c46809b12c44f2f8588e6978a4cab21e02f4 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -1206,7 +1206,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
|
||||
this.tryCheckInsideBlocks();
|
||||
- float f2 = this.getBlockSpeedFactor();
|
||||
+ // NFT-Worlds start
|
||||
+ float f2;
|
||||
+ if (wtf.etil.mirai.MiraiConfig.fastSpeedCheck) {
|
||||
+ if (this.getDeltaMovement().x == 0 && this.getDeltaMovement().z == 0) {
|
||||
+ f2 = 1;
|
||||
+ } else {
|
||||
+ f2 = this.getBlockSpeedFactor();
|
||||
+ }
|
||||
+ } else {
|
||||
+ f2 = this.getBlockSpeedFactor();
|
||||
+ }
|
||||
+ // NFT-Worlds stop
|
||||
|
||||
this.setDeltaMovement(this.getDeltaMovement().multiply((double) f2, 1.0D, (double) f2));
|
||||
// Paper start - remove expensive streams from here
|
||||
diff --git a/src/main/java/wtf/etil/mirai/MiraiConfig.java b/src/main/java/wtf/etil/mirai/MiraiConfig.java
|
||||
index 559d0fb9931ae8a7d14a43e13fe1fdf544915ecb..39b0c038ae053ef78c62691c73edecad94938fc7 100644
|
||||
--- a/src/main/java/wtf/etil/mirai/MiraiConfig.java
|
||||
+++ b/src/main/java/wtf/etil/mirai/MiraiConfig.java
|
||||
@@ -221,4 +221,11 @@ public class MiraiConfig {
|
||||
"Whether or not server should listen to location triggers.");
|
||||
}
|
||||
|
||||
+ public static boolean fastSpeedCheck;
|
||||
+ private static void speedCheck() {
|
||||
+ fastSpeedCheck = getBoolean("fast-speed-check", true,
|
||||
+ "Whether or not server should use a faster method",
|
||||
+ "to check when entity delta movement is null.");
|
||||
+ }
|
||||
+
|
||||
}
|
||||
\ No newline at end of file
|
||||
Reference in New Issue
Block a user