Search in sources :

Example 1 with TileRitualLink

use of hellfirepvp.astralsorcery.common.tile.TileRitualLink in project AstralSorcery by HellFirePvP.

the class ConstellationEffect method getPedestal.

@Nullable
public TileRitualPedestal getPedestal(World world, BlockPos pos) {
    TileEntity te = MiscUtils.getTileAt(world, pos, TileEntity.class, false);
    if (te instanceof TileRitualLink) {
        TileRitualLink link = (TileRitualLink) te;
        pos = link.getLinkedTo();
        if (pos != null) {
            pos = pos.subtract(TileRitualPedestal.RITUAL_ANCHOR_OFFEST);
            return MiscUtils.getTileAt(world, pos, TileRitualPedestal.class, false);
        }
    }
    return te instanceof TileRitualPedestal ? (TileRitualPedestal) te : null;
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) TileRitualPedestal(hellfirepvp.astralsorcery.common.tile.TileRitualPedestal) TileRitualLink(hellfirepvp.astralsorcery.common.tile.TileRitualLink) Nullable(javax.annotation.Nullable)

Aggregations

TileRitualLink (hellfirepvp.astralsorcery.common.tile.TileRitualLink)1 TileRitualPedestal (hellfirepvp.astralsorcery.common.tile.TileRitualPedestal)1 Nullable (javax.annotation.Nullable)1 TileEntity (net.minecraft.tileentity.TileEntity)1