Search in sources :

Example 1 with WorldBorder

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());
}
Also used : WorldBorder(org.bukkit.WorldBorder)

Example 2 with WorldBorder

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());
}
Also used : WorldBorder(org.bukkit.WorldBorder)

Example 3 with WorldBorder

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());
}
Also used : WorldBorder(org.bukkit.WorldBorder)

Example 4 with WorldBorder

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());
}
Also used : WorldBorder(org.bukkit.WorldBorder)

Example 5 with WorldBorder

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);
}
Also used : LivingEntity(org.bukkit.entity.LivingEntity) Entity(org.bukkit.entity.Entity) LivingEntity(org.bukkit.entity.LivingEntity) Player(org.bukkit.entity.Player) EffectPlayer(com.elmakers.mine.bukkit.effect.EffectPlayer) WorldBorder(org.bukkit.WorldBorder) Location(org.bukkit.Location)

Aggregations

WorldBorder (org.bukkit.WorldBorder)11 Location (org.bukkit.Location)3 Player (org.bukkit.entity.Player)3 LocationTag (com.denizenscript.denizen.objects.LocationTag)1 PlayerTag (com.denizenscript.denizen.objects.PlayerTag)1 WorldTag (com.denizenscript.denizen.objects.WorldTag)1 DurationTag (com.denizenscript.denizencore.objects.core.DurationTag)1 ElementTag (com.denizenscript.denizencore.objects.core.ElementTag)1 CastSourceLocation (com.elmakers.mine.bukkit.api.magic.CastSourceLocation)1 EffectPlayer (com.elmakers.mine.bukkit.effect.EffectPlayer)1 BaseSpell (com.elmakers.mine.bukkit.spell.BaseSpell)1 BorderData (com.wimbli.WorldBorder.BorderData)1 List (java.util.List)1 Guild (net.dzikoysk.funnyguilds.basic.Guild)1 Region (net.dzikoysk.funnyguilds.basic.Region)1 User (net.dzikoysk.funnyguilds.basic.User)1 ConcurrencyManager (net.dzikoysk.funnyguilds.concurrency.ConcurrencyManager)1 PrefixGlobalAddGuildRequest (net.dzikoysk.funnyguilds.concurrency.requests.prefix.PrefixGlobalAddGuildRequest)1 PrefixGlobalAddPlayerRequest (net.dzikoysk.funnyguilds.concurrency.requests.prefix.PrefixGlobalAddPlayerRequest)1 RankUpdateGuildRequest (net.dzikoysk.funnyguilds.concurrency.requests.rank.RankUpdateGuildRequest)1