Initial Work on Rituals
Added the framework for Rituals, including the automatic registration of rituals using the annotation. This includes: - The Master Ritual Stone - The regular Ritual Stones (all 7 types) - The Ritual Registration system - The activation crystal items. - Reintroduction of the Demon Will Aura (changed saved Dimension ID from Integer to ResourceLocation) Localization needs to be completed, as well as the implementation of all the rituals.
This commit is contained in:
parent
0a9717f1ed
commit
1f0dcb608a
61 changed files with 3943 additions and 26 deletions
|
@ -0,0 +1,89 @@
|
|||
package wayoftime.bloodmagic.common.block;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ToolType;
|
||||
import wayoftime.bloodmagic.ritual.EnumRuneType;
|
||||
import wayoftime.bloodmagic.ritual.IRitualStone;
|
||||
|
||||
public class BlockRitualStone extends Block implements IRitualStone
|
||||
{
|
||||
private final EnumRuneType type;
|
||||
|
||||
public BlockRitualStone(EnumRuneType type)
|
||||
{
|
||||
super(Properties.create(Material.ROCK).hardnessAndResistance(2.0F, 5.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(2));
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, @Nullable IBlockReader world, List<ITextComponent> tooltip, ITooltipFlag flag)
|
||||
{
|
||||
tooltip.add(new TranslationTextComponent("tooltip.bloodmagic.decoration.safe"));
|
||||
super.addInformation(stack, world, tooltip, flag);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public int damageDropped(BlockState state)
|
||||
// {
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean canSilkHarvest(World world, BlockPos pos, BlockState state, PlayerEntity player)
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean isRuneType(World world, BlockPos pos, EnumRuneType runeType)
|
||||
{
|
||||
return type.equals(runeType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRuneType(World world, BlockPos pos, EnumRuneType runeType)
|
||||
{
|
||||
Block runeBlock = this;
|
||||
switch (type)
|
||||
{
|
||||
case AIR:
|
||||
runeBlock = BloodMagicBlocks.AIR_RITUAL_STONE.get();
|
||||
break;
|
||||
case BLANK:
|
||||
runeBlock = BloodMagicBlocks.BLANK_RITUAL_STONE.get();
|
||||
break;
|
||||
case DAWN:
|
||||
runeBlock = BloodMagicBlocks.DAWN_RITUAL_STONE.get();
|
||||
break;
|
||||
case DUSK:
|
||||
runeBlock = BloodMagicBlocks.DUSK_RITUAL_STONE.get();
|
||||
break;
|
||||
case EARTH:
|
||||
runeBlock = BloodMagicBlocks.EARTH_RITUAL_STONE.get();
|
||||
break;
|
||||
case FIRE:
|
||||
runeBlock = BloodMagicBlocks.FIRE_RITUAL_STONE.get();
|
||||
break;
|
||||
case WATER:
|
||||
runeBlock = BloodMagicBlocks.WATER_RITUAL_STONE.get();
|
||||
break;
|
||||
}
|
||||
|
||||
BlockState newState = runeBlock.getDefaultState();
|
||||
world.setBlockState(pos, newState);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue