This repository has been archived by the owner on Apr 21, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated Upstream (Paper), Fix MC-252817, Implement Anti Shulker Dupe
- Loading branch information
Showing
11 changed files
with
143 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,21 +3,25 @@ From: AlphaKR93 <[email protected]> | |
Date: Sun, 30 Oct 2022 06:00:46 +0000 | ||
Subject: [PATCH] Purpur API Changes | ||
|
||
Original by PurpurMC Team | ||
|
||
Copyright (C) 2022 PurpurMC LLC | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the Software), to deal | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED AS | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
|
||
diff --git a/build.gradle.kts b/build.gradle.kts | ||
index 780c9b40f69c247592c1fe469c05fd12e984b633..8e64ccdb928bc38cb703e60c8ec31339a6f6d894 100644 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,21 +3,25 @@ From: AlphaKR93 <[email protected]> | |
Date: Sun, 30 Oct 2022 06:00:46 +0000 | ||
Subject: [PATCH] Purpur Server Changes | ||
|
||
Original by PurpurMC Team | ||
|
||
Copyright (C) 2022 PurpurMC LLC | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the Software), to deal | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED AS | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
|
||
diff --git a/build.gradle.kts b/build.gradle.kts | ||
index 5b43f5c27ce903c53cbce245477fbdefdc88733f..40e47799426ba0180c15204241d7687071908543 100644 | ||
|
@@ -1627,7 +1631,7 @@ index a32cfa75a9bea896f558bab646d0868391b069a9..01ca7156d86243a80cd343a2a66be9eb | |
public final boolean spawnNpcs = this.get("spawn-npcs", true); | ||
public final boolean pvp = this.get("pvp", true); | ||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java | ||
index 2e811de518dbc63e791508d060c9db64de48fdbb..2182ee049defee88067aa61cee42d3a0122061b7 100644 | ||
index bf2998947f4165f9a661c8fc5f6b846ab9852370..c1db2333ce5fe87fd1ce059cbd8ae6d77abf6f06 100644 | ||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java | ||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java | ||
@@ -606,20 +606,20 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider | ||
|
@@ -1923,7 +1927,7 @@ index 0b75caca3f77980505d0689601d920fb50f7ac4d..9d13ef8c597b9ca11280ad1d3249d13b | |
} | ||
|
||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java | ||
index 1eb912ad97f9663bf6bd336ad739f2552b0a5c9b..3441339e1ba5efb0e25c16fa13cb65d2fbdafc42 100644 | ||
index 163f14b4e1ca99d75e5d8e14190f7b91cb58e8f3..7880cdcaf12197f6b36777c51b2859f2463f1595 100644 | ||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java | ||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java | ||
@@ -65,7 +65,7 @@ public class ServerEntity { | ||
|
@@ -1932,9 +1936,9 @@ index 1eb912ad97f9663bf6bd336ad739f2552b0a5c9b..3441339e1ba5efb0e25c16fa13cb65d2 | |
// CraftBukkit start | ||
- final Set<ServerPlayerConnection> trackedPlayers; // Paper - private -> package | ||
+ public final Set<ServerPlayerConnection> trackedPlayers; // Paper - private -> package // Purpur - package -> public | ||
public boolean clearDirtyEntityData = true; // Paper | ||
|
||
public ServerEntity(ServerLevel worldserver, Entity entity, int i, boolean flag, Consumer<Packet<?>> consumer, Set<ServerPlayerConnection> trackedPlayers) { | ||
this.trackedPlayers = trackedPlayers; | ||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java | ||
index 94f4a5bfd2af8389a99f80bab4eceac1f075512e..c888e654ab9449bfdc7dfe16078eb0786ae6c15e 100644 | ||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java | ||
|
@@ -2832,7 +2836,7 @@ index 80c1e0e47818486a68e0114b063395290365346b..c677a55db62b4d197eeb1bf5d929e240 | |
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 4e615e5d5b8d79f6eaac2136be03961415fd093e..66c632f9a824e705420b9bb86de294f0e7305c50 100644 | ||
index 21c482725d2504b0aedb83ed2a7954b19c11bb61..257daaf0881b1af992a20df83be3846e0d58de66 100644 | ||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java | ||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java | ||
@@ -260,6 +260,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic | ||
|
@@ -3174,8 +3178,8 @@ index 4e615e5d5b8d79f6eaac2136be03961415fd093e..66c632f9a824e705420b9bb86de294f0 | |
+ | ||
// Entity in bucket - SPIGOT-4048 and SPIGOT-6859 | ||
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)) { | ||
ServerGamePacketListenerImpl.this.send(new ClientboundAddEntityPacket(entity)); | ||
@@ -3571,11 +3665,17 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic | ||
// Paper start | ||
@@ -3572,11 +3666,17 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic | ||
for (int i = 0; i < signText.size(); ++i) { | ||
FilteredText filteredtext = (FilteredText) signText.get(i); | ||
|
||
|
@@ -3196,7 +3200,7 @@ index 4e615e5d5b8d79f6eaac2136be03961415fd093e..66c632f9a824e705420b9bb86de294f0 | |
} | ||
SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.player.getBukkitEntity(), lines); | ||
this.cserver.getPluginManager().callEvent(event); | ||
@@ -3597,6 +3697,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic | ||
@@ -3598,6 +3698,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic | ||
|
||
@Override | ||
public void handleKeepAlive(ServerboundKeepAlivePacket packet) { | ||
|
@@ -3213,15 +3217,15 @@ index 4e615e5d5b8d79f6eaac2136be03961415fd093e..66c632f9a824e705420b9bb86de294f0 | |
//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); | ||
@@ -3647,6 +3757,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic | ||
@@ -3648,6 +3758,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 | ||
+ private static final ResourceLocation PURPUR_CLIENT = new ResourceLocation("purpur", "client"); // Purpur | ||
|
||
@Override | ||
public void handleCustomPayload(ServerboundCustomPayloadPacket packet) { | ||
@@ -3671,6 +3782,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic | ||
@@ -3672,6 +3783,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 | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.