Swap the API packages

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.
This commit is contained in:
Nicholas Ignoffo 2018-02-05 17:04:38 -08:00
parent 4fbcac6aa2
commit ddaadfbe52
421 changed files with 1006 additions and 999 deletions

View file

@ -1,58 +0,0 @@
package WayofTime.bloodmagic.api_impl;
import WayofTime.bloodmagic.api.altar.EnumAltarComponent;
import WayofTime.bloodmagic.apiv2.IBloodMagicAPI;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import com.google.common.collect.Multimap;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.ResourceLocation;
import java.util.*;
public class BloodMagicAPI implements IBloodMagicAPI {
public static final BloodMagicAPI INSTANCE = new BloodMagicAPI();
private final BloodMagicBlacklist blacklist;
private final Map<ResourceLocation, Integer> sacrificialValues;
private final Multimap<EnumAltarComponent, IBlockState> altarComponents;
public BloodMagicAPI() {
this.blacklist = new BloodMagicBlacklist();
this.sacrificialValues = Maps.newHashMap();
this.altarComponents = ArrayListMultimap.create();
}
@Override
public BloodMagicBlacklist getBlacklist() {
return blacklist;
}
@Override
public void setSacrificialValue(ResourceLocation entityId, int value) {
sacrificialValues.put(entityId, value);
}
@Override
public void registerAltarComponent(IBlockState state, String componentType) {
EnumAltarComponent component = EnumAltarComponent.NOTAIR;
for (EnumAltarComponent type : EnumAltarComponent.VALUES) {
if (type.name().equalsIgnoreCase(componentType)) {
component = type;
break;
}
}
altarComponents.put(component, state);
}
public Map<ResourceLocation, Integer> getSacrificialValues() {
return ImmutableMap.copyOf(sacrificialValues);
}
public List<IBlockState> getComponentStates(EnumAltarComponent component) {
return (List<IBlockState>) altarComponents.get(component);
}
}