46 lines
1.1 KiB
Java
46 lines
1.1 KiB
Java
package net.minecraft.server;
|
|
|
|
public abstract class TileEntityContainer extends TileEntity implements ITileInventory {
|
|
|
|
private ChestLock a;
|
|
|
|
protected TileEntityContainer(TileEntityTypes<?> tileentitytypes) {
|
|
super(tileentitytypes);
|
|
this.a = ChestLock.a;
|
|
}
|
|
|
|
public void load(NBTTagCompound nbttagcompound) {
|
|
super.load(nbttagcompound);
|
|
this.a = ChestLock.b(nbttagcompound);
|
|
}
|
|
|
|
public NBTTagCompound save(NBTTagCompound nbttagcompound) {
|
|
super.save(nbttagcompound);
|
|
if (this.a != null) {
|
|
this.a.a(nbttagcompound);
|
|
}
|
|
|
|
return nbttagcompound;
|
|
}
|
|
|
|
public boolean isLocked() {
|
|
return this.a != null && !this.a.a();
|
|
}
|
|
|
|
public ChestLock getLock() {
|
|
return this.a;
|
|
}
|
|
|
|
public void setLock(ChestLock chestlock) {
|
|
this.a = chestlock;
|
|
}
|
|
|
|
// CraftBukkit start
|
|
@Override
|
|
public org.bukkit.Location getLocation() {
|
|
if (world == null) return null;
|
|
return new org.bukkit.Location(world.getWorld(), position.getX(), position.getY(), position.getZ());
|
|
}
|
|
// CraftBukkit end
|
|
}
|