下面列出了org.bukkit.craftbukkit.CraftWorld#getTileEntityAt ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
public CraftCommandBlock(Block block) {
super(block);
CraftWorld world = (CraftWorld) block.getWorld();
commandBlock = (TileEntityCommandBlock) world.getTileEntityAt(getX(), getY(), getZ());
command = commandBlock.func_145993_a().field_145763_e;
name = commandBlock.func_145993_a().getCommandSenderName();
}
public CraftSign(final Block block) {
super(block);
CraftWorld world = (CraftWorld) block.getWorld();
sign = (net.minecraft.tileentity.TileEntitySign) world.getTileEntityAt(getX(), getY(), getZ());
// Spigot start
if (sign == null) {
lines = new String[]{"", "", "", ""};
return;
}
// Spigot end
lines = new String[sign.signText.length];
System.arraycopy(sign.signText, 0, lines, 0, lines.length);
}
public CraftSkull(final Block block) {
super(block);
CraftWorld world = (CraftWorld) block.getWorld();
skull = (TileEntitySkull) world.getTileEntityAt(getX(), getY(), getZ());
profile = skull.func_152108_a();
skullType = getSkullType(skull.func_145904_a());
rotation = (byte) skull.getRotation();
}
public CraftCustomContainer(Block block) {
super(block);
world = (CraftWorld) block.getWorld();
container = (IInventory) world.getTileEntityAt(getX(), getY(), getZ());
}
public CraftJukebox(final Block block) {
super(block);
world = (CraftWorld) block.getWorld();
jukebox = (TileEntityJukebox) world.getTileEntityAt(getX(), getY(), getZ());
}
public CraftNoteBlock(final Block block) {
super(block);
world = (CraftWorld) block.getWorld();
note = (TileEntityNote) world.getTileEntityAt(getX(), getY(), getZ());
}
public CraftDropper(final Block block) {
super(block);
world = (CraftWorld) block.getWorld();
dropper = (TileEntityDropper) world.getTileEntityAt(getX(), getY(), getZ());
}
public CraftDispenser(final Block block) {
super(block);
world = (CraftWorld) block.getWorld();
dispenser = (TileEntityDispenser) world.getTileEntityAt(getX(), getY(), getZ());
}
public CraftBeacon(final Block block) {
super(block);
world = (CraftWorld) block.getWorld();
beacon = (TileEntityBeacon) world.getTileEntityAt(getX(), getY(), getZ());
}
public CraftChest(final Block block) {
super(block);
world = (CraftWorld) block.getWorld();
chest = (TileEntityChest) world.getTileEntityAt(getX(), getY(), getZ());
}
public CraftCustomContainer(Block block) {
super(block);
world = (CraftWorld) block.getWorld();
container = (IInventory)world.getTileEntityAt(getX(), getY(), getZ());
}