本文整理汇总了Java中org.bukkit.event.world.SpawnChangeEvent类的典型用法代码示例。如果您正苦于以下问题:Java SpawnChangeEvent类的具体用法?Java SpawnChangeEvent怎么用?Java SpawnChangeEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SpawnChangeEvent类属于org.bukkit.event.world包,在下文中一共展示了SpawnChangeEvent类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setSpawnLocation
import org.bukkit.event.world.SpawnChangeEvent; //导入依赖的package包/类
public boolean setSpawnLocation(int x, int y, int z) {
try {
Location previousLocation = getSpawnLocation();
world.worldInfo.setSpawnPosition(x, y, z);
// Notify anyone who's listening.
SpawnChangeEvent event = new SpawnChangeEvent(this, previousLocation);
server.getPluginManager().callEvent(event);
return true;
} catch (Exception e) {
return false;
}
}
示例2: get
import org.bukkit.event.world.SpawnChangeEvent; //导入依赖的package包/类
@Override
protected Location[] get(final Event e, final World[] source) {
if (getTime() == -1 && e instanceof SpawnChangeEvent && !Delay.isDelayed(e)) {
return new Location[] {((SpawnChangeEvent) e).getPreviousLocation()};
}
return get(source, new Converter<World, Location>() {
@Override
@Nullable
public Location convert(final World w) {
return w.getSpawnLocation();
}
});
}
示例3: setSpawnLocation
import org.bukkit.event.world.SpawnChangeEvent; //导入依赖的package包/类
public boolean setSpawnLocation(int x, int y, int z) {
try {
Location previousLocation = getSpawnLocation();
world.worldData.setSpawn(x, y, z);
// Notify anyone who's listening.
SpawnChangeEvent event = new SpawnChangeEvent(this, previousLocation);
server.getPluginManager().callEvent(event);
return true;
} catch (Exception e) {
return false;
}
}
示例4: setSpawnLocation
import org.bukkit.event.world.SpawnChangeEvent; //导入依赖的package包/类
public boolean setSpawnLocation(int x, int y, int z) {
try {
Location previousLocation = getSpawnLocation();
world.worldData.setSpawn(new BlockPosition(x, y, z));
// Notify anyone who's listening.
SpawnChangeEvent event = new SpawnChangeEvent(this, previousLocation);
server.getPluginManager().callEvent(event);
return true;
} catch (Exception e) {
return false;
}
}
示例5: setSpawnLocation
import org.bukkit.event.world.SpawnChangeEvent; //导入依赖的package包/类
public boolean setSpawnLocation(int x, int y, int z) {
try {
Location previousLocation = getSpawnLocation();
world.field_72986_A.func_76081_a(x, y, z);
// Notify anyone who's listening.
SpawnChangeEvent event = new SpawnChangeEvent(this, previousLocation);
server.getPluginManager().callEvent(event);
return true;
} catch (Exception e) {
return false;
}
}
示例6: setTime
import org.bukkit.event.world.SpawnChangeEvent; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public boolean setTime(final int time) {
return super.setTime(time, getExpr(), SpawnChangeEvent.class);
}
示例7: onSpawnChange
import org.bukkit.event.world.SpawnChangeEvent; //导入依赖的package包/类
@EventHandler
public void onSpawnChange(SpawnChangeEvent spawnChangeEvent) {
checkSafety(spawnChangeEvent);
}