Added more rituals

Includes the Green Grove, Regen, Animal Growth, and a fix to the Feathered Knife ritual so that it... doesn't cause the damage animation.
This commit is contained in:
WayofTime 2020-11-26 15:21:03 -05:00
parent e312e3d854
commit 06faa916c3
15 changed files with 1365 additions and 45 deletions

View file

@ -24,25 +24,25 @@ public class BloodMagicAPI implements IBloodMagicAPI
public static final BloodMagicAPI INSTANCE = new BloodMagicAPI();
// private final BloodMagicBlacklist blacklist;
private final BloodMagicBlacklist blacklist;
private final BloodMagicRecipeRegistrar recipeRegistrar;
private final BloodMagicValueManager valueManager;
private final Multimap<ComponentType, BlockState> altarComponents;
public BloodMagicAPI()
{
// this.blacklist = new BloodMagicBlacklist();
this.blacklist = new BloodMagicBlacklist();
this.recipeRegistrar = new BloodMagicRecipeRegistrar();
this.valueManager = new BloodMagicValueManager();
this.altarComponents = ArrayListMultimap.create();
}
// @Nonnull
// @Override
// public BloodMagicBlacklist getBlacklist()
// {
// return blacklist;
// }
@Nonnull
@Override
public BloodMagicBlacklist getBlacklist()
{
return blacklist;
}
@Nonnull
public BloodMagicRecipeRegistrar getRecipeRegistrar()
@ -91,9 +91,10 @@ public class BloodMagicAPI implements IBloodMagicAPI
if (type != null)
{
IncenseTranquilityRegistry.registerTranquilityHandler((world, pos, block, state) -> blockState.test(state) ? new TranquilityStack(type, value) : null);
}
else
IncenseTranquilityRegistry.registerTranquilityHandler((world, pos, block, state) -> blockState.test(state)
? new TranquilityStack(type, value)
: null);
} else
{
BMLog.API.warn("Invalid Tranquility type: {}.", tranquilityType);
}

View file

@ -0,0 +1,125 @@
package wayoftime.bloodmagic.impl;
import java.util.Set;
import javax.annotation.Nonnull;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.util.ResourceLocation;
import wayoftime.bloodmagic.api.IBloodMagicBlacklist;
import wayoftime.bloodmagic.util.BMLog;
public class BloodMagicBlacklist implements IBloodMagicBlacklist
{
private final Set<BlockState> teleposer;
private final Set<ResourceLocation> teleposerEntities;
private final Set<BlockState> transposition;
private final Set<BlockState> greenGrove;
private final Set<ResourceLocation> sacrifice;
public BloodMagicBlacklist()
{
this.teleposer = Sets.newHashSet();
this.teleposerEntities = Sets.newHashSet();
this.transposition = Sets.newHashSet();
this.greenGrove = Sets.newHashSet();
this.sacrifice = Sets.newHashSet();
}
@Override
public void addTeleposer(@Nonnull BlockState state)
{
if (!teleposer.contains(state))
{
BMLog.API_VERBOSE.info("Blacklist: Added {} to the Teleposer blacklist.", state);
teleposer.add(state);
}
}
public void addTeleposer(@Nonnull Block block)
{
for (BlockState state : block.getStateContainer().getValidStates()) addTeleposer(state);
}
@Override
public void addTeleposer(@Nonnull ResourceLocation entityId)
{
if (!teleposerEntities.contains(entityId))
{
BMLog.API_VERBOSE.info("Blacklist: Added {} to the Teleposer blacklist.", entityId);
teleposerEntities.add(entityId);
}
}
@Override
public void addTransposition(@Nonnull BlockState state)
{
if (!transposition.contains(state))
{
BMLog.API_VERBOSE.info("Blacklist: Added {} to the Transposition blacklist.", state);
transposition.add(state);
}
}
public void addTransposition(@Nonnull Block block)
{
for (BlockState state : block.getStateContainer().getValidStates()) addTransposition(state);
}
@Override
public void addGreenGrove(@Nonnull BlockState state)
{
if (!greenGrove.contains(state))
{
BMLog.API_VERBOSE.info("Blacklist: Added {} to the Green Grove blacklist.", state);
greenGrove.add(state);
}
}
public void addGreenGrove(@Nonnull Block block)
{
for (BlockState state : block.getStateContainer().getValidStates()) addGreenGrove(state);
}
@Override
public void addWellOfSuffering(@Nonnull ResourceLocation entityId)
{
if (!sacrifice.contains(entityId))
{
BMLog.API_VERBOSE.info("Blacklist: Added {} to the Well of Suffering blacklist.", entityId);
sacrifice.add(entityId);
}
}
// Internal use getters
public Set<BlockState> getTeleposer()
{
return ImmutableSet.copyOf(teleposer);
}
public Set<ResourceLocation> getTeleposerEntities()
{
return ImmutableSet.copyOf(teleposerEntities);
}
public Set<BlockState> getTransposition()
{
return ImmutableSet.copyOf(transposition);
}
public Set<BlockState> getGreenGrove()
{
return ImmutableSet.copyOf(greenGrove);
}
public Set<ResourceLocation> getSacrifice()
{
return ImmutableSet.copyOf(sacrifice);
}
}