本文整理汇总了Java中org.bukkit.WorldBorder.setDamageAmount方法的典型用法代码示例。如果您正苦于以下问题:Java WorldBorder.setDamageAmount方法的具体用法?Java WorldBorder.setDamageAmount怎么用?Java WorldBorder.setDamageAmount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.WorldBorder
的用法示例。
在下文中一共展示了WorldBorder.setDamageAmount方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: setProperty
import org.bukkit.WorldBorder; //导入方法依赖的package包/类
public static void setProperty(WorldBorder border, BorderProperty borderProperty, Number value) {
switch (borderProperty) {
case DIAMETER: border.setSize(value.doubleValue()); return;
case DAMAGE_AMOUNT: border.setDamageAmount(value.doubleValue()); return;
case DAMAGE_BUFFER: border.setDamageBuffer(value.doubleValue()); return;
case WARNING_DISTANCE: border.setWarningDistance(value.intValue()); return;
case WARNING_TIME: border.setWarningTime(value.intValue()); return;
}
throw new IllegalArgumentException("Illegal BorderProperty: " + borderProperty);
}
示例3: resetProperty
import org.bukkit.WorldBorder; //导入方法依赖的package包/类
public static void resetProperty(WorldBorder border, BorderProperty borderProperty) {
switch (borderProperty) {
case DIAMETER: border.setSize(60000000); return;
case DAMAGE_AMOUNT: border.setDamageAmount(0.2); return;
case DAMAGE_BUFFER: border.setDamageBuffer(5); return;
case WARNING_DISTANCE: border.setWarningDistance(5); return;
case WARNING_TIME: border.setWarningTime(15); return;
}
throw new IllegalArgumentException("Illegal BorderProperty: " + borderProperty);
}
示例4: 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);
}