Logging overhaul
This commit is contained in:
parent
29c2ebe8c2
commit
b29ade63f0
12 changed files with 130 additions and 40 deletions
|
@ -2,6 +2,7 @@ package WayofTime.bloodmagic.api.impl;
|
|||
|
||||
import WayofTime.bloodmagic.api.IBloodMagicAPI;
|
||||
import WayofTime.bloodmagic.altar.EnumAltarComponent;
|
||||
import WayofTime.bloodmagic.util.BMLog;
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
@ -45,7 +46,7 @@ public class BloodMagicAPI implements IBloodMagicAPI {
|
|||
|
||||
@Override
|
||||
public void registerAltarComponent(@Nonnull IBlockState state, @Nonnull String componentType) {
|
||||
EnumAltarComponent component = EnumAltarComponent.NOTAIR;
|
||||
EnumAltarComponent component = null;
|
||||
for (EnumAltarComponent type : EnumAltarComponent.VALUES) {
|
||||
if (type.name().equalsIgnoreCase(componentType)) {
|
||||
component = type;
|
||||
|
@ -53,7 +54,10 @@ public class BloodMagicAPI implements IBloodMagicAPI {
|
|||
}
|
||||
}
|
||||
|
||||
altarComponents.put(component, state);
|
||||
if (component != null) {
|
||||
BMLog.API.info("Registered {} as a {} altar component.", state, componentType);
|
||||
altarComponents.put(component, state);
|
||||
} else BMLog.API.warn("Invalid Altar component type: {}.", componentType);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package WayofTime.bloodmagic.api.impl;
|
||||
|
||||
import WayofTime.bloodmagic.api.IBloodMagicBlacklist;
|
||||
import WayofTime.bloodmagic.util.BMLog;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Sets;
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -28,8 +29,10 @@ public class BloodMagicBlacklist implements IBloodMagicBlacklist {
|
|||
|
||||
@Override
|
||||
public void addTeleposer(@Nonnull IBlockState state) {
|
||||
if (!teleposer.contains(state))
|
||||
if (!teleposer.contains(state)) {
|
||||
BMLog.API.info("Blacklist: Added {} to the Teleposer blacklist.", state);
|
||||
teleposer.add(state);
|
||||
}
|
||||
}
|
||||
|
||||
public void addTeleposer(@Nonnull Block block) {
|
||||
|
@ -39,14 +42,18 @@ public class BloodMagicBlacklist implements IBloodMagicBlacklist {
|
|||
|
||||
@Override
|
||||
public void addTeleposer(@Nonnull ResourceLocation entityId) {
|
||||
if (!teleposerEntities.contains(entityId))
|
||||
if (!teleposerEntities.contains(entityId)) {
|
||||
BMLog.API.info("Blacklist: Added {} to the Teleposer blacklist.", entityId);
|
||||
teleposerEntities.add(entityId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTransposition(@Nonnull IBlockState state) {
|
||||
if (!transposition.contains(state))
|
||||
if (!transposition.contains(state)) {
|
||||
BMLog.API.info("Blacklist: Added {} to the Transposition blacklist.", state);
|
||||
transposition.add(state);
|
||||
}
|
||||
}
|
||||
|
||||
public void addTransposition(@Nonnull Block block) {
|
||||
|
@ -56,8 +63,10 @@ public class BloodMagicBlacklist implements IBloodMagicBlacklist {
|
|||
|
||||
@Override
|
||||
public void addGreenGrove(@Nonnull IBlockState state) {
|
||||
if (!greenGrove.contains(state))
|
||||
if (!greenGrove.contains(state)) {
|
||||
BMLog.API.info("Blacklist: Added {} to the Green Grove blacklist.", state);
|
||||
greenGrove.add(state);
|
||||
}
|
||||
}
|
||||
|
||||
public void addGreenGrove(@Nonnull Block block) {
|
||||
|
@ -67,8 +76,10 @@ public class BloodMagicBlacklist implements IBloodMagicBlacklist {
|
|||
|
||||
@Override
|
||||
public void addWellOfSuffering(@Nonnull ResourceLocation entityId) {
|
||||
if (!sacrifice.contains(entityId))
|
||||
if (!sacrifice.contains(entityId)) {
|
||||
BMLog.API.info("Blacklist: Added {} to the Well of Suffering blacklist.", entityId);
|
||||
sacrifice.add(entityId);
|
||||
}
|
||||
}
|
||||
|
||||
// Internal use getters
|
||||
|
|
|
@ -3,6 +3,7 @@ package WayofTime.bloodmagic.api.impl;
|
|||
import WayofTime.bloodmagic.api.IBloodMagicValueManager;
|
||||
import WayofTime.bloodmagic.incense.EnumTranquilityType;
|
||||
import WayofTime.bloodmagic.incense.TranquilityStack;
|
||||
import WayofTime.bloodmagic.util.BMLog;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Maps;
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -24,6 +25,7 @@ public class BloodMagicValueManager implements IBloodMagicValueManager {
|
|||
|
||||
@Override
|
||||
public void setSacrificialValue(@Nonnull ResourceLocation entityId, int value) {
|
||||
BMLog.API.info("Value Manager: Set sacrificial value of {} to {}.", entityId, value);
|
||||
sacrificial.put(entityId, value);
|
||||
}
|
||||
|
||||
|
@ -37,13 +39,17 @@ public class BloodMagicValueManager implements IBloodMagicValueManager {
|
|||
}
|
||||
}
|
||||
|
||||
if (tranquility != null)
|
||||
if (tranquility != null) {
|
||||
BMLog.API.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 (IBlockState state : block.getBlockState().getValidStates())
|
||||
for (IBlockState state : block.getBlockState().getValidStates()) {
|
||||
BMLog.API.info("Value Manager: Set tranquility value of {} to {} @ {}", state, tranquilityStack.type, tranquilityStack.value);
|
||||
tranquility.put(state, tranquilityStack);
|
||||
}
|
||||
}
|
||||
|
||||
public Map<ResourceLocation, Integer> getSacrificial() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue