本文整理汇总了Java中com.sk89q.worldedit.BlockVector.getY方法的典型用法代码示例。如果您正苦于以下问题:Java BlockVector.getY方法的具体用法?Java BlockVector.getY怎么用?Java BlockVector.getY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sk89q.worldedit.BlockVector
的用法示例。
在下文中一共展示了BlockVector.getY方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isaVenda
import com.sk89q.worldedit.BlockVector; //导入方法依赖的package包/类
public static boolean isaVenda(World w, BlockVector bvmin, BlockVector bvmax) {
Location min = new Location(w, bvmin.getX(), bvmin.getY(), bvmin.getZ());
Location max = new Location(w, bvmax.getX(), bvmax.getY(), bvmax.getZ());
for (int x = min.getBlockX(); x <= max.getBlockX(); x++) {
for (int y = min.getBlockY(); y <= max.getBlockY(); y++) {
for (int z = min.getBlockZ(); z <= max.getBlockZ(); z++) {
Block b = w.getBlockAt(x, y, z);
if (b.getType() == Material.SIGN_POST && ((Sign) b.getState()).getLine(0).equals(getMensagem("placa_venda.linha1"))) {
return true;
}
}
}
}
return false;
}
示例2: delTerreno
import com.sk89q.worldedit.BlockVector; //导入方法依赖的package包/类
public static void delTerreno(World w, BlockVector bvmin, BlockVector bvmax) {
Location min = new Location(w, bvmin.getX(), bvmin.getY(), bvmin.getZ());
Location max = new Location(w, bvmax.getX(), bvmax.getY(), bvmax.getZ());
for (int x = min.getBlockX(); x <= max.getBlockX(); x++) {
for (int y = min.getBlockY(); y <= max.getBlockY(); y++) {
for (int z = min.getBlockZ(); z <= max.getBlockZ(); z++) {
Block b = w.getBlockAt(x, y, z);
List<String> s = Main.getPlugin().getConfig().getStringList("SafeBlocks");
if (!s.contains(Integer.toString(b.getTypeId()))) {
b.setType(Material.AIR);
}
}
}
}
}
示例3: process
import com.sk89q.worldedit.BlockVector; //导入方法依赖的package包/类
@Override
public void process(World from, World to) {
if(rm == null){
rm = ((WorldGuardPlugin) Bukkit.getPluginManager().getPlugin("WorldGuard")).getRegionManager(to);
}
System.out.println("Preprocessing: WG Region " + r.getId());
if (r.getId().equalsIgnoreCase("__global__")) {
System.out.println("Global region, returning!");
return;
}
DefaultDomain owners = r.getOwners();
boolean found = false;
for (String s : owners.getPlayers()) {
User u = e.getOfflineUser(s);
if(u != null){
long time = System.currentTimeMillis() - u.getLastLogout();
System.out.println("Milliseconds since last played: " + time);
if (time < WorldRestore.month) {
System.out.println("Found an owner played within last month.");
found = true;
break;
}
}
}
if (found) {
BlockVector min = r.getMinimumPoint();
BlockVector max = r.getMaximumPoint();
System.out.println("min: " + min + "max: " + max);
for (double x = min.getX(); x <= max.getX(); x++) {
for (double y = min.getY(); y <= max.getY(); y++) {
for (double z = min.getZ(); z <= max.getZ(); z++) {
Block b = from.getBlockAt((int) x, (int) y, (int) z);
WorldRestore.addToProcessQueues(b);
}
}
}
}
}
示例4: 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;
}
}