本文整理匯總了Java中org.bukkit.Material.STANDING_BANNER屬性的典型用法代碼示例。如果您正苦於以下問題:Java Material.STANDING_BANNER屬性的具體用法?Java Material.STANDING_BANNER怎麽用?Java Material.STANDING_BANNER使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.bukkit.Material
的用法示例。
在下文中一共展示了Material.STANDING_BANNER屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: placeBlock
@Override
public boolean placeBlock(ArmorStand e, Player p) {
//e.setHelmet(new ItemStack(Material.STONE, 1));
if (e.getWorld().getBlockAt(e.getLocation()).getType() != Material.STANDING_BANNER) {
p.sendMessage(ChatColor.RED + "Please place down a banner first!");
e.remove();
}
else {
e.setCustomName("flag");
p.sendMessage(ChatColor.GREEN + "Flag placed");
}
return true;
}
示例2: Uncarried
public Uncarried(Flag flag, Post post, @Nullable Location location) {
super(flag, post);
if(location == null) location = flag.getReturnPoint(post);
this.location = new Location(location.getWorld(),
location.getBlockX() + 0.5,
location.getBlockY(),
location.getBlockZ() + 0.5,
location.getYaw(),
location.getPitch());
if(!flag.getMatch().getWorld().equals(this.location.getWorld())) {
throw new IllegalStateException("Tried to place flag in the wrong world");
}
Block block = this.location.getBlock();
if(block.getType() == Material.STANDING_BANNER) {
// Banner may already be here at match start
this.oldBlock = BlockStateUtils.cloneWithMaterial(block, Material.AIR);
} else {
this.oldBlock = block.getState();
}
this.oldBase = block.getRelative(BlockFace.DOWN).getState();
}
示例3: convert
@Override
public ItemStack convert(Block block) {
if (block.getType() == Material.STANDING_BANNER || block.getType() == Material.WALL_BANNER) {
Banner banner = (Banner) block.getState();
ItemStack item = new ItemStack(Material.BANNER);
BannerMeta meta = (BannerMeta) item.getItemMeta();
meta.setPatterns(banner.getPatterns());
meta.setBaseColor(banner.getBaseColor());
item.setItemMeta(meta);
return item;
}
return null;
}
示例4: get
@Nullable
@Override
protected Pattern[] get(Event e) {
Block b = block.getSingle(e);
if (b == null) {
return null;
}
if (b.getType() == Material.STANDING_BANNER || b.getType() == Material.WALL_BANNER) {
return ((Banner) b.getState()).getPatterns().stream().toArray(Pattern[]::new);
}
return null;
}