
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.
70 lines
1.3 KiB
Java
70 lines
1.3 KiB
Java
package wayoftime.bloodmagic.ritual;
|
|
|
|
import net.minecraft.util.Direction;
|
|
import net.minecraft.util.math.BlockPos;
|
|
|
|
/**
|
|
* Used to set a {@link EnumRuneType} type to a given {@link BlockPos} for usage
|
|
* in Ritual creation.
|
|
*/
|
|
public class RitualComponent
|
|
{
|
|
private final BlockPos offset;
|
|
private final EnumRuneType runeType;
|
|
|
|
public RitualComponent(BlockPos offset, EnumRuneType runeType)
|
|
{
|
|
this.offset = offset;
|
|
this.runeType = runeType;
|
|
}
|
|
|
|
public int getX(Direction direction)
|
|
{
|
|
switch (direction)
|
|
{
|
|
case EAST:
|
|
return -this.getOffset().getZ();
|
|
case SOUTH:
|
|
return -this.getOffset().getX();
|
|
case WEST:
|
|
return this.getOffset().getZ();
|
|
default:
|
|
return this.getOffset().getX();
|
|
}
|
|
}
|
|
|
|
public int getY()
|
|
{
|
|
return this.getOffset().getY();
|
|
}
|
|
|
|
public int getZ(Direction direction)
|
|
{
|
|
switch (direction)
|
|
{
|
|
case EAST:
|
|
return this.getOffset().getX();
|
|
case SOUTH:
|
|
return -this.getOffset().getZ();
|
|
case WEST:
|
|
return -this.getOffset().getX();
|
|
default:
|
|
return this.getOffset().getZ();
|
|
}
|
|
}
|
|
|
|
public BlockPos getOffset(Direction direction)
|
|
{
|
|
return new BlockPos(getX(direction), offset.getY(), getZ(direction));
|
|
}
|
|
|
|
public BlockPos getOffset()
|
|
{
|
|
return offset;
|
|
}
|
|
|
|
public EnumRuneType getRuneType()
|
|
{
|
|
return runeType;
|
|
}
|
|
} |