mirror of
https://github.com/BX-Team/DivineMC.git
synced 2026-01-04 15:31:43 +00:00
another patch split
This commit is contained in:
@@ -1,53 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
||||
Date: Sat, 1 Feb 2025 19:50:02 +0300
|
||||
Subject: [PATCH] Skip distanceToSqr call in ServerEntity#sendChanges if the
|
||||
delta movement hasn't changed
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerEntity.java b/net/minecraft/server/level/ServerEntity.java
|
||||
index fa0fd2a7f15a076ac981f85f4f249a15a4ab512e..ff2f1e31633749da89cfc0779004ac1ef104470d 100644
|
||||
--- a/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -209,23 +209,27 @@ public class ServerEntity {
|
||||
|
||||
if (this.entity.hasImpulse || this.trackDelta || this.entity instanceof LivingEntity && ((LivingEntity)this.entity).isFallFlying()) {
|
||||
Vec3 deltaMovement = this.entity.getDeltaMovement();
|
||||
- double d = deltaMovement.distanceToSqr(this.lastSentMovement);
|
||||
- if (d > 1.0E-7 || d > 0.0 && deltaMovement.lengthSqr() == 0.0) {
|
||||
- this.lastSentMovement = deltaMovement;
|
||||
- if (this.entity instanceof AbstractHurtingProjectile abstractHurtingProjectile) {
|
||||
- this.broadcast
|
||||
- .accept(
|
||||
- new ClientboundBundlePacket(
|
||||
- List.of(
|
||||
- new ClientboundSetEntityMotionPacket(this.entity.getId(), this.lastSentMovement),
|
||||
- new ClientboundProjectilePowerPacket(abstractHurtingProjectile.getId(), abstractHurtingProjectile.accelerationPower)
|
||||
+ // DivineMC start - Skip "distanceToSqr" call in "ServerEntity#sendChanges" if the delta movement hasn't changed
|
||||
+ if (deltaMovement != this.lastSentMovement) {
|
||||
+ double d = deltaMovement.distanceToSqr(this.lastSentMovement);
|
||||
+ if (d > 1.0E-7 || d > 0.0 && deltaMovement.lengthSqr() == 0.0) {
|
||||
+ this.lastSentMovement = deltaMovement;
|
||||
+ if (this.entity instanceof AbstractHurtingProjectile abstractHurtingProjectile) {
|
||||
+ this.broadcast
|
||||
+ .accept(
|
||||
+ new ClientboundBundlePacket(
|
||||
+ List.of(
|
||||
+ new ClientboundSetEntityMotionPacket(this.entity.getId(), this.lastSentMovement),
|
||||
+ new ClientboundProjectilePowerPacket(abstractHurtingProjectile.getId(), abstractHurtingProjectile.accelerationPower)
|
||||
+ )
|
||||
)
|
||||
- )
|
||||
- );
|
||||
- } else {
|
||||
- this.broadcast.accept(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.lastSentMovement));
|
||||
+ );
|
||||
+ } else {
|
||||
+ this.broadcast.accept(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.lastSentMovement));
|
||||
+ }
|
||||
}
|
||||
}
|
||||
+ // DivineMC end - Skip "distanceToSqr" call in "ServerEntity#sendChanges" if the delta movement hasn't changed
|
||||
}
|
||||
|
||||
if (packet != null) {
|
||||
@@ -1,38 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
||||
Date: Wed, 5 Feb 2025 17:48:56 +0300
|
||||
Subject: [PATCH] Verify Minecraft EULA earlier
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/Main.java b/net/minecraft/server/Main.java
|
||||
index bc3209d3cbe971af74b7856caa6300b59b0bb6bc..9a19c36074b9d8eb291b15b080687e47bcd5d007 100644
|
||||
--- a/net/minecraft/server/Main.java
|
||||
+++ b/net/minecraft/server/Main.java
|
||||
@@ -124,7 +124,6 @@ public class Main {
|
||||
dedicatedServerSettings.forceSave();
|
||||
RegionFileVersion.configure(dedicatedServerSettings.getProperties().regionFileComression);
|
||||
Path path2 = Paths.get("eula.txt");
|
||||
- Eula eula = new Eula(path2);
|
||||
// Paper start - load config files early for access below if needed
|
||||
org.bukkit.configuration.file.YamlConfiguration bukkitConfiguration = io.papermc.paper.configuration.PaperConfigurations.loadLegacyConfigFile((File) optionSet.valueOf("bukkit-settings"));
|
||||
org.bukkit.configuration.file.YamlConfiguration spigotConfiguration = io.papermc.paper.configuration.PaperConfigurations.loadLegacyConfigFile((File) optionSet.valueOf("spigot-settings"));
|
||||
@@ -147,19 +146,6 @@ public class Main {
|
||||
return;
|
||||
}
|
||||
|
||||
- // Spigot start
|
||||
- boolean eulaAgreed = Boolean.getBoolean("com.mojang.eula.agree");
|
||||
- if (eulaAgreed) {
|
||||
- LOGGER.error("You have used the Spigot command line EULA agreement flag.");
|
||||
- LOGGER.error("By using this setting you are indicating your agreement to Mojang's EULA (https://aka.ms/MinecraftEULA).");
|
||||
- LOGGER.error("If you do not agree to the above EULA please stop your server and remove this flag immediately.");
|
||||
- }
|
||||
- if (!eula.hasAgreedToEULA() && !eulaAgreed) {
|
||||
- // Spigot end
|
||||
- LOGGER.info("You need to agree to the EULA in order to run the server. Go to eula.txt for more info.");
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
// Paper start - Detect headless JRE
|
||||
String awtException = io.papermc.paper.util.ServerEnvironment.awtDependencyCheck();
|
||||
if (awtException != null) {
|
||||
Reference in New Issue
Block a user