本文整理汇总了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;
}