Search in sources :

Example 6 with RitualComponent

use of WayofTime.bloodmagic.ritual.RitualComponent in project BloodMagic by WayofTime.

the class RitualHelper method checkValidRitual.

public static boolean checkValidRitual(World world, BlockPos pos, String ritualId, EnumFacing direction) {
    Ritual ritual = RitualRegistry.getRitualForId(ritualId);
    if (ritual == null) {
        return false;
    }
    List<RitualComponent> components = Lists.newArrayList();
    ritual.gatherComponents(components::add);
    for (RitualComponent component : components) {
        BlockPos newPos = pos.add(component.getOffset(direction));
        if (isRuneType(world, newPos, component.getRuneType())) {
            continue;
        } else {
            return false;
        }
    }
    return true;
}
Also used : Ritual(WayofTime.bloodmagic.ritual.Ritual) RitualComponent(WayofTime.bloodmagic.ritual.RitualComponent) BlockPos(net.minecraft.util.math.BlockPos)

Aggregations

RitualComponent (WayofTime.bloodmagic.ritual.RitualComponent)6 Ritual (WayofTime.bloodmagic.ritual.Ritual)5 BlockPos (net.minecraft.util.math.BlockPos)4 TextureAtlasSprite (net.minecraft.client.renderer.texture.TextureAtlasSprite)2 EnumFacing (net.minecraft.util.EnumFacing)2 World (net.minecraft.world.World)2 ItemRitualDiviner (WayofTime.bloodmagic.item.ItemRitualDiviner)1 EnumDemonWillType (WayofTime.bloodmagic.soul.EnumDemonWillType)1 TileMasterRitualStone (WayofTime.bloodmagic.tile.TileMasterRitualStone)1 List (java.util.List)1 Block (net.minecraft.block.Block)1 IBlockState (net.minecraft.block.state.IBlockState)1 EntityPlayerSP (net.minecraft.client.entity.EntityPlayerSP)1 ItemBlock (net.minecraft.item.ItemBlock)1 TileEntity (net.minecraft.tileentity.TileEntity)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1