Skip to content

Commit 690c12e

Browse files
committed
update upstream
1 parent 471e9ca commit 690c12e

File tree

10 files changed

+59
-24
lines changed

10 files changed

+59
-24
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
group=gg.projecteden.parchment
22
version=1.21.8-R0.1-SNAPSHOT
33
mcVersion=1.21.8
4-
paperRef=103187750e29fd982b84b2bab114fe5af98a82e5
4+
paperRef=614e9acfca696b98b810c65e3582993fcefc321e
55

66
org.gradle.configuration-cache=true
77
org.gradle.caching=true

parchment-api/paper-patches/files/src/main/java/org/bukkit/World.java.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/src/main/java/org/bukkit/World.java
22
+++ b/src/main/java/org/bukkit/World.java
3-
@@ -51,6 +_,36 @@
3+
@@ -52,6 +_,36 @@
44
*/
55
public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, PersistentDataHolder, Keyed, net.kyori.adventure.audience.ForwardingAudience { // Paper
66

parchment-server/minecraft-patches/sources/net/minecraft/server/level/ServerPlayer.java.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import org.slf4j.Logger;
99

1010
public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patches.chunk_system.player.ChunkSystemServerPlayer { // Paper - rewrite chunk system
11-
@@ -2500,7 +_,7 @@
11+
@@ -2504,7 +_,7 @@
1212
event.isForced()
1313
);
1414
if (event.willNotifyPlayer() && event.getNotification() != null) {
@@ -17,7 +17,7 @@
1717
}
1818
}
1919

20-
@@ -2527,12 +_,20 @@
20+
@@ -2531,12 +_,20 @@
2121

2222
@Override
2323
public void playNotifySound(SoundEvent sound, SoundSource source, float volume, float pitch) {

parchment-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
if (org.spigotmc.SpigotConfig.enableSpamExclusions) {
2424
for (String exclude : org.spigotmc.SpigotConfig.spamExclusions) {
2525
if (exclude != null && message.startsWith(exclude)) {
26-
@@ -3245,9 +_,11 @@
26+
@@ -3246,9 +_,11 @@
2727
public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) {
2828
// Paper start - auto recipe limit
2929
if (!org.bukkit.Bukkit.isPrimaryThread()) {

parchment-server/minecraft-patches/sources/net/minecraft/server/players/PlayerList.java.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/net/minecraft/server/players/PlayerList.java
22
+++ b/net/minecraft/server/players/PlayerList.java
3-
@@ -767,19 +_,7 @@
3+
@@ -765,19 +_,7 @@
44
BlockPos blockPos = respawnConfig.pos();
55
BlockState blockState = level1.getBlockState(blockPos);
66
if (blockState.is(Blocks.RESPAWN_ANCHOR)) {

parchment-server/minecraft-patches/sources/net/minecraft/world/entity/LivingEntity.java.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/net/minecraft/world/entity/LivingEntity.java
22
+++ b/net/minecraft/world/entity/LivingEntity.java
3-
@@ -4199,7 +_,7 @@
3+
@@ -4215,7 +_,7 @@
44
Vec3 direction = this.getLookAngle();
55
Vec3 end = start.add(direction.x * maxDistance, direction.y * maxDistance, direction.z * maxDistance);
66

parchment-server/paper-patches/files/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
22
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
3-
@@ -307,6 +_,7 @@
3+
@@ -308,6 +_,7 @@
44
}
55

66
public boolean disablePlayerCrits = false;

parchment-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/CraftWorld.java.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
22
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
3-
@@ -2488,4 +_,16 @@
3+
@@ -2490,4 +_,16 @@
44
return POINTERS_SUPPLIER.view(this);
55
}
66
// Paper end

parchment-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java.patch

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
11
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
22
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
3-
@@ -225,6 +_,9 @@
4-
private int hash = 0;
5-
private double health = 20;
6-
// Paper end
3+
@@ -3522,4 +_,41 @@
4+
public PlayerGameConnection getConnection() {
5+
return this.getHandle().connection.playerGameConnection;
6+
}
77
+
88
+ private boolean bypassesInsomnia = false; // Parchment - Insomnia api
9-
+
10-
// Spigot start
11-
private final Player.Spigot spigot = new Player.Spigot() {
12-
13-
@@ -3600,4 +_,40 @@
14-
this(new ShortArraySet(), new ArrayList<>());
15-
}
16-
}
179
+
1810
+ // Parchment start
1911
+ @Override
@@ -48,6 +40,5 @@
4840
+ public int getTimeSinceLastRest() {
4941
+ return net.minecraft.util.Mth.clamp(this.getHandle().getStats().getValue(net.minecraft.stats.Stats.CUSTOM.get(net.minecraft.stats.Stats.TIME_SINCE_REST)), 1, Integer.MAX_VALUE);
5042
+ }
51-
+
5243
+
5344
}

parchment-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java.patch

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
22
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
3-
@@ -745,11 +_,12 @@
3+
@@ -746,11 +_,12 @@
44
this.setMaxDamage(maxDamage);
55
}
66

@@ -14,7 +14,51 @@
1414
this.deserializeInternal(internalTag, map);
1515
} catch (IOException ex) {
1616
LOGGER.error("Failed to read internal tag from object", ex);
17-
@@ -812,6 +_,18 @@
17+
@@ -762,23 +_,26 @@
18+
ByteArrayInputStream buf = new ByteArrayInputStream(Base64.getDecoder().decode(unhandled));
19+
try {
20+
CompoundTag unhandledTag = NbtIo.readCompressed(buf, NbtAccounter.unlimitedHeap());
21+
- DataComponentPatch unhandledPatch = DataComponentPatch.CODEC.parse(CraftRegistry.getMinecraftRegistry().createSerializationContext(NbtOps.INSTANCE), unhandledTag).result().get();
22+
-
23+
- CraftMetaItem.getOrEmpty(unhandledPatch, CraftMetaItem.CAN_PLACE_ON).ifPresent(data -> {
24+
- this.canPlaceOnPredicates = List.copyOf(data.predicates);
25+
- });
26+
- CraftMetaItem.getOrEmpty(unhandledPatch, CraftMetaItem.CAN_BREAK).ifPresent(data -> {
27+
- this.canBreakPredicates = List.copyOf(data.predicates);
28+
- });
29+
- this.unhandledTags.copy(unhandledPatch.forget(type -> type == CraftMetaItem.CAN_PLACE_ON.TYPE || type == CraftMetaItem.CAN_BREAK.TYPE));
30+
-
31+
- for (Entry<DataComponentType<?>, Optional<?>> entry : unhandledPatch.entrySet()) {
32+
- // Move removed unhandled tags to dedicated removedTags
33+
- if (entry.getValue().isEmpty()) {
34+
- DataComponentType<?> key = entry.getKey();
35+
-
36+
- this.unhandledTags.clear(key);
37+
- this.removedTags.add(key);
38+
+ Optional<DataComponentPatch> unhandledPatchOptional = DataComponentPatch.CODEC.parse(CraftRegistry.getMinecraftRegistry().createSerializationContext(NbtOps.INSTANCE), unhandledTag).result();
39+
+ if (unhandledPatchOptional.isPresent()) {
40+
+ DataComponentPatch unhandledPatch = unhandledPatchOptional.get();
41+
+
42+
+ CraftMetaItem.getOrEmpty(unhandledPatch, CraftMetaItem.CAN_PLACE_ON).ifPresent(data -> {
43+
+ this.canPlaceOnPredicates = List.copyOf(data.predicates);
44+
+ });
45+
+ CraftMetaItem.getOrEmpty(unhandledPatch, CraftMetaItem.CAN_BREAK).ifPresent(data -> {
46+
+ this.canBreakPredicates = List.copyOf(data.predicates);
47+
+ });
48+
+ this.unhandledTags.copy(unhandledPatch.forget(type -> type == CraftMetaItem.CAN_PLACE_ON.TYPE || type == CraftMetaItem.CAN_BREAK.TYPE));
49+
+
50+
+ for (Entry<DataComponentType<?>, Optional<?>> entry : unhandledPatch.entrySet()) {
51+
+ // Move removed unhandled tags to dedicated removedTags
52+
+ if (entry.getValue().isEmpty()) {
53+
+ DataComponentType<?> key = entry.getKey();
54+
+
55+
+ this.unhandledTags.clear(key);
56+
+ this.removedTags.add(key);
57+
+ }
58+
}
59+
}
60+
} catch (IOException ex) {
61+
@@ -813,6 +_,18 @@
1862
this.customTag = NbtIo.readCompressed(buf, NbtAccounter.unlimitedHeap());
1963
} catch (IOException ex) {
2064
LOGGER.error("Failed to read custom tag for item", ex);

0 commit comments

Comments
 (0)