blob: c75b102417d98ebb7d3efb0c98112f3e54810a2d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
package org.bukkit.craftbukkit.block;
import net.minecraft.server.TileEntityLootable;
import org.bukkit.Material;
import org.bukkit.Nameable;
import org.bukkit.block.Block;
import org.bukkit.craftbukkit.CraftWorld;
public class CraftLootable extends CraftContainer implements Nameable {
private final TileEntityLootable te;
public CraftLootable(Block block) {
super(block);
te = (TileEntityLootable) ((CraftWorld) block.getWorld()).getTileEntityAt(getX(), getY(), getZ());
}
public CraftLootable(Material material, TileEntityLootable tileEntity) {
super(material, tileEntity);
te = tileEntity;
}
@Override
public String getCustomName() {
return te.hasCustomName() ? te.getName() : null;
}
@Override
public void setCustomName(String name) {
te.setCustomName(name);
}
}
|