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


Java Vector.toBlockVector方法代碼示例

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


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

示例1: execute

import com.sk89q.worldedit.Vector; //導入方法依賴的package包/類
protected void execute(Event event) {
	String name = (String) this.name.getSingle(event);
	Location loc1 = (Location) this.loc1.getSingle(event);
	Location loc2 = (Location) this.loc2.getSingle(event);
	World world = (World) this.world.getSingle(event);

	int x1 = loc1.getBlockX();
	int y1 = loc1.getBlockY();
	int z1 = loc1.getBlockZ();

	int x2 = loc2.getBlockX();
	int y2 = loc2.getBlockY();
	int z2 = loc2.getBlockZ();

	Vector p1 = new Vector(x1, y1, z1);
	Vector p2 = new Vector(x2, y2, z2);
	RegionManager regionManager = WGBukkit.getRegionManager(world);
	ProtectedCuboidRegion region = new ProtectedCuboidRegion(name, p1.toBlockVector(), p2.toBlockVector());
	regionManager.addRegion(region);
	try {
		regionManager.save();
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
開發者ID:Sharpjaws,項目名稱:SharpSK,代碼行數:26,代碼來源:EffCreateRegion.java

示例2: selectPrimary

import com.sk89q.worldedit.Vector; //導入方法依賴的package包/類
@Override
public boolean selectPrimary(Vector position, SelectorLimits limits) {
    checkNotNull(position);
    clear();
    pos1 = position.toBlockVector();
    return region.addVertex(position);
}
 
開發者ID:boy0001,項目名稱:FastAsyncWorldedit,代碼行數:8,代碼來源:PolyhedralRegionSelector.java

示例3: selectPrimary

import com.sk89q.worldedit.Vector; //導入方法依賴的package包/類
@Override
public boolean selectPrimary(Vector position, SelectorLimits limits) {
    if (position.equals(pos1)) {
        return false;
    }

    pos1 = position.toBlockVector();
    region = new Polygonal2DRegion(region.getWorld());
    region.addPoint(position);
    region.expandY(position.getBlockY());

    return true;
}
 
開發者ID:boy0001,項目名稱:FastAsyncWorldedit,代碼行數:14,代碼來源:Polygonal2DRegionSelector.java

示例4: selectPrimary

import com.sk89q.worldedit.Vector; //導入方法依賴的package包/類
@Override
public boolean selectPrimary(Vector position, SelectorLimits limits) {
    if (position1 != null && position2 != null && position.compareTo(position1) == 0 && position.compareTo(position2) == 0) {
        return false;
    }

    position1 = position2 = position.toBlockVector();
    region.setPos1(position1);
    region.setPos2(position2);
    return true;
}
 
開發者ID:boy0001,項目名稱:FastAsyncWorldedit,代碼行數:12,代碼來源:ExtendingCuboidRegionSelector.java

示例5: CuboidRegionSelector

import com.sk89q.worldedit.Vector; //導入方法依賴的package包/類
/**
 * Create a new region selector with the given two positions.
 *
 * @param world     the world
 * @param position1 position 1
 * @param position2 position 2
 */
public CuboidRegionSelector(@Nullable World world, Vector position1, Vector position2) {
    this(world);
    checkNotNull(position1);
    checkNotNull(position2);
    this.position1 = position1.toBlockVector();
    this.position2 = position2.toBlockVector();
    region.setPos1(position1);
    region.setPos2(position2);
}
 
開發者ID:boy0001,項目名稱:FastAsyncWorldedit,代碼行數:17,代碼來源:CuboidRegionSelector.java

示例6: selectPrimary

import com.sk89q.worldedit.Vector; //導入方法依賴的package包/類
@Override
public boolean selectPrimary(Vector position, SelectorLimits limits) {
    checkNotNull(position);

    if (position1 != null && (position.compareTo(position1) == 0)) {
        return false;
    }

    position1 = position.toBlockVector();
    region.setPos1(position1);
    return true;
}
 
開發者ID:boy0001,項目名稱:FastAsyncWorldedit,代碼行數:13,代碼來源:CuboidRegionSelector.java

示例7: selectSecondary

import com.sk89q.worldedit.Vector; //導入方法依賴的package包/類
@Override
public boolean selectSecondary(Vector position, SelectorLimits limits) {
    checkNotNull(position);

    if (position2 != null && (position.compareTo(position2)) == 0) {
        return false;
    }

    position2 = position.toBlockVector();
    region.setPos2(position2);
    return true;
}
 
開發者ID:boy0001,項目名稱:FastAsyncWorldedit,代碼行數:13,代碼來源:CuboidRegionSelector.java


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