use of org.bukkit.WorldBorder in project PyrCore by PYRRH4.
the class Compat_1_10_2 method copyWorldBorder.
@Override
public void copyWorldBorder(World oldWorld, World newWorld) {
WorldBorder border = oldWorld.getWorldBorder();
newWorld.getWorldBorder().setCenter(border.getCenter());
newWorld.getWorldBorder().setDamageAmount(border.getDamageAmount());
newWorld.getWorldBorder().setDamageBuffer(border.getDamageBuffer());
newWorld.getWorldBorder().setSize(border.getSize());
newWorld.getWorldBorder().setWarningDistance(border.getWarningDistance());
newWorld.getWorldBorder().setWarningTime(border.getWarningTime());
}
use of org.bukkit.WorldBorder in project PyrCore by PYRRH4.
the class Compat_1_11 method copyWorldBorder.
@Override
public void copyWorldBorder(World oldWorld, World newWorld) {
WorldBorder border = oldWorld.getWorldBorder();
newWorld.getWorldBorder().setCenter(border.getCenter());
newWorld.getWorldBorder().setDamageAmount(border.getDamageAmount());
newWorld.getWorldBorder().setDamageBuffer(border.getDamageBuffer());
newWorld.getWorldBorder().setSize(border.getSize());
newWorld.getWorldBorder().setWarningDistance(border.getWarningDistance());
newWorld.getWorldBorder().setWarningTime(border.getWarningTime());
}
use of org.bukkit.WorldBorder in project PyrCore by PYRRH4.
the class Compat_1_8_8 method copyWorldBorder.
@Override
public void copyWorldBorder(World oldWorld, World newWorld) {
WorldBorder border = oldWorld.getWorldBorder();
newWorld.getWorldBorder().setCenter(border.getCenter());
newWorld.getWorldBorder().setDamageAmount(border.getDamageAmount());
newWorld.getWorldBorder().setDamageBuffer(border.getDamageBuffer());
newWorld.getWorldBorder().setSize(border.getSize());
newWorld.getWorldBorder().setWarningDistance(border.getWarningDistance());
newWorld.getWorldBorder().setWarningTime(border.getWarningTime());
}
use of org.bukkit.WorldBorder in project PyrCore by PYRRH4.
the class Compat_1_9_4 method copyWorldBorder.
@Override
public void copyWorldBorder(World oldWorld, World newWorld) {
WorldBorder border = oldWorld.getWorldBorder();
newWorld.getWorldBorder().setCenter(border.getCenter());
newWorld.getWorldBorder().setDamageAmount(border.getDamageAmount());
newWorld.getWorldBorder().setDamageBuffer(border.getDamageBuffer());
newWorld.getWorldBorder().setSize(border.getSize());
newWorld.getWorldBorder().setWarningDistance(border.getWarningDistance());
newWorld.getWorldBorder().setWarningTime(border.getWarningTime());
}
use of org.bukkit.WorldBorder in project MagicPlugin by elBukkit.
the class BaseSpell method canCast.
@Override
public boolean canCast(Location location) {
if (bypassAll)
return true;
if (!hasCastPermission(mage.getCommandSender()))
return false;
Entity entity = mage.getEntity();
if (disguiseRestricted && entity != null && entity instanceof Player && controller.isDisguised(entity))
return false;
if (glideRestricted && entity != null && entity instanceof LivingEntity && ((LivingEntity) entity).isGliding())
return false;
if (glideExclusive && entity != null && entity instanceof LivingEntity && !((LivingEntity) entity).isGliding())
return false;
if (location == null)
return true;
Boolean regionPermission = bypassRegionPermission ? null : controller.getRegionCastPermission(mage.getPlayer(), this, location);
if (regionPermission != null && regionPermission == true)
return true;
Boolean personalPermission = bypassRegionPermission ? null : controller.getPersonalCastPermission(mage.getPlayer(), this, location);
if (personalPermission != null && personalPermission == true)
return true;
if (regionPermission != null && regionPermission == false)
return false;
if (requiresBuildPermission() && !hasBuildPermission(location.getBlock()))
return false;
if (requiresBreakPermission() && !hasBreakPermission(location.getBlock()))
return false;
if (worldBorderRestricted) {
WorldBorder border = location.getWorld().getWorldBorder();
double borderSize = border.getSize() / 2 - border.getWarningDistance();
Location offset = location.clone().subtract(border.getCenter());
if (offset.getX() < -borderSize || offset.getX() > borderSize || offset.getZ() < -borderSize || offset.getZ() > borderSize)
return false;
}
return !pvpRestricted || bypassPvpRestriction || mage.isPVPAllowed(location);
}
Aggregations