#1125: Add support for NoteBlock sounds in Skulls
By: Doc <nachito94@msn.com>
This commit is contained in:
@@ -2,9 +2,11 @@ package org.bukkit.craftbukkit.block;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import net.minecraft.resources.MinecraftKey;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.world.level.block.entity.TileEntitySkull;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.SkullType;
|
||||
import org.bukkit.World;
|
||||
@@ -15,7 +17,9 @@ import org.bukkit.block.data.Directional;
|
||||
import org.bukkit.block.data.Rotatable;
|
||||
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.profile.CraftPlayerProfile;
|
||||
import org.bukkit.craftbukkit.util.CraftNamespacedKey;
|
||||
import org.bukkit.profile.PlayerProfile;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class CraftSkull extends CraftBlockEntityState<TileEntitySkull> implements Skull {
|
||||
|
||||
@@ -120,6 +124,21 @@ public class CraftSkull extends CraftBlockEntityState<TileEntitySkull> implement
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public NamespacedKey getNoteBlockSound() {
|
||||
MinecraftKey key = getSnapshot().getNoteBlockSound();
|
||||
return (key != null) ? CraftNamespacedKey.fromMinecraft(key) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNoteBlockSound(@Nullable NamespacedKey namespacedKey) {
|
||||
if (namespacedKey == null) {
|
||||
this.getSnapshot().noteBlockSound = null;
|
||||
return;
|
||||
}
|
||||
this.getSnapshot().noteBlockSound = CraftNamespacedKey.toMinecraft(namespacedKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockFace getRotation() {
|
||||
BlockData blockData = getBlockData();
|
||||
|
||||
Reference in New Issue
Block a user