Finished implementation of Incense Altar and associated blocks.
Also added the recipe for the Ritual Tinkerer, as well as the finalized book entry for the Incense Altar.
This commit is contained in:
parent
7634404dac
commit
cb2db9bc50
108 changed files with 2197 additions and 81 deletions
|
@ -32,14 +32,14 @@ public interface IBloodMagicAPI
|
|||
*/
|
||||
@Nonnull
|
||||
IBloodMagicRecipeRegistrar getRecipeRegistrar();
|
||||
//
|
||||
// /**
|
||||
// * Retrieves the instance of the value manager.
|
||||
// *
|
||||
// * @return the active {@link IBloodMagicValueManager} instance
|
||||
// */
|
||||
// @Nonnull
|
||||
// IBloodMagicValueManager getValueManager();
|
||||
|
||||
/**
|
||||
* Retrieves the instance of the value manager.
|
||||
*
|
||||
* @return the active {@link IBloodMagicValueManager} instance
|
||||
*/
|
||||
@Nonnull
|
||||
IBloodMagicValueManager getValueManager();
|
||||
|
||||
/**
|
||||
* Registers an {@link IBlockState} as a given component for the Blood Altar.
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
package wayoftime.bloodmagic.api;
|
||||
|
||||
import javax.annotation.Nonnegative;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
/**
|
||||
* Allows value modification for various features of Blood Magic such as
|
||||
* Sacrificial values.
|
||||
*/
|
||||
public interface IBloodMagicValueManager
|
||||
{
|
||||
|
||||
/**
|
||||
* Sets the amount of LP received per health point from sacrificing the given
|
||||
* entity. By default, this is 25. Setting the value to 0 effectively disables
|
||||
* sacrificing.
|
||||
*
|
||||
* @param entityId The registry name of the entity.
|
||||
* @param value The amount of LP per health point to receive upon sacrifice.
|
||||
*/
|
||||
void setSacrificialValue(@Nonnull ResourceLocation entityId, @Nonnegative int value);
|
||||
|
||||
/**
|
||||
* Sets the Tranquility value of a given {@link IBlockState}.
|
||||
* <p>
|
||||
* Valid tranquility types:
|
||||
* <ul>
|
||||
* <li>PLANT</li>
|
||||
* <li>CROP</li>
|
||||
* <li>TREE</li>
|
||||
* <li>EARTHEN</li>
|
||||
* <li>WATER</li>
|
||||
* <li>FIRE</li>
|
||||
* <li>LAVA</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param state The {@link IBlockState} to set the value of.
|
||||
* @param tranquilityType The type of Tranquility this block should provide.
|
||||
* @param value The amount of tranquility this block should provide.
|
||||
*/
|
||||
void setTranquility(@Nonnull BlockState state, @Nonnull String tranquilityType, double value);
|
||||
}
|
|
@ -19,14 +19,14 @@ public class BloodMagicAPI implements IBloodMagicAPI
|
|||
|
||||
// private final BloodMagicBlacklist blacklist;
|
||||
private final BloodMagicRecipeRegistrar recipeRegistrar;
|
||||
// private final BloodMagicValueManager valueManager;
|
||||
private final BloodMagicValueManager valueManager;
|
||||
private final Multimap<ComponentType, BlockState> altarComponents;
|
||||
|
||||
public BloodMagicAPI()
|
||||
{
|
||||
// this.blacklist = new BloodMagicBlacklist();
|
||||
this.recipeRegistrar = new BloodMagicRecipeRegistrar();
|
||||
// this.valueManager = new BloodMagicValueManager();
|
||||
this.valueManager = new BloodMagicValueManager();
|
||||
this.altarComponents = ArrayListMultimap.create();
|
||||
}
|
||||
|
||||
|
@ -43,13 +43,14 @@ public class BloodMagicAPI implements IBloodMagicAPI
|
|||
{
|
||||
return recipeRegistrar;
|
||||
}
|
||||
|
||||
//
|
||||
// @Nonnull
|
||||
// @Override
|
||||
// public BloodMagicValueManager getValueManager()
|
||||
// {
|
||||
// return valueManager;
|
||||
// }
|
||||
@Nonnull
|
||||
@Override
|
||||
public BloodMagicValueManager getValueManager()
|
||||
{
|
||||
return valueManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerAltarComponent(@Nonnull BlockState state, @Nonnull String componentType)
|
||||
|
|
|
@ -4,6 +4,8 @@ import net.minecraft.block.Blocks;
|
|||
import wayoftime.bloodmagic.altar.ComponentType;
|
||||
import wayoftime.bloodmagic.api.IBloodMagicAPI;
|
||||
import wayoftime.bloodmagic.common.block.BloodMagicBlocks;
|
||||
import wayoftime.bloodmagic.incense.EnumTranquilityType;
|
||||
import wayoftime.bloodmagic.incense.TranquilityStack;
|
||||
|
||||
public class BloodMagicCorePlugin
|
||||
{
|
||||
|
@ -11,6 +13,21 @@ public class BloodMagicCorePlugin
|
|||
|
||||
public void register(IBloodMagicAPI apiInterface)
|
||||
{
|
||||
BloodMagicAPI api = (BloodMagicAPI) apiInterface;
|
||||
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.water, new TranquilityStack(EnumTranquilityType.WATER, 1.0D));
|
||||
api.getValueManager().setTranquility(BloodMagicBlocks.LIFE_ESSENCE_BLOCK.get(), 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));
|
||||
|
||||
apiInterface.registerAltarComponent(Blocks.GLOWSTONE.getDefaultState(), ComponentType.GLOWSTONE.name());
|
||||
apiInterface.registerAltarComponent(Blocks.SEA_LANTERN.getDefaultState(), ComponentType.GLOWSTONE.name());
|
||||
apiInterface.registerAltarComponent(BloodMagicBlocks.BLOODSTONE.get().getDefaultState(), ComponentType.BLOODSTONE.name());
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
package wayoftime.bloodmagic.api.impl;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import wayoftime.bloodmagic.api.IBloodMagicValueManager;
|
||||
import wayoftime.bloodmagic.incense.EnumTranquilityType;
|
||||
import wayoftime.bloodmagic.incense.TranquilityStack;
|
||||
import wayoftime.bloodmagic.util.BMLog;
|
||||
|
||||
public class BloodMagicValueManager implements IBloodMagicValueManager
|
||||
{
|
||||
|
||||
private final Map<ResourceLocation, Integer> sacrificial;
|
||||
private final Map<BlockState, TranquilityStack> tranquility;
|
||||
|
||||
public BloodMagicValueManager()
|
||||
{
|
||||
this.sacrificial = Maps.newHashMap();
|
||||
this.tranquility = Maps.newHashMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSacrificialValue(@Nonnull ResourceLocation entityId, int value)
|
||||
{
|
||||
BMLog.API_VERBOSE.info("Value Manager: Set sacrificial value of {} to {}.", entityId, value);
|
||||
sacrificial.put(entityId, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTranquility(@Nonnull BlockState state, @Nonnull String tranquilityType, double value)
|
||||
{
|
||||
EnumTranquilityType tranquility = null;
|
||||
for (EnumTranquilityType type : EnumTranquilityType.values())
|
||||
{
|
||||
if (type.name().equalsIgnoreCase(tranquilityType))
|
||||
{
|
||||
tranquility = type;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (tranquility != null)
|
||||
{
|
||||
BMLog.API_VERBOSE.info("Value Manager: Set tranquility value of {} to {} @ {}", state, tranquilityType, value);
|
||||
this.tranquility.put(state, new TranquilityStack(tranquility, value));
|
||||
} else
|
||||
BMLog.API.warn("Invalid tranquility type: {}.", tranquilityType);
|
||||
}
|
||||
|
||||
public void setTranquility(Block block, TranquilityStack tranquilityStack)
|
||||
{
|
||||
for (BlockState state : block.getStateContainer().getValidStates())
|
||||
{
|
||||
BMLog.API_VERBOSE.info("Value Manager: Set tranquility value of {} to {} @ {}", state, tranquilityStack.type, tranquilityStack.value);
|
||||
tranquility.put(state, tranquilityStack);
|
||||
}
|
||||
}
|
||||
|
||||
public Map<ResourceLocation, Integer> getSacrificial()
|
||||
{
|
||||
return ImmutableMap.copyOf(sacrificial);
|
||||
}
|
||||
|
||||
public Map<BlockState, TranquilityStack> getTranquility()
|
||||
{
|
||||
return ImmutableMap.copyOf(tranquility);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue