本文整理汇总了Java中org.bukkit.Location.setWorld方法的典型用法代码示例。如果您正苦于以下问题:Java Location.setWorld方法的具体用法?Java Location.setWorld怎么用?Java Location.setWorld使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.Location
的用法示例。
在下文中一共展示了Location.setWorld方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: teleportPlayer
import org.bukkit.Location; //导入方法依赖的package包/类
public void teleportPlayer(Entity p, int dx, int dy, int dz) {
NavyCraft.instance.DebugMessage("Teleporting entity " + p.getEntityId(), 4);
Location pLoc = p.getLocation();
pLoc.setWorld(craft.world);
pLoc.setX(pLoc.getX() + dx);
pLoc.setY(pLoc.getY() + dy + .05);
pLoc.setZ(pLoc.getZ() + dz);
if (p instanceof Player) {
playerTeleports.put((Player) p, pLoc);
} else {
p.teleport(pLoc);
}
}
示例2: execute
import org.bukkit.Location; //导入方法依赖的package包/类
public boolean execute(CommandSender sender, String[] args) {
Player p = (Player) sender;
if (args.length != 1) {
Chat.player(sender, "&4[SG] &cPlease include the world name");
return true;
}
Chat.player(sender, Map.getList().toString());
Map m = Map.getByID(1);
for (Location l : m.getSpawns()) {
l.setWorld(m.getWorld());
p.sendBlockChange(l, Material.GLOWSTONE, (byte) 0);
}
Chat.player(sender, "&2[SG] &aSpawns have been shown with glowstone");
return true;
}
示例3: execute
import org.bukkit.Location; //导入方法依赖的package包/类
@Override
public void execute() {
if (this.target == null)
return;
Entity e = getEntity();
Location goal = this.target.clone();
goal.setWorld(e.getWorld());
BukkitTask[] task = new BukkitTask[1];
final double walkSpeed = e.getLocation().distance(goal) / (double) getEvent().getTickDelay();
task[0] = Bukkit.getScheduler().runTaskTimer(Core.getInstance(), () -> stepLocation(e, goal, walkSpeed), 0L, 1L); // Move the entity closer every tick.
Bukkit.getScheduler().runTaskLater(Core.getInstance(), task[0]::cancel, getEvent().getTickDelay() - 1);
}
示例4: getLocation
import org.bukkit.Location; //导入方法依赖的package包/类
public Location getLocation(Location loc) {
if (loc != null) {
loc.setWorld(getWorld());
loc.setX(x);
loc.setY(y);
loc.setZ(z);
loc.setYaw(0);
loc.setPitch(0);
}
return loc;
}
示例5: getLocation
import org.bukkit.Location; //导入方法依赖的package包/类
public Location getLocation(Location loc) {
if (loc != null) {
loc.setWorld(world);
loc.setX(x);
loc.setY(y);
loc.setZ(z);
loc.setYaw(0);
loc.setPitch(0);
}
return loc;
}
示例6: getLocation
import org.bukkit.Location; //导入方法依赖的package包/类
@Override
public Location getLocation(Location loc)
{
loc.setWorld(location.getWorld());
loc.setDirection(location.getDirection());
loc.setX(location.getX());
loc.setY(location.getY());
loc.setZ(location.getZ());
return loc;
}
示例7: getRedSpawn
import org.bukkit.Location; //导入方法依赖的package包/类
public Location getRedSpawn() {
Location l = getCurrent().getRedSpawn();
l.setWorld(Bukkit.getWorld(worldName));
return l;
}
示例8: getBlueSpawn
import org.bukkit.Location; //导入方法依赖的package包/类
public Location getBlueSpawn() {
Location l = getCurrent().getBlueSpawn();
l.setWorld(Bukkit.getWorld(worldName));
return l;
}
示例9: getSpawn
import org.bukkit.Location; //导入方法依赖的package包/类
public Location getSpawn() {
Location l = getCurrent().getSpawn();
l.setWorld(Bukkit.getWorld(worldName));
return l;
}
示例10: fixLocation
import org.bukkit.Location; //导入方法依赖的package包/类
/**
* Create a duplicate location with a set world.
* @param old
* @param world
* @return fixed
*/
protected Location fixLocation(Location old, World world) {
Location fixed = old.clone();
fixed.setWorld(world);
return fixed;
}