use of WayofTime.bloodmagic.block.BlockBloodRune in project BloodMagic by WayofTime.
the class BloodMagicCorePlugin method register.
@Override
public void register(IBloodMagicAPI apiInterface) {
BloodMagicAPI api = (BloodMagicAPI) apiInterface;
// Add forced blacklistings
api.getBlacklist().addTeleposer(RegistrarBloodMagicBlocks.INPUT_ROUTING_NODE);
api.getBlacklist().addTransposition(RegistrarBloodMagicBlocks.INPUT_ROUTING_NODE);
api.getBlacklist().addTeleposer(RegistrarBloodMagicBlocks.OUTPUT_ROUTING_NODE);
api.getBlacklist().addTransposition(RegistrarBloodMagicBlocks.OUTPUT_ROUTING_NODE);
api.getBlacklist().addTeleposer(RegistrarBloodMagicBlocks.ITEM_ROUTING_NODE);
api.getBlacklist().addTransposition(RegistrarBloodMagicBlocks.ITEM_ROUTING_NODE);
api.getBlacklist().addTeleposer(RegistrarBloodMagicBlocks.MASTER_ROUTING_NODE);
api.getBlacklist().addTransposition(RegistrarBloodMagicBlocks.MASTER_ROUTING_NODE);
api.getBlacklist().addTeleposer(RegistrarBloodMagicBlocks.DEMON_CRYSTAL);
api.getBlacklist().addTransposition(RegistrarBloodMagicBlocks.DEMON_CRYSTAL);
api.getBlacklist().addTeleposer(RegistrarBloodMagicBlocks.INVERSION_PILLAR);
api.getBlacklist().addTransposition(RegistrarBloodMagicBlocks.INVERSION_PILLAR);
api.getBlacklist().addWellOfSuffering(new ResourceLocation("armor_stand"));
api.getBlacklist().addWellOfSuffering(new ResourceLocation(BloodMagic.MODID, "sentient_specter"));
api.getValueManager().setSacrificialValue(new ResourceLocation("armor_stand"), 0);
api.getValueManager().setSacrificialValue(new ResourceLocation(BloodMagic.MODID, "sentient_specter"), 0);
api.getValueManager().setTranquility(Blocks.LAVA, new TranquilityStack(EnumTranquilityType.LAVA, 1.2D));
api.getValueManager().setTranquility(Blocks.FLOWING_LAVA, new TranquilityStack(EnumTranquilityType.LAVA, 1.2D));
api.getValueManager().setTranquility(Blocks.WATER, new TranquilityStack(EnumTranquilityType.WATER, 1.0D));
api.getValueManager().setTranquility(Blocks.FLOWING_WATER, new TranquilityStack(EnumTranquilityType.WATER, 1.0D));
api.getValueManager().setTranquility(RegistrarBloodMagicBlocks.LIFE_ESSENCE, new TranquilityStack(EnumTranquilityType.WATER, 1.5D));
api.getValueManager().setTranquility(Blocks.NETHERRACK, new TranquilityStack(EnumTranquilityType.FIRE, 0.5D));
api.getValueManager().setTranquility(Blocks.DIRT, new TranquilityStack(EnumTranquilityType.EARTHEN, 0.25D));
api.getValueManager().setTranquility(Blocks.FARMLAND, new TranquilityStack(EnumTranquilityType.EARTHEN, 1.0D));
api.getValueManager().setTranquility(Blocks.POTATOES, new TranquilityStack(EnumTranquilityType.CROP, 1.0D));
api.getValueManager().setTranquility(Blocks.CARROTS, new TranquilityStack(EnumTranquilityType.CROP, 1.0D));
api.getValueManager().setTranquility(Blocks.WHEAT, new TranquilityStack(EnumTranquilityType.CROP, 1.0D));
api.getValueManager().setTranquility(Blocks.NETHER_WART, new TranquilityStack(EnumTranquilityType.CROP, 1.0D));
api.getValueManager().setTranquility(Blocks.BEETROOTS, new TranquilityStack(EnumTranquilityType.CROP, 1.0D));
handleConfigValues(api);
// Add standard blocks for altar components
api.registerAltarComponent(Blocks.GLOWSTONE.getDefaultState(), ComponentType.GLOWSTONE.name());
api.registerAltarComponent(Blocks.SEA_LANTERN.getDefaultState(), ComponentType.GLOWSTONE.name());
api.registerAltarComponent(Blocks.BEACON.getDefaultState(), ComponentType.BEACON.name());
BlockDecorative decorative = (BlockDecorative) RegistrarBloodMagicBlocks.DECORATIVE_BRICK;
api.registerAltarComponent(decorative.getDefaultState().withProperty(decorative.getProperty(), EnumDecorative.BLOODSTONE_BRICK), ComponentType.BLOODSTONE.name());
api.registerAltarComponent(decorative.getDefaultState().withProperty(decorative.getProperty(), EnumDecorative.BLOODSTONE_TILE), ComponentType.BLOODSTONE.name());
api.registerAltarComponent(decorative.getDefaultState().withProperty(decorative.getProperty(), EnumDecorative.CRYSTAL_BRICK), ComponentType.CRYSTAL.name());
api.registerAltarComponent(decorative.getDefaultState().withProperty(decorative.getProperty(), EnumDecorative.CRYSTAL_TILE), ComponentType.CRYSTAL.name());
BlockBloodRune bloodRune = (BlockBloodRune) RegistrarBloodMagicBlocks.BLOOD_RUNE;
for (BloodRuneType runeType : BloodRuneType.values()) api.registerAltarComponent(bloodRune.getDefaultState().withProperty(bloodRune.getProperty(), runeType), ComponentType.BLOODRUNE.name());
}
use of WayofTime.bloodmagic.block.BlockBloodRune in project BloodMagic by WayofTime.
the class RitualAltarBuilder method getBloodRune.
public BlockStack getBloodRune(TileEntity tileEntity) {
if (tileEntity != null) {
if (tileEntity.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.DOWN)) {
IItemHandler itemHandler = tileEntity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.DOWN);
if (itemHandler.getSlots() <= 0) {
return null;
}
for (int i = 0; i < itemHandler.getSlots(); i++) {
if (!itemHandler.getStackInSlot(i).isEmpty() && itemHandler.getStackInSlot(i).getItem() instanceof ItemBlock && Block.getBlockFromItem(itemHandler.getStackInSlot(i).getItem()) instanceof BlockBloodRune && itemHandler.extractItem(i, 1, true) != null) {
BlockStack blockStack = new BlockStack(Utils.getBlockForComponent(ComponentType.BLOODRUNE), itemHandler.getStackInSlot(i).getItemDamage());
itemHandler.extractItem(i, 1, false);
return blockStack;
}
}
} else if (tileEntity instanceof IInventory) {
IInventory inv = (IInventory) tileEntity;
for (int i = 0; i < inv.getSizeInventory(); i++) {
if (!inv.getStackInSlot(i).isEmpty() && inv.getStackInSlot(i).getItem() instanceof ItemBlock && Block.getBlockFromItem(inv.getStackInSlot(i).getItem()) instanceof BlockBloodRune) {
BlockStack blockStack = new BlockStack(Utils.getBlockForComponent(ComponentType.BLOODRUNE), inv.getStackInSlot(i).getItemDamage());
inv.decrStackSize(i, 1);
return blockStack;
}
}
}
}
return null;
}
use of WayofTime.bloodmagic.block.BlockBloodRune in project BloodMagic by WayofTime.
the class AltarUtil method getUpgrades.
@Nonnull
public static AltarUpgrade getUpgrades(World world, BlockPos pos, AltarTier currentTier) {
AltarUpgrade upgrades = new AltarUpgrade();
for (AltarTier tier : AltarTier.values()) {
if (tier.ordinal() > currentTier.ordinal())
return upgrades;
for (AltarComponent component : tier.getAltarComponents()) {
if (!component.isUpgradeSlot() || component.getComponent() != ComponentType.BLOODRUNE)
continue;
BlockPos componentPos = pos.add(component.getOffset());
IBlockState state = world.getBlockState(componentPos);
if (state.getBlock() instanceof BlockBloodRune)
upgrades.upgrade(((BlockBloodRune) state.getBlock()).getBloodRune(world, componentPos, state));
}
}
return upgrades;
}
use of WayofTime.bloodmagic.block.BlockBloodRune in project BloodMagic by WayofTime.
the class RitualAltarBuilder method getMundaneBlock.
public BlockStack getMundaneBlock(TileEntity tileEntity) {
if (tileEntity != null) {
if (tileEntity.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.DOWN)) {
IItemHandler itemHandler = tileEntity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.DOWN);
if (itemHandler.getSlots() <= 0) {
return null;
}
for (int i = 0; i < itemHandler.getSlots(); i++) {
if (!itemHandler.getStackInSlot(i).isEmpty() && itemHandler.getStackInSlot(i).getItem() instanceof ItemBlock && !(Block.getBlockFromItem(itemHandler.getStackInSlot(i).getItem()) instanceof BlockBloodRune) && !itemHandler.extractItem(i, 1, true).isEmpty()) {
Block block = Block.getBlockFromItem(itemHandler.getStackInSlot(i).getItem());
if (block != Blocks.AIR && block != Blocks.GLOWSTONE && block != RegistrarBloodMagicBlocks.DECORATIVE_BRICK) {
BlockStack blockStack = new BlockStack(block, itemHandler.getStackInSlot(i).getItemDamage());
itemHandler.extractItem(i, 1, false);
return blockStack;
}
}
}
} else if (tileEntity instanceof IInventory) {
IInventory inv = (IInventory) tileEntity;
for (int i = 0; i < inv.getSizeInventory(); i++) {
if (!inv.getStackInSlot(i).isEmpty() && inv.getStackInSlot(i).getItem() instanceof ItemBlock && !(Block.getBlockFromItem(inv.getStackInSlot(i).getItem()) instanceof BlockBloodRune)) {
Block block = Block.getBlockFromItem(inv.getStackInSlot(i).getItem());
if (block != Blocks.GLOWSTONE && block != RegistrarBloodMagicBlocks.DECORATIVE_BRICK) {
BlockStack blockStack = new BlockStack(block, inv.getStackInSlot(i).getItemDamage());
inv.decrStackSize(i, 1);
return blockStack;
}
}
}
}
}
return null;
}
Aggregations