Fix NCR
Add Some Patches
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Mon, 1 May 2023 08:34:00 +0000
|
||||
Date: Mon, 8 May 2023 05:49:31 +0000
|
||||
Subject: [PATCH] Pufferfish Server Changes
|
||||
|
||||
Original: Kevin Raneri <kevin.raneri@gmail.com>
|
||||
@@ -1743,7 +1743,7 @@ index 3bb63a652aca3c23f5f1bbf9cb70fce6540f2e33..dda5e77f7d9fb2340d50997c0a17bc7f
|
||||
this.getRandomBlockPosition(j, 0, k, 15, blockposition);
|
||||
int normalY = chunk.getHeight(Heightmap.Types.MOTION_BLOCKING, blockposition.getX() & 15, blockposition.getZ() & 15) + 1;
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 9c5754ac3b00d3f0cb80ec83a2beefadee6d0a14..cc7187c597337665d3cf3c3de4b53e3105b9e4c3 100644
|
||||
index 04a92f33f15d1696e38d38839651adf7d0462cac..acd1c6891f5ab7949689cac5ec859a7a60bf6bb0 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1215,6 +1215,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -1754,7 +1754,7 @@ index 9c5754ac3b00d3f0cb80ec83a2beefadee6d0a14..cc7187c597337665d3cf3c3de4b53e31
|
||||
// Paper start
|
||||
if (!this.cserver.isPrimaryThread()) {
|
||||
List<String> pageList = packet.getPages();
|
||||
@@ -2356,6 +2357,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -2357,6 +2358,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
}
|
||||
|
||||
private boolean updateChatOrder(Instant timestamp) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Mon, 1 May 2023 08:35:32 +0000
|
||||
Date: Mon, 8 May 2023 05:58:24 +0000
|
||||
Subject: [PATCH] Purpur Server Changes
|
||||
|
||||
Original: PurpurMC
|
||||
@@ -3005,7 +3005,7 @@ index 877498729c66de9aa6a27c9148f7494d7895615c..acd7468ee3c86d3456e96e4ec3d7e6a4
|
||||
Util.logAndPauseIfInIde("Detected setBlock in a far chunk [" + i + ", " + j + "], pos: " + pos + ", status: " + this.generatingStatus + (this.currentlyGenerating == null ? "" : ", currently generating: " + (String) this.currentlyGenerating.get()));
|
||||
hasSetFarWarned = true;
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index cc7187c597337665d3cf3c3de4b53e3105b9e4c3..7254d62f3713113027eba29853e9d975eab15f7f 100644
|
||||
index acd1c6891f5ab7949689cac5ec859a7a60bf6bb0..5f868d5ea8c3b42fa3e6f519122c751cee89d8f2 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -262,6 +262,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -3286,7 +3286,7 @@ index cc7187c597337665d3cf3c3de4b53e3105b9e4c3..7254d62f3713113027eba29853e9d975
|
||||
player.getBukkitEntity().setResourcePackStatus(packStatus);
|
||||
this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), packStatus)); // CraftBukkit
|
||||
// Paper end
|
||||
@@ -2363,7 +2454,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -2364,7 +2455,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
do {
|
||||
instant1 = (Instant) this.lastChatTimeStamp.get();
|
||||
if (timestamp.isBefore(instant1)) {
|
||||
@@ -3295,7 +3295,7 @@ index cc7187c597337665d3cf3c3de4b53e3105b9e4c3..7254d62f3713113027eba29853e9d975
|
||||
}
|
||||
} while (!this.lastChatTimeStamp.compareAndSet(instant1, timestamp));
|
||||
|
||||
@@ -2500,7 +2591,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -2501,7 +2592,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
}
|
||||
}
|
||||
// Paper End
|
||||
@@ -3304,7 +3304,7 @@ index cc7187c597337665d3cf3c3de4b53e3105b9e4c3..7254d62f3713113027eba29853e9d975
|
||||
if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot
|
||||
this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s);
|
||||
|
||||
@@ -2510,7 +2601,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -2511,7 +2602,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
this.cserver.getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
@@ -3313,7 +3313,7 @@ index cc7187c597337665d3cf3c3de4b53e3105b9e4c3..7254d62f3713113027eba29853e9d975
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2523,7 +2614,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -2524,7 +2615,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
java.util.logging.Logger.getLogger(ServerGamePacketListenerImpl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||
return;
|
||||
} finally {
|
||||
@@ -3322,7 +3322,7 @@ index cc7187c597337665d3cf3c3de4b53e3105b9e4c3..7254d62f3713113027eba29853e9d975
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -2789,6 +2880,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -2790,6 +2881,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
AABB axisalignedbb = entity.getBoundingBox();
|
||||
|
||||
if (axisalignedbb.distanceToSqr(this.player.getEyePosition()) < ServerGamePacketListenerImpl.MAX_INTERACTION_DISTANCE) {
|
||||
@@ -3330,7 +3330,7 @@ index cc7187c597337665d3cf3c3de4b53e3105b9e4c3..7254d62f3713113027eba29853e9d975
|
||||
packet.dispatch(new ServerboundInteractPacket.Handler() {
|
||||
private void performInteraction(InteractionHand enumhand, ServerGamePacketListenerImpl.EntityInteraction playerconnection_a, PlayerInteractEntityEvent event) { // CraftBukkit
|
||||
ItemStack itemstack = ServerGamePacketListenerImpl.this.player.getItemInHand(enumhand);
|
||||
@@ -2802,6 +2894,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -2803,6 +2895,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
|
||||
ServerGamePacketListenerImpl.this.cserver.getPluginManager().callEvent(event);
|
||||
|
||||
@@ -3339,7 +3339,7 @@ index cc7187c597337665d3cf3c3de4b53e3105b9e4c3..7254d62f3713113027eba29853e9d975
|
||||
// Entity in bucket - SPIGOT-4048 and SPIGOT-6859a
|
||||
if ((entity instanceof Bucketable && entity instanceof LivingEntity && origItem != null && origItem.asItem() == Items.WATER_BUCKET) && (event.isCancelled() || ServerGamePacketListenerImpl.this.player.getInventory().getSelected() == null || ServerGamePacketListenerImpl.this.player.getInventory().getSelected().getItem() != origItem)) {
|
||||
entity.getEntityData().resendPossiblyDesyncedEntity(player); // Paper - The entire mob gets deleted, so resend it.
|
||||
@@ -3353,6 +3447,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -3354,6 +3448,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3352,7 +3352,7 @@ index cc7187c597337665d3cf3c3de4b53e3105b9e4c3..7254d62f3713113027eba29853e9d975
|
||||
|
||||
boolean flag1 = packet.getSlotNum() >= 1 && packet.getSlotNum() <= 45;
|
||||
boolean flag2 = itemstack.isEmpty() || itemstack.getDamageValue() >= 0 && itemstack.getCount() <= 64 && !itemstack.isEmpty();
|
||||
@@ -3459,11 +3559,17 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -3460,11 +3560,17 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
for (int i = 0; i < signText.size(); ++i) {
|
||||
FilteredText filteredtext = (FilteredText) signText.get(i);
|
||||
|
||||
@@ -3373,7 +3373,7 @@ index cc7187c597337665d3cf3c3de4b53e3105b9e4c3..7254d62f3713113027eba29853e9d975
|
||||
}
|
||||
SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.player.getBukkitEntity(), lines);
|
||||
this.cserver.getPluginManager().callEvent(event);
|
||||
@@ -3485,6 +3591,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -3486,6 +3592,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
|
||||
@Override
|
||||
public void handleKeepAlive(ServerboundKeepAlivePacket packet) {
|
||||
@@ -3390,7 +3390,7 @@ index cc7187c597337665d3cf3c3de4b53e3105b9e4c3..7254d62f3713113027eba29853e9d975
|
||||
//PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); // CraftBukkit // Paper - This shouldn't be on the main thread
|
||||
if (this.keepAlivePending && packet.getId() == this.keepAliveChallenge) {
|
||||
int i = (int) (Util.getMillis() - this.keepAliveTime);
|
||||
@@ -3535,6 +3651,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -3536,6 +3652,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
private static final ResourceLocation CUSTOM_UNREGISTER = new ResourceLocation("unregister");
|
||||
|
||||
private static final ResourceLocation MINECRAFT_BRAND = new ResourceLocation("brand"); // Paper - Brand support
|
||||
@@ -3398,7 +3398,7 @@ index cc7187c597337665d3cf3c3de4b53e3105b9e4c3..7254d62f3713113027eba29853e9d975
|
||||
|
||||
@Override
|
||||
public void handleCustomPayload(ServerboundCustomPayloadPacket packet) {
|
||||
@@ -3559,6 +3676,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -3560,6 +3677,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t unregister custom payload", ex);
|
||||
this.disconnect("Invalid payload UNREGISTER!", org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PAYLOAD); // Paper - kick event cause
|
||||
}
|
||||
@@ -17910,7 +17910,7 @@ index a6c25647fb37f59307de0d390f8e8cf55504d7d3..52aae8bd4023b2bb48f12983f54b20fa
|
||||
world.scheduleTick(pos, this, 1);
|
||||
return super.updateShape(state, direction, neighborState, world, pos, neighborPos);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
|
||||
index ae90e86327957bb784e2d81694ee7eea288bb455..c5e4bc4bbeacd4875996ba54e795689feb8023af 100644
|
||||
index fb4382337fe83f7d00c2212a7a71e0ba5bdd51cc..f085a669e2f2645e8c4f7a7e5a3c958f13809744 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
|
||||
@@ -228,26 +228,28 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
|
||||
@@ -17921,13 +17921,13 @@ index ae90e86327957bb784e2d81694ee7eea288bb455..c5e4bc4bbeacd4875996ba54e795689f
|
||||
- // Paper start - EntityChangeBlockEvent
|
||||
- double rand = world.getRandom().nextDouble();
|
||||
- BlockState dummyBlockState = ComposterBlock.addItem(player, state, org.bukkit.craftbukkit.util.DummyGeneratorAccess.INSTANCE, pos, itemstack, rand);
|
||||
- if (dummyBlockState == null) {
|
||||
- return InteractionResult.PASS;
|
||||
- }
|
||||
- if (state != dummyBlockState && org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(player, pos, dummyBlockState).isCancelled()) { // if block state will change and event cancelled
|
||||
- return InteractionResult.sidedSuccess(world.isClientSide);
|
||||
- }
|
||||
- BlockState iblockdata1 = ComposterBlock.addItem(player, state, world, pos, itemstack, rand);
|
||||
- if (iblockdata1 == null) {
|
||||
- return InteractionResult.PASS;
|
||||
- }
|
||||
- // Paper end
|
||||
-
|
||||
- world.levelEvent(1500, pos, state != iblockdata1 ? 1 : 0);
|
||||
@@ -17970,13 +17970,13 @@ index ae90e86327957bb784e2d81694ee7eea288bb455..c5e4bc4bbeacd4875996ba54e795689f
|
||||
+ // Paper start - EntityChangeBlockEvent
|
||||
+ double rand = world.getRandom().nextDouble();
|
||||
+ BlockState dummyBlockState = ComposterBlock.addItem(player, state, org.bukkit.craftbukkit.util.DummyGeneratorAccess.INSTANCE, pos, itemstack, rand);
|
||||
+ if (dummyBlockState == null) {
|
||||
+ return dummyBlockState;
|
||||
+ }
|
||||
+ if (state != dummyBlockState && org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(player, pos, dummyBlockState).isCancelled()) { // if block state will change and event cancelled
|
||||
+ return state;
|
||||
+ }
|
||||
+ BlockState iblockdata1 = ComposterBlock.addItem(player, state, world, pos, itemstack, rand);
|
||||
+ if (iblockdata1 == null) {
|
||||
+ return iblockdata1;
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
+ world.levelEvent(1500, pos, state != iblockdata1 ? 1 : 0);
|
||||
@@ -20890,7 +20890,7 @@ index e43fd3e59fd8c74828ae65965fade27f56beef65..b2f133c8baabba1cffa6e92ea0f85453
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index 819c9c020f4d5a1373f68850134960d24b8fc308..a60948f4085232082f205ad4f0f627a28342bd36 100644
|
||||
index dee0168b50c7fbaefb762939a04e8f51e7bc58f7..85180c61e6124989e227150e0fdd5484ae3ebf1c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -561,6 +561,15 @@ public class CraftEventFactory {
|
||||
@@ -20917,7 +20917,7 @@ index 819c9c020f4d5a1373f68850134960d24b8fc308..a60948f4085232082f205ad4f0f627a2
|
||||
}
|
||||
event.setCancelled(cancelled);
|
||||
|
||||
@@ -1107,6 +1117,7 @@ public class CraftEventFactory {
|
||||
@@ -1112,6 +1122,7 @@ public class CraftEventFactory {
|
||||
} else {
|
||||
entity.lastDamageCancelled = true; // SPIGOT-5339, SPIGOT-6252, SPIGOT-6777: Keep track if the event was canceled
|
||||
}
|
||||
@@ -20925,7 +20925,7 @@ index 819c9c020f4d5a1373f68850134960d24b8fc308..a60948f4085232082f205ad4f0f627a2
|
||||
return event;
|
||||
}
|
||||
|
||||
@@ -1166,6 +1177,7 @@ public class CraftEventFactory {
|
||||
@@ -1171,6 +1182,7 @@ public class CraftEventFactory {
|
||||
EntityDamageEvent event;
|
||||
if (damager != null) {
|
||||
event = new EntityDamageByEntityEvent(damager.getBukkitEntity(), damagee.getBukkitEntity(), cause, modifiers, modifierFunctions, critical); // Paper - add critical damage API
|
||||
|
||||
@@ -7,21 +7,8 @@ Subject: [PATCH] Console log tweaks
|
||||
Original by Irochi <me@irochi.moe>
|
||||
Licensed under the GPL 3.0
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
||||
index 951a7df30bd70bb3051c04f592529d560be6948e..461dbcac2f1265be7b23960f4422f69d5c8c42a9 100644
|
||||
--- a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
||||
+++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
||||
@@ -353,7 +353,7 @@ public final class ChatProcessor {
|
||||
|
||||
private void sendToServer(final ChatType.Bound chatType, final @Nullable Function<Audience, net.minecraft.network.chat.Component> msgFunction) {
|
||||
final PlayerChatMessage toConsoleMessage = msgFunction == null ? ChatProcessor.this.message : ChatProcessor.this.message.withUnsignedContent(msgFunction.apply(ChatProcessor.this.server.console));
|
||||
- ChatProcessor.this.server.logChatMessage(toConsoleMessage.decoratedContent(), chatType, ChatProcessor.this.server.getPlayerList().verifyChatTrusted(toConsoleMessage) ? null : "Not Secure");
|
||||
+ ChatProcessor.this.server.logChatMessage(toConsoleMessage.decoratedContent(), chatType, ChatProcessor.this.server.getPlayerList().verifyChatTrusted(toConsoleMessage) || !org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.enableSecureChatMarker ? null : "Not Secure");
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 429ccd583ecd136a63862e94b8eb36b371e28d0f..efcee39cd7154493de04ca903edbd32b5901b191 100644
|
||||
index 429ccd583ecd136a63862e94b8eb36b371e28d0f..fd962c112f5d8823fa6f28c556c4fcb5e8abf9d7 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -179,16 +179,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -55,7 +42,7 @@ index 429ccd583ecd136a63862e94b8eb36b371e28d0f..efcee39cd7154493de04ca903edbd32b
|
||||
}
|
||||
// Spigot end
|
||||
- DedicatedServer.LOGGER.warn("To change this, set \"online-mode\" to \"true\" in the server.properties file.");
|
||||
+ DedicatedServer.LOGGER.warn("To change this, set \"online-mode\" to \"true\" in the \"server.properties\" file or set \"console-logs.offline-warning\" to \"false\" in the \"plazma.yml\" file."); // Plazma
|
||||
+ DedicatedServer.LOGGER.warn("To change this, set \"online-mode\" to \"true\" in the \"server.properties\" file or set \"console-logs.offline-warning\" to \"false\" in the \"config/plazma-global.yml\" file."); // Plazma
|
||||
}
|
||||
|
||||
+ // Plazma start - Moved down
|
||||
@@ -72,30 +59,16 @@ index 429ccd583ecd136a63862e94b8eb36b371e28d0f..efcee39cd7154493de04ca903edbd32b
|
||||
|
||||
if (!OldUsersConverter.serverReadyAfterUserconversion(this)) {
|
||||
return false;
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 33d4c1af86382cc3343d5db42283b27f69f52374..030166f46b2ce23976a679685ffccf8b5439ce48 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1431,7 +1431,7 @@ public abstract class PlayerList {
|
||||
}
|
||||
public void broadcastChatMessage(PlayerChatMessage message, Predicate<ServerPlayer> shouldSendFiltered, @Nullable ServerPlayer sender, ChatType.Bound params, @Nullable Function<net.kyori.adventure.audience.Audience, Component> unsignedFunction) {
|
||||
// Paper end
|
||||
- boolean flag = this.verifyChatTrusted(message);
|
||||
+ boolean flag = this.verifyChatTrusted(message) || !org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.enableSecureChatMarker;
|
||||
|
||||
this.server.logChatMessage((unsignedFunction == null ? message.decoratedContent() : unsignedFunction.apply(this.server.console)), params, flag ? null : "Not Secure"); // Paper
|
||||
OutgoingChatMessage outgoingchatmessage = OutgoingChatMessage.create(message);
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 3c70653b720d3d55be199e000e89c627b90e65da..ba542542cbab63b0764d437049123a76ccaca716 100644
|
||||
index 3c70653b720d3d55be199e000e89c627b90e65da..122482e1fae7d6ac8e6b32ebdcf3e611d47901c4 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -24,6 +24,9 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -24,6 +24,8 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public ConsoleLogs consoleLogs;
|
||||
public class ConsoleLogs extends ConfigurationPart {
|
||||
|
||||
+ public boolean enableOfflineWarnings = true;
|
||||
+ public boolean enableRootUserWarnings = true;
|
||||
+ public boolean enableSecureChatMarker = DO_OPTIMIZE;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,12 +5,12 @@ Subject: [PATCH] Player configuration section
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index ba542542cbab63b0764d437049123a76ccaca716..3590442906a3f1cf27f621a1e093c1c4cc0887ac 100644
|
||||
index 122482e1fae7d6ac8e6b32ebdcf3e611d47901c4..61f364abb094a1d137478c106fefa22ceb057ed2 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -28,5 +28,12 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -27,5 +27,12 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public boolean enableOfflineWarnings = true;
|
||||
public boolean enableRootUserWarnings = true;
|
||||
public boolean enableSecureChatMarker = DO_OPTIMIZE;
|
||||
|
||||
+ }
|
||||
+
|
||||
|
||||
@@ -18,10 +18,10 @@ index f719f8aafe7c75e2ef8fcb05f556a8d6bd94b9a0..06ff5dd9e39e2be8dd8397a764813111
|
||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation) {
|
||||
if (!this.iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation && !validateUsername(packet.name())) {
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 3590442906a3f1cf27f621a1e093c1c4cc0887ac..b9a04a8042f1bedaeb27681f84f9e2df7cf1794d 100644
|
||||
index 61f364abb094a1d137478c106fefa22ceb057ed2..a45ff31d08129c0d5f159615d934a4450d54146e 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -33,7 +33,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -32,7 +32,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public Player player;
|
||||
public class Player extends ConfigurationPart {
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Add permission to bypass reducedDebugInfo gamerule
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 030166f46b2ce23976a679685ffccf8b5439ce48..427a50198c80459fb4d2364a859ed978b1ec7871 100644
|
||||
index 33d4c1af86382cc3343d5db42283b27f69f52374..e49e213924206f55f25a44edb4d0ce4bb4d27fc2 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -273,7 +273,7 @@ public abstract class PlayerList {
|
||||
@@ -13,7 +13,7 @@ index 030166f46b2ce23976a679685ffccf8b5439ce48..427a50198c80459fb4d2364a859ed978
|
||||
GameRules gamerules = worldserver1.getGameRules();
|
||||
boolean flag = gamerules.getBoolean(GameRules.RULE_DO_IMMEDIATE_RESPAWN);
|
||||
- boolean flag1 = gamerules.getBoolean(GameRules.RULE_REDUCEDDEBUGINFO);
|
||||
+ boolean flag1 = gamerules.getBoolean(GameRules.RULE_REDUCEDDEBUGINFO) || !player.getBukkitEntity().hasPermission("plazma.bypass-reduced-debug-info-gamerule"); // Plazma
|
||||
+ boolean flag1 = gamerules.getBoolean(GameRules.RULE_REDUCEDDEBUGINFO) && !player.getBukkitEntity().hasPermission("plazma.bypass-reduced-debug-info-gamerule"); // Plazma
|
||||
|
||||
// Spigot - view distance
|
||||
playerconnection.send(new ClientboundLoginPacket(player.getId(), worlddata.isHardcore(), player.gameMode.getGameModeForPlayer(), player.gameMode.getPreviousGameModeForPlayer(), this.server.levelKeys(), this.synchronizedRegistries, worldserver1.dimensionTypeId(), worldserver1.dimension(), BiomeManager.obfuscateSeed(worldserver1.getSeed()), this.getMaxPlayers(), worldserver1.getChunkSource().chunkMap.playerChunkManager.getTargetSendDistance(), worldserver1.getChunkSource().chunkMap.playerChunkManager.getTargetTickViewDistance(), flag1, !flag, worldserver1.isDebug(), worldserver1.isFlat(), player.getLastDeathLocation())); // Paper - replace old player chunk management
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Misc configuration
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index b9a04a8042f1bedaeb27681f84f9e2df7cf1794d..1e979bb87ec743e87909927a517692da38e7b18f 100644
|
||||
index a45ff31d08129c0d5f159615d934a4450d54146e..59b9b268467b098e5c21d1d00f599cfb36154179 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -35,5 +35,12 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -34,5 +34,12 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
|
||||
public boolean allowAnyUsername = false;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ index 591163d8f8300b084ac734800efee902c4def958..d74401ca3182145d136ad668704f5c04
|
||||
double d1 = (double) (center.y - maxRange);
|
||||
double d2 = (double) (center.x + maxRange);
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 29c46144de1aad31b997ee5000114e6f33f1a1f7..c6d860687f6a1c286c286bb64ac4eed75a88f0c4 100644
|
||||
index de93be4ddbc36832a76ee94ac9828e1873ab3775..dab9aade837cfe97993c689e598f46e9bb796ffe 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -403,7 +403,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -162,10 +162,10 @@ index 9e9ac64764cf0a84e25e75d8d6f516cde6047284..2d197a7de77657a19b1b527c0aa53ef9
|
||||
|
||||
MinecraftServer minecraftServer = this.level.getServer();
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 1e979bb87ec743e87909927a517692da38e7b18f..66436d4eb66b5a71f18b7db359ab1d63bbac74c0 100644
|
||||
index 59b9b268467b098e5c21d1d00f599cfb36154179..fa33fd5a64fadbfe6507ae9f61fdfbfc816686b5 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -40,7 +40,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -39,7 +39,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public Misc misc;
|
||||
public class Misc extends ConfigurationPart {
|
||||
|
||||
|
||||
@@ -10,14 +10,14 @@ Subject: [PATCH] Various Optimizations
|
||||
0011 - Swaps the predicate order of collision (Akarin)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 3c10c719f6172161a2dcc6592a0a1492e9b3d7c1..d64f188257c135e2a4af07e28ff8f912c80eac03 100644
|
||||
index b2ee73a2ef6042694ca84c27d592e5fb13b4a0fe..d6e20ebb1e07da767f6571bbaf0dc882cdf4503f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -1991,8 +1991,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
public void playerTouch(Player player) {}
|
||||
|
||||
public void push(Entity entity) {
|
||||
+ if (entity.noPhysics && this.noPhysics) return; // Plazma
|
||||
+ if (entity.noPhysics || this.noPhysics) return; // Plazma
|
||||
if (!this.isPassengerOfSameVehicle(entity)) {
|
||||
- if (!entity.noPhysics && !this.noPhysics) {
|
||||
+ //if (!entity.noPhysics && !this.noPhysics) { // Plazma
|
||||
@@ -81,10 +81,10 @@ index 36af81f0957d17e170d229059c66f4eb4539dfeb..039c952f0c157cba6e79fa9b976958bd
|
||||
}
|
||||
// Spigot Start
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 66436d4eb66b5a71f18b7db359ab1d63bbac74c0..87a85fb1cd9a19541df04a5d1c457d86cf7f68eb 100644
|
||||
index fa33fd5a64fadbfe6507ae9f61fdfbfc816686b5..590afba7c588e7b9f5f9c61e91805e3dc3b62771 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -41,6 +41,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -40,6 +40,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public class Misc extends ConfigurationPart {
|
||||
|
||||
public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
|
||||
|
||||
@@ -39,10 +39,10 @@ index 6afee2a744a3498d4a0eee35f77cde444f73d12c..dbb987d5896e199aeae3bcd86c69bf33
|
||||
this.entity.stopSeenByPlayer(player);
|
||||
player.connection.send(new ClientboundRemoveEntitiesPacket(new int[]{this.entity.getId()}));
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 87a85fb1cd9a19541df04a5d1c457d86cf7f68eb..989b6d20818dec0a527a170ad2b19d456ca023d9 100644
|
||||
index 590afba7c588e7b9f5f9c61e91805e3dc3b62771..8ed22e178bd093241592981c06c747524ad24dc3 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -42,6 +42,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -41,6 +41,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
|
||||
public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
|
||||
public boolean doNotTriggerLootTableRefreshForNonPlayerInteraction = DO_OPTIMIZE;
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] No Chat Reports Configuration
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 989b6d20818dec0a527a170ad2b19d456ca023d9..b6348572f4a90acbcf6ec234beac84e8a019ee50 100644
|
||||
index 8ed22e178bd093241592981c06c747524ad24dc3..0e8d5b01a673ba826c943fcb33552518022a2ea3 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -44,5 +44,12 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -43,5 +43,12 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public boolean doNotTriggerLootTableRefreshForNonPlayerInteraction = DO_OPTIMIZE;
|
||||
public boolean doNotSendUselessEntityPackets = DO_OPTIMIZE;
|
||||
|
||||
|
||||
@@ -5,10 +5,25 @@ Subject: [PATCH] Implement No Chat Reports
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||
index 1f4b64a5f812376c499c98cb4be62469bd0b7dbe..59d3b33d523dea21e7a3f0747734b20226fd1dae 100644
|
||||
index 1f4b64a5f812376c499c98cb4be62469bd0b7dbe..c0bd2997fe3ebbfe926de832a36d209cc875f3e2 100644
|
||||
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||
@@ -156,9 +156,14 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||
@@ -147,18 +147,23 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||
public <T> T readJsonWithCodec(Codec<T> codec) {
|
||||
JsonElement jsonelement = (JsonElement) GsonHelper.fromJson(FriendlyByteBuf.GSON, this.readUtf(), JsonElement.class);
|
||||
DataResult<T> dataresult = codec.parse(JsonOps.INSTANCE, jsonelement);
|
||||
-
|
||||
- return Util.getOrThrow(dataresult, (s) -> {
|
||||
- return new DecoderException("Failed to decode json: " + s);
|
||||
- });
|
||||
+ // Plazma start - NCR
|
||||
+ T result = Util.getOrThrow(dataresult, (s) -> new DecoderException("Failed to decode json: " + s));
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.addQueryData() && jsonelement.getAsJsonObject().has("preventsChatReports"))
|
||||
+ ((net.minecraft.network.protocol.status.ServerStatus) result).setPreventsChatReports(jsonelement.getAsJsonObject().get("preventsChatReports").getAsBoolean());
|
||||
+ return result;
|
||||
+ // Plazma end
|
||||
}
|
||||
|
||||
public <T> void writeJsonWithCodec(Codec<T> codec, T value) {
|
||||
DataResult<JsonElement> dataresult = codec.encodeStart(JsonOps.INSTANCE, value);
|
||||
|
||||
@@ -17,48 +32,41 @@ index 1f4b64a5f812376c499c98cb4be62469bd0b7dbe..59d3b33d523dea21e7a3f0747734b202
|
||||
- })));
|
||||
+ // Plazma start - NCR
|
||||
+ JsonElement element = Util.getOrThrow(dataresult, (s) -> new EncoderException("Failed to encode: " + s + " " + value));
|
||||
+
|
||||
+ if (codec == net.minecraft.network.protocol.status.ServerStatus.CODEC && org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.addQueryData())
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.addQueryData() && codec == net.minecraft.network.protocol.status.ServerStatus.CODEC)
|
||||
+ element.getAsJsonObject().addProperty("preventsChatReports", true);
|
||||
+
|
||||
+ this.writeUtf(FriendlyByteBuf.GSON.toJson(element));
|
||||
+ // Plazma end
|
||||
}
|
||||
|
||||
public <T> void writeId(IdMap<T> registry, T value) {
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java
|
||||
index b8c1f3b9afddc87d56541c8af63cffecfcdd2653..c74c17f058b7a6587e3dcab35878d469e0599240 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java
|
||||
@@ -24,4 +24,10 @@ public record ServerboundChatCommandPacket(String command, Instant timeStamp, lo
|
||||
public void handle(ServerGamePacketListener listener) {
|
||||
listener.handleChatCommand(this);
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/status/ServerStatus.java b/src/main/java/net/minecraft/network/protocol/status/ServerStatus.java
|
||||
index e6cc2bab1fde2e8c1394772b99201ea8d7eb8057..2ba3291f6c82f633d7ed7b150f2ae3c28d74b21e 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/status/ServerStatus.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/status/ServerStatus.java
|
||||
@@ -64,4 +64,21 @@ public record ServerStatus(Component description, Optional<ServerStatus.Players>
|
||||
return new ServerStatus.Version(worldVersion.getName(), worldVersion.getProtocolVersion());
|
||||
}
|
||||
}
|
||||
+
|
||||
+ // Plazma start - NCR
|
||||
+ public ArgumentSignatures argumentSignatures() {
|
||||
+ return org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.enabled ? ArgumentSignatures.EMPTY : this.argumentSignatures;
|
||||
+ public boolean enforcesSecureChat() {
|
||||
+ return org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.enabled || this.enforcesSecureChat;
|
||||
+ }
|
||||
+ // Plazma end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java
|
||||
index d1d2fc0c57523c1abf1e8bfec913c78927c3dafc..f93372070b3babc76d43b18df9a0f91a2125e37e 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java
|
||||
@@ -25,4 +25,11 @@ public record ServerboundChatPacket(String message, Instant timeStamp, long salt
|
||||
public void handle(ServerGamePacketListener listener) {
|
||||
listener.handleChat(this);
|
||||
}
|
||||
+
|
||||
+ // Plazma start - NCR
|
||||
+ @Nullable
|
||||
+ public MessageSignature signature() {
|
||||
+ return org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.enabled ? null : this.signature;
|
||||
+ private static boolean preventsChatReports;
|
||||
+
|
||||
+ public boolean preventsChatReports() {
|
||||
+ if (this.version().isPresent() && this.version().get().protocol() < 759 && this.version().get().protocol() > 0) return true;
|
||||
+ return this.preventsChatReports;
|
||||
+ }
|
||||
+
|
||||
+ public void setPreventsChatReports(boolean prevents) {
|
||||
+ this.preventsChatReports = prevents;
|
||||
+ }
|
||||
+ // Plazma end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index efcee39cd7154493de04ca903edbd32b5901b191..a398b71c52817bd68a05613ec037ed6d7ae6fb27 100644
|
||||
index fd962c112f5d8823fa6f28c556c4fcb5e8abf9d7..43ee9198b323a89625b723ba25e09cbfc6c29f7c 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -683,7 +683,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -71,18 +79,16 @@ index efcee39cd7154493de04ca903edbd32b5901b191..a398b71c52817bd68a05613ec037ed6d
|
||||
|
||||
protected boolean convertOldUsers() {
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index ed696a749feed6e9da9302e15130694e659a0a0b..3726af867efbb5dc5b898e00efd5e35f1fd834d4 100644
|
||||
index ed696a749feed6e9da9302e15130694e659a0a0b..48ee396b858a26f382ca71d0665475abb4ae5891 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2234,10 +2234,21 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -2234,10 +2234,19 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
|
||||
@Override
|
||||
public void send(Packet<?> packet) {
|
||||
+ // Plazma start - NCR
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.convertToGameMessage() && packet instanceof ClientboundPlayerChatPacket chat) {
|
||||
+ this.send(new ClientboundSystemChatPacket(null, Component.Serializer.toJson(chat.chatType().resolve(this.player.level.registryAccess()).get().decorate(chat.unsignedContent() != null ? chat.unsignedContent() : Component.literal(chat.body().content()))), false));
|
||||
+ return;
|
||||
+ }
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.convertToGameMessage() && packet instanceof ClientboundPlayerChatPacket chat)
|
||||
+ packet = new ClientboundSystemChatPacket(null, Component.Serializer.toJson(chat.chatType().resolve(this.player.level.registryAccess()).get().decorate(chat.unsignedContent() != null ? chat.unsignedContent() : Component.literal(chat.body().content()))), false);
|
||||
this.send(packet, (PacketSendListener) null);
|
||||
}
|
||||
|
||||
@@ -97,7 +103,7 @@ index ed696a749feed6e9da9302e15130694e659a0a0b..3726af867efbb5dc5b898e00efd5e35f
|
||||
if (packet == null || this.processedDisconnect) { // Spigot
|
||||
return;
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 427a50198c80459fb4d2364a859ed978b1ec7871..91c047d865fe40f130f4414e9722dad447478de5 100644
|
||||
index e49e213924206f55f25a44edb4d0ce4bb4d27fc2..b0b7affc10892ca5572e5c220bd26811778b2d57 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1462,7 +1462,7 @@ public abstract class PlayerList {
|
||||
@@ -110,10 +116,10 @@ index 427a50198c80459fb4d2364a859ed978b1ec7871..91c047d865fe40f130f4414e9722dad4
|
||||
|
||||
// CraftBukkit start
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index b6348572f4a90acbcf6ec234beac84e8a019ee50..7a585540c72c1c18ddcb45ec1caa350f1f9ce544 100644
|
||||
index 0e8d5b01a673ba826c943fcb33552518022a2ea3..17454a128f7ef53428920f95e4709180fd8efb32 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -49,7 +49,17 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -48,7 +48,17 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public NoChatReports noChatReports;
|
||||
public class NoChatReports extends ConfigurationPart {
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] FixMySpawnR Configuration
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 7a585540c72c1c18ddcb45ec1caa350f1f9ce544..088670ec016514b4a7fae402d7119a6aaa491c5d 100644
|
||||
index 17454a128f7ef53428920f95e4709180fd8efb32..39eca4acefa8f9cf143398cfc6cf157e8489947e 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -62,4 +62,12 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -61,4 +61,12 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user