Update to Minecraft 1.19.3

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2022-12-08 03:00:00 +11:00
parent a13136ada2
commit 8b26bb8f3e
305 changed files with 3331 additions and 2864 deletions

View File

@@ -1,7 +1,7 @@
package org.bukkit.craftbukkit;
import com.google.common.base.Preconditions;
import net.minecraft.core.IRegistry;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.MinecraftKey;
import net.minecraft.sounds.SoundEffect;
import org.bukkit.Registry;
@@ -11,20 +11,20 @@ import org.bukkit.craftbukkit.util.CraftNamespacedKey;
public class CraftSound {
public static SoundEffect getSoundEffect(String s) {
SoundEffect effect = IRegistry.SOUND_EVENT.get(new MinecraftKey(s));
SoundEffect effect = BuiltInRegistries.SOUND_EVENT.get(new MinecraftKey(s));
Preconditions.checkArgument(effect != null, "Sound effect %s does not exist", s);
return effect;
}
public static SoundEffect getSoundEffect(Sound s) {
SoundEffect effect = IRegistry.SOUND_EVENT.get(CraftNamespacedKey.toMinecraft(s.getKey()));
SoundEffect effect = BuiltInRegistries.SOUND_EVENT.get(CraftNamespacedKey.toMinecraft(s.getKey()));
Preconditions.checkArgument(effect != null, "Sound effect %s does not exist", s);
return effect;
}
public static Sound getBukkit(SoundEffect soundEffect) {
return Registry.SOUNDS.get(CraftNamespacedKey.fromMinecraft(IRegistry.SOUND_EVENT.getKey(soundEffect)));
return Registry.SOUNDS.get(CraftNamespacedKey.fromMinecraft(BuiltInRegistries.SOUND_EVENT.getKey(soundEffect)));
}
}