本文整理匯總了Java中org.bukkit.entity.ItemFrame.remove方法的典型用法代碼示例。如果您正苦於以下問題:Java ItemFrame.remove方法的具體用法?Java ItemFrame.remove怎麽用?Java ItemFrame.remove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.bukkit.entity.ItemFrame
的用法示例。
在下文中一共展示了ItemFrame.remove方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: placePoster
import org.bukkit.entity.ItemFrame; //導入方法依賴的package包/類
private void placePoster(List<ItemStack> maps, int width, int height, final Block topLeftBlock, final BlockFace facing) {
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
Block block = Util.getRelative(topLeftBlock, facing, -y, x, 0);
for (ItemFrame entity : block.getWorld().getEntitiesByClass(ItemFrame.class)) {
if (entity.getLocation().getBlock().getRelative(entity.getAttachedFace()).getLocation().equals(block.getLocation())) {
entity.teleport(new Location(entity.getWorld(), 0, -1, 0)); //workaround so that respawning an item frame immediately works
entity.remove();
break;
}
}
final ItemStack map = maps.get(y * width + x);
ItemMeta meta = map.getItemMeta();
meta.setDisplayName("");
map.setItemMeta(meta);
Util.attachItemFrame(Util.getRelative(topLeftBlock, facing, -y, x, 0), map, facing);
}
}
propagateMaps(maps, topLeftBlock.getLocation());
}
示例2: setFrame
import org.bukkit.entity.ItemFrame; //導入方法依賴的package包/類
public ItemFrame setFrame(FrameInfo.Frame type, ItemFrame frame) {
// If we've got an existing frame of that type, remove it.
FrameInfo info = frames.get(type);
if (info != null) {
// Remove the existing frame if it's not this frame.
ItemFrame old = info.getFrame(true);
if (old.equals(frame))
return frame;
old.remove();
frames.remove(type);
}
// Create the new info and store it.
info = new FrameInfo(type, frame);
frames.put(type, info);
frameIDs.put(info.id, info);
plugin.getManager().addFrame(this, frame);
return frame;
}