Added in some debug configuration for helping mods interacting with EE3 (more debug options to come as API matures)
This commit is contained in:
parent
ed2be79ec2
commit
4372294d61
|
@ -92,17 +92,17 @@ public final class EnergyValueRegistryProxy
|
|||
return EE3Wrapper.ee3mod.getEnergyValueRegistry().getEnergyValue(object, strict);
|
||||
}
|
||||
|
||||
public List getStacksInRange(int start, int finish)
|
||||
public static List getStacksInRange(int start, int finish)
|
||||
{
|
||||
return getStacksInRange(new EnergyValue(start), new EnergyValue(finish));
|
||||
}
|
||||
|
||||
public List getStacksInRange(float start, float finish)
|
||||
public static List getStacksInRange(float start, float finish)
|
||||
{
|
||||
return getStacksInRange(new EnergyValue(start), new EnergyValue(finish));
|
||||
}
|
||||
|
||||
public List getStacksInRange(EnergyValue start, EnergyValue finish)
|
||||
public static List getStacksInRange(EnergyValue start, EnergyValue finish)
|
||||
{
|
||||
init();
|
||||
|
||||
|
@ -115,6 +115,19 @@ public final class EnergyValueRegistryProxy
|
|||
return EE3Wrapper.ee3mod.getEnergyValueRegistry().getStacksInRange(start, finish);
|
||||
}
|
||||
|
||||
public static String getStageValueWasAssigned(Object object)
|
||||
{
|
||||
init();
|
||||
|
||||
// NOOP if EquivalentExchange3 is not present
|
||||
if (ee3Mod == null)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
return EE3Wrapper.ee3mod.getEnergyValueRegistry().getStageValueWasAssigned(object);
|
||||
}
|
||||
|
||||
private static class EE3Wrapper
|
||||
{
|
||||
private static EquivalentExchange3 ee3mod;
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
package com.pahimar.ee3.client.handler;
|
||||
|
||||
import com.pahimar.ee3.api.EnergyValue;
|
||||
import com.pahimar.ee3.api.EnergyValueRegistryProxy;
|
||||
import com.pahimar.ee3.exchange.EnergyValueRegistry;
|
||||
import com.pahimar.ee3.exchange.WrappedStack;
|
||||
import com.pahimar.ee3.reference.Settings;
|
||||
import com.pahimar.ee3.skill.SkillRegistry;
|
||||
import com.pahimar.ee3.util.IOwnable;
|
||||
import com.pahimar.ee3.util.ItemHelper;
|
||||
|
@ -51,7 +53,16 @@ public class ItemTooltipEventHandler
|
|||
event.toolTip.add("No Exchange Energy value");
|
||||
}
|
||||
|
||||
event.toolTip.add(String.format("Can Learn: %s", SkillRegistry.canLearnItemStack(event.itemStack)));
|
||||
if (Settings.Debug.debugMode)
|
||||
{
|
||||
event.toolTip.add("");
|
||||
event.toolTip.add("[DEBUG INFORMATION]");
|
||||
if (EnergyValueRegistry.getInstance().hasEnergyValue(stack))
|
||||
{
|
||||
event.toolTip.add(String.format("Value was: %s", EnergyValueRegistryProxy.getStageValueWasAssigned(event.itemStack)));
|
||||
}
|
||||
event.toolTip.add(String.format("Can Learn: %s", SkillRegistry.canLearnItemStack(event.itemStack)));
|
||||
}
|
||||
}
|
||||
|
||||
if (event.itemStack.getItem() instanceof IOwnable)
|
||||
|
|
|
@ -413,6 +413,10 @@ public class EnergyValueRegistry
|
|||
stackValueMap.put(wrappedStack, postAssignedMappings.get(wrappedStack));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
postAssignedMappings = new HashMap<WrappedStack, EnergyValue>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Finalize the stack to value map
|
||||
|
@ -545,4 +549,27 @@ public class EnergyValueRegistry
|
|||
|
||||
return stacksInRange;
|
||||
}
|
||||
|
||||
public String getStageValueWasAssigned(Object object)
|
||||
{
|
||||
if (WrappedStack.canBeWrapped(object))
|
||||
{
|
||||
WrappedStack wrappedStack = new WrappedStack(object);
|
||||
|
||||
if (preAssignedMappings.keySet().contains(wrappedStack))
|
||||
{
|
||||
return "Pre Assigned";
|
||||
}
|
||||
else if (postAssignedMappings.keySet().contains(wrappedStack))
|
||||
{
|
||||
return "Post Assigned";
|
||||
}
|
||||
else if (hasEnergyValue(object))
|
||||
{
|
||||
return "Computed";
|
||||
}
|
||||
}
|
||||
|
||||
return "No Value Assigned";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ public class ConfigurationHandler
|
|||
Settings.Transmutation.maxKnowledgeTier = configuration.getInt(Messages.Configuration.TRANSMUTATION_KNOWLEDGE_MAX_TIER, Messages.Configuration.CATEGORY_TRANSMUTATION, 0, 0, Short.MAX_VALUE, StatCollector.translateToLocal(Messages.Configuration.TRANSMUTATION_KNOWLEDGE_MAX_TIER_COMMENT), Messages.Configuration.TRANSMUTATION_KNOWLEDGE_MAX_TIER_LABEL);
|
||||
Settings.Transmutation.useTemplateFile = configuration.getBoolean(Messages.Configuration.TRANSMUTATION_KNOWLEDGE_TEMPLATE, Messages.Configuration.CATEGORY_TRANSMUTATION, true, StatCollector.translateToLocal(Messages.Configuration.TRANSMUTATION_KNOWLEDGE_TEMPLATE_COMMENT), Messages.Configuration.TRANSMUTATION_KNOWLEDGE_TEMPLATE_LABEL);
|
||||
Settings.Sounds.soundMode = ConfigurationHelper.getString(configuration, Messages.Configuration.SOUND_MODE, Configuration.CATEGORY_GENERAL, "All", StatCollector.translateToLocal(Messages.Configuration.SOUND_MODE_COMMENT), new String[]{"All", "Self", "None"}, Messages.Configuration.SOUND_MODE_LABEL);
|
||||
Settings.Debug.debugMode = configuration.getBoolean(Messages.Configuration.DEBUG_MODE, Messages.Configuration.CATEGORY_DEBUG, false, StatCollector.translateToLocal(Messages.Configuration.DEBUG_MODE_COMMENT), Messages.Configuration.DEBUG_MODE_LABEL);
|
||||
|
||||
if (configuration.hasChanged())
|
||||
{
|
||||
|
|
|
@ -80,11 +80,11 @@ public class MessageSoundEvent implements IMessage, IMessageHandler<MessageSound
|
|||
{
|
||||
UUID originUUID = new UUID(event.mostSigUUID, event.leastSigUUID);
|
||||
|
||||
if (Settings.Sounds.soundMode.equalsIgnoreCase(Settings.Sounds.SOUND_MODE_ALL))
|
||||
if (Settings.Sounds.soundMode.equalsIgnoreCase("All"))
|
||||
{
|
||||
EquivalentExchange3.proxy.playSound(event.soundName, event.xCoord, event.yCoord, event.zCoord, event.volume, event.pitch);
|
||||
}
|
||||
else if (Settings.Sounds.soundMode.equalsIgnoreCase(Settings.Sounds.SOUND_MODE_SELF))
|
||||
else if (Settings.Sounds.soundMode.equalsIgnoreCase("Self"))
|
||||
{
|
||||
if (FMLClientHandler.instance().getClient().thePlayer.getUniqueID().equals(originUUID))
|
||||
{
|
||||
|
|
|
@ -11,6 +11,12 @@ public final class Messages
|
|||
|
||||
public static final class Configuration
|
||||
{
|
||||
public static final String CATEGORY_DEBUG = "general.debug";
|
||||
|
||||
public static final String DEBUG_MODE = "debugMode";
|
||||
public static final String DEBUG_MODE_LABEL = "general.debug.mode.label";
|
||||
public static final String DEBUG_MODE_COMMENT = "general.debug.mode.comment";
|
||||
|
||||
public static final String CATEGORY_TRANSMUTATION = "general.transmutation";
|
||||
|
||||
public static final String TRANSMUTATION_KNOWLEDGE_MODE = "knowledgeMode";
|
||||
|
|
|
@ -2,6 +2,11 @@ package com.pahimar.ee3.reference;
|
|||
|
||||
public class Settings
|
||||
{
|
||||
public static class Debug
|
||||
{
|
||||
public static boolean debugMode;
|
||||
}
|
||||
|
||||
public static class Transmutation
|
||||
{
|
||||
public static String knowledgeMode;
|
||||
|
@ -12,8 +17,5 @@ public class Settings
|
|||
public static class Sounds
|
||||
{
|
||||
public static String soundMode;
|
||||
public static final String SOUND_MODE_ALL = "All";
|
||||
public static final String SOUND_MODE_SELF = "Self";
|
||||
public static final String SOUND_MODE_NONE = "None";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,10 @@ general.transmutation.knowledge.template.comment=If true, new player's will have
|
|||
general.sound.soundMode.label=Sounds
|
||||
general.sound.soundMode.comment='All' plays mod sounds from all players, 'Self' only plays mod sounds from you, and 'None' plays no mod sounds
|
||||
|
||||
general.debug=Debug Settings
|
||||
general.debug.mode.label=Debug Mode Enabled
|
||||
general.debug.mode.comment=Toggles whether or not debug mode is enabled (Note: This is primarily for modders testing mod interaction with Equivalent Exchange 3)
|
||||
|
||||
# Keys
|
||||
key.categories.ee3=Equivalent Exchange 3
|
||||
key.charge=Charge
|
||||
|
|
Loading…
Reference in a new issue