本文整理汇总了Java中org.bukkit.Material.SOUL_SAND属性的典型用法代码示例。如果您正苦于以下问题:Java Material.SOUL_SAND属性的具体用法?Java Material.SOUL_SAND怎么用?Java Material.SOUL_SAND使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.Material
的用法示例。
在下文中一共展示了Material.SOUL_SAND属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkXZSpeed
public static void checkXZSpeed(Player player, double x, double z) {
if(player.getVehicle() == null && !player.isFlying() && !Flight.movingExempt.containsKey(player)) {
String reason = "";
double max = 0.25;
if(player.getLocation().getBlock().getType() == Material.SOUL_SAND) {
if(player.isSprinting()) {
reason = "on soulsand while sprinting";
max = 0.2;
} else if(player.hasPotionEffect(PotionEffectType.SPEED)) {
max = 0.16;
reason = "on soulsand with speed pot";
} else {
max = 0.13;
}
} else if(player.hasPotionEffect(PotionEffectType.SPEED)) {
if(player.isSprinting()) {
reason = "with speed pot while sprinting";
max = 0.95;
} else {
reason = "with speed pot";
max = 0.7;
}
} else if(player.isSprinting()) {
max = 0.65;
reason = "while sprinting";
}
float speed = player.getWalkSpeed();
max += speed > 0 ? player.getWalkSpeed() - 0.2f : 0;
if(x > max || z > max) {
speedViolation.put(player, speedViolation.containsKey(player) ? speedViolation.get(player) + 1 : 1);
if(speedViolation.get(player) > MagicNumbers.SPEED_MAX) {
for(Player pla : DynamicAC.instance.onlinestaff) {
pla.sendMessage(ChatColor.RED + "[DAC] " + ChatColor.GREEN + player.getName() + " failed " +
"Speed " + reason + "!");
}
DACManager.getUserManager().incrementUser(DACManager.getUserManager().getUser(player.getName()),
"Speed " + reason);
}
} else {
speedViolation.put(player, 0);
}
}
}