
The new one is now built for the api jar and the old one is now internal. It will slowly be moved around to sane places within the internal code. Most of the features provided in the old "api" are addon specific features which will generally rely on the main jar anyways. The new API will be specific to compatibility features, such as blacklists, recipes, and value modification.
108 lines
3.8 KiB
Java
108 lines
3.8 KiB
Java
package WayofTime.bloodmagic.incense;
|
|
|
|
import WayofTime.bloodmagic.apibutnotreally.incense.EnumTranquilityType;
|
|
import WayofTime.bloodmagic.apibutnotreally.incense.ITranquilityHandler;
|
|
import WayofTime.bloodmagic.apibutnotreally.incense.TranquilityStack;
|
|
import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks;
|
|
import net.minecraft.block.*;
|
|
import net.minecraft.block.state.IBlockState;
|
|
import net.minecraft.init.Blocks;
|
|
import net.minecraft.util.math.BlockPos;
|
|
import net.minecraft.world.World;
|
|
|
|
public class TranquilityHandlers {
|
|
|
|
public static class Plant implements ITranquilityHandler {
|
|
@Override
|
|
public TranquilityStack getTranquilityOfBlock(World world, BlockPos pos, Block block, IBlockState state) {
|
|
if (block instanceof BlockLeaves) {
|
|
return new TranquilityStack(EnumTranquilityType.PLANT, 1);
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public static class Lava implements ITranquilityHandler {
|
|
@Override
|
|
public TranquilityStack getTranquilityOfBlock(World world, BlockPos pos, Block block, IBlockState state) {
|
|
if (block == Blocks.LAVA || block == Blocks.FLOWING_LAVA) {
|
|
return new TranquilityStack(EnumTranquilityType.LAVA, 1.2);
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public static class Fire implements ITranquilityHandler {
|
|
@Override
|
|
public TranquilityStack getTranquilityOfBlock(World world, BlockPos pos, Block block, IBlockState state) {
|
|
if (block instanceof BlockFire) {
|
|
return new TranquilityStack(EnumTranquilityType.FIRE, 1);
|
|
}
|
|
|
|
if (block == Blocks.NETHERRACK) {
|
|
return new TranquilityStack(EnumTranquilityType.FIRE, 0.5);
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public static class Earth implements ITranquilityHandler {
|
|
@Override
|
|
public TranquilityStack getTranquilityOfBlock(World world, BlockPos pos, Block block, IBlockState state) {
|
|
if (block == Blocks.DIRT) {
|
|
return new TranquilityStack(EnumTranquilityType.EARTHEN, 0.25);
|
|
}
|
|
|
|
if (block instanceof BlockGrass) {
|
|
return new TranquilityStack(EnumTranquilityType.EARTHEN, 0.5);
|
|
}
|
|
|
|
if (block == Blocks.FARMLAND) {
|
|
return new TranquilityStack(EnumTranquilityType.EARTHEN, 1);
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public static class Crop implements ITranquilityHandler {
|
|
@Override
|
|
public TranquilityStack getTranquilityOfBlock(World world, BlockPos pos, Block block, IBlockState state) {
|
|
if (block == Blocks.POTATOES || block == Blocks.CARROTS || block == Blocks.WHEAT || block == Blocks.NETHER_WART || block == Blocks.BEETROOTS) {
|
|
return new TranquilityStack(EnumTranquilityType.CROP, 1);
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public static class Tree implements ITranquilityHandler {
|
|
@Override
|
|
public TranquilityStack getTranquilityOfBlock(World world, BlockPos pos, Block block, IBlockState state) {
|
|
if (block instanceof BlockLog) {
|
|
return new TranquilityStack(EnumTranquilityType.TREE, 1);
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public static class Water implements ITranquilityHandler {
|
|
@Override
|
|
public TranquilityStack getTranquilityOfBlock(World world, BlockPos pos, Block block, IBlockState state) {
|
|
if (block == Blocks.WATER || block == Blocks.FLOWING_WATER) {
|
|
return new TranquilityStack(EnumTranquilityType.WATER, 1);
|
|
}
|
|
|
|
if (block == RegistrarBloodMagicBlocks.LIFE_ESSENCE) {
|
|
return new TranquilityStack(EnumTranquilityType.WATER, 1.5);
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|
|
}
|