本文整理汇总了Java中com.sk89q.worldedit.bukkit.BukkitUtil.toVector方法的典型用法代码示例。如果您正苦于以下问题:Java BukkitUtil.toVector方法的具体用法?Java BukkitUtil.toVector怎么用?Java BukkitUtil.toVector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sk89q.worldedit.bukkit.BukkitUtil
的用法示例。
在下文中一共展示了BukkitUtil.toVector方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isInsideDeathzone
import com.sk89q.worldedit.bukkit.BukkitUtil; //导入方法依赖的package包/类
private boolean isInsideDeathzone(Location location, Game game, boolean useLiquidDeathzone) {
boolean result = false;
if (useLiquidDeathzone && FLOWING_MATERIALS.contains(location.getBlock().getType())) {
result = true;
} else {
Vector vec = BukkitUtil.toVector(location);
for (Region deathzone : game.getDeathzones().values()) {
if (deathzone.contains(vec)) {
//Location is in deathzone
result = true;
break;
}
}
}
return result;
}
示例2: editAnimation
import com.sk89q.worldedit.bukkit.BukkitUtil; //导入方法依赖的package包/类
public static boolean editAnimation(Player p, String animationName) {
clear();
MCMEAnimation animation = null;
for (MCMEAnimation a : MCMEAnimations.animations) {
if (a.getName().equals(animationName)) {
animation = a;
}
}
if (null == animation) {
p.sendMessage(ChatColor.RED + "Cannot find animation\"" + animationName + "\"!");
return false;
}
AnimationFactory.animationName = animationName;
AnimationFactory.animationDescription = (String) animation.getConfiguration().get("description");
AnimationFactory.origin = BukkitUtil.toVector(animation.getOrigin());
AnimationFactory.owner = p;
AnimationFactory.type = animation.getType();
ArrayList<MCMEClipboardStore> clipboards = new ArrayList();
MCMEClipboardStore c = new MCMEClipboardStore();
for (MCMEAnimationFrame f : animation.getFrames()) {
f.getFrameName();
}
return true;
}
示例3: BlockSpawnTask
import com.sk89q.worldedit.bukkit.BukkitUtil; //导入方法依赖的package包/类
/**Constructor, passes arguments to super class and loads special values from config.
* @param parent The Room this Task belongs to
* @param conf Given config file of this room has entries on tasks.
* @param taskNr Task number is needed to load keys correctly.
*/
public BlockSpawnTask(Room parent, FileConfiguration conf, int taskNr) {
super(parent, conf, taskNr);
this.type = TaskType.BLOCKSPAWN;
// loading values for this Task type:
String path = "tasks.task" + this.taskNr + ".";
blockMaterial = Material.getMaterial(conf.getString(path + "blockType").toUpperCase(Locale.ENGLISH)); // this is a lookup 'string' -> 'enum value'
incrementVec = BukkitUtil.toVector(conf.getVector(path + "incrementVector",new org.bukkit.util.Vector())); // default no increment
// The targetRegion is not converted to global here, as it is potentially incremented each cycle with a relative vector.
}
示例4: RoomTask
import com.sk89q.worldedit.bukkit.BukkitUtil; //导入方法依赖的package包/类
/**Constructor takes a back-reference to do actions and loads itself via config and TaskNr.
* @param parent The Room this Task belongs to
* @param conf Given config file of this room has entries on tasks.
* @param taskNr Task number is needed to load keys correctly.
*/
public RoomTask(Room parent, FileConfiguration conf,int taskNr) {
this.parent = parent;
this.taskNr = taskNr;
// Load RoomTask values for Task i values from config:
String path = "tasks.task" + this.taskNr + ".";
type = TaskType.valueOf(conf.getString(path + "type").trim().toUpperCase());
delay = conf.getDouble(path + "delay", 0);
period = conf.getDouble(path + "period", 0);
targetRegion = new CuboidRegion(BukkitUtil.toVector(conf.getVector(path + "regionCorner1",new org.bukkit.util.Vector())),
BukkitUtil.toVector(conf.getVector(path + "regionCorner2",new org.bukkit.util.Vector())));
}
示例5: genEntry
import com.sk89q.worldedit.bukkit.BukkitUtil; //导入方法依赖的package包/类
/**
* Starts the dungeon, generating the entry area and setting up listeners for player button press actions.
* The STARTUP status will lead to the execution of the startup() member as soon as the entry's button is pressed.
* @param start Vector where the dungeon entry is generated
* @param towardsD Dungeon Entry direction
*/
public void genEntry(Vector start, Direc towardsD) {
state = State.STARTUP;
// generate entry:
String name = getRandomModule(entryModules);
entry = new Entry(this,name,BukkitUtil.toVector(start),towardsD); //generate the named entry. 'This' is given for attribute access.
curPassway2 = entry; // start chain of module tripplets
entry.place();
entry.register(); //listener for button now active
entry.toggleExit(false);
entry.toggleEntry(true);
getServer().broadcastMessage("Dungeon started, enter on your own risk."); // ok to broadcast to whole server?
}
示例6: loadConfig
import com.sk89q.worldedit.bukkit.BukkitUtil; //导入方法依赖的package包/类
/** Loads all basic properties common for every module.
* The initial yml check makes sure all properties are already in there.
* This superclass function has to be called by every subclass upon loading its own config!
*/
public void loadConfig() {
description = conf.getString("description");
fileName = conf.getString("schematic") + ".schematic";
type = ModuleType.values()[conf.getInt("type")]; // valid Enum from int
entry.placementLoc = BukkitUtil.toVector(conf.getVector("entry.placementLoc"));
entry.doorLoc = BukkitUtil.toVector(conf.getVector("entry.doorLoc"));
entry.width = conf.getInt("entry.width");
entry.height = conf.getInt("entry.height");
exit.placementLoc = BukkitUtil.toVector(conf.getVector("exit.placementLoc"));
exit.doorLoc = BukkitUtil.toVector(conf.getVector("exit.doorLoc"));
exit.width = conf.getInt("exit.width");
exit.height = conf.getInt("exit.height");
exit.initDirec = Direc.fromDeg(conf.getInt("exit.initDirec"));
}
示例7: run
import com.sk89q.worldedit.bukkit.BukkitUtil; //导入方法依赖的package包/类
@Override
public void run(String playerID) throws QuestRuntimeException {
try {
Location location = loc.getLocation(playerID);
SchematicFormat schematic = SchematicFormat.getFormat(file);
CuboidClipboard clipboard = schematic.load(file);
BukkitWorld world = new BukkitWorld(location.getWorld());
EditSession editSession = we.getWorldEdit().getEditSessionFactory().getEditSession(world, 64*64*64);
Vector newOrigin = BukkitUtil.toVector(location);
clipboard.paste(editSession, newOrigin, noAir);
} catch (DataException | IOException | MaxChangedBlocksException e) {
Debug.error("Error while pasting a schematic: " + e.getMessage());
}
}
示例8: setAnimationOrigin
import com.sk89q.worldedit.bukkit.BukkitUtil; //导入方法依赖的package包/类
public static void setAnimationOrigin(Player p) {
Selection s = MCMEAnimations.WEPlugin.getSelection(p);
if (!s.getMinimumPoint().equals(s.getMaximumPoint())) {
p.sendMessage(ChatColor.RED + "More than one block selected! Select a single block in order to set the Animation origin");
return;
}
origin = BukkitUtil.toVector(s.getMinimumPoint());
p.sendMessage(ChatColor.BLUE + "Animation origin point set to X:" + origin.getX() + " Y:" + origin.getY() + " Z:" + origin.getZ());
}
示例9: loadConfig
import com.sk89q.worldedit.bukkit.BukkitUtil; //导入方法依赖的package包/类
@Override
public void loadConfig() {
super.loadConfig();
targetRegCorner1 = BukkitUtil.toVector(conf.getVector("targetRegCorner1"));
targetRegCorner2 = BukkitUtil.toVector(conf.getVector("targetRegCorner2"));
}
示例10: legacyStringToVector
import com.sk89q.worldedit.bukkit.BukkitUtil; //导入方法依赖的package包/类
private Vector legacyStringToVector(String legacyString) {
Location location = legacyStringToLocation(legacyString);
return BukkitUtil.toVector(location);
}
示例11: contains
import com.sk89q.worldedit.bukkit.BukkitUtil; //导入方法依赖的package包/类
@Override
public boolean contains(Location location) {
Vector pt = BukkitUtil.toVector(location);
return floorClipboard.getRegion().contains(pt);
}
示例12: getWGRegionsIdsByLocation
import com.sk89q.worldedit.bukkit.BukkitUtil; //导入方法依赖的package包/类
private List<String> getWGRegionsIdsByLocation(Location playerLocation) {
WorldGuardPlugin worldGuardPlugin = WGBukkit.getPlugin();
Vector locVector = BukkitUtil.toVector(playerLocation.toVector());
List<String> wgRegions = worldGuardPlugin.getRegionManager(playerLocation.getWorld()).getApplicableRegionsIDs(locVector);
return wgRegions;
}