diff --git a/divinemc-server/minecraft-patches/sources/net/minecraft/server/level/ServerEntity.java.patch b/divinemc-server/minecraft-patches/sources/net/minecraft/server/level/ServerEntity.java.patch new file mode 100644 index 0000000..2166d2b --- /dev/null +++ b/divinemc-server/minecraft-patches/sources/net/minecraft/server/level/ServerEntity.java.patch @@ -0,0 +1,23 @@ +--- a/net/minecraft/server/level/ServerEntity.java ++++ b/net/minecraft/server/level/ServerEntity.java +@@ -407,7 +_,10 @@ + } + + if (this.entity instanceof LivingEntity) { +- Set attributesToSync = ((LivingEntity)this.entity).getAttributes().getAttributesToSync(); ++ // DivineMC start - Suppress errors from dirty attributes ++ Set attributes = ((LivingEntity) this.entity).getAttributes().getAttributesToSync(); ++ final Set attributesToSync = this.level.divineConfig().optimizations.suppressErrorsFromDirtyAttributes ? Collections.synchronizedSet(attributes) : attributes; ++ // DivineMC end - Suppress errors from dirty attributes + if (!attributesToSync.isEmpty()) { + // CraftBukkit start - Send scaled max health + if (this.entity instanceof ServerPlayer serverPlayer) { +@@ -417,7 +_,7 @@ + this.broadcastAndSend(new ClientboundUpdateAttributesPacket(this.entity.getId(), attributesToSync)); + } + +- attributesToSync.clear(); ++ attributes.clear(); + } + } + diff --git a/divinemc-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch b/divinemc-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch index d36b607..cfd08ed 100644 --- a/divinemc-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch +++ b/divinemc-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch @@ -1,5 +1,23 @@ --- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java +@@ -572,7 +_,7 @@ + return; + } + // Paper end - Prevent moving into unloaded chunks +- if (d7 - d6 > Math.max(100.0, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { ++ if (!space.bxteam.divinemc.configuration.DivineGlobalConfiguration.get().misc.disableMovedWronglyThreshold && d7 - d6 > Math.max(100.0, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { // DivineMC - Option to disable moved wrongly threshold + // CraftBukkit end + LOGGER.warn( + "{} (vehicle of {}) moved too quickly! {},{},{}", rootVehicle.getName().getString(), this.player.getName().getString(), d3, d4, d5 +@@ -602,7 +_,7 @@ + d5 = d2 - rootVehicle.getZ(); + d7 = d3 * d3 + d4 * d4 + d5 * d5; + boolean flag2 = false; +- if (d7 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot ++ if (!space.bxteam.divinemc.configuration.DivineGlobalConfiguration.get().misc.disableMovedWronglyThreshold && d7 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot // DivineMC - Option to disable moved wrongly threshold + flag2 = true; // Paper - diff on change, this should be moved wrongly + LOGGER.warn("{} (vehicle of {}) moved wrongly! {}", rootVehicle.getName().getString(), this.player.getName().getString(), Math.sqrt(d7)); + } @@ -2387,6 +_,7 @@ } diff --git a/divinemc-server/minecraft-patches/sources/net/minecraft/server/network/ServerLoginPacketListenerImpl.java.patch b/divinemc-server/minecraft-patches/sources/net/minecraft/server/network/ServerLoginPacketListenerImpl.java.patch new file mode 100644 index 0000000..8071ca5 --- /dev/null +++ b/divinemc-server/minecraft-patches/sources/net/minecraft/server/network/ServerLoginPacketListenerImpl.java.patch @@ -0,0 +1,12 @@ +--- a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java ++++ b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +@@ -172,7 +_,8 @@ + public void handleHello(ServerboundHelloPacket packet) { + Validate.validState(this.state == ServerLoginPacketListenerImpl.State.HELLO, "Unexpected hello packet"); + // Paper start - Validate usernames +- if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() ++ if (!space.bxteam.divinemc.configuration.DivineGlobalConfiguration.get().misc.removeVanillaUsernameCheck // DivineMC - Remove vanilla username check ++ && io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() + && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation + && !this.iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation) { + Validate.validState(StringUtil.isReasonablePlayerName(packet.name()), "Invalid characters in username"); diff --git a/divinemc-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/FireworkRocketEntity.java.patch b/divinemc-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/FireworkRocketEntity.java.patch index 5fcebb3..093325f 100644 --- a/divinemc-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/FireworkRocketEntity.java.patch +++ b/divinemc-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/FireworkRocketEntity.java.patch @@ -7,7 +7,7 @@ + // DivineMC start - Don't save Fireworks + @Override + public boolean shouldBeSaved() { -+ return true; // Temporary fix for saving fireworks ++ return this.level().divineConfig().gameplayMechanics.projectiles.saveFireworks; + } + // DivineMC end - Don't save Fireworks + diff --git a/divinemc-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/ShulkerBullet.java.patch b/divinemc-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/ShulkerBullet.java.patch new file mode 100644 index 0000000..c1a8adb --- /dev/null +++ b/divinemc-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/ShulkerBullet.java.patch @@ -0,0 +1,20 @@ +--- a/net/minecraft/world/entity/projectile/ShulkerBullet.java ++++ b/net/minecraft/world/entity/projectile/ShulkerBullet.java +@@ -215,6 +_,17 @@ + super.tick(); + HitResult hitResult = null; + if (!this.level().isClientSide) { ++ // DivineMC start - despawn shulker bullets on owner death ++ if (this.level().divineConfig().gameplayMechanics.mob.shulker.despawnShulkerBulletsOnOwnerDeath) { ++ if (!isInvulnerable()) { ++ var owner = getOwner(); ++ if (owner == null || !owner.isAlive()) { ++ discard(); ++ return; ++ } ++ } ++ } ++ // DivineMC end - despawn shulker bullets on owner death + if (this.finalTarget == null && this.targetId != null) { + this.finalTarget = ((ServerLevel)this.level()).getEntity(this.targetId); + if (this.finalTarget == null) { diff --git a/divinemc-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/SignBlockEntity.java.patch b/divinemc-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/SignBlockEntity.java.patch new file mode 100644 index 0000000..53ecd18 --- /dev/null +++ b/divinemc-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/SignBlockEntity.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/level/block/entity/SignBlockEntity.java ++++ b/net/minecraft/world/level/block/entity/SignBlockEntity.java +@@ -152,7 +_,7 @@ + this.setAllowedPlayerEditor(null); + this.level.sendBlockUpdated(this.getBlockPos(), this.getBlockState(), this.getBlockState(), 3); + } else { +- LOGGER.warn("Player {} just tried to change non-editable sign", player.getName().getString()); ++ if (!space.bxteam.divinemc.configuration.DivineGlobalConfiguration.get().misc.disableNonEditableSignWarning) LOGGER.warn("Player {} just tried to change non-editable sign", player.getName().getString()); // DivineMC - Option to disable warning + if (player.distanceToSqr(this.getBlockPos().getX(), this.getBlockPos().getY(), this.getBlockPos().getZ()) < Mth.square(32)) // Paper - Don't send far away sign update + ((net.minecraft.server.level.ServerPlayer) player).connection.send(this.getUpdatePacket()); // CraftBukkit + } diff --git a/divinemc-server/paper-patches/files/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java.patch b/divinemc-server/paper-patches/files/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java.patch new file mode 100644 index 0000000..d90a4b0 --- /dev/null +++ b/divinemc-server/paper-patches/files/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java.patch @@ -0,0 +1,11 @@ +--- a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java ++++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java +@@ -295,7 +_,7 @@ + + private static GameProfile createAuthLibProfile(UUID uniqueId, String name) { + Preconditions.checkArgument(name == null || name.length() <= 16, "Name cannot be longer than 16 characters"); +- Preconditions.checkArgument(name == null || StringUtil.isValidPlayerName(name), "The name of the profile contains invalid characters: %s", name); ++ Preconditions.checkArgument(name == null || space.bxteam.divinemc.configuration.DivineGlobalConfiguration.get().misc.removeVanillaUsernameCheck || StringUtil.isValidPlayerName(name), "The name of the profile contains invalid characters: %s", name); // DivineMC - Remove vanilla username check + return new GameProfile( + uniqueId != null ? uniqueId : Util.NIL_UUID, + name != null ? name : "" diff --git a/divinemc-server/src/main/java/space/bxteam/divinemc/configuration/DivineGlobalConfiguration.java b/divinemc-server/src/main/java/space/bxteam/divinemc/configuration/DivineGlobalConfiguration.java index 09a18d9..5f8443b 100644 --- a/divinemc-server/src/main/java/space/bxteam/divinemc/configuration/DivineGlobalConfiguration.java +++ b/divinemc-server/src/main/java/space/bxteam/divinemc/configuration/DivineGlobalConfiguration.java @@ -20,4 +20,12 @@ public class DivineGlobalConfiguration extends ConfigurationPart { @Setting(Configuration.VERSION_FIELD) public int version = CURRENT_VERSION; + + public Misc misc; + + public class Misc extends ConfigurationPart { + public boolean disableNonEditableSignWarning = true; + public boolean removeVanillaUsernameCheck = false; + public boolean disableMovedWronglyThreshold = false; + } } diff --git a/divinemc-server/src/main/java/space/bxteam/divinemc/configuration/DivineWorldConfiguration.java b/divinemc-server/src/main/java/space/bxteam/divinemc/configuration/DivineWorldConfiguration.java index ae03234..23475bb 100644 --- a/divinemc-server/src/main/java/space/bxteam/divinemc/configuration/DivineWorldConfiguration.java +++ b/divinemc-server/src/main/java/space/bxteam/divinemc/configuration/DivineWorldConfiguration.java @@ -7,6 +7,7 @@ import io.papermc.paper.configuration.PaperConfigurations; import net.minecraft.resources.ResourceLocation; import org.slf4j.Logger; import org.spigotmc.SpigotWorldConfig; +import org.spongepowered.configurate.objectmapping.meta.Comment; import org.spongepowered.configurate.objectmapping.meta.Setting; @SuppressWarnings({"FieldCanBeLocal", "FieldMayBeFinal", "NotNullFieldNotInitialized", "InnerClassMayBeStatic"}) @@ -28,4 +29,33 @@ public class DivineWorldConfiguration extends ConfigurationPart { @Setting(Configuration.VERSION_FIELD) public int version = CURRENT_VERSION; + + public Optimizations optimizations; + + public class Optimizations extends ConfigurationPart { + public boolean suppressErrorsFromDirtyAttributes = true; + } + + public GameplayMechanics gameplayMechanics; + + public class GameplayMechanics extends ConfigurationPart { + public Mob mob; + + public class Mob extends ConfigurationPart { + public Shulker shulker; + + public class Shulker extends ConfigurationPart { + @Comment("If true, shulker bullets will despawn when their owner dies.") + public boolean despawnShulkerBulletsOnOwnerDeath = true; + } + } + + public Projectiles projectiles; + + public class Projectiles extends ConfigurationPart { + public boolean snowballCanKnockback = true; + public boolean eggCanKnockback = true; + public boolean saveFireworks = false; + } + } } diff --git a/patches/server/0025-Despawn-shulker-bullets-on-owner-death.patch b/patches/server/0025-Despawn-shulker-bullets-on-owner-death.patch deleted file mode 100644 index 7ccfe0d..0000000 --- a/patches/server/0025-Despawn-shulker-bullets-on-owner-death.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com> -Date: Sat, 10 Jun 2023 13:12:59 +0300 -Subject: [PATCH] Despawn shulker bullets on owner death - - -diff --git a/src/main/java/net/minecraft/world/entity/projectile/ShulkerBullet.java b/src/main/java/net/minecraft/world/entity/projectile/ShulkerBullet.java -index 347b1cab11529cb5399e607626c84bc985d5c513..9ab72bfeafed21c47f6ce27cf5df921d4b768f97 100644 ---- a/src/main/java/net/minecraft/world/entity/projectile/ShulkerBullet.java -+++ b/src/main/java/net/minecraft/world/entity/projectile/ShulkerBullet.java -@@ -227,6 +227,17 @@ public class ShulkerBullet extends Projectile { - Vec3 vec3d; - - if (!this.level().isClientSide) { -+ // DivineMC start - despawn shulker bullets on owner death -+ if (this.level().divinemcConfig.despawnShulkerBulletsOnOwnerDeath) { -+ if (!isInvulnerable()) { -+ var owner = getOwner(); -+ if (owner == null || !owner.isAlive()) { -+ discard(); -+ return; -+ } -+ } -+ } -+ // DivineMC end - if (this.finalTarget == null && this.targetId != null) { - this.finalTarget = ((ServerLevel) this.level()).getEntity(this.targetId); - if (this.finalTarget == null) { -diff --git a/src/main/java/space/bxteam/divinemc/configuration/DivineWorldConfig.java b/src/main/java/space/bxteam/divinemc/configuration/DivineWorldConfig.java -index e1274fe3b0ff369d1f6f229026ced2e03ea335ca..7e62ee9418d5add5b0b4ddb885d3a1745ce799b2 100644 ---- a/src/main/java/space/bxteam/divinemc/configuration/DivineWorldConfig.java -+++ b/src/main/java/space/bxteam/divinemc/configuration/DivineWorldConfig.java -@@ -89,4 +89,9 @@ public class DivineWorldConfig { - dontEjectPlayerFromBoatUnderwater = getBoolean("gameplay-mechanics.boat.dont-eject-players-from-boat-underwater", dontEjectPlayerFromBoatUnderwater); - alwaysAllowToEnterTheBoat = getBoolean("gameplay-mechanics.boat.always-allow-to-enter-the-boat", alwaysAllowToEnterTheBoat); - } -+ -+ public boolean despawnShulkerBulletsOnOwnerDeath = true; -+ private void despawnShulkerBulletsOnOwnerDeath() { -+ despawnShulkerBulletsOnOwnerDeath = getBoolean("gameplay-mechanics.mob.shulker.despawn-bullets-on-player-death", despawnShulkerBulletsOnOwnerDeath); -+ } - } diff --git a/patches/server/0031-Option-to-disable-non-editable-sign-warning.patch b/patches/server/0031-Option-to-disable-non-editable-sign-warning.patch deleted file mode 100644 index 1a25660..0000000 --- a/patches/server/0031-Option-to-disable-non-editable-sign-warning.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com> -Date: Mon, 17 Jun 2024 16:21:15 +0300 -Subject: [PATCH] Option to disable non editable sign warning - - -diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java -index b51b0b0f48b1da6187387d6ec025681e10ed584d..507b94fe816596e381434cf2e160bdee8023d337 100644 ---- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java -+++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java -@@ -189,7 +189,7 @@ public class SignBlockEntity extends BlockEntity { - this.setAllowedPlayerEditor((UUID) null); - this.level.sendBlockUpdated(this.getBlockPos(), this.getBlockState(), this.getBlockState(), 3); - } else { -- SignBlockEntity.LOGGER.warn("Player {} just tried to change non-editable sign", player.getName().getString()); -+ if (!space.bxteam.divinemc.configuration.DivineConfig.disableNonEditableSignWarning) SignBlockEntity.LOGGER.warn("Player {} just tried to change non-editable sign", player.getName().getString()); // DivineMC - Option to disable warning - if (player.distanceToSqr(this.getBlockPos().getX(), this.getBlockPos().getY(), this.getBlockPos().getZ()) < 32 * 32) // Paper - Dont send far away sign update - ((ServerPlayer) player).connection.send(this.getUpdatePacket()); // CraftBukkit - } -diff --git a/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java b/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java -index 27c45545e1e9ad6ea88e65c884c5a4955fc1c80c..882e08b1eef89dd01129c89aa5fa1094d35788c5 100644 ---- a/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java -+++ b/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java -@@ -154,4 +154,9 @@ public class DivineConfig { - } - return builder.build(); - } -+ -+ public static boolean disableNonEditableSignWarning = true; -+ private static void miscSettings() { -+ disableNonEditableSignWarning = getBoolean("settings.misc.disable-non-editable-sign-warning", disableNonEditableSignWarning); -+ } - } diff --git a/patches/server/0032-Suppress-errors-from-dirty-attributes.patch b/patches/server/0032-Suppress-errors-from-dirty-attributes.patch deleted file mode 100644 index ba62918..0000000 --- a/patches/server/0032-Suppress-errors-from-dirty-attributes.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com> -Date: Sun, 14 Jan 2024 22:58:43 +0300 -Subject: [PATCH] Suppress errors from dirty attributes - - -diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java -index 2bec5ed591e658765602379f9065b8089f5df6ea..944de5ff109b15b76b69326e69b6b1c2afb63dd1 100644 ---- a/src/main/java/net/minecraft/server/level/ServerEntity.java -+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java -@@ -455,7 +455,10 @@ public class ServerEntity { - } - - if (this.entity instanceof LivingEntity) { -- Set set = ((LivingEntity) this.entity).getAttributes().getAttributesToSync(); -+ // DivineMC start - Suppress errors from dirty attributes -+ Set attributes = ((LivingEntity) this.entity).getAttributes().getAttributesToSync(); -+ final Set set = this.level.divinemcConfig.suppressErrorsFromDirtyAttributes ? Collections.synchronizedSet(attributes) : attributes; -+ // DivineMC end - - if (!set.isEmpty()) { - // CraftBukkit start - Send scaled max health -@@ -466,7 +469,7 @@ public class ServerEntity { - this.broadcastAndSend(new ClientboundUpdateAttributesPacket(this.entity.getId(), set)); - } - -- set.clear(); -+ attributes.clear(); // DivineMC - } - - } -diff --git a/src/main/java/space/bxteam/divinemc/configuration/DivineWorldConfig.java b/src/main/java/space/bxteam/divinemc/configuration/DivineWorldConfig.java -index 242da697c957508c8e75bfd232c44ea34ba3a62a..d94c51ea18d299dd52b9a8521a9cdc0d95b79356 100644 ---- a/src/main/java/space/bxteam/divinemc/configuration/DivineWorldConfig.java -+++ b/src/main/java/space/bxteam/divinemc/configuration/DivineWorldConfig.java -@@ -101,4 +101,9 @@ public class DivineWorldConfig { - snowballCanKnockback = getBoolean("gameplay-mechanics.projectiles.snowball.knockback", snowballCanKnockback); - eggCanKnockback = getBoolean("gameplay-mechanics.projectiles.egg.knockback", eggCanKnockback); - } -+ -+ public boolean suppressErrorsFromDirtyAttributes = true; -+ private void suppressErrorsFromDirtyAttributes() { -+ suppressErrorsFromDirtyAttributes = getBoolean("suppress-errors-from-dirty-attributes", suppressErrorsFromDirtyAttributes); -+ } - } diff --git a/patches/server/0040-Remove-vanilla-username-check.patch b/patches/server/0040-Remove-vanilla-username-check.patch deleted file mode 100644 index 615c2c4..0000000 --- a/patches/server/0040-Remove-vanilla-username-check.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com> -Date: Mon, 24 Jun 2024 14:05:44 +0300 -Subject: [PATCH] Remove vanilla username check - - -diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java -index 8849862b45ccbbc635a1c316e9870bca81e55c04..85b7c7742a2cc678aec317487fc811b9680e87d6 100644 ---- a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java -+++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java -@@ -295,7 +295,7 @@ public class CraftPlayerProfile implements PlayerProfile, SharedPlayerProfile { - - private static GameProfile createAuthLibProfile(UUID uniqueId, String name) { - Preconditions.checkArgument(name == null || name.length() <= 16, "Name cannot be longer than 16 characters"); -- Preconditions.checkArgument(name == null || StringUtil.isValidPlayerName(name), "The name of the profile contains invalid characters: %s", name); -+ Preconditions.checkArgument(name == null || space.bxteam.divinemc.configuration.DivineConfig.removeVanillaUsernameCheck || StringUtil.isValidPlayerName(name), "The name of the profile contains invalid characters: %s", name); // DivineMC - Remove vanilla username check - return new GameProfile( - uniqueId != null ? uniqueId : Util.NIL_UUID, - name != null ? name : "" -diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index 16069b9cbf6c7679c28a2e9a54e77d23cd10e541..1b33f08b1d4730b28f61435488a1e1c04051c8dc 100644 ---- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -174,7 +174,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, - public void handleHello(ServerboundHelloPacket packet) { - Validate.validState(this.state == ServerLoginPacketListenerImpl.State.HELLO, "Unexpected hello packet", new Object[0]); - // Paper start - Validate usernames -- if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() -+ if (!space.bxteam.divinemc.configuration.DivineConfig.removeVanillaUsernameCheck // DivineMC - Remove vanilla username check -+ && io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() - && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation - && !this.iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation) { - Validate.validState(StringUtil.isReasonablePlayerName(packet.name()), "Invalid characters in username", new Object[0]); -diff --git a/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java b/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java -index 261a55a4a5171f4ceb57fda8532bc1f795dc30ed..028589d94e04828686ff09e6a6b1a8fc71f054a0 100644 ---- a/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java -+++ b/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java -@@ -156,8 +156,10 @@ public class DivineConfig { - } - - public static boolean disableNonEditableSignWarning = true; -+ public static boolean removeVanillaUsernameCheck = false; - private static void miscSettings() { - disableNonEditableSignWarning = getBoolean("settings.misc.disable-non-editable-sign-warning", disableNonEditableSignWarning); -+ removeVanillaUsernameCheck = getBoolean("settings.misc.remove-vanilla-username-check", removeVanillaUsernameCheck); - } - - public static boolean biomeManagerOptimization = true; diff --git a/patches/server/0045-Option-to-disable-moved-wrongly-threshold.patch b/patches/server/0045-Option-to-disable-moved-wrongly-threshold.patch deleted file mode 100644 index 25f3b0e..0000000 --- a/patches/server/0045-Option-to-disable-moved-wrongly-threshold.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com> -Date: Sat, 13 Jul 2024 01:44:48 +0300 -Subject: [PATCH] Option to disable moved wrongly threshold - - -diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 0fef16501c1a971dc8bd2616c7476dffabb6ea08..ac1d8c5eb616d11fc1bda929a8607daf2d616b46 100644 ---- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -592,7 +592,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - } - // Paper end - Prevent moving into unloaded chunks - -- if (d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { -+ if (!space.bxteam.divinemc.configuration.DivineConfig.disableMovedWronglyThreshold && d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { // DivineMC - Option to disable moved wrongly threshold - // CraftBukkit end - ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", new Object[]{entity.getName().getString(), this.player.getName().getString(), d6, d7, d8}); - this.send(ClientboundMoveVehiclePacket.fromEntity(entity)); -@@ -628,8 +628,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - d10 = d6 * d6 + d7 * d7 + d8 * d8; - boolean flag2 = false; - -- if (d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot -- flag2 = true; // Paper - diff on change, this should be moved wrongly -+ if (!space.bxteam.divinemc.configuration.DivineConfig.disableMovedWronglyThreshold && d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot // DivineMC - Option to disable moved wrongly threshold -+ flag2 = true;// Paper - diff on change, this should be moved wrongly - ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved wrongly! {}", new Object[]{entity.getName().getString(), this.player.getName().getString(), Math.sqrt(d10)}); - } - -@@ -1537,7 +1537,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_TOO_QUICKLY, - toX, toY, toZ, toYaw, toPitch, true); - if (!event.isAllowed()) { -- if (event.getLogWarning()) -+ if (!space.bxteam.divinemc.configuration.DivineConfig.disableMovedWronglyThreshold && event.getLogWarning()) // DivineMC - Option to disable moved wrongly threshold - ServerGamePacketListenerImpl.LOGGER.warn("{} moved too quickly! {},{},{}", new Object[]{this.player.getName().getString(), d6, d7, d8}); - this.teleport(this.player.getX(), this.player.getY(), this.player.getZ(), this.player.getYRot(), this.player.getXRot()); - return; -@@ -1607,7 +1607,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - d10 = d6 * d6 + d7 * d7 + d8 * d8; - boolean movedWrongly = false; // Paper - Add fail move event; rename - -- if (!this.player.isChangingDimension() && d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.gameMode.isCreative() && this.player.gameMode.getGameModeForPlayer() != GameType.SPECTATOR) { // Spigot -+ if (!space.bxteam.divinemc.configuration.DivineConfig.disableMovedWronglyThreshold && !this.player.isChangingDimension() && d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.gameMode.isCreative() && this.player.gameMode.getGameModeForPlayer() != GameType.SPECTATOR) { // Spigot // DivineMC - Option to disable moved wrongly threshold - // Paper start - Add fail move event - io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_WRONGLY, - toX, toY, toZ, toYaw, toPitch, true); -diff --git a/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java b/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java -index 028589d94e04828686ff09e6a6b1a8fc71f054a0..9deb9310b6829f2e1bac36327bbb21cee099b22b 100644 ---- a/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java -+++ b/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java -@@ -157,9 +157,11 @@ public class DivineConfig { - - public static boolean disableNonEditableSignWarning = true; - public static boolean removeVanillaUsernameCheck = false; -+ public static boolean disableMovedWronglyThreshold = false; - private static void miscSettings() { - disableNonEditableSignWarning = getBoolean("settings.misc.disable-non-editable-sign-warning", disableNonEditableSignWarning); - removeVanillaUsernameCheck = getBoolean("settings.misc.remove-vanilla-username-check", removeVanillaUsernameCheck); -+ disableMovedWronglyThreshold = getBoolean("settings.misc.disable-moved-wrongly-threshold", disableMovedWronglyThreshold); - } - - public static boolean biomeManagerOptimization = true;