Logging overhaul
This commit is contained in:
parent
29c2ebe8c2
commit
b29ade63f0
12 changed files with 130 additions and 40 deletions
|
@ -1,5 +1,7 @@
|
|||
package WayofTime.bloodmagic.core.data;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.util.BMLog;
|
||||
import WayofTime.bloodmagic.util.PleaseStopUsingMe;
|
||||
import WayofTime.bloodmagic.event.AddToNetworkEvent;
|
||||
import WayofTime.bloodmagic.event.SoulNetworkEvent;
|
||||
|
@ -130,7 +132,7 @@ public class SoulNetwork implements INBTSerializable<NBTTagCompound> {
|
|||
if (getParent() != null)
|
||||
getParent().markDirty();
|
||||
else
|
||||
PleaseStopUsingMe.logger.error("A SoulNetwork was created, but a parent was not set to allow saving.");
|
||||
BMLog.DEFAULT.error("A SoulNetwork was created, but a parent was not set to allow saving.");
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package WayofTime.bloodmagic.core.registry;
|
||||
|
||||
import WayofTime.bloodmagic.util.PleaseStopUsingMe;
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.util.BMLog;
|
||||
import WayofTime.bloodmagic.util.ItemStackWrapper;
|
||||
import WayofTime.bloodmagic.altar.EnumAltarTier;
|
||||
import com.google.common.collect.BiMap;
|
||||
|
@ -29,7 +30,7 @@ public class AltarRecipeRegistry {
|
|||
if (!recipes.containsValue(altarRecipe) && altarRecipe.getInput().size() > 0)
|
||||
recipes.put(altarRecipe.getInput(), altarRecipe);
|
||||
else
|
||||
PleaseStopUsingMe.logger.error("Error adding altar recipe for input [{}].", altarRecipe.toString());
|
||||
BMLog.DEFAULT.error("Error adding altar recipe for input [{}].", altarRecipe.toString());
|
||||
}
|
||||
|
||||
public static void registerFillRecipe(ItemStack orbStack, EnumAltarTier tier, int maxForOrb, int consumeRate, int drainRate) {
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
package WayofTime.bloodmagic.core.registry;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.util.BMLog;
|
||||
import WayofTime.bloodmagic.util.BlockStack;
|
||||
import WayofTime.bloodmagic.util.PleaseStopUsingMe;
|
||||
import WayofTime.bloodmagic.ritual.data.imperfect.ImperfectRitual;
|
||||
import com.google.common.collect.BiMap;
|
||||
import com.google.common.collect.HashBiMap;
|
||||
|
@ -23,7 +24,7 @@ public class ImperfectRitualRegistry {
|
|||
public static void registerRitual(ImperfectRitual imperfectRitual, String id, boolean enabled) {
|
||||
if (imperfectRitual != null) {
|
||||
if (registry.containsKey(id))
|
||||
PleaseStopUsingMe.logger.error("Duplicate imperfect ritual id: %s", id);
|
||||
BMLog.DEFAULT.error("Duplicate imperfect ritual id: %s", id);
|
||||
else {
|
||||
registry.put(id, imperfectRitual);
|
||||
enabledRituals.put(imperfectRitual, enabled);
|
||||
|
@ -71,7 +72,7 @@ public class ImperfectRitualRegistry {
|
|||
try {
|
||||
return enabledRituals.get(imperfectRitual);
|
||||
} catch (NullPointerException e) {
|
||||
PleaseStopUsingMe.logger.error("Invalid Imperfect Ritual was called");
|
||||
BMLog.DEFAULT.error("Invalid Imperfect Ritual was called");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package WayofTime.bloodmagic.core.registry;
|
||||
|
||||
import WayofTime.bloodmagic.util.PleaseStopUsingMe;
|
||||
import WayofTime.bloodmagic.ritual.data.Ritual;
|
||||
import WayofTime.bloodmagic.util.BMLog;
|
||||
import com.google.common.collect.BiMap;
|
||||
import com.google.common.collect.HashBiMap;
|
||||
|
||||
|
@ -28,14 +28,14 @@ public class RitualRegistry {
|
|||
*/
|
||||
public static void registerRitual(Ritual ritual, String id, boolean enabled) {
|
||||
if (locked) {
|
||||
PleaseStopUsingMe.logger.error("This registry has been locked. Please register your ritual earlier.");
|
||||
PleaseStopUsingMe.logger.error("If you reflect this, I will hunt you down. - TehNut");
|
||||
BMLog.DEFAULT.error("This registry has been locked. Please register your ritual earlier.");
|
||||
BMLog.DEFAULT.error("If you reflect this, I will hunt you down. - TehNut");
|
||||
return;
|
||||
}
|
||||
|
||||
if (ritual != null) {
|
||||
if (registry.containsKey(id))
|
||||
PleaseStopUsingMe.logger.error("Duplicate ritual id: %s", id);
|
||||
BMLog.DEFAULT.error("Duplicate ritual id: %s", id);
|
||||
else {
|
||||
registry.put(id, ritual);
|
||||
enabledRituals.put(ritual, enabled);
|
||||
|
@ -78,7 +78,7 @@ public class RitualRegistry {
|
|||
try {
|
||||
return enabledRituals.get(ritual);
|
||||
} catch (NullPointerException e) {
|
||||
PleaseStopUsingMe.logger.error("Invalid Ritual was called");
|
||||
BMLog.DEFAULT.error("Invalid Ritual was called");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -111,13 +111,10 @@ public class RitualRegistry {
|
|||
locked = true; // Lock registry so no no rituals can be registered
|
||||
lookupList.clear(); // Make sure it's empty
|
||||
lookupList.addAll(registry.keySet());
|
||||
Collections.sort(lookupList, new Comparator<String>() {
|
||||
@Override
|
||||
public int compare(String o1, String o2) {
|
||||
Ritual ritual1 = registry.get(o1);
|
||||
Ritual ritual2 = registry.get(o2);
|
||||
return ritual1.getComponents().size() > ritual2.getComponents().size() ? -1 : 0; // Put earlier if bigger
|
||||
}
|
||||
Collections.sort(lookupList, (o1, o2) -> {
|
||||
Ritual ritual1 = registry.get(o1);
|
||||
Ritual ritual2 = registry.get(o2);
|
||||
return ritual1.getComponents().size() > ritual2.getComponents().size() ? -1 : 0; // Put earlier if bigger
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue