Search in sources :

Example 1 with TileCollectorCrystal

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

the class IndependentCrystalSource method updateFromTileEntity.

@Override
public <T extends TileEntity> boolean updateFromTileEntity(T tile) {
    if (!(tile instanceof TileCollectorCrystal)) {
        return true;
    }
    TileCollectorCrystal tcc = (TileCollectorCrystal) tile;
    this.doesSeeSky = tcc.doesSeeSky();
    // Structural, not player-placed.
    this.doesAutoLink = !tcc.isPlayerMade();
    this.enhanced = tcc.isEnhanced();
    this.constellation = tcc.getAttunedConstellation();
    this.crystalAttributes = tcc.getAttributes();
    return true;
}
Also used : TileCollectorCrystal(hellfirepvp.astralsorcery.common.tile.TileCollectorCrystal)

Example 2 with TileCollectorCrystal

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

the class RegistryCrystalProperties method initDefaultAttributes.

public static void initDefaultAttributes() {
    SOURCE_RITUAL_PEDESTAL = new PropertySource<StarlightReceiverRitualPedestal, Ritual>(AstralSorcery.key("ritual_network")) {

        @Override
        public Ritual createInstance(StarlightReceiverRitualPedestal obj) {
            return new Ritual(this, obj.getChannelingType(), obj.getChannelingTrait());
        }
    };
    SOURCE_TILE_RITUAL_PEDESTAL = new PropertySource<TileRitualPedestal, Ritual>(AstralSorcery.key("ritual_tile")) {

        @Override
        public Ritual createInstance(TileRitualPedestal obj) {
            return new Ritual(this, obj.getRitualConstellation(), obj.getRitualTrait());
        }
    };
    SOURCE_COLLECTOR_CRYSTAL = new PropertySource<IndependentCrystalSource, Crystal>(AstralSorcery.key("crystal_network")) {

        @Override
        public Crystal createInstance(IndependentCrystalSource obj) {
            return new Crystal(this, obj.getStarlightType());
        }
    };
    SOURCE_TILE_COLLECTOR_CRYSTAL = new PropertySource<TileCollectorCrystal, Crystal>(AstralSorcery.key("crystal_tile")) {

        @Override
        public Crystal createInstance(TileCollectorCrystal obj) {
            return new Crystal(this, obj.getAttunedConstellation());
        }
    };
    CREATIVE_CRYSTAL_TOOL_ATTRIBUTES = CrystalAttributes.Builder.newBuilder(false).addProperty(PROPERTY_SIZE, 3).addProperty(PROPERTY_SHAPE, 3).addProperty(PROPERTY_TOOL_DURABILITY, 3).addProperty(PROPERTY_TOOL_EFFICIENCY, 3).build();
    WORLDGEN_SHRINE_COLLECTOR_ATTRIBUTES = CrystalAttributes.Builder.newBuilder(false).addProperty(PROPERTY_SIZE, 2).addProperty(PROPERTY_SHAPE, 2).addProperty(PROPERTY_PURITY, 2).addProperty(PROPERTY_COLLECTOR_COLLECTION_RATE, 2).build();
    CREATIVE_ROCK_COLLECTOR_ATTRIBUTES = CrystalAttributes.Builder.newBuilder(false).addProperty(PROPERTY_SIZE, 3).addProperty(PROPERTY_SHAPE, 3).addProperty(PROPERTY_PURITY, 2).addProperty(PROPERTY_COLLECTOR_COLLECTION_RATE, 3).build();
    CREATIVE_CELESTIAL_COLLECTOR_ATTRIBUTES = CrystalAttributes.Builder.newBuilder(false).addProperty(PROPERTY_SIZE, 3).addProperty(PROPERTY_SHAPE, 3).addProperty(PROPERTY_PURITY, 2).addProperty(PROPERTY_COLLECTOR_COLLECTION_RATE, 3).build();
    LENS_PRISM_CREATIVE_ATTRIBUTES = CrystalAttributes.Builder.newBuilder(false).addProperty(PROPERTY_PURITY, 2).addProperty(PROPERTY_SHAPE, 3).build();
}
Also used : TileRitualPedestal(hellfirepvp.astralsorcery.common.tile.TileRitualPedestal) IndependentCrystalSource(hellfirepvp.astralsorcery.common.starlight.transmission.base.crystal.IndependentCrystalSource) StarlightReceiverRitualPedestal(hellfirepvp.astralsorcery.common.tile.network.StarlightReceiverRitualPedestal) Ritual(hellfirepvp.astralsorcery.common.crystal.source.Ritual) TileCollectorCrystal(hellfirepvp.astralsorcery.common.tile.TileCollectorCrystal) Crystal(hellfirepvp.astralsorcery.common.crystal.source.Crystal) TileCollectorCrystal(hellfirepvp.astralsorcery.common.tile.TileCollectorCrystal)

Example 3 with TileCollectorCrystal

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

the class MarkerManagerAS method makeCollectorCrystal.

private static void makeCollectorCrystal(IWorld world, BlockPos pos, Random rand, MutableBoundingBox box) {
    if (box.isVecInside(pos) && world.getBlockState(pos).getBlock() != BlocksAS.ROCK_COLLECTOR_CRYSTAL) {
        world.setBlockState(pos, BlocksAS.ROCK_COLLECTOR_CRYSTAL.getDefaultState(), Constants.BlockFlags.BLOCK_UPDATE);
        TileCollectorCrystal tcc = MiscUtils.getTileAt(world, pos, TileCollectorCrystal.class, true);
        if (tcc != null) {
            IMajorConstellation cst = MiscUtils.getRandomEntry(ConstellationRegistry.getMajorConstellations(), rand);
            tcc.setAttributes(CrystalPropertiesAS.WORLDGEN_SHRINE_COLLECTOR_ATTRIBUTES);
            tcc.setAttunedConstellation(cst);
        }
    }
}
Also used : IMajorConstellation(hellfirepvp.astralsorcery.common.constellation.IMajorConstellation) TileCollectorCrystal(hellfirepvp.astralsorcery.common.tile.TileCollectorCrystal)

Example 4 with TileCollectorCrystal

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

the class BlockCollectorCrystal method onBlockPlacedBy.

@Override
public void onBlockPlacedBy(World world, BlockPos pos, BlockState state, @Nullable LivingEntity entity, ItemStack stack) {
    TileCollectorCrystal tcc = MiscUtils.getTileAt(world, pos, TileCollectorCrystal.class, true);
    Item i = stack.getItem();
    if (tcc != null && i instanceof ItemBlockCollectorCrystal) {
        ItemBlockCollectorCrystal ibcc = (ItemBlockCollectorCrystal) i;
        UUID playerUUID = null;
        if (entity instanceof PlayerEntity) {
            playerUUID = entity.getUniqueID();
        }
        tcc.updateData(playerUUID, ibcc.getCollectorType());
    }
    super.onBlockPlacedBy(world, pos, state, entity, stack);
}
Also used : Item(net.minecraft.item.Item) ConstellationItem(hellfirepvp.astralsorcery.common.constellation.ConstellationItem) TileCollectorCrystal(hellfirepvp.astralsorcery.common.tile.TileCollectorCrystal) UUID(java.util.UUID) ItemBlockCollectorCrystal(hellfirepvp.astralsorcery.common.item.block.ItemBlockCollectorCrystal) PlayerEntity(net.minecraft.entity.player.PlayerEntity)

Aggregations

TileCollectorCrystal (hellfirepvp.astralsorcery.common.tile.TileCollectorCrystal)4 ConstellationItem (hellfirepvp.astralsorcery.common.constellation.ConstellationItem)1 IMajorConstellation (hellfirepvp.astralsorcery.common.constellation.IMajorConstellation)1 Crystal (hellfirepvp.astralsorcery.common.crystal.source.Crystal)1 Ritual (hellfirepvp.astralsorcery.common.crystal.source.Ritual)1 ItemBlockCollectorCrystal (hellfirepvp.astralsorcery.common.item.block.ItemBlockCollectorCrystal)1 IndependentCrystalSource (hellfirepvp.astralsorcery.common.starlight.transmission.base.crystal.IndependentCrystalSource)1 TileRitualPedestal (hellfirepvp.astralsorcery.common.tile.TileRitualPedestal)1 StarlightReceiverRitualPedestal (hellfirepvp.astralsorcery.common.tile.network.StarlightReceiverRitualPedestal)1 UUID (java.util.UUID)1 PlayerEntity (net.minecraft.entity.player.PlayerEntity)1 Item (net.minecraft.item.Item)1