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;
}
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();
}
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);
}
}
}
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);
}
Aggregations