Skip to content

Commit 8ad567c

Browse files
committed
fix build
1 parent 5d5df93 commit 8ad567c

File tree

8 files changed

+36
-14
lines changed

8 files changed

+36
-14
lines changed

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
group=gg.projecteden.parchment
22
version=1.21.11-R0.1-SNAPSHOT
33
mcVersion=1.21.11
4+
apiVersion=1.21.11
45
paperRef=4446f17f652d3ce56860f8c06d6746fa3c1853fc
56

67
org.gradle.configuration-cache=true

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
+ entity == null ? null : entity.getBukkitEntity(),
3030
+ net.kyori.adventure.sound.Sound.sound()
3131
+ .type(sound.unwrap().<net.kyori.adventure.key.Key>map(
32-
+ key -> io.papermc.paper.adventure.PaperAdventure.asAdventure(key.location()),
32+
+ key -> io.papermc.paper.adventure.PaperAdventure.asAdventure(key.identifier()),
3333
+ soundEvent -> io.papermc.paper.adventure.PaperAdventure.asAdventure(soundEvent.location())
3434
+ ))
3535
+ .source(io.papermc.paper.adventure.PaperAdventure.asAdventure(source))
@@ -64,7 +64,7 @@
6464
+ entity == null ? null : entity.getBukkitEntity(),
6565
+ net.kyori.adventure.sound.Sound.sound()
6666
+ .type(sound.unwrap().<net.kyori.adventure.key.Key>map(
67-
+ key -> io.papermc.paper.adventure.PaperAdventure.asAdventure(key.location()),
67+
+ key -> io.papermc.paper.adventure.PaperAdventure.asAdventure(key.identifier()),
6868
+ soundEvent -> io.papermc.paper.adventure.PaperAdventure.asAdventure(soundEvent.location())
6969
+ ))
7070
+ .source(io.papermc.paper.adventure.PaperAdventure.asAdventure(source))

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
@@ -22,7 +22,7 @@
2222
+ null,
2323
+ net.kyori.adventure.sound.Sound.sound()
2424
+ .type(SoundEvents.RESPAWN_ANCHOR_DEPLETE.unwrap().<net.kyori.adventure.key.Key>map(
25-
+ key -> io.papermc.paper.adventure.PaperAdventure.asAdventure(key.location()),
25+
+ key -> io.papermc.paper.adventure.PaperAdventure.asAdventure(key.identifier()),
2626
+ soundEvent -> io.papermc.paper.adventure.PaperAdventure.asAdventure(soundEvent.location())
2727
+ ))
2828
+ .source(io.papermc.paper.adventure.PaperAdventure.asAdventure(SoundSource.BLOCKS))

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
+
1818
+ @Override
1919
+ public void tick() {
20-
+ if (tick && !this.level().isClientSide) { // Parchment
20+
+ if (tick && !this.level().isClientSide()) { // Parchment
2121
+ this.checkBelowWorld();
2222
+ if (this.checkInterval++ == this.level().spigotConfig.hangingTickFrequency) { // Spigot
2323
+ this.checkInterval = 0;
@@ -41,7 +41,7 @@
4141
+ }
4242
+ // CraftBukkit end
4343
+ this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DROP); // CraftBukkit - add Bukkit remove cause
44-
+ this.dropItem((ServerLevel) this.level(), (Entity) null);
44+
+ this.dropItem((ServerLevel) this.level(), null);
4545
+ }
4646
+ }
4747
+ }
Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
11
--- a/net/minecraft/world/entity/raid/Raid.java
22
+++ b/net/minecraft/world/entity/raid/Raid.java
3-
@@ -531,8 +_,7 @@
3+
@@ -531,8 +_,21 @@
44
double d = vec3.x + 13.0 / squareRoot * (vec31.x - vec3.x);
55
double d1 = vec3.z + 13.0 / squareRoot * (vec31.z - vec3.z);
66
if (squareRoot <= 64.0 || players.contains(serverPlayer)) {
77
- serverPlayer.connection
88
- .send(new ClientboundSoundPacket(SoundEvents.RAID_HORN, SoundSource.NEUTRAL, d, serverPlayer.getY(), d1, 64.0F, 1.0F, randomLong));
9-
+ serverPlayer.playNotifySound(SoundEvents.RAID_HORN.value(), SoundSource.NEUTRAL, 64.0F, 1.0F); // Parchment - use existing play sound method
9+
+ org.bukkit.craftbukkit.event.CraftEventFactory.playSoundEvent(new gg.projecteden.parchment.event.sound.SoundEvent(
10+
+ null,
11+
+ net.kyori.adventure.sound.Sound.sound()
12+
+ .type(SoundEvents.RAID_HORN.unwrap().<net.kyori.adventure.key.Key>map(
13+
+ key -> io.papermc.paper.adventure.PaperAdventure.asAdventure(key.identifier()),
14+
+ soundEvent -> io.papermc.paper.adventure.PaperAdventure.asAdventure(soundEvent.location())
15+
+ ))
16+
+ .source(io.papermc.paper.adventure.PaperAdventure.asAdventure(SoundSource.NEUTRAL))
17+
+ .volume(64.0f)
18+
+ .pitch(1.0f)
19+
+ .build(),
20+
+ gg.projecteden.parchment.event.sound.ParchmentSoundEvent.createEmitter(level, pos.getX(), pos.getY(), pos.getZ()),
21+
+ gg.projecteden.parchment.event.sound.ParchmentSoundEvent.DISTANCE_FUNCTION,
22+
+ null
23+
+ ));
1024
}
1125
}
1226
}

parchment-server/minecraft-patches/sources/net/minecraft/world/level/block/RespawnAnchorBlock.java.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
+ result = gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent.RespawnAnchorResult.CHARGE;
1515
+ } else if (state.getValue(CHARGE) == 0) {
1616
+ result = gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent.RespawnAnchorResult.NOTHING;
17-
+ } else if (!canSetSpawn(level) && !level.isClientSide) {
17+
+ } else if (level instanceof ServerLevel serverLevel && !canSetSpawn(serverLevel, pos) && !level.isClientSide()) {
1818
+ result = gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent.RespawnAnchorResult.EXPLODE;
19-
+ } else if (!level.isClientSide) {
19+
+ } else if (!level.isClientSide()) {
2020
+ result = gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent.RespawnAnchorResult.SET_SPAWN;
2121
+ } else {
2222
+ return InteractionResult.SUCCESS;

parchment-server/paper-patches/files/src/main/java/io/papermc/paper/adventure/PaperAdventure.java.patch

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
--- a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
22
+++ b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
3-
@@ -467,5 +_,38 @@
4-
return AdventureCodecs.STYLE_MAP_CODEC.codec()
3+
@@ -468,4 +_,37 @@
54
.parse(ops, encoded).getOrThrow(IllegalStateException::new);
65
}
7-
+
6+
87
+
98
+ // Parchment start
109
+ public static net.kyori.adventure.sound.Sound.Source asAdventure(final SoundSource source) {
@@ -37,5 +36,5 @@
3736
+
3837
+ // Parchment end
3938
+
40-
39+
+
4140
}

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
22
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
3+
@@ -28,6 +_,7 @@
4+
import net.minecraft.network.Connection;
5+
import net.minecraft.network.chat.Component;
6+
import net.minecraft.network.protocol.game.ServerboundContainerClosePacket;
7+
+import net.minecraft.resources.Identifier;
8+
import net.minecraft.server.MinecraftServer;
9+
import net.minecraft.server.level.ServerLevel;
10+
import net.minecraft.server.level.ServerPlayer;
311
@@ -1181,7 +_,7 @@
412
}
513

@@ -17,7 +25,7 @@
1725
+ // Parchment start
1826
+ private static net.minecraft.network.protocol.@org.jetbrains.annotations.NotNull Packet<net.minecraft.network.protocol.game.ClientGamePacketListener> handleSoundEvent(gg.projecteden.parchment.event.sound.SoundEvent event, CraftPlayer recipient) {
1927
+ net.kyori.adventure.sound.Sound sound = event.calculateSound(recipient);
20-
+ ResourceLocation name = io.papermc.paper.adventure.PaperAdventure.asVanilla(sound.name());
28+
+ Identifier name = io.papermc.paper.adventure.PaperAdventure.asVanilla(sound.name());
2129
+ gg.projecteden.parchment.event.sound.SoundEvent.Emitter emitter = event.calculateEmitter(recipient);
2230
+ net.minecraft.sounds.SoundSource source = io.papermc.paper.adventure.PaperAdventure.asVanilla(sound.source());
2331
+ float volume = sound.volume();

0 commit comments

Comments
 (0)