mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-23 08:59:31 +00:00
Update Syncmatica protocol
This commit is contained in:
@@ -120,10 +120,10 @@ index 0000000000000000000000000000000000000000..64a1d25973b032e8cab64bbffa6824a1
|
||||
+}
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/protocol/core/LeavesProtocolManager.java b/src/main/java/top/leavesmc/leaves/protocol/core/LeavesProtocolManager.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..00a259a8f462aaa591c335bcbb91aee45cefaff4
|
||||
index 0000000000000000000000000000000000000000..eb8bec80870bbe8a6b6aea324376485875a30d00
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/top/leavesmc/leaves/protocol/core/LeavesProtocolManager.java
|
||||
@@ -0,0 +1,280 @@
|
||||
@@ -0,0 +1,292 @@
|
||||
+package top.leavesmc.leaves.protocol.core;
|
||||
+
|
||||
+import net.minecraft.network.FriendlyByteBuf;
|
||||
@@ -395,14 +395,26 @@ index 0000000000000000000000000000000000000000..00a259a8f462aaa591c335bcbb91aee4
|
||||
+
|
||||
+ public record EmptyPayload(ResourceLocation id) implements CustomPacketPayload {
|
||||
+
|
||||
+ public EmptyPayload(ResourceLocation id, FriendlyByteBuf buf) {
|
||||
+ this(id);
|
||||
+ public EmptyPayload(ResourceLocation location, FriendlyByteBuf buf) {
|
||||
+ this(location);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void write(@NotNull FriendlyByteBuf buf) {
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public record LeavesPayload(FriendlyByteBuf data, ResourceLocation id) implements CustomPacketPayload {
|
||||
+
|
||||
+ public LeavesPayload(ResourceLocation location, FriendlyByteBuf buf) {
|
||||
+ this(new FriendlyByteBuf(buf.readBytes(buf.readableBytes())), location);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void write(FriendlyByteBuf buf) {
|
||||
+ buf.writeBytes(data);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/protocol/core/ProtocolHandler.java b/src/main/java/top/leavesmc/leaves/protocol/core/ProtocolHandler.java
|
||||
new file mode 100644
|
||||
|
||||
@@ -6,24 +6,19 @@ Subject: [PATCH] Syncmatica Protocol
|
||||
This patch is Powered by Syncmatica(https://github.com/End-Tech/syncmatica)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 7b0e956b11817c08b42ee3a7db87d42a090f5b15..6775fbfe4051ae639f753d618fc6d5a17db2326b 100644
|
||||
index 72cfca4a310f7714c7e22be312175e7435051397..67431477762c1744a4604d5d1f59f1172be0244e 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -324,6 +324,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -310,6 +310,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
player.getTextFilter().join();
|
||||
this.signedMessageDecoder = server.enforceSecureProfile() ? SignedMessageChain.Decoder.REJECT_ALL : SignedMessageChain.Decoder.unsigned(player.getUUID());
|
||||
this.chatMessageChain = new FutureChain(server.chatExecutor); // CraftBukkit - async chat
|
||||
// CraftBukkit start - add fields and methods
|
||||
this.cserver = server.server;
|
||||
+ // Leaves start - Syncmatica Protocol
|
||||
+ this.exchangeTarget = new top.leavesmc.leaves.protocol.syncmatica.exchange.ExchangeTarget(this);
|
||||
+ if (top.leavesmc.leaves.LeavesConfig.syncmaticaProtocol) {
|
||||
+ top.leavesmc.leaves.protocol.syncmatica.SyncmaticaProtocol.getCommunicationManager().onPlayerJoin(exchangeTarget, player);
|
||||
+ }
|
||||
+ // Leaves end - Syncmatica Protocol
|
||||
+ this.exchangeTarget = new top.leavesmc.leaves.protocol.syncmatica.exchange.ExchangeTarget(this); // Leaves - Syncmatica Protocol
|
||||
}
|
||||
|
||||
private final org.bukkit.craftbukkit.CraftServer cserver;
|
||||
@@ -348,6 +354,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
}
|
||||
// CraftBukkit start - add fields
|
||||
@@ -329,6 +330,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
private boolean hasMoved; // Spigot
|
||||
// CraftBukkit end
|
||||
|
||||
+ public final top.leavesmc.leaves.protocol.syncmatica.exchange.ExchangeTarget exchangeTarget; // Leaves - Syncmatica Protocol
|
||||
@@ -31,30 +26,8 @@ index 7b0e956b11817c08b42ee3a7db87d42a090f5b15..6775fbfe4051ae639f753d618fc6d5a1
|
||||
@Override
|
||||
public void tick() {
|
||||
if (this.ackBlockChangesUpTo > -1) {
|
||||
@@ -2166,6 +2174,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
this.processedDisconnect = true;
|
||||
}
|
||||
// CraftBukkit end
|
||||
+ // Leaves start - Syncmatica Protocol
|
||||
+ if (top.leavesmc.leaves.LeavesConfig.syncmaticaProtocol) {
|
||||
+ top.leavesmc.leaves.protocol.syncmatica.SyncmaticaProtocol.getCommunicationManager().onPlayerLeave(exchangeTarget);
|
||||
+ }
|
||||
+ // Leaves end - Syncmatica Protocol
|
||||
this.chatMessageChain.close();
|
||||
ServerGamePacketListenerImpl.LOGGER.info("{} lost connection: {}", this.player.getName().getString(), reason.getString());
|
||||
// CraftBukkit start - Replace vanilla quit message handling with our own.
|
||||
@@ -3626,6 +3639,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
if (top.leavesmc.leaves.LeavesConfig.jadeProtocol && ProtocolUtils.isNamespacePacket(packet, top.leavesmc.leaves.protocol.JadeProtocol.PROTOCOL_ID)) {
|
||||
top.leavesmc.leaves.protocol.JadeProtocol.handlePacket(server, player, packet);
|
||||
}
|
||||
+ if (top.leavesmc.leaves.LeavesConfig.syncmaticaProtocol && ProtocolUtils.isNamespacePacket(packet, top.leavesmc.leaves.protocol.syncmatica.SyncmaticaProtocol.PROTOCOL_ID)) {
|
||||
+ top.leavesmc.leaves.protocol.syncmatica.SyncmaticaProtocol.getCommunicationManager().onPacketGet(packet, this);
|
||||
+ }
|
||||
} catch (Exception ex) {
|
||||
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex);
|
||||
this.disconnect("Invalid custom payload!", org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PAYLOAD);
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index f0e28ad726fd9de56df7fcf78f18309e744a626f..a60c13ddbc4e9147324e8442ff48974f6dd35dbf 100644
|
||||
index db6b7ff06bf646aa50afadc354b381821cb5b1a9..7a1fae214f7ed5c664459665f43011c84e6b6259 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -12,6 +12,7 @@ import top.leavesmc.leaves.command.LeavesCommand;
|
||||
@@ -75,10 +48,10 @@ index f0e28ad726fd9de56df7fcf78f18309e744a626f..a60c13ddbc4e9147324e8442ff48974f
|
||||
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/protocol/syncmatica/CommunicationManager.java b/src/main/java/top/leavesmc/leaves/protocol/syncmatica/CommunicationManager.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..5320948762a791bcdda915f842ce139516b09657
|
||||
index 0000000000000000000000000000000000000000..747da005acc37d8c1f8adec0d707afab1b5fc352
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/top/leavesmc/leaves/protocol/syncmatica/CommunicationManager.java
|
||||
@@ -0,0 +1,382 @@
|
||||
@@ -0,0 +1,391 @@
|
||||
+package top.leavesmc.leaves.protocol.syncmatica;
|
||||
+
|
||||
+import com.mojang.authlib.GameProfile;
|
||||
@@ -86,13 +59,16 @@ index 0000000000000000000000000000000000000000..5320948762a791bcdda915f842ce1395
|
||||
+import net.minecraft.core.BlockPos;
|
||||
+import net.minecraft.network.FriendlyByteBuf;
|
||||
+import net.minecraft.network.chat.Component;
|
||||
+import net.minecraft.network.protocol.game.ServerboundCustomPayloadPacket;
|
||||
+import net.minecraft.network.protocol.common.ServerboundCustomPayloadPacket;
|
||||
+import net.minecraft.resources.ResourceLocation;
|
||||
+import net.minecraft.server.level.ServerPlayer;
|
||||
+import net.minecraft.server.network.ServerGamePacketListenerImpl;
|
||||
+import net.minecraft.world.level.block.Mirror;
|
||||
+import net.minecraft.world.level.block.Rotation;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import top.leavesmc.leaves.protocol.core.LeavesProtocol;
|
||||
+import top.leavesmc.leaves.protocol.core.LeavesProtocolManager;
|
||||
+import top.leavesmc.leaves.protocol.core.ProtocolHandler;
|
||||
+import top.leavesmc.leaves.protocol.syncmatica.exchange.DownloadExchange;
|
||||
+import top.leavesmc.leaves.protocol.syncmatica.exchange.Exchange;
|
||||
+import top.leavesmc.leaves.protocol.syncmatica.exchange.ExchangeTarget;
|
||||
@@ -111,6 +87,7 @@ index 0000000000000000000000000000000000000000..5320948762a791bcdda915f842ce1395
|
||||
+import java.util.Map;
|
||||
+import java.util.UUID;
|
||||
+
|
||||
+@LeavesProtocol(namespace = "syncmatica")
|
||||
+public class CommunicationManager {
|
||||
+
|
||||
+ private final Map<UUID, List<ServerPlacement>> downloadingFile = new HashMap<>();
|
||||
@@ -143,7 +120,9 @@ index 0000000000000000000000000000000000000000..5320948762a791bcdda915f842ce1395
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public void onPlayerJoin(final ExchangeTarget newPlayer, final ServerPlayer player) {
|
||||
+ @ProtocolHandler.PlayerJoin
|
||||
+ public void onPlayerJoin(ServerPlayer player) {
|
||||
+ final ExchangeTarget newPlayer = player.connection.exchangeTarget;
|
||||
+ final VersionHandshakeServer hi = new VersionHandshakeServer(newPlayer);
|
||||
+ playerMap.put(newPlayer, player);
|
||||
+ final GameProfile profile = player.getGameProfile();
|
||||
@@ -151,7 +130,9 @@ index 0000000000000000000000000000000000000000..5320948762a791bcdda915f842ce1395
|
||||
+ startExchangeUnchecked(hi);
|
||||
+ }
|
||||
+
|
||||
+ public void onPlayerLeave(final @NotNull ExchangeTarget oldPlayer) {
|
||||
+ @ProtocolHandler.PlayerLeave
|
||||
+ public void onPlayerLeave(ServerPlayer player) {
|
||||
+ final ExchangeTarget oldPlayer = player.connection.exchangeTarget;
|
||||
+ final Collection<Exchange> potentialMessageTarget = oldPlayer.getExchanges();
|
||||
+ if (potentialMessageTarget != null) {
|
||||
+ for (final Exchange target : potentialMessageTarget) {
|
||||
@@ -163,8 +144,9 @@ index 0000000000000000000000000000000000000000..5320948762a791bcdda915f842ce1395
|
||||
+ playerMap.remove(oldPlayer);
|
||||
+ }
|
||||
+
|
||||
+ public void onPacketGet(final @NotNull ServerboundCustomPayloadPacket packet, final @NotNull ServerGamePacketListenerImpl impl) {
|
||||
+ onPacket(impl.exchangeTarget, packet.identifier, packet.data);
|
||||
+ @ProtocolHandler.PayloadReceiver(payload = LeavesProtocolManager.LeavesPayload.class, ignoreId = true)
|
||||
+ public void onPacketGet(ServerPlayer player, LeavesProtocolManager.LeavesPayload payload) {
|
||||
+ onPacket(player.connection.exchangeTarget, payload.id(), payload.data());
|
||||
+ }
|
||||
+
|
||||
+ public void onPacket(final @NotNull ExchangeTarget source, final ResourceLocation id, final FriendlyByteBuf packetBuf) {
|
||||
@@ -1694,16 +1676,16 @@ index 0000000000000000000000000000000000000000..26482e63b7c24c80bdc111cea51b8d7b
|
||||
+}
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/protocol/syncmatica/exchange/ExchangeTarget.java b/src/main/java/top/leavesmc/leaves/protocol/syncmatica/exchange/ExchangeTarget.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..eae6aab5cb02ea167ebfbfcb5e3f20f933ee6d39
|
||||
index 0000000000000000000000000000000000000000..706680a3d7fae22f94cb86b8da2e306cfcf4cb1b
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/top/leavesmc/leaves/protocol/syncmatica/exchange/ExchangeTarget.java
|
||||
@@ -0,0 +1,38 @@
|
||||
@@ -0,0 +1,40 @@
|
||||
+package top.leavesmc.leaves.protocol.syncmatica.exchange;
|
||||
+
|
||||
+import net.minecraft.network.FriendlyByteBuf;
|
||||
+import net.minecraft.network.protocol.game.ClientboundCustomPayloadPacket;
|
||||
+import net.minecraft.resources.ResourceLocation;
|
||||
+import net.minecraft.server.network.ServerGamePacketListenerImpl;
|
||||
+import top.leavesmc.leaves.protocol.core.ProtocolUtils;
|
||||
+import top.leavesmc.leaves.protocol.syncmatica.FeatureSet;
|
||||
+
|
||||
+import java.util.ArrayList;
|
||||
@@ -1721,7 +1703,9 @@ index 0000000000000000000000000000000000000000..eae6aab5cb02ea167ebfbfcb5e3f20f9
|
||||
+ }
|
||||
+
|
||||
+ public void sendPacket(final ResourceLocation id, final FriendlyByteBuf packetBuf) {
|
||||
+ client.send(new ClientboundCustomPayloadPacket(id, packetBuf));
|
||||
+ ProtocolUtils.sendPayloadPacket(client.player, id, buf -> {
|
||||
+ buf.writeBytes(packetBuf);
|
||||
+ });
|
||||
+ }
|
||||
+
|
||||
+ public FeatureSet getFeatureSet() {
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Disable distance check for UseItemOnPacket
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 72cfca4a310f7714c7e22be312175e7435051397..209511eb52fe815e7387bd2bf37497748af00119 100644
|
||||
index 67431477762c1744a4604d5d1f59f1172be0244e..574f5c06bd9c30b45534949e4e289e9ed8e55b47 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1901,7 +1901,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1904,7 +1904,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
Vec3 vec3d2 = vec3d.subtract(vec3d1);
|
||||
double d0 = 1.0000001D;
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Disable check out-of-order command
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 209511eb52fe815e7387bd2bf37497748af00119..8b072958aca8215e58e54fb2e64855b7632fbbf6 100644
|
||||
index 574f5c06bd9c30b45534949e4e289e9ed8e55b47..d6c9348d7e8989ebca5f9fe35915d9a5910162aa 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2244,7 +2244,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -2247,7 +2247,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
}
|
||||
|
||||
private Optional<LastSeenMessages> tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) {
|
||||
@@ -5,19 +5,19 @@ Subject: [PATCH] Leaves carpet support
|
||||
|
||||
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index db6b7ff06bf646aa50afadc354b381821cb5b1a9..af17de2dcadcfe3b0706c8c04fc804c520d1e83d 100644
|
||||
index 7a1fae214f7ed5c664459665f43011c84e6b6259..79e3e4ae09d29134219485800d8d9efc91d9ce6b 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -13,6 +13,8 @@ import top.leavesmc.leaves.bot.BotCommand;
|
||||
import top.leavesmc.leaves.bot.agent.Actions;
|
||||
@@ -14,6 +14,8 @@ import top.leavesmc.leaves.bot.agent.Actions;
|
||||
import top.leavesmc.leaves.profile.LeavesMinecraftSessionService;
|
||||
import top.leavesmc.leaves.protocol.syncmatica.SyncmaticaProtocol;
|
||||
import top.leavesmc.leaves.util.MathUtils;
|
||||
+import top.leavesmc.leaves.protocol.CarpetServerProtocol.CarpetRule;
|
||||
+import top.leavesmc.leaves.protocol.CarpetServerProtocol.CarpetRules;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
@@ -607,6 +609,8 @@ public final class LeavesConfig {
|
||||
@@ -609,6 +611,8 @@ public final class LeavesConfig {
|
||||
}
|
||||
|
||||
public static void registerCarpetRules() {
|
||||
@@ -45,10 +45,10 @@ index ed2e0774d5b14d4926b3214ebf3795d7555327e3..0434bf9b8d3b064c8426d51f9969686a
|
||||
|
||||
while (objectiterator.hasNext()) {
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 8b072958aca8215e58e54fb2e64855b7632fbbf6..84c481fe696b4d1da2ef01692e9347d0a9a8ecae 100644
|
||||
index d6c9348d7e8989ebca5f9fe35915d9a5910162aa..6d03da4fee0e53ffffe12a36efe0e095498eac6f 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -537,7 +537,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -540,7 +540,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
speed *= 2f; // TODO: Get the speed of the vehicle instead of the player
|
||||
|
||||
// Paper start - Prevent moving into unloaded chunks
|
||||
@@ -92,7 +92,7 @@ index 2708251ebc1995e71fb0e5dca9e158a3005f8a8a..e28351b379677fec356b6efec2d882ee
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index af17de2dcadcfe3b0706c8c04fc804c520d1e83d..3b8db2215f3000cd091a5c363ac4f25c01ddc26e 100644
|
||||
index 79e3e4ae09d29134219485800d8d9efc91d9ce6b..f378005cafe92f57e8264757b17eeb9d43b177aa 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -11,6 +11,7 @@ import org.bukkit.configuration.file.YamlConfiguration;
|
||||
@@ -101,9 +101,9 @@ index af17de2dcadcfe3b0706c8c04fc804c520d1e83d..3b8db2215f3000cd091a5c363ac4f25c
|
||||
import top.leavesmc.leaves.bot.agent.Actions;
|
||||
+import top.leavesmc.leaves.command.NoBlockUpdateCommand;
|
||||
import top.leavesmc.leaves.profile.LeavesMinecraftSessionService;
|
||||
import top.leavesmc.leaves.protocol.syncmatica.SyncmaticaProtocol;
|
||||
import top.leavesmc.leaves.util.MathUtils;
|
||||
import top.leavesmc.leaves.protocol.CarpetServerProtocol.CarpetRule;
|
||||
@@ -82,6 +83,10 @@ public final class LeavesConfig {
|
||||
@@ -83,6 +84,10 @@ public final class LeavesConfig {
|
||||
commands.put("bot", new BotCommand("bot"));
|
||||
Actions.registerAll();
|
||||
}
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Bladeren Protocol
|
||||
|
||||
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index 3b8db2215f3000cd091a5c363ac4f25c01ddc26e..2c3becfa0e540ce1ae5a1357201666bbf3df665f 100644
|
||||
index f378005cafe92f57e8264757b17eeb9d43b177aa..38e6a4299e7664608b288ec4fff29f4979337544 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -16,6 +16,8 @@ import top.leavesmc.leaves.profile.LeavesMinecraftSessionService;
|
||||
@@ -17,6 +17,8 @@ import top.leavesmc.leaves.protocol.syncmatica.SyncmaticaProtocol;
|
||||
import top.leavesmc.leaves.util.MathUtils;
|
||||
import top.leavesmc.leaves.protocol.CarpetServerProtocol.CarpetRule;
|
||||
import top.leavesmc.leaves.protocol.CarpetServerProtocol.CarpetRules;
|
||||
@@ -17,7 +17,7 @@ index 3b8db2215f3000cd091a5c363ac4f25c01ddc26e..2c3becfa0e540ce1ae5a1357201666bb
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
@@ -75,6 +77,7 @@ public final class LeavesConfig {
|
||||
@@ -76,6 +78,7 @@ public final class LeavesConfig {
|
||||
|
||||
LeavesConfig.load(config);
|
||||
registerCarpetRules();
|
||||
@@ -25,7 +25,7 @@ index 3b8db2215f3000cd091a5c363ac4f25c01ddc26e..2c3becfa0e540ce1ae5a1357201666bb
|
||||
|
||||
commands = new HashMap<>();
|
||||
commands.put("leaves", new LeavesCommand("leaves"));
|
||||
@@ -851,6 +854,10 @@ public final class LeavesConfig {
|
||||
@@ -853,6 +856,10 @@ public final class LeavesConfig {
|
||||
}
|
||||
|
||||
public static void registerLeavesFeatures() {
|
||||
@@ -257,7 +257,7 @@ index c0ebba04b41628f691ab55853498df258549e939..8ce9c990d9db973ea2bb80a58fa9002a
|
||||
return ret;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 84c481fe696b4d1da2ef01692e9347d0a9a8ecae..5753f163a46ae86a45cc363d7656841f552e49b9 100644
|
||||
index 6d03da4fee0e53ffffe12a36efe0e095498eac6f..18e1845f3919d988d51ab7ba0a6eec6cd3a38df8 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -239,6 +239,7 @@ import org.bukkit.inventory.EquipmentSlot;
|
||||
@@ -268,7 +268,7 @@ index 84c481fe696b4d1da2ef01692e9347d0a9a8ecae..5753f163a46ae86a45cc363d7656841f
|
||||
|
||||
public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl implements ServerGamePacketListener, ServerPlayerConnection, TickablePacketListener {
|
||||
|
||||
@@ -776,13 +777,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -779,13 +780,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
// PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // Paper - run this async
|
||||
// CraftBukkit start
|
||||
if (this.chatSpamTickCount.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamLimit && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Paper start - split and make configurable
|
||||
@@ -284,7 +284,7 @@ index 84c481fe696b4d1da2ef01692e9347d0a9a8ecae..5753f163a46ae86a45cc363d7656841f
|
||||
return;
|
||||
}
|
||||
// Paper end
|
||||
@@ -3191,7 +3192,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -3194,7 +3195,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
// Paper start
|
||||
if (!org.bukkit.Bukkit.isPrimaryThread()) {
|
||||
if (this.recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) {
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add Leaves Auto Update
|
||||
|
||||
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index 2c3becfa0e540ce1ae5a1357201666bbf3df665f..1d4d357465edf888f1d52755c382dcd8e015fc09 100644
|
||||
index 38e6a4299e7664608b288ec4fff29f4979337544..99192e8c41613fee3bbd432e55ac24f1178f3edc 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -16,6 +16,7 @@ import top.leavesmc.leaves.profile.LeavesMinecraftSessionService;
|
||||
@@ -17,6 +17,7 @@ import top.leavesmc.leaves.protocol.syncmatica.SyncmaticaProtocol;
|
||||
import top.leavesmc.leaves.util.MathUtils;
|
||||
import top.leavesmc.leaves.protocol.CarpetServerProtocol.CarpetRule;
|
||||
import top.leavesmc.leaves.protocol.CarpetServerProtocol.CarpetRules;
|
||||
@@ -16,7 +16,7 @@ index 2c3becfa0e540ce1ae5a1357201666bbf3df665f..1d4d357465edf888f1d52755c382dcd8
|
||||
import top.leavesmc.leaves.protocol.bladeren.BladerenProtocol.LeavesFeatureSet;
|
||||
import top.leavesmc.leaves.protocol.bladeren.BladerenProtocol.LeavesFeature;
|
||||
|
||||
@@ -823,6 +824,7 @@ public final class LeavesConfig {
|
||||
@@ -825,6 +826,7 @@ public final class LeavesConfig {
|
||||
private static void autoUpdate() {
|
||||
autoUpdate = getBoolean("settings.misc.auto-update.enable", autoUpdate);
|
||||
autoUpdateTime = getList("settings.misc.auto-update.time", autoUpdateTime);
|
||||
@@ -107,7 +107,7 @@ index fbd602b5219c0eeefea36dbaca7aae10d483a152..e05620a5fa75e22001511fff205b718b
|
||||
}
|
||||
// Leaves end - bot can't get advancement
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 5753f163a46ae86a45cc363d7656841f552e49b9..e63455e3b0911c4b519ed3c3b8025c60f0a4c521 100644
|
||||
index 18e1845f3919d988d51ab7ba0a6eec6cd3a38df8..2072faea136e67ae34f52cb8dd9d00293097aaaa 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -300,7 +300,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -21,10 +21,10 @@ index c3d1d7b525a6f2b708144ebe9bc28dfadcfe11fa..55b4386fc57286548161f9ee91e19e22
|
||||
|
||||
private GossipType(String key, int multiplier, int maxReputation, int decay, int shareDecrement) {
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
index 1d4d357465edf888f1d52755c382dcd8e015fc09..dc15ec2edf4577e1a116f0fa7ecbfb63ba623aa6 100644
|
||||
index 99192e8c41613fee3bbd432e55ac24f1178f3edc..9a320d0452b9059614e7a58fdf86ec4bf8e02e50 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -19,6 +19,7 @@ import top.leavesmc.leaves.protocol.CarpetServerProtocol.CarpetRules;
|
||||
@@ -20,6 +20,7 @@ import top.leavesmc.leaves.protocol.CarpetServerProtocol.CarpetRules;
|
||||
import top.leavesmc.leaves.util.LeavesUpdateHelper;
|
||||
import top.leavesmc.leaves.protocol.bladeren.BladerenProtocol.LeavesFeatureSet;
|
||||
import top.leavesmc.leaves.protocol.bladeren.BladerenProtocol.LeavesFeature;
|
||||
@@ -32,7 +32,7 @@ index 1d4d357465edf888f1d52755c382dcd8e015fc09..dc15ec2edf4577e1a116f0fa7ecbfb63
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
@@ -896,6 +897,9 @@ public final class LeavesConfig {
|
||||
@@ -898,6 +899,9 @@ public final class LeavesConfig {
|
||||
private static void villagerInfiniteDiscounts() {
|
||||
villagerInfiniteDiscounts = getBoolean("settings.modify.minecraft-old.villager-infinite-discounts", villagerInfiniteDiscounts);
|
||||
if (villagerInfiniteDiscounts) {
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] 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 e63455e3b0911c4b519ed3c3b8025c60f0a4c521..e651dd7aadd16ae82f3352f0691f5530fd422e57 100644
|
||||
index 2072faea136e67ae34f52cb8dd9d00293097aaaa..813edf1e61bd75b044551c0cfdfdbf2433d3f309 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -583,7 +583,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -586,7 +586,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
d10 = d6 * d6 + d7 * d7 + d8 * d8;
|
||||
boolean flag2 = false;
|
||||
|
||||
@@ -17,7 +17,7 @@ index e63455e3b0911c4b519ed3c3b8025c60f0a4c521..e651dd7aadd16ae82f3352f0691f5530
|
||||
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)});
|
||||
}
|
||||
@@ -1466,7 +1466,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1469,7 +1469,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
d10 = d6 * d6 + d7 * d7 + d8 * d8;
|
||||
boolean flag2 = false;
|
||||
|
||||
Reference in New Issue
Block a user