Added full tile entity data support for all block types that use it, including chests, dispensers, furnaces, mob spawners, and note blocks.

This commit is contained in:
sk89q
2011-01-23 00:37:10 -08:00
parent e0b04001aa
commit 9cd81ddd6d
7 changed files with 335 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
package org.bukkit.craftbukkit.block;
import net.minecraft.server.TileEntityNote;
import org.bukkit.block.Block;
import org.bukkit.block.NoteBlock;
import org.bukkit.craftbukkit.CraftWorld;
/**
* Represents a note block.
*
* @author sk89q
*/
public class CraftNoteBlock extends CraftBlockState implements NoteBlock {
private final CraftWorld world;
private final TileEntityNote note;
public CraftNoteBlock(final Block block) {
super(block);
world = (CraftWorld)block.getWorld();
note = (TileEntityNote)world.getTileEntityAt(getX(), getY(), getZ());
}
public byte getNote() {
return note.e;
}
public void setNote(byte n) {
note.e = n;
}
}