當前位置: 首頁>>代碼示例>>Java>>正文


Java Location.getBlockZ方法代碼示例

本文整理匯總了Java中org.spongepowered.api.world.Location.getBlockZ方法的典型用法代碼示例。如果您正苦於以下問題:Java Location.getBlockZ方法的具體用法?Java Location.getBlockZ怎麽用?Java Location.getBlockZ使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.spongepowered.api.world.Location的用法示例。


在下文中一共展示了Location.getBlockZ方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: isInside

import org.spongepowered.api.world.Location; //導入方法依賴的package包/類
public boolean isInside(Location<World> loc)
{
	Rect extr = extrema.get(loc.getExtent().getUniqueId());
	Vector2i p = new Vector2i(loc.getBlockX(), loc.getBlockZ());
	if (p.getX() < extr.getMinX() || p.getX() > extr.getMaxX() || p.getY() < extr.getMinY() || p.getY() > extr.getMaxY())
	{
		return false;
	}
	for (Rect r : rects)
	{
		if (r.isInside(p))
		{
			return true;
		}
	}
	return false;
}
 
開發者ID:Arckenver,項目名稱:Nations,代碼行數:18,代碼來源:Region.java

示例2: onOpened

import org.spongepowered.api.world.Location; //導入方法依賴的package包/類
@Listener
public void onOpened(PlayerOpenedCrateEvent event) {
    Player player = event.getPlayer();
    Manager manager = event.getManager();
    Drop drop = event.getDrop();
    if (manager.isSendOpenMessage()) {
        Optional<String> optional_custom_open_message = manager.getCustomOpenMessage();
        if (optional_custom_open_message.isPresent()) {
            player.sendMessage(TextSerializers.FORMATTING_CODE.
                    deserialize(optional_custom_open_message.get().
                            replace("%MANAGER%", manager.getName())));
        } else {
            player.sendMessage(LanguageUtils.getText("SUCCESSFULLY_OPENED_MANAGER",
                    new Pair<String, String>("%MANAGER%", manager.getName())));
        }
    }
    if (GWMCrates.getInstance().isLogOpenedCrates()) {
        try {
            String time = LocalTime.now().withNano(0).format(DateTimeFormatter.ISO_LOCAL_TIME);
            String player_name = player.getName();
            String player_uuid = player.getUniqueId().toString();
            String manager_name = manager.getName();
            String manager_id = manager.getId();
            String drop_name = drop == null ? "null" : drop.getId().orElse("Unknown ID");
            Location<World> location = player.getLocation();
            String player_location = location.getExtent().getName() + ' ' + location.getBlockX() + ' ' + location.getBlockY() + ' ' + location.getBlockZ();
            LOG_FILE_WRITER.write(LanguageUtils.getPhrase("CRATE_OPENING_LOG_MESSAGE",
                    new Pair("%TIME%", time),
                    new Pair("%PLAYER%", player_name),
                    new Pair("%PLAYER_UUID%", player_uuid),
                    new Pair("%MANAGER_NAME%", manager_name),
                    new Pair("%MANAGER_ID%", manager_id),
                    new Pair("%DROP%", drop_name),
                    new Pair("%LOCATION%", player_location)) + '\n');
            LOG_FILE_WRITER.flush();
        } catch (Exception e) {
            GWMCrates.getInstance().getLogger().warn("Exception logging crate opening!", e);
        }
    }
}
 
開發者ID:GreWeMa,項目名稱:gwm_Crates,代碼行數:41,代碼來源:DebugCrateListener.java

示例3: isLocationChanged

import org.spongepowered.api.world.Location; //導入方法依賴的package包/類
public static boolean isLocationChanged(Transform<World> from, Transform<World> to, boolean y_sensitive) {
    Location<World> location_from = from.getLocation();
    Location<World> location_to = to.getLocation();
    int x_from = location_from.getBlockX();
    int y_from = location_from.getBlockY();
    int z_from = location_from.getBlockZ();
    int x_to = location_to.getBlockX();
    int y_to = location_to.getBlockY();
    int z_to = location_to.getBlockZ();
    return x_from != x_to || z_from != z_to || (y_sensitive && y_from != y_to);
}
 
開發者ID:GreWeMa,項目名稱:gwm_Crates,代碼行數:12,代碼來源:Utils.java

示例4: getZone

import org.spongepowered.api.world.Location; //導入方法依賴的package包/類
public Zone getZone(Location<World> loc)
{
	Vector2i p = new Vector2i(loc.getBlockX(), loc.getBlockZ());
	for (Zone zone : zones.values())
	{
		if (zone.getRect().isInside(p))
		{
			return zone;
		}
	}
	return null;
}
 
開發者ID:Arckenver,項目名稱:Nations,代碼行數:13,代碼來源:Nation.java

示例5: isFor

import org.spongepowered.api.world.Location; //導入方法依賴的package包/類
public boolean isFor(Location<World> location) {
    return this.location.getBlockX() == location.getBlockX() && this.location.getBlockY() == location.getBlockY() && this.location.getBlockZ() == location.getBlockZ();
}
 
開發者ID:MinecraftMarket,項目名稱:MinecraftMarket-Plugin,代碼行數:4,代碼來源:SignsConfig.java

示例6: Kit

import org.spongepowered.api.world.Location; //導入方法依賴的package包/類
public Kit(String name, Location<World> block) {
	super(name, block.getExtent().getName(), block.getBlockX(), block.getBlockY(), block.getBlockZ(), 0, Collections.emptyList());
}
 
開發者ID:KaiKikuchi,項目名稱:BetterKits,代碼行數:4,代碼來源:Kit.java

示例7: setLoc

import org.spongepowered.api.world.Location; //導入方法依賴的package包/類
public void setLoc(Location<World> loc) {
	this.loc = new Location<World>(loc.getExtent(), loc.getBlockX()+0.5, loc.getY(), loc.getBlockZ()+0.5);
}
 
開發者ID:DosMike,項目名稱:VillagerShops,代碼行數:4,代碼來源:NPCguard.java

示例8: getLocationString

import org.spongepowered.api.world.Location; //導入方法依賴的package包/類
public static String getLocationString(Location<World> location) {
    return "(" + location.getBlockX() + "," + location.getBlockY() + "," + location.getBlockZ() + ")";
}
 
開發者ID:ichorpowered,項目名稱:latch,代碼行數:4,代碼來源:LatchUtils.java


注:本文中的org.spongepowered.api.world.Location.getBlockZ方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。