本文整理汇总了Java中org.bukkit.WorldBorder.setCenter方法的典型用法代码示例。如果您正苦于以下问题:Java WorldBorder.setCenter方法的具体用法?Java WorldBorder.setCenter怎么用?Java WorldBorder.setCenter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.WorldBorder
的用法示例。
在下文中一共展示了WorldBorder.setCenter方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onEnable
import org.bukkit.WorldBorder; //导入方法依赖的package包/类
public void onEnable() {
registerListeners();
registerCommands();
ConfigManager.getInstance().setup(this);
WorldBorder b = Bukkit.getWorld("world").getWorldBorder();
b.setCenter(new Location(Bukkit.getWorld("world"), 0, 64, 0));
b.setSize(SettingsManager.border);
BukkitScheduler scheduler = getServer().getScheduler();
scheduler.scheduleSyncRepeatingTask(this, new Runnable() {
@Override
public void run() {
Bukkit.broadcastMessage("loop all players: :kappa:");
if(GameManager.getGameSituation()) {
if(GameManager.getStartTime() + 600000 > System.currentTimeMillis()) {
b.setSize(b.getSize() - 1);
}
}
}
}, 0L, 1 * 20L);
}
示例2: BorderManagement
import org.bukkit.WorldBorder; //导入方法依赖的package包/类
public BorderManagement(int size, int decreaseSize, Location loc, int triggerTime){
if(size<1 && decreaseSize>size){
System.out.println("Wielkosc granicy musi byc >1");
this.size = 1000;
this.loc = loc;
this.decreasedSize = 100;
this.triggerTime = 60;
}else{
this.size = size;
this.loc = loc;
this.decreasedSize = decreaseSize;
this.triggerTime = triggerTime;
}
WorldBorder wb = loc.getWorld().getWorldBorder();
wb.setCenter(loc);
wb.setDamageAmount(2);
wb.setWarningTime(5);
wb.setSize(size);
wb.setWarningDistance(30);
}
示例3: onWorldLoad
import org.bukkit.WorldBorder; //导入方法依赖的package包/类
@EventHandler
private void onWorldLoad(WorldLoadEvent e){
e.getWorld().setAutoSave(false);
WorldBorder b = e.getWorld().getWorldBorder();
b.setCenter(0d, 0d);
b.setSize(3000000d);
plugin.getLogger().info(String.format("Auto-save for world [" + e.getWorld().getName() + "] is prevented! "));
}
示例4: onMatchCreate
import org.bukkit.WorldBorder; //导入方法依赖的package包/类
@EventHandler
public void onMatchCreate(MatchCreateEvent event) {
GameMap map = event.getMatch().getMap();
if (map.getWorldBorder().isEnabled()) {
WorldBorder wb = event.getMatch().getWorld().getWorldBorder();
wb.setCenter(map.getWorldBorder().getCenterX(), map.getWorldBorder().getCenterY());
wb.setSize(map.getWorldBorder().getRadius()*2);
}
}
示例5: resetBorder
import org.bukkit.WorldBorder; //导入方法依赖的package包/类
public void resetBorder(){
WorldBorder wb = this.loc.getWorld().getWorldBorder();
wb.setCenter(this.loc);
wb.setDamageAmount(2);
wb.setWarningTime(5);
wb.setSize(this.size);
wb.setWarningDistance(30);
}