当前位置: 首页>>代码示例>>Java>>正文


Java Material.STANDING_BANNER属性代码示例

本文整理汇总了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;
}
 
开发者ID:GigaGamma,项目名称:SuperiorCraft,代码行数:17,代码来源:Flag.java

示例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();
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:23,代码来源:Uncarried.java

示例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;
}
 
开发者ID:Syst3ms,项目名称:QuarSK,代码行数:13,代码来源:ExprItemOfBannerBlock.java

示例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;
}
 
开发者ID:Syst3ms,项目名称:QuarSK,代码行数:12,代码来源:SExprBannerBlockLayers.java


注:本文中的org.bukkit.Material.STANDING_BANNER属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。