83 lines
5.0 KiB
Diff
83 lines
5.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Etil <81570777+etil2jz@users.noreply.github.com>
|
|
Date: Fri, 17 Sep 2021 23:53:12 +0200
|
|
Subject: [PATCH] Configurable brandName and EntityStuckChecks
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
index ad9fb50791779a5fe7d22268b71bd10d9c9ff3f0..4cd38de09c25ef77adf86636ae4d133c070771c9 100644
|
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
@@ -269,7 +269,7 @@ public abstract class PlayerList {
|
|
// Spigot - view distance
|
|
playerconnection.send(new ClientboundLoginPacket(player.getId(), player.gameMode.getGameModeForPlayer(), player.gameMode.getPreviousGameModeForPlayer(), BiomeManager.obfuscateSeed(worldserver1.getSeed()), worlddata.isHardcore(), this.server.levelKeys(), this.registryHolder, worldserver1.dimensionType(), worldserver1.dimension(), this.getMaxPlayers(), worldserver1.getChunkSource().chunkMap.playerChunkManager.getLoadDistance(), flag1, !flag, worldserver1.isDebug(), worldserver1.isFlat())); // Paper - no-tick view distance // Paper - replace old player chunk management
|
|
player.getBukkitEntity().sendSupportedChannels(); // CraftBukkit
|
|
- playerconnection.send(new ClientboundCustomPayloadPacket(ClientboundCustomPayloadPacket.BRAND, (new FriendlyByteBuf(Unpooled.buffer())).writeUtf(this.getServer().getServerModName())));
|
|
+ playerconnection.send(new ClientboundCustomPayloadPacket(ClientboundCustomPayloadPacket.BRAND, (new FriendlyByteBuf(Unpooled.buffer())).writeUtf((xyz.arthurb.mirai.MiraiConfig.brandName)))); // Mirai
|
|
playerconnection.send(new ClientboundChangeDifficultyPacket(worlddata.getDifficulty(), worlddata.isDifficultyLocked()));
|
|
playerconnection.send(new ClientboundPlayerAbilitiesPacket(player.getAbilities()));
|
|
playerconnection.send(new ClientboundSetCarriedItemPacket(player.getInventory().selected));
|
|
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
index 8347b13e515e306253ca2a1f79001e1aced30c2a..db7ecf2bdbc684f1199e5a3179a876f212af5ec5 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
@@ -392,21 +392,23 @@ public abstract class LivingEntity extends Entity {
|
|
this.level.getProfiler().push("livingEntityBaseTick");
|
|
boolean flag = this instanceof net.minecraft.world.entity.player.Player;
|
|
|
|
- if (this.isAlive()) {
|
|
- if (this.isInWall()) {
|
|
- this.hurt(DamageSource.IN_WALL, 1.0F);
|
|
- } else if (flag && !this.level.getWorldBorder().isWithinBounds(this.getBoundingBox())) {
|
|
- double d0 = this.level.getWorldBorder().getDistanceToBorder((Entity) this) + this.level.getWorldBorder().getDamageSafeZone();
|
|
-
|
|
- if (d0 < 0.0D) {
|
|
- double d1 = this.level.getWorldBorder().getDamagePerBlock();
|
|
-
|
|
- if (d1 > 0.0D) {
|
|
- this.hurt(DamageSource.IN_WALL, (float) Math.max(1, Mth.floor(-d0 * d1)));
|
|
+ if (!xyz.arthurb.mirai.MiraiConfig.disableEntityStuckChecks) { // Mirai
|
|
+ if (this.isAlive()) {
|
|
+ if (this.isInWall()) {
|
|
+ this.hurt(DamageSource.IN_WALL, 1.0F);
|
|
+ } else if (flag && !this.level.getWorldBorder().isWithinBounds(this.getBoundingBox())) {
|
|
+ double d0 = this.level.getWorldBorder().getDistanceToBorder((Entity) this) + this.level.getWorldBorder().getDamageSafeZone();
|
|
+
|
|
+ if (d0 < 0.0D) {
|
|
+ double d1 = this.level.getWorldBorder().getDamagePerBlock();
|
|
+
|
|
+ if (d1 > 0.0D) {
|
|
+ this.hurt(DamageSource.IN_WALL, (float) Math.max(1, Mth.floor(-d0 * d1)));
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
+ } // Mirai
|
|
|
|
if (this.fireImmune() || this.level.isClientSide) {
|
|
this.clearFire();
|
|
diff --git a/src/main/java/xyz/arthurb/mirai/MiraiConfig.java b/src/main/java/xyz/arthurb/mirai/MiraiConfig.java
|
|
index 03c7a724d42f64946b8cd01ea7065fb02dd3fb7a..126d74b4b5964b0a3e3b09abd456d27466242c40 100644
|
|
--- a/src/main/java/xyz/arthurb/mirai/MiraiConfig.java
|
|
+++ b/src/main/java/xyz/arthurb/mirai/MiraiConfig.java
|
|
@@ -187,5 +187,17 @@ public class MiraiConfig {
|
|
private static void hidePlayerIps() {
|
|
hidePlayerIps = getBoolean("settings.hide-player-ips", hidePlayerIps);
|
|
}
|
|
+
|
|
+ public static boolean disableEntityStuckChecks = false;
|
|
+
|
|
+ private static void disableEntityStuckChecks() {
|
|
+ disableEntityStuckChecks = getBoolean("settings.disableEntityStuckChecks", false);
|
|
+ }
|
|
+
|
|
+ public static String brandName = "§bM§3i§br§3a§bi§r";
|
|
+
|
|
+ private static void brandName() {
|
|
+ brandName = getString("settings.brand-name", brandName);
|
|
+ }
|
|
|
|
}
|
|
\ No newline at end of file
|