Search in sources :

Example 26 with MaterialTag

use of com.denizenscript.denizen.objects.MaterialTag in project Denizen-For-Bukkit by DenizenScript.

the class MaterialCount method describes.

public static boolean describes(ObjectTag material) {
    if (!(material instanceof MaterialTag)) {
        return false;
    }
    MaterialTag mat = (MaterialTag) material;
    if (!mat.hasModernData()) {
        return false;
    }
    BlockData data = mat.getModernData();
    return data instanceof SeaPickle || data instanceof TurtleEgg || data instanceof RespawnAnchor || (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_17) && data instanceof Candle);
}
Also used : MaterialTag(com.denizenscript.denizen.objects.MaterialTag) Candle(org.bukkit.block.data.type.Candle) SeaPickle(org.bukkit.block.data.type.SeaPickle) RespawnAnchor(org.bukkit.block.data.type.RespawnAnchor) BlockData(org.bukkit.block.data.BlockData) TurtleEgg(org.bukkit.block.data.type.TurtleEgg)

Example 27 with MaterialTag

use of com.denizenscript.denizen.objects.MaterialTag in project Denizen-For-Bukkit by DenizenScript.

the class MaterialDirectional method describes.

public static boolean describes(ObjectTag material) {
    if (!(material instanceof MaterialTag)) {
        return false;
    }
    MaterialTag mat = (MaterialTag) material;
    if (!mat.hasModernData()) {
        return false;
    }
    BlockData data = mat.getModernData();
    return data instanceof Directional || data instanceof Orientable || data instanceof Rotatable || data instanceof Rail || data instanceof Jigsaw || (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_17) && data instanceof PointedDripstone);
}
Also used : MaterialTag(com.denizenscript.denizen.objects.MaterialTag) PointedDripstone(org.bukkit.block.data.type.PointedDripstone) Jigsaw(org.bukkit.block.data.type.Jigsaw)

Example 28 with MaterialTag

use of com.denizenscript.denizen.objects.MaterialTag in project Denizen-For-Bukkit by DenizenScript.

the class MaterialBlockType method describes.

public static boolean describes(ObjectTag material) {
    if (!(material instanceof MaterialTag)) {
        return false;
    }
    MaterialTag mat = (MaterialTag) material;
    if (!mat.hasModernData()) {
        return false;
    }
    BlockData data = mat.getModernData();
    return data instanceof Slab || data instanceof TechnicalPiston || data instanceof Campfire || data instanceof Scaffolding || (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_17) && (data instanceof PointedDripstone || data instanceof CaveVinesPlant));
}
Also used : MaterialTag(com.denizenscript.denizen.objects.MaterialTag) BlockData(org.bukkit.block.data.BlockData)

Example 29 with MaterialTag

use of com.denizenscript.denizen.objects.MaterialTag in project Denizen-For-Bukkit by DenizenScript.

the class MaterialSides method describes.

public static boolean describes(ObjectTag material) {
    if (!(material instanceof MaterialTag)) {
        return false;
    }
    MaterialTag mat = (MaterialTag) material;
    if (!mat.hasModernData()) {
        return false;
    }
    BlockData data = mat.getModernData();
    if (!(data instanceof Wall) && !(data instanceof RedstoneWire)) {
        return false;
    }
    return true;
}
Also used : MaterialTag(com.denizenscript.denizen.objects.MaterialTag) RedstoneWire(org.bukkit.block.data.type.RedstoneWire) Wall(org.bukkit.block.data.type.Wall)

Example 30 with MaterialTag

use of com.denizenscript.denizen.objects.MaterialTag in project Denizen-For-Bukkit by DenizenScript.

the class MaterialLevel method describes.

public static boolean describes(ObjectTag material) {
    if (!(material instanceof MaterialTag)) {
        return false;
    }
    MaterialTag mat = (MaterialTag) material;
    if (!mat.hasModernData()) {
        return false;
    }
    BlockData data = mat.getModernData();
    return data instanceof Levelled || data instanceof Cake || data instanceof Snow || data instanceof Farmland || data instanceof Beehive;
}
Also used : MaterialTag(com.denizenscript.denizen.objects.MaterialTag) Snow(org.bukkit.block.data.type.Snow) Beehive(org.bukkit.block.data.type.Beehive) Cake(org.bukkit.block.data.type.Cake) Farmland(org.bukkit.block.data.type.Farmland) Levelled(org.bukkit.block.data.Levelled) BlockData(org.bukkit.block.data.BlockData)

Aggregations

MaterialTag (com.denizenscript.denizen.objects.MaterialTag)51 LocationTag (com.denizenscript.denizen.objects.LocationTag)33 EventHandler (org.bukkit.event.EventHandler)21 ElementTag (com.denizenscript.denizencore.objects.core.ElementTag)9 EntityTag (com.denizenscript.denizen.objects.EntityTag)8 Material (org.bukkit.Material)8 PlayerTag (com.denizenscript.denizen.objects.PlayerTag)7 BlockData (org.bukkit.block.data.BlockData)7 DurationTag (com.denizenscript.denizencore.objects.core.DurationTag)6 ListTag (com.denizenscript.denizencore.objects.core.ListTag)6 ItemStack (org.bukkit.inventory.ItemStack)6 List (java.util.List)4 Block (org.bukkit.block.Block)4 PlayerChangesSignScriptEvent (com.denizenscript.denizen.events.player.PlayerChangesSignScriptEvent)3 ItemTag (com.denizenscript.denizen.objects.ItemTag)3 SignChangeEvent (org.bukkit.event.block.SignChangeEvent)3 InvalidArgumentsException (com.denizenscript.denizencore.exceptions.InvalidArgumentsException)2 ScriptEntry (com.denizenscript.denizencore.scripts.ScriptEntry)2 HashSet (java.util.HashSet)2 BlockPos (net.minecraft.core.BlockPos)2