13
0
geforkt von Mirrors/Paper

Fix compile issue in MinecraftServer

Dieser Commit ist enthalten in:
Bjarne Koll 2024-12-14 05:48:25 +01:00
Ursprung f25c1a33a0
Commit afa25753de
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 9576DAF3FDDB088F
3 geänderte Dateien mit 11 neuen und 15 gelöschten Zeilen

Datei anzeigen

@ -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 @@
};
}

Datei anzeigen

@ -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
+

Datei anzeigen

@ -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());