1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-02-03 13:27:23 +01:00

Fix compile issue in MinecraftServer

This commit is contained in:
Bjarne Koll 2024-12-14 05:48:25 +01:00
parent f25c1a33a0
commit afa25753de
No known key found for this signature in database
GPG key ID: 9576DAF3FDDB088F
3 changed files with 11 additions and 15 deletions
paper-server/patches/sources/net/minecraft

View file

@ -1220,7 +1220,7 @@
}
@Nullable
@@ -1980,23 +_,29 @@
@@ -1980,16 +_,22 @@
}
public void logChatMessage(Component content, ChatType.Bound boundChatType, @Nullable String header) {
@ -1247,14 +1247,6 @@
}
public boolean logIPs() {
return true;
}
- public void subscribeToDebugSample(ServerPlayer player, RemoteDebugSampleType sampleType) {
+ public void subscribeToDebugSample(ServerPlaye player, RemoteDebugSampleType sampleType) {
}
public boolean acceptsTransfers() {
@@ -2122,4 +_,53 @@
};
}

View file

@ -21,8 +21,8 @@
+ this.onClose(level, blockPos, blockState);
+ }
+
+ public void openerAPICountChanged(Level world, BlockPos blockPos, BlockState blockState, int count, int openCount) {
+ this.openerCountChanged(world, blockPos, blockState, count, openCount);
+ public void openerAPICountChanged(Level level, BlockPos blockPos, BlockState blockState, int count, int openCount) {
+ this.openerCountChanged(level, blockPos, blockState, count, openCount);
+ }
+ // CraftBukkit en
+

View file

@ -54,15 +54,19 @@
}
@Override
@@ -147,9 +_,14 @@
@@ -145,11 +_,16 @@
}
@VisibleForTesting
public void setSongItemWithoutPlaying(ItemStack stack) {
- public void setSongItemWithoutPlaying(ItemStack stack) {
+ public void setSongItemWithoutPlaying(ItemStack stack, final long ticksSinceSongStarted) { // CraftBukkit - passed ticks since song started
this.item = stack;
- JukeboxSong.fromStack(this.level.registryAccess(), stack)
- .ifPresent(holder -> this.jukeboxSongPlayer.setSongWithoutPlaying((Holder<JukeboxSong>)holder, 0L));
- this.level.updateNeighborsAt(this.getBlockPos(), this.getBlockState().getBlock());
+ this.jukeboxSongPlayer.song = null; // CraftBukkit - reset
+ JukeboxSong.fromStack(this.level != null ? this.level.registryAccess() : org.bukkit.craftbukkit.CraftRegistry.getMinecraftRegistry(), stack) // Paper - fallback to other RegistyrAccess if no level
.ifPresent(holder -> this.jukeboxSongPlayer.setSongWithoutPlaying((Holder<JukeboxSong>)holder, 0L));
- this.level.updateNeighborsAt(this.getBlockPos(), this.getBlockState().getBlock());
+ .ifPresent(holder -> this.jukeboxSongPlayer.setSongWithoutPlaying((Holder<JukeboxSong>)holder, ticksSinceSongStarted)); // CraftBukkit - passed ticks since song started
+ // CraftBukkit start - add null check for level
+ if (this.level != null) {
+ this.level.updateNeighborsAt(this.getBlockPos(), this.getBlockState().getBlock());