Bunches of stuff
This commit is contained in:
parent
bb7b40c8bb
commit
b98dee6e96
|
@ -72,6 +72,21 @@ public final class AbilityRegistryProxy
|
|||
}
|
||||
}
|
||||
|
||||
public static void dumpAbilityRegistryToLog()
|
||||
{
|
||||
dumpAbilityRegistryToLog(Abilities.ALL);
|
||||
}
|
||||
|
||||
public static void dumpAbilityRegistryToLog(Abilities ability)
|
||||
{
|
||||
init();
|
||||
|
||||
if (ee3Mod != null)
|
||||
{
|
||||
EE3Wrapper.ee3mod.getAbilityRegistry().dumpAbilityRegistryToLog(ability);
|
||||
}
|
||||
}
|
||||
|
||||
private static class EE3Wrapper
|
||||
{
|
||||
private static EquivalentExchange3 ee3mod;
|
||||
|
@ -84,4 +99,11 @@ public final class AbilityRegistryProxy
|
|||
EE3Wrapper.ee3mod = (EquivalentExchange3) ee3Mod;
|
||||
}
|
||||
}
|
||||
|
||||
public enum Abilities
|
||||
{
|
||||
NOT_LEARNABLE,
|
||||
NOT_RECOVERABLE,
|
||||
ALL
|
||||
}
|
||||
}
|
||||
|
|
|
@ -107,6 +107,21 @@ public final class EnergyValueRegistryProxy
|
|||
return null;
|
||||
}
|
||||
|
||||
public static void dumpEnergyValueRegistryToLog()
|
||||
{
|
||||
dumpEnergyValueRegistryToLog(Phase.ALL);
|
||||
}
|
||||
|
||||
public static void dumpEnergyValueRegistryToLog(Phase phase)
|
||||
{
|
||||
init();
|
||||
|
||||
if (ee3Mod != null)
|
||||
{
|
||||
EE3Wrapper.ee3mod.getEnergyValueRegistry().dumpEnergyValueRegistryToLog(phase);
|
||||
}
|
||||
}
|
||||
|
||||
private static class EE3Wrapper
|
||||
{
|
||||
private static EquivalentExchange3 ee3mod;
|
||||
|
@ -119,4 +134,11 @@ public final class EnergyValueRegistryProxy
|
|||
EE3Wrapper.ee3mod = (EquivalentExchange3) ee3Mod;
|
||||
}
|
||||
}
|
||||
|
||||
public enum Phase
|
||||
{
|
||||
PRE_ASSIGNMENT,
|
||||
POST_ASSIGNMENT,
|
||||
ALL
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,12 +12,21 @@ public final class RecipeRegistryProxy
|
|||
init();
|
||||
|
||||
// NOOP if EquivalentExchange3 is not present
|
||||
if (ee3Mod == null)
|
||||
if (ee3Mod != null)
|
||||
{
|
||||
return;
|
||||
EE3Wrapper.ee3mod.getRecipeRegistry().addRecipe(recipeOutput, recipeInputList);
|
||||
}
|
||||
}
|
||||
|
||||
EE3Wrapper.ee3mod.getRecipeRegistry().addRecipe(recipeOutput, recipeInputList);
|
||||
public static void dumpRecipeRegistryToLog()
|
||||
{
|
||||
init();
|
||||
|
||||
// NOOP if EquivalentExchange3 is not present
|
||||
if (ee3Mod != null)
|
||||
{
|
||||
EE3Wrapper.ee3mod.getRecipeRegistry().dumpRecipeRegistryToLog();
|
||||
}
|
||||
}
|
||||
|
||||
@Mod.Instance("EE3")
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.pahimar.ee3.exchange;
|
|||
import com.google.common.collect.ImmutableSortedMap;
|
||||
import com.google.gson.*;
|
||||
import com.pahimar.ee3.api.EnergyValue;
|
||||
import com.pahimar.ee3.api.EnergyValueRegistryProxy;
|
||||
import com.pahimar.ee3.api.IEnergyValueProvider;
|
||||
import com.pahimar.ee3.knowledge.AbilityRegistry;
|
||||
import com.pahimar.ee3.recipe.RecipeRegistry;
|
||||
|
@ -60,7 +61,7 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
|
|||
{
|
||||
if (preAssignedMappings == null)
|
||||
{
|
||||
preAssignedMappings = new HashMap<WrappedStack, EnergyValue>();
|
||||
preAssignedMappings = new TreeMap<WrappedStack, EnergyValue>();
|
||||
}
|
||||
|
||||
if (WrappedStack.canBeWrapped(object) && energyValue != null && Float.compare(energyValue.getEnergyValue(), 0f) > 0)
|
||||
|
@ -96,7 +97,7 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
|
|||
{
|
||||
if (postAssignedExactMappings == null)
|
||||
{
|
||||
postAssignedExactMappings = new HashMap<WrappedStack, EnergyValue>();
|
||||
postAssignedExactMappings = new TreeMap<WrappedStack, EnergyValue>();
|
||||
}
|
||||
|
||||
if (WrappedStack.canBeWrapped(object) && energyValue != null && Float.compare(energyValue.getEnergyValue(), 0f) > 0)
|
||||
|
@ -117,7 +118,7 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
|
|||
{
|
||||
if (postAssignedDependentMappings == null)
|
||||
{
|
||||
postAssignedDependentMappings = new HashMap<WrappedStack, List<WrappedStack>>();
|
||||
postAssignedDependentMappings = new TreeMap<WrappedStack, List<WrappedStack>>();
|
||||
}
|
||||
|
||||
if (!WrappedStack.canBeWrapped(object))
|
||||
|
@ -303,7 +304,7 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
|
|||
|
||||
private void runDynamicEnergyValueResolution()
|
||||
{
|
||||
HashMap<WrappedStack, EnergyValue> stackValueMap = new HashMap<WrappedStack, EnergyValue>();
|
||||
TreeMap<WrappedStack, EnergyValue> stackValueMap = new TreeMap<WrappedStack, EnergyValue>();
|
||||
|
||||
/*
|
||||
* Pre-assigned values
|
||||
|
@ -321,7 +322,7 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
|
|||
ImmutableSortedMap.Builder<WrappedStack, EnergyValue> stackMappingsBuilder = ImmutableSortedMap.naturalOrder();
|
||||
stackMappingsBuilder.putAll(stackValueMap);
|
||||
stackMappings = stackMappingsBuilder.build();
|
||||
Map<WrappedStack, EnergyValue> computedStackValues = new HashMap<WrappedStack, EnergyValue>();
|
||||
Map<WrappedStack, EnergyValue> computedStackValues = new TreeMap<WrappedStack, EnergyValue>();
|
||||
|
||||
// Initialize the pass counter
|
||||
int passNumber = 0;
|
||||
|
@ -431,7 +432,7 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
|
|||
}
|
||||
else
|
||||
{
|
||||
postAssignedExactMappings = new HashMap<WrappedStack, EnergyValue>();
|
||||
postAssignedExactMappings = new TreeMap<WrappedStack, EnergyValue>();
|
||||
}
|
||||
|
||||
// Grab custom post-assigned values from file
|
||||
|
@ -486,7 +487,7 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
|
|||
|
||||
private Map<WrappedStack, EnergyValue> computeStackMappings()
|
||||
{
|
||||
Map<WrappedStack, EnergyValue> computedStackMap = new HashMap<WrappedStack, EnergyValue>();
|
||||
Map<WrappedStack, EnergyValue> computedStackMap = new TreeMap<WrappedStack, EnergyValue>();
|
||||
|
||||
for (WrappedStack recipeOutput : RecipeRegistry.getInstance().getRecipeMappings().keySet())
|
||||
{
|
||||
|
@ -584,7 +585,7 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
|
|||
{
|
||||
if (nbtTagCompound != null && nbtTagCompound.hasKey("stackMappingList"))
|
||||
{
|
||||
HashMap<WrappedStack, EnergyValue> stackValueMap = new HashMap<WrappedStack, EnergyValue>();
|
||||
TreeMap<WrappedStack, EnergyValue> stackValueMap = new TreeMap<WrappedStack, EnergyValue>();
|
||||
|
||||
/**
|
||||
* Read stack value mappings from NBTTagCompound
|
||||
|
@ -637,7 +638,7 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
|
|||
{
|
||||
if (wrappedStack != null && energyValue != null && Float.compare(energyValue.getEnergyValue(), 0f) > 0)
|
||||
{
|
||||
HashMap<WrappedStack, EnergyValue> stackValueMap = new HashMap<WrappedStack, EnergyValue>();
|
||||
TreeMap<WrappedStack, EnergyValue> stackValueMap = new TreeMap<WrappedStack, EnergyValue>();
|
||||
|
||||
/**
|
||||
* Read stack value mappings from NBTTagCompound
|
||||
|
@ -793,7 +794,7 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
|
|||
if (json.isJsonArray())
|
||||
{
|
||||
JsonArray jsonArray = (JsonArray) json;
|
||||
Map<WrappedStack, EnergyValue> stackValueMap = new HashMap<WrappedStack, EnergyValue>();
|
||||
Map<WrappedStack, EnergyValue> stackValueMap = new TreeMap<WrappedStack, EnergyValue>();
|
||||
Iterator<JsonElement> iterator = jsonArray.iterator();
|
||||
|
||||
while (iterator.hasNext())
|
||||
|
@ -829,4 +830,48 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
|
|||
|
||||
return jsonEnergyValueRegistry;
|
||||
}
|
||||
|
||||
public void dumpEnergyValueRegistryToLog()
|
||||
{
|
||||
dumpEnergyValueRegistryToLog(EnergyValueRegistryProxy.Phase.ALL);
|
||||
}
|
||||
|
||||
public void dumpEnergyValueRegistryToLog(EnergyValueRegistryProxy.Phase phase)
|
||||
{
|
||||
LogHelper.info(String.format("BEGIN DUMPING %s ENERGY VALUE MAPPINGS", phase));
|
||||
if (phase == EnergyValueRegistryProxy.Phase.PRE_ASSIGNMENT)
|
||||
{
|
||||
for (WrappedStack wrappedStack : this.preAssignedMappings.keySet())
|
||||
{
|
||||
LogHelper.info(String.format("- Object: %s, Value: %s", wrappedStack, EnergyValueRegistry.getInstance().getStackValueMap().get(wrappedStack)));
|
||||
}
|
||||
}
|
||||
else if (phase == EnergyValueRegistryProxy.Phase.POST_ASSIGNMENT)
|
||||
{
|
||||
LogHelper.info("POST-ASSIGNED VALUES (DEPENDENT)");
|
||||
if (this.postAssignedDependentMappings != null)
|
||||
{
|
||||
for (WrappedStack wrappedStack : this.postAssignedDependentMappings.keySet())
|
||||
{
|
||||
LogHelper.info(String.format("- Object: %s, Value: %s", wrappedStack, EnergyValueRegistry.getInstance().getStackValueMap().get(wrappedStack)));
|
||||
}
|
||||
}
|
||||
LogHelper.info("POST-ASSIGNED VALUES (EXACT)");
|
||||
if (this.postAssignedExactMappings != null)
|
||||
{
|
||||
for (WrappedStack wrappedStack : this.postAssignedExactMappings.keySet())
|
||||
{
|
||||
LogHelper.info(String.format("- Object: %s, Value: %s", wrappedStack, EnergyValueRegistry.getInstance().getStackValueMap().get(wrappedStack)));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (phase == EnergyValueRegistryProxy.Phase.ALL)
|
||||
{
|
||||
for (WrappedStack wrappedStack : EnergyValueRegistry.getInstance().getStackValueMap().keySet())
|
||||
{
|
||||
LogHelper.info(String.format("- Object: %s, Value: %s", wrappedStack, EnergyValueRegistry.getInstance().getStackValueMap().get(wrappedStack)));
|
||||
}
|
||||
}
|
||||
LogHelper.info(String.format("END DUMPING %s ENERGY VALUE MAPPINGS", phase));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,12 +74,26 @@ public class EnergyValueStackMapping implements JsonSerializer<EnergyValueStackM
|
|||
|
||||
if (jsonStackValueMapping.get("wrappedStack") != null)
|
||||
{
|
||||
wrappedStack = new WrappedStack().deserialize(jsonStackValueMapping.get("wrappedStack").getAsJsonObject(), typeOfT, context);
|
||||
try
|
||||
{
|
||||
wrappedStack = new WrappedStack().deserialize(jsonStackValueMapping.get("wrappedStack").getAsJsonObject(), typeOfT, context);
|
||||
}
|
||||
catch (JsonParseException e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (jsonStackValueMapping.get("energyValue") != null)
|
||||
{
|
||||
energyValue = new EnergyValue().deserialize(jsonStackValueMapping.get("energyValue").getAsJsonObject(), typeOfT, context);
|
||||
try
|
||||
{
|
||||
energyValue = new EnergyValue().deserialize(jsonStackValueMapping.get("energyValue").getAsJsonObject(), typeOfT, context);
|
||||
}
|
||||
catch (JsonParseException e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (wrappedStack != null && energyValue != null)
|
||||
|
|
|
@ -1,11 +1,19 @@
|
|||
package com.pahimar.ee3.exchange;
|
||||
|
||||
import com.google.gson.*;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.JsonToNBT;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTException;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class JsonItemStack
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
public class JsonItemStack implements JsonSerializer<JsonItemStack>, JsonDeserializer<JsonItemStack>
|
||||
{
|
||||
public static final Gson jsonSerializer = (new GsonBuilder()).registerTypeAdapter(JsonItemStack.class, new JsonItemStack()).create();
|
||||
|
||||
public String itemName;
|
||||
public int itemDamage;
|
||||
public NBTTagCompound itemNBTTagCompound;
|
||||
|
@ -26,4 +34,75 @@ public class JsonItemStack
|
|||
this.itemNBTTagCompound = itemStack.getTagCompound();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JsonItemStack deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException
|
||||
{
|
||||
if (json.isJsonObject())
|
||||
{
|
||||
JsonObject jsonObject = (JsonObject) json;
|
||||
JsonItemStack jsonItemStack = new JsonItemStack();
|
||||
|
||||
if (jsonObject.has("itemName"))
|
||||
{
|
||||
jsonItemStack.itemName = jsonObject.get("itemName").getAsString();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new JsonParseException(""); // TODO Exception message
|
||||
}
|
||||
|
||||
if (jsonObject.has("itemDamage"))
|
||||
{
|
||||
jsonItemStack.itemDamage = jsonObject.get("itemDamage").getAsInt();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new JsonParseException(""); // TODO Exception message
|
||||
}
|
||||
|
||||
if (jsonObject.has("itemNBTTagCompound"))
|
||||
{
|
||||
try
|
||||
{
|
||||
NBTBase nbtBase = JsonToNBT.func_150315_a(jsonObject.get("itemNBTTagCompound").getAsString());
|
||||
|
||||
if (nbtBase instanceof NBTTagCompound)
|
||||
{
|
||||
jsonItemStack.itemNBTTagCompound = (NBTTagCompound) nbtBase;
|
||||
}
|
||||
}
|
||||
catch (NBTException e)
|
||||
{
|
||||
throw new JsonParseException(e.getMessage(), e.getCause());
|
||||
}
|
||||
}
|
||||
|
||||
return jsonItemStack;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JsonElement serialize(JsonItemStack src, Type typeOfSrc, JsonSerializationContext context)
|
||||
{
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
|
||||
jsonObject.addProperty("itemName", src.itemName);
|
||||
jsonObject.addProperty("itemDamage", src.itemDamage);
|
||||
|
||||
if (src.itemNBTTagCompound != null)
|
||||
{
|
||||
jsonObject.addProperty("itemNBTTagCompound", src.itemNBTTagCompound.toString());
|
||||
}
|
||||
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.format("itemName: %s, itemDamage: %s, itemNBTTagCompound: %s", itemName, itemDamage, itemNBTTagCompound);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,7 +49,12 @@ public class WrappedStack implements Comparable<WrappedStack>, JsonDeserializer<
|
|||
{
|
||||
if (((ItemStack) object).getItem() != null)
|
||||
{
|
||||
ItemStack itemStack = ((ItemStack) object).copy();
|
||||
ItemStack itemStackObject = (ItemStack) object;
|
||||
ItemStack itemStack = new ItemStack(itemStackObject.getItem(), itemStackObject.stackSize, itemStackObject.getItemDamage());
|
||||
if (itemStackObject.stackTagCompound != null)
|
||||
{
|
||||
itemStack.stackTagCompound = (NBTTagCompound) itemStackObject.stackTagCompound.copy();
|
||||
}
|
||||
objectType = "itemstack";
|
||||
stackSize = itemStack.stackSize;
|
||||
itemStack.stackSize = 1;
|
||||
|
@ -392,7 +397,7 @@ public class WrappedStack implements Comparable<WrappedStack>, JsonDeserializer<
|
|||
{
|
||||
if (objectType.equalsIgnoreCase("ItemStack"))
|
||||
{
|
||||
JsonItemStack jsonItemStack = jsonSerializer.fromJson(jsonWrappedStack.get("wrappedStack_data"), JsonItemStack.class);
|
||||
JsonItemStack jsonItemStack = JsonItemStack.jsonSerializer.fromJson(jsonWrappedStack.get("wrappedStack_data"), JsonItemStack.class);
|
||||
ItemStack itemStack = null;
|
||||
Item item = (Item) Item.itemRegistry.getObject(jsonItemStack.itemName);
|
||||
if (stackSize > 0 && item != null)
|
||||
|
@ -477,7 +482,7 @@ public class WrappedStack implements Comparable<WrappedStack>, JsonDeserializer<
|
|||
{
|
||||
jsonItemStack.itemNBTTagCompound = ((ItemStack) wrappedStack.wrappedStack).stackTagCompound;
|
||||
}
|
||||
jsonWrappedStack.add("wrappedStack_data", gson.toJsonTree(jsonItemStack, JsonItemStack.class));
|
||||
jsonWrappedStack.add("wrappedStack_data", JsonItemStack.jsonSerializer.toJsonTree(jsonItemStack, JsonItemStack.class));
|
||||
}
|
||||
else if (wrappedStack.wrappedStack instanceof OreStack)
|
||||
{
|
||||
|
@ -555,7 +560,7 @@ public class WrappedStack implements Comparable<WrappedStack>, JsonDeserializer<
|
|||
{
|
||||
if (wrappedStack instanceof ItemStack)
|
||||
{
|
||||
return String.format("%sxitemStack[%s@%s, %s]", stackSize, ((ItemStack) wrappedStack).getUnlocalizedName(), ((ItemStack) wrappedStack).getItemDamage(), Item.getIdFromItem(((ItemStack) wrappedStack).getItem()));
|
||||
return ItemHelper.toString((ItemStack) wrappedStack);
|
||||
}
|
||||
else if (wrappedStack instanceof OreStack)
|
||||
{
|
||||
|
|
|
@ -21,7 +21,6 @@ import java.util.UUID;
|
|||
public class ContainerAlchemicalTome extends ContainerEE implements IElementButtonHandler, IElementTextFieldHandler
|
||||
{
|
||||
private final InventoryAlchemicalTome inventoryAlchemicalTome;
|
||||
private final ItemStack alchemicalTomeItemStack;
|
||||
private int pageOffset, maxPageOffset;
|
||||
private String searchTerm;
|
||||
private boolean requiresUpdate = false;
|
||||
|
@ -31,7 +30,6 @@ public class ContainerAlchemicalTome extends ContainerEE implements IElementButt
|
|||
|
||||
public ContainerAlchemicalTome(EntityPlayer entityPlayer, ItemStack itemStack)
|
||||
{
|
||||
this.alchemicalTomeItemStack = itemStack;
|
||||
TreeSet<ItemStack> knownTransmutations = new TreeSet<ItemStack>(ItemHelper.displayNameComparator);
|
||||
|
||||
if (itemStack.getItem() instanceof ItemAlchemicalTome && ItemHelper.hasOwnerUUID(itemStack))
|
||||
|
|
|
@ -3,11 +3,13 @@ package com.pahimar.ee3.knowledge;
|
|||
import com.google.gson.*;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.pahimar.ee3.api.AbilityRegistryProxy;
|
||||
import com.pahimar.ee3.exchange.EnergyValueRegistry;
|
||||
import com.pahimar.ee3.exchange.OreStack;
|
||||
import com.pahimar.ee3.exchange.WrappedStack;
|
||||
import com.pahimar.ee3.reference.Files;
|
||||
import com.pahimar.ee3.util.ItemHelper;
|
||||
import com.pahimar.ee3.util.LogHelper;
|
||||
import com.pahimar.ee3.util.SerializationHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
@ -332,4 +334,55 @@ public class AbilityRegistry implements JsonSerializer<AbilityRegistry>, JsonDes
|
|||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void dumpAbilityRegistryToLog()
|
||||
{
|
||||
dumpAbilityRegistryToLog(AbilityRegistryProxy.Abilities.ALL);
|
||||
}
|
||||
|
||||
public void dumpAbilityRegistryToLog(AbilityRegistryProxy.Abilities abilityType)
|
||||
{
|
||||
LogHelper.info(String.format("BEGIN DUMPING %s ABILITY OBJECTS", abilityType));
|
||||
if (abilityType == AbilityRegistryProxy.Abilities.NOT_LEARNABLE)
|
||||
{
|
||||
if (this.notLearnableSet != null)
|
||||
{
|
||||
for (WrappedStack wrappedStack : this.notLearnableSet)
|
||||
{
|
||||
LogHelper.info(String.format("- Object: %s", wrappedStack));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (abilityType == AbilityRegistryProxy.Abilities.NOT_RECOVERABLE)
|
||||
{
|
||||
if (this.notRecoverableSet != null)
|
||||
{
|
||||
for (WrappedStack wrappedStack : this.notRecoverableSet)
|
||||
{
|
||||
LogHelper.info(String.format("- Object: %s", wrappedStack));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (abilityType == AbilityRegistryProxy.Abilities.ALL)
|
||||
{
|
||||
if (this.notLearnableSet != null)
|
||||
{
|
||||
LogHelper.info("NOT LEARNABLE OBJECTS");
|
||||
for (WrappedStack wrappedStack : this.notLearnableSet)
|
||||
{
|
||||
LogHelper.info(String.format("- Object: %s", wrappedStack));
|
||||
}
|
||||
}
|
||||
|
||||
if (this.notRecoverableSet != null)
|
||||
{
|
||||
LogHelper.info("NOT RECOVERABLE OBJECTS");
|
||||
for (WrappedStack wrappedStack : this.notRecoverableSet)
|
||||
{
|
||||
LogHelper.info(String.format("- Object: %s", wrappedStack));
|
||||
}
|
||||
}
|
||||
}
|
||||
LogHelper.info(String.format("END DUMPING %s ABILITY OBJECTS", abilityType));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -266,22 +266,28 @@ public class TransmutationKnowledge implements INBTTaggable, JsonSerializer<Tran
|
|||
JsonElement jsonElement = iterator.next();
|
||||
if (jsonElement.isJsonObject())
|
||||
{
|
||||
JsonItemStack jsonItemStack = jsonSerializer.fromJson(jsonElement, JsonItemStack.class);
|
||||
|
||||
ItemStack itemStack = null;
|
||||
Item item = (Item) Item.itemRegistry.getObject(jsonItemStack.itemName);
|
||||
if (item != null)
|
||||
try
|
||||
{
|
||||
itemStack = new ItemStack(item, 1, jsonItemStack.itemDamage);
|
||||
if (jsonItemStack.itemNBTTagCompound != null)
|
||||
JsonItemStack jsonItemStack = JsonItemStack.jsonSerializer.fromJson(jsonElement, JsonItemStack.class);
|
||||
|
||||
ItemStack itemStack = null;
|
||||
Item item = (Item) Item.itemRegistry.getObject(jsonItemStack.itemName);
|
||||
if (item != null)
|
||||
{
|
||||
itemStack.stackTagCompound = jsonItemStack.itemNBTTagCompound;
|
||||
itemStack = new ItemStack(item, 1, jsonItemStack.itemDamage);
|
||||
if (jsonItemStack.itemNBTTagCompound != null)
|
||||
{
|
||||
itemStack.stackTagCompound = jsonItemStack.itemNBTTagCompound;
|
||||
}
|
||||
}
|
||||
|
||||
if (itemStack != null)
|
||||
{
|
||||
itemStacks.add(itemStack);
|
||||
}
|
||||
}
|
||||
|
||||
if (itemStack != null)
|
||||
catch (JsonParseException e)
|
||||
{
|
||||
itemStacks.add(itemStack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -303,7 +309,7 @@ public class TransmutationKnowledge implements INBTTaggable, JsonSerializer<Tran
|
|||
JsonArray knownTransmutations = new JsonArray();
|
||||
for (ItemStack itemStack : transmutationKnowledge.getKnownTransmutations())
|
||||
{
|
||||
knownTransmutations.add(jsonSerializer.toJsonTree(new JsonItemStack(itemStack)));
|
||||
knownTransmutations.add(JsonItemStack.jsonSerializer.toJsonTree(new JsonItemStack(itemStack)));
|
||||
}
|
||||
jsonTransmutationKnowledge.add("knownTransmutations", knownTransmutations);
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.pahimar.ee3.network.message;
|
|||
|
||||
import com.pahimar.ee3.EquivalentExchange3;
|
||||
import com.pahimar.ee3.settings.ChalkSettings;
|
||||
import com.pahimar.ee3.util.LogHelper;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
|
@ -62,9 +61,6 @@ public class MessageChalkSettings implements IMessage, IMessageHandler<MessageCh
|
|||
public IMessage onMessage(MessageChalkSettings message, MessageContext ctx)
|
||||
{
|
||||
EquivalentExchange3.proxy.getClientProxy().chalkSettings = new ChalkSettings(message.index, message.size, message.rotation);
|
||||
|
||||
LogHelper.info(String.format("index: %s, size: %s, rotation: %s", EquivalentExchange3.proxy.getClientProxy().chalkSettings.getIndex(), EquivalentExchange3.proxy.getClientProxy().chalkSettings.getSize(), EquivalentExchange3.proxy.getClientProxy().chalkSettings.getRotation()));
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -18,7 +18,7 @@ public class RecipeRegistry
|
|||
|
||||
private RecipeRegistry()
|
||||
{
|
||||
recipeMap = HashMultimap.create();
|
||||
recipeMap = HashMultimap.create(); // TODO Switch this to a TreeMultimap
|
||||
}
|
||||
|
||||
public static RecipeRegistry getInstance()
|
||||
|
@ -82,11 +82,11 @@ public class RecipeRegistry
|
|||
|
||||
public void dumpRecipeRegistryToLog()
|
||||
{
|
||||
for (WrappedStack wrappedStack : recipeMap.keySet())
|
||||
for (WrappedStack wrappedStack : getRecipeMappings().keySet())
|
||||
{
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.append(String.format("Output: %s, Inputs: ", wrappedStack.toString()));
|
||||
for (List<WrappedStack> listStacks : recipeMap.get(wrappedStack))
|
||||
stringBuilder.append(String.format("-Output: %s, Inputs: ", wrappedStack.toString()));
|
||||
for (List<WrappedStack> listStacks : getRecipeMappings().get(wrappedStack))
|
||||
{
|
||||
for (WrappedStack listStack : listStacks)
|
||||
{
|
||||
|
|
|
@ -207,7 +207,10 @@ public class SerializationHelper
|
|||
while (jsonReader.hasNext())
|
||||
{
|
||||
EnergyValueStackMapping energyValueStackMapping = EnergyValueStackMapping.jsonSerializer.fromJson(jsonReader, EnergyValueStackMapping.class);
|
||||
energyValueStackMap.put(energyValueStackMapping.wrappedStack, energyValueStackMapping.energyValue);
|
||||
if (energyValueStackMapping != null)
|
||||
{
|
||||
energyValueStackMap.put(energyValueStackMapping.wrappedStack, energyValueStackMapping.energyValue);
|
||||
}
|
||||
}
|
||||
jsonReader.endArray();
|
||||
jsonReader.close();
|
||||
|
|
Loading…
Reference in a new issue