當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。