Added a bit of framework for the incense system.
This commit is contained in:
parent
2ffd6c144a
commit
574c995865
10 changed files with 286 additions and 0 deletions
|
@ -0,0 +1,8 @@
|
|||
package WayofTime.bloodmagic.api.incense;
|
||||
|
||||
public enum EnumTranquilityType
|
||||
{
|
||||
PLANT(),
|
||||
WATER(),
|
||||
FIRE();
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package WayofTime.bloodmagic.api.incense;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IIncensePath
|
||||
{
|
||||
/**
|
||||
* Goes from 0 to however far this path block can be from the altar while
|
||||
* still functioning. 0 represents a block that can work when it is two
|
||||
* blocks horizontally away from the altar.
|
||||
*/
|
||||
int getLevelOfPath(World world, BlockPos pos, IBlockState state);
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package WayofTime.bloodmagic.api.incense;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class IncenseTranquilityRegistry
|
||||
{
|
||||
public static List<TranquilityHandler> handlerList = new ArrayList<TranquilityHandler>();
|
||||
|
||||
public static void registerTranquilityHandler(TranquilityHandler handler)
|
||||
{
|
||||
handlerList.add(handler);
|
||||
}
|
||||
|
||||
public static TranquilityStack getTranquilityOfBlock(World world, BlockPos pos, Block block, IBlockState state)
|
||||
{
|
||||
for (TranquilityHandler handler : handlerList)
|
||||
{
|
||||
TranquilityStack tranq = handler.getTranquilityOfBlock(world, pos, block, state);
|
||||
if (tranq != null)
|
||||
{
|
||||
return tranq;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package WayofTime.bloodmagic.api.incense;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public abstract class TranquilityHandler
|
||||
{
|
||||
public abstract TranquilityStack getTranquilityOfBlock(World world, BlockPos pos, Block block, IBlockState state);
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package WayofTime.bloodmagic.api.incense;
|
||||
|
||||
public class TranquilityStack
|
||||
{
|
||||
public final EnumTranquilityType type;
|
||||
public double value;
|
||||
|
||||
public TranquilityStack(EnumTranquilityType type, double value)
|
||||
{
|
||||
this.type = type;
|
||||
this.value = value;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue