Remap CraftBukkit to Mojang+Yarn Mappings

By: Initial Source <noreply+automated@papermc.io>
This commit is contained in:
CraftBukkit/Spigot
2024-12-11 22:26:55 +01:00
parent a265d64138
commit 30e4583dbe
1780 changed files with 44628 additions and 41274 deletions

View File

@@ -2,7 +2,6 @@ package org.bukkit.craftbukkit;
import com.google.common.base.Preconditions;
import net.minecraft.core.Holder;
import net.minecraft.core.IRegistry;
import net.minecraft.core.registries.Registries;
import net.minecraft.world.item.Instrument;
import org.bukkit.MusicInstrument;
@@ -18,7 +17,7 @@ public class CraftMusicInstrument extends MusicInstrument implements Handleable<
}
public static MusicInstrument minecraftHolderToBukkit(Holder<Instrument> minecraft) {
return minecraftToBukkit(minecraft.value());
return CraftMusicInstrument.minecraftToBukkit(minecraft.value());
}
public static Instrument bukkitToMinecraft(MusicInstrument bukkit) {
@@ -28,9 +27,9 @@ public class CraftMusicInstrument extends MusicInstrument implements Handleable<
public static Holder<Instrument> bukkitToMinecraftHolder(MusicInstrument bukkit) {
Preconditions.checkArgument(bukkit != null);
IRegistry<Instrument> registry = CraftRegistry.getMinecraftRegistry(Registries.INSTRUMENT);
net.minecraft.core.Registry<Instrument> registry = CraftRegistry.getMinecraftRegistry(Registries.INSTRUMENT);
if (registry.wrapAsHolder(bukkitToMinecraft(bukkit)) instanceof Holder.c<Instrument> holder) {
if (registry.wrapAsHolder(CraftMusicInstrument.bukkitToMinecraft(bukkit)) instanceof Holder.Reference<Instrument> holder) {
return holder;
}
@@ -60,13 +59,13 @@ public class CraftMusicInstrument extends MusicInstrument implements Handleable<
@Override
public Instrument getHandle() {
return handle;
return this.handle;
}
@NotNull
@Override
public NamespacedKey getKey() {
return key;
return this.key;
}
@Override
@@ -79,16 +78,16 @@ public class CraftMusicInstrument extends MusicInstrument implements Handleable<
return false;
}
return getKey().equals(((MusicInstrument) other).getKey());
return this.getKey().equals(((MusicInstrument) other).getKey());
}
@Override
public int hashCode() {
return getKey().hashCode();
return this.getKey().hashCode();
}
@Override
public String toString() {
return "CraftMusicInstrument{key=" + key + "}";
return "CraftMusicInstrument{key=" + this.key + "}";
}
}