本文整理汇总了Java中com.sk89q.worldedit.BlockVector.getBlockY方法的典型用法代码示例。如果您正苦于以下问题:Java BlockVector.getBlockY方法的具体用法?Java BlockVector.getBlockY怎么用?Java BlockVector.getBlockY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sk89q.worldedit.BlockVector
的用法示例。
在下文中一共展示了BlockVector.getBlockY方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: contains
import com.sk89q.worldedit.BlockVector; //导入方法依赖的package包/类
public boolean contains(final BlockVector loc) {
if (loc.getBlockX() < this.position1.getBlockX()) {
return false;
}
if (loc.getBlockX() > this.position2.getBlockX()) {
return false;
}
if (loc.getBlockZ() < this.position1.getBlockZ()) {
return false;
}
if (loc.getBlockZ() > this.position2.getBlockZ()) {
return false;
}
if (loc.getBlockY() < this.position1.getBlockY()) {
return false;
}
if (loc.getBlockY() > this.position2.getBlockY()) {
return false;
}
return true;
}
示例2: FaweMask
import com.sk89q.worldedit.BlockVector; //导入方法依赖的package包/类
public FaweMask(final BlockVector pos1, final BlockVector pos2, final String id) {
if ((pos1 == null) || (pos2 == null)) {
throw new IllegalArgumentException("BlockVectors cannot be null!");
}
this.description = id;
this.position1 = new BlockVector(Math.min(pos1.getBlockX(), pos2.getBlockX()), pos1.getBlockY(), Math.min(pos1.getBlockZ(), pos2.getBlockZ()));
this.position2 = new BlockVector(Math.max(pos1.getBlockX(), pos2.getBlockX()), pos2.getBlockY(), Math.max(pos1.getBlockZ(), pos2.getBlockZ()));
}
示例3: compare
import com.sk89q.worldedit.BlockVector; //导入方法依赖的package包/类
@Override
public int compare(BlockVector o1, BlockVector o2) {
int resp;
resp = o1.getBlockX() - o2.getBlockX();
if (resp == 0) {
resp = o1.getBlockY() - o2.getBlockY();
if (resp == 0) {
resp = o1.getBlockZ() - o2.getBlockZ();
}
}
return resp;
}
示例4: putFence
import com.sk89q.worldedit.BlockVector; //导入方法依赖的package包/类
public static void putFence(LibelulaProtectionBlocks plugin, World world, TreeSet<BlockVector> blockVectors) {
for (BlockVector bv : blockVectors) {
Location loc = new Location(world, bv.getBlockX(), bv.getBlockY(), bv.getBlockZ());
if (loc.getBlock().getType() == Material.AIR) {
loc.getBlock().setType(Material.FENCE);
}
}
}
示例5: getWorldEditRegionsInSelection
import com.sk89q.worldedit.BlockVector; //导入方法依赖的package包/类
/**
* Get all WorldGuard regions intersecting with a WorldEdit selection.
* @param selection The selection to check
* @return A list with all the WorldGuard regions intersecting with the selection
*/
public static List<ProtectedRegion> getWorldEditRegionsInSelection(Selection selection) {
// Get all regions inside or intersecting with the WorldEdit selection of the player
World world = selection.getWorld();
RegionManager regionManager = AreaShop.getInstance().getWorldGuard().getRegionManager(world);
ArrayList<ProtectedRegion> result = new ArrayList<>();
Location selectionMin = selection.getMinimumPoint();
Location selectionMax = selection.getMaximumPoint();
for(ProtectedRegion region : regionManager.getRegions().values()) {
BlockVector regionMin = region.getMinimumPoint();
BlockVector regionMax = region.getMaximumPoint();
if(
( // x part, resolves to true if the selection and region overlap anywhere on the x-axis
(regionMin.getBlockX() <= selectionMax.getBlockX() && regionMin.getBlockX() >= selectionMin.getBlockX())
|| (regionMax.getBlockX() <= selectionMax.getBlockX() && regionMax.getBlockX() >= selectionMin.getBlockX())
|| (selectionMin.getBlockX() >= regionMin.getBlockX() && selectionMin.getBlockX() <= regionMax.getBlockX())
|| (selectionMax.getBlockX() >= regionMin.getBlockX() && selectionMax.getBlockX() <= regionMax.getBlockX())
) && ( // Y part, resolves to true if the selection and region overlap anywhere on the y-axis
(regionMin.getBlockY() <= selectionMax.getBlockY() && regionMin.getBlockY() >= selectionMin.getBlockY())
|| (regionMax.getBlockY() <= selectionMax.getBlockY() && regionMax.getBlockY() >= selectionMin.getBlockY())
|| (selectionMin.getBlockY() >= regionMin.getBlockY() && selectionMin.getBlockY() <= regionMax.getBlockY())
|| (selectionMax.getBlockY() >= regionMin.getBlockY() && selectionMax.getBlockY() <= regionMax.getBlockY())
) && ( // Z part, resolves to true if the selection and region overlap anywhere on the z-axis
(regionMin.getBlockZ() <= selectionMax.getBlockZ() && regionMin.getBlockZ() >= selectionMin.getBlockZ())
|| (regionMax.getBlockZ() <= selectionMax.getBlockZ() && regionMax.getBlockZ() >= selectionMin.getBlockZ())
|| (selectionMin.getBlockZ() >= regionMin.getBlockZ() && selectionMin.getBlockZ() <= regionMax.getBlockZ())
|| (selectionMax.getBlockZ() >= regionMin.getBlockZ() && selectionMax.getBlockZ() <= regionMax.getBlockZ())
)
) {
result.add(region);
}
}
return result;
}
示例6: getMin
import com.sk89q.worldedit.BlockVector; //导入方法依赖的package包/类
@Override
public BlockPos getMin() {
BlockVector min = getHandle().getMinimumPoint();
return new BlockPos(min.getBlockX(), min.getBlockY(), min.getBlockZ(), getWorld());
}
示例7: getMax
import com.sk89q.worldedit.BlockVector; //导入方法依赖的package包/类
@Override
public BlockPos getMax() {
BlockVector max = getHandle().getMaximumPoint();
return new BlockPos(max.getBlockX(), max.getBlockY(), max.getBlockZ(), getWorld());
}
示例8: onPlayerMove
import com.sk89q.worldedit.BlockVector; //导入方法依赖的package包/类
@EventHandler(ignoreCancelled = true)
public void onPlayerMove(PlayerMoveEvent e) {
boolean moveIntoArena = false;
BlockVector min = g.getArena().area.getMinimumPoint();
BlockVector max = g.getArena().area.getMaximumPoint();
if (e.getTo().getWorld().getName().equals(g.getArena().capturePoint.getWorld().getName())) {
if (e.getTo().getBlockX() >= min.getX() && e.getTo().getBlockX() <= max.getBlockX()
&& e.getTo().getBlockY() >= min.getY() && e.getTo().getBlockY() <= max.getBlockY()
&& e.getTo().getBlockZ() >= min.getZ() && e.getTo().getBlockZ() <= max.getBlockZ()) {
moveIntoArena = true;
}
}
if (g.getTeam(e.getPlayer()) == null) {
if (moveIntoArena) {
if (!e.getPlayer().isOp()) {
e.getPlayer().teleport(g.getPlugin().mapMan.getLobby());
g.getPlugin().teamMan.backToNormal(e.getPlayer());
}
return;
}
} else {
if (!moveIntoArena) {
// g.getPlugin().getLogger().info("Debug: fuera de Area " +e.getTo() + " " + g.getArena().area.getMinimumPoint() + " / " + g.getArena().area.getMaximumPoint());
g.messageAll(e.getPlayer().getName() + " ha caído fuera de la arena.");
g.moveToSpawn(e.getPlayer());
}
}
if (g.getArena().capturePoint.getBlockX() == e.getTo().getBlockX()
&& g.getArena().capturePoint.getBlockY() == e.getTo().getBlockY()
&& g.getArena().capturePoint.getBlockZ() == e.getTo().getBlockZ()
&& g.getArena().capturePoint.getWorld().getName().equals(e.getTo().getWorld().getName())) {
g.moveAllToSpawn();
g.messageAll(ChatColor.GOLD + e.getPlayer().getDisplayName() + " captura el punto");
int score = g.getPlugin().teamMan.getScore(e.getPlayer()).getScore();
g.getPlugin().teamMan.getScore(e.getPlayer()).setScore(score + reward.get(round));
g.playSoundAll(Sound.EXPLODE);
/*
Location pointLoc = e.getTo();
pointLoc.setY(e.getTo().getY() - round);
pointLoc.getBlock().setType(Material.WOOL);
pointLoc.getBlock().setData(g.getPlugin().teamMan.getDyeColor(e.getPlayer()).getData());
*/
g.announsePoint();
round++;
tickCounter = 0;
}
}
示例9: run
import com.sk89q.worldedit.BlockVector; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public void run() {
boolean finish = !player.isOnline();
if (player.isOnline()) {
Player bukkitPlayer = player.getBukkitPlayer();
// Stores the current wool data
byte data;
if (currentRepetitions % 2 == 0) {
data = LIME_WOOL_DATA;
} else {
data = RED_WOOL_DATA;
}
finish = currentRepetitions > REPETITIONS;
Iterator<BlockVector> iterator = region.iterator();
while (iterator.hasNext()) {
BlockVector vec = iterator.next();
int x = vec.getBlockX();
int y = vec.getBlockY();
int z = vec.getBlockZ();
Location location = new Location(world, x, y, z);
if (!finish) {
bukkitPlayer.sendBlockChange(location, Material.WOOL, data);
} else {
Block block = world.getBlockAt(location);
Material material = block.getType();
data = block.getData();
bukkitPlayer.sendBlockChange(location, material, data);
}
}
}
if (finish) {
BukkitTask task = tasks.get(player);
task.cancel();
tasks.remove(player);
}
++currentRepetitions;
}
示例10: toBukkit
import com.sk89q.worldedit.BlockVector; //导入方法依赖的package包/类
protected Location toBukkit(BlockVector block) {
return new Location(world, block.getBlockX(), block.getBlockY(), block.getBlockZ());
}