Renaming some stuff, adding more functionality to the LogHelper, and ItemStack wild card detection for the vanilla Crafting Manager
This commit is contained in:
parent
a5209fab99
commit
c8b4c4e642
|
@ -1,7 +1,6 @@
|
|||
package com.pahimar.ee3;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
|
@ -78,7 +77,7 @@ public class EquivalentExchange3 {
|
|||
public void invalidFingerprint(FMLFingerprintViolationEvent event) {
|
||||
|
||||
// Report (log) to the user that the version of Equivalent Exchange 3 they are using has been changed/tampered with
|
||||
LogHelper.log(Level.SEVERE, Strings.INVALID_FINGERPRINT_MESSAGE);
|
||||
LogHelper.severe(Strings.INVALID_FINGERPRINT_MESSAGE);
|
||||
}
|
||||
|
||||
@ServerStarting
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package com.pahimar.ee3.client.audio;
|
||||
|
||||
import java.util.logging.Level;
|
||||
|
||||
import net.minecraftforge.client.event.sound.SoundLoadEvent;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
|
||||
|
@ -30,7 +28,7 @@ public class SoundHandler {
|
|||
}
|
||||
// If we cannot add the custom sound file to the pool, log the exception
|
||||
catch (Exception e) {
|
||||
LogHelper.log(Level.WARNING, "Failed loading sound file: " + soundFile);
|
||||
LogHelper.warning("Failed loading sound file: " + soundFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package com.pahimar.ee3.core.addons;
|
||||
|
||||
import java.util.logging.Level;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
|
@ -35,10 +33,10 @@ public class AddonRedPower2 {
|
|||
RecipeHelper.addRecipe(new ItemStack(rp2Stone.blockID, 1, 3), stone, Block.cobblestone, Block.cobblestone, Block.cobblestone, Block.cobblestone, Block.cobblestone, Block.cobblestone);
|
||||
}
|
||||
|
||||
LogHelper.log(Level.INFO, "Loaded RP2 World addon");
|
||||
LogHelper.info("Loaded RP2 World addon");
|
||||
}
|
||||
catch (Exception e) {
|
||||
LogHelper.log(Level.SEVERE, "Could not load RP2 World addon");
|
||||
LogHelper.severe("Could not load RP2 World addon");
|
||||
e.printStackTrace(System.err);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.pahimar.ee3.core.handlers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
|
@ -248,7 +247,7 @@ public class EquivalencyHandler {
|
|||
|
||||
int i = 0;
|
||||
for (ArrayList<ItemStack> list : equivalencyList) {
|
||||
LogHelper.log(Level.INFO, "equivalencyList[" + i + "]: " + list.toString());
|
||||
LogHelper.info("equivalencyList[" + i + "]: " + list.toString());
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -104,14 +104,14 @@ public class ItemUtil {
|
|||
boolean found = false;
|
||||
|
||||
for (int j = 0; j < collatedStacks.size(); j++) {
|
||||
if (unCollatedStacks.get(i).getItemStack() != null && collatedStacks.get(j).getItemStack() != null) {
|
||||
if (compare(unCollatedStacks.get(i).getItemStack(), collatedStacks.get(j).getItemStack())) {
|
||||
if (unCollatedStacks.get(i).getWrappedStack() instanceof ItemStack && collatedStacks.get(j).getWrappedStack() instanceof ItemStack) {
|
||||
if (compare((ItemStack) unCollatedStacks.get(i).getWrappedStack(), (ItemStack) collatedStacks.get(j).getWrappedStack())) {
|
||||
collatedStacks.get(j).setStackSize(collatedStacks.get(j).getStackSize() + 1);
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
else if (unCollatedStacks.get(i).getOreStack() != null && collatedStacks.get(j).getOreStack() != null) {
|
||||
if (OreStack.compareStacks(unCollatedStacks.get(i).getOreStack(), collatedStacks.get(j).getOreStack())) {
|
||||
else if (unCollatedStacks.get(i).getWrappedStack() instanceof OreStack && collatedStacks.get(j).getWrappedStack() instanceof OreStack) {
|
||||
if (OreStack.compareStacks((OreStack) unCollatedStacks.get(i).getWrappedStack(), (OreStack) collatedStacks.get(j).getWrappedStack())) {
|
||||
collatedStacks.get(j).setStackSize(collatedStacks.get(j).getStackSize() + 1);
|
||||
found = true;
|
||||
}
|
||||
|
|
|
@ -30,4 +30,38 @@ public class LogHelper {
|
|||
eeLogger.log(logLevel, message);
|
||||
}
|
||||
|
||||
public static void severe(String message) {
|
||||
|
||||
log(Level.SEVERE, message);
|
||||
}
|
||||
|
||||
public static void warning(String message) {
|
||||
|
||||
log(Level.WARNING, message);
|
||||
}
|
||||
|
||||
public static void info(String message) {
|
||||
|
||||
log(Level.INFO, message);
|
||||
}
|
||||
|
||||
public static void config(String message) {
|
||||
|
||||
log(Level.CONFIG, message);
|
||||
}
|
||||
|
||||
public static void fine(String message) {
|
||||
|
||||
log(Level.FINE, message);
|
||||
}
|
||||
|
||||
public static void finer(String message) {
|
||||
|
||||
log(Level.FINER, message);
|
||||
}
|
||||
|
||||
public static void finest(String message) {
|
||||
|
||||
log(Level.FINEST, message);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -133,9 +133,13 @@ public class RecipeHelper {
|
|||
return ItemUtil.collateStacks(getRecipeInputs(recipe));
|
||||
}
|
||||
|
||||
public static ArrayList<IRecipe> getReverseRecipes(CustomWrappedStack customStackWrapper) {
|
||||
public static ArrayList<IRecipe> getReverseRecipes(CustomWrappedStack customWrappedStack) {
|
||||
|
||||
return getReverseRecipes(customStackWrapper.getItemStack());
|
||||
if (customWrappedStack.getWrappedStack() instanceof ItemStack) {
|
||||
return getReverseRecipes((ItemStack) customWrappedStack.getWrappedStack());
|
||||
}
|
||||
|
||||
return new ArrayList<IRecipe>();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
|
|
@ -3,7 +3,6 @@ package com.pahimar.ee3.core.util;
|
|||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.util.Properties;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import net.minecraftforge.common.Configuration;
|
||||
|
||||
|
@ -123,10 +122,10 @@ public class VersionHelper implements Runnable {
|
|||
public static void logResult() {
|
||||
|
||||
if (result == CURRENT || result == OUTDATED) {
|
||||
LogHelper.log(Level.INFO, getResultMessage());
|
||||
LogHelper.info(getResultMessage());
|
||||
}
|
||||
else {
|
||||
LogHelper.log(Level.WARNING, getResultMessage());
|
||||
LogHelper.warning(getResultMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -192,7 +191,7 @@ public class VersionHelper implements Runnable {
|
|||
|
||||
int count = 0;
|
||||
|
||||
LogHelper.log(Level.INFO, LanguageRegistry.instance().getStringLocalization(Strings.VERSION_CHECK_INIT_LOG_MESSAGE) + " " + REMOTE_VERSION_XML_FILE);
|
||||
LogHelper.info(LanguageRegistry.instance().getStringLocalization(Strings.VERSION_CHECK_INIT_LOG_MESSAGE) + " " + REMOTE_VERSION_XML_FILE);
|
||||
|
||||
try {
|
||||
while (count < Reference.VERSION_CHECK_ATTEMPTS - 1 && (result == UNINITIALIZED || result == ERROR)) {
|
||||
|
|
|
@ -5,7 +5,6 @@ import java.util.Iterator;
|
|||
import java.util.List;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -50,9 +49,56 @@ public class DynEMC {
|
|||
}
|
||||
|
||||
private void init() {
|
||||
|
||||
}
|
||||
|
||||
populateItemList();
|
||||
populateGraph();
|
||||
/**
|
||||
* Discovers all instances of ItemStacks with wild card meta values in the vanilla Crafting Manager
|
||||
* @return A list of CustomWrappedStacks that contains all wild card meta ItemStacks in the vanilla Crafting Manager
|
||||
*/
|
||||
private ArrayList<CustomWrappedStack> findWildCards() {
|
||||
|
||||
ArrayList<CustomWrappedStack> wildCards = new ArrayList<CustomWrappedStack>();
|
||||
|
||||
for (Object recipe : CraftingManager.getInstance().getRecipeList()) {
|
||||
|
||||
if (recipe instanceof IRecipe) {
|
||||
if (((IRecipe) recipe).getRecipeOutput() instanceof ItemStack) {
|
||||
CustomWrappedStack recipeOutput = new CustomWrappedStack(((IRecipe) recipe).getRecipeOutput());
|
||||
ArrayList<CustomWrappedStack> recipeInputs = RecipeHelper.getRecipeInputs((IRecipe) recipe);
|
||||
ItemStack itemStack = null;
|
||||
|
||||
if (recipeOutput.getWrappedStack() instanceof ItemStack) {
|
||||
|
||||
itemStack = (ItemStack) recipeOutput.getWrappedStack();
|
||||
|
||||
if (itemStack.getItemDamage() == OreDictionary.WILDCARD_VALUE && OreDictionary.getOreID(itemStack) == -1) {
|
||||
|
||||
if (!wildCards.contains(recipeOutput)) {
|
||||
wildCards.add(recipeOutput);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (CustomWrappedStack inputStack : recipeInputs) {
|
||||
|
||||
if (inputStack.getWrappedStack() instanceof ItemStack) {
|
||||
|
||||
itemStack = (ItemStack) inputStack.getWrappedStack();
|
||||
|
||||
if (itemStack.getItemDamage() == OreDictionary.WILDCARD_VALUE && OreDictionary.getOreID(itemStack) == -1) {
|
||||
|
||||
if (!wildCards.contains(inputStack)) {
|
||||
wildCards.add(inputStack);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return wildCards;
|
||||
}
|
||||
|
||||
private void populateItemList() {
|
||||
|
@ -85,11 +131,15 @@ public class DynEMC {
|
|||
}
|
||||
|
||||
for (CustomWrappedStack wrappedRecipeInput : RecipeHelper.getCollatedRecipeInputs((IRecipe) recipe)) {
|
||||
if ((wrappedRecipeInput.getItemStack() != null) && (wrappedRecipeInput.getItemStack().getItemDamage() == OreDictionary.WILDCARD_VALUE)) {
|
||||
|
||||
wrappedRecipeInput.setStackSize(1);
|
||||
if (!discoveredItems.contains(wrappedRecipeInput)) {
|
||||
discoveredItems.add(wrappedRecipeInput);
|
||||
if (wrappedRecipeInput.getWrappedStack() instanceof ItemStack) {
|
||||
ItemStack wrappedItemStack = (ItemStack) wrappedRecipeInput.getWrappedStack();
|
||||
if (wrappedItemStack.getItemDamage() == OreDictionary.WILDCARD_VALUE) {
|
||||
|
||||
wrappedRecipeInput.setStackSize(1);
|
||||
|
||||
if (!discoveredItems.contains(wrappedRecipeInput)) {
|
||||
discoveredItems.add(wrappedRecipeInput);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -111,10 +161,10 @@ public class DynEMC {
|
|||
for (ItemStack itemStack : subItems) {
|
||||
if (itemStack != null) {
|
||||
|
||||
CustomWrappedStack customStackWrapper = new CustomWrappedStack(itemStack);
|
||||
CustomWrappedStack customWrappedStack = new CustomWrappedStack(itemStack);
|
||||
|
||||
if (!discoveredItems.contains(customStackWrapper)) {
|
||||
discoveredItems.add(customStackWrapper);
|
||||
if (!discoveredItems.contains(customWrappedStack)) {
|
||||
discoveredItems.add(customWrappedStack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -123,9 +173,9 @@ public class DynEMC {
|
|||
|
||||
ItemStack itemStack = new ItemStack(Item.itemsList[i]);
|
||||
|
||||
CustomWrappedStack customStackWrapper = new CustomWrappedStack(itemStack);
|
||||
if (!discoveredItems.contains(customStackWrapper)) {
|
||||
discoveredItems.add(customStackWrapper);
|
||||
CustomWrappedStack customWrappedStack = new CustomWrappedStack(itemStack);
|
||||
if (!discoveredItems.contains(customWrappedStack)) {
|
||||
discoveredItems.add(customWrappedStack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -135,10 +185,10 @@ public class DynEMC {
|
|||
* Now that we have discovered as many items as possible, trim out the
|
||||
* items that are black listed
|
||||
*/
|
||||
for (CustomWrappedStack customStackWrapper : EmcBlackList.getInstance().getBlackListStacks()) {
|
||||
for (CustomWrappedStack customWrappedStack : EmcBlackList.getInstance().getBlackListStacks()) {
|
||||
|
||||
while (discoveredItems.contains(customStackWrapper)) {
|
||||
discoveredItems.remove(customStackWrapper);
|
||||
while (discoveredItems.contains(customWrappedStack)) {
|
||||
discoveredItems.remove(customWrappedStack);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -166,8 +216,8 @@ public class DynEMC {
|
|||
|
||||
CustomWrappedStack recipeInput = null;
|
||||
|
||||
if (wrappedRecipeInput.getItemStack() != null) {
|
||||
ItemStack itemStack = wrappedRecipeInput.getItemStack();
|
||||
if (wrappedRecipeInput.getWrappedStack() instanceof ItemStack) {
|
||||
ItemStack itemStack = (ItemStack) wrappedRecipeInput.getWrappedStack();
|
||||
|
||||
if (OreDictionary.getOreID(itemStack) != -1) {
|
||||
recipeInput = new CustomWrappedStack(new OreStack(itemStack));
|
||||
|
@ -176,8 +226,8 @@ public class DynEMC {
|
|||
recipeInput = new CustomWrappedStack(itemStack);
|
||||
}
|
||||
}
|
||||
else if (wrappedRecipeInput.getOreStack() != null) {
|
||||
recipeInput = new CustomWrappedStack(wrappedRecipeInput.getOreStack());
|
||||
else if (wrappedRecipeInput.getWrappedStack() instanceof OreStack) {
|
||||
recipeInput = new CustomWrappedStack((OreStack) wrappedRecipeInput.getWrappedStack());
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -186,7 +236,7 @@ public class DynEMC {
|
|||
}
|
||||
}
|
||||
catch (NoSuchElementException e) {
|
||||
LogHelper.log(Level.SEVERE, e.getMessage() + ";\nFrom: [" + customWrappedStack + "]\nTo: [" + wrappedRecipeInput + "]");
|
||||
LogHelper.severe(e.getMessage() + ";\nFrom: [" + customWrappedStack + "]\nTo: [" + wrappedRecipeInput + "]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -247,29 +297,29 @@ public class DynEMC {
|
|||
|
||||
public void printDebugDump() {
|
||||
|
||||
LogHelper.log(Level.INFO, "***** START NODES *****");
|
||||
LogHelper.info("***** START NODES *****");
|
||||
Iterator<CustomWrappedStack> nodeIter = graph.iterator();
|
||||
while (nodeIter.hasNext()) {
|
||||
CustomWrappedStack node = nodeIter.next();
|
||||
LogHelper.log(Level.INFO, "Node: " + node);
|
||||
LogHelper.info("Node: " + node);
|
||||
}
|
||||
LogHelper.log(Level.INFO, "***** END NODES *****");
|
||||
LogHelper.info("***** END NODES *****");
|
||||
|
||||
LogHelper.log(Level.INFO, "***** START EDGES FROM *****");
|
||||
LogHelper.info("***** START EDGES FROM *****");
|
||||
nodeIter = graph.iterator();
|
||||
while (nodeIter.hasNext()) {
|
||||
CustomWrappedStack node = nodeIter.next();
|
||||
Set<WeightedEdge<CustomWrappedStack>> edgesFrom = graph.edgesFrom(node);
|
||||
for (WeightedEdge<CustomWrappedStack> edge : edgesFrom) {
|
||||
LogHelper.log(Level.INFO, "Crafting Output: " + node);
|
||||
LogHelper.log(Level.INFO, "Crafting Input: " + edge.getTarget());
|
||||
LogHelper.log(Level.INFO, "Weight: " + edge.getWeight());
|
||||
LogHelper.log(Level.INFO, "");
|
||||
LogHelper.info("Crafting Output: " + node);
|
||||
LogHelper.info("Crafting Input: " + edge.getTarget());
|
||||
LogHelper.info("Weight: " + edge.getWeight());
|
||||
LogHelper.info("");
|
||||
}
|
||||
}
|
||||
LogHelper.log(Level.INFO, "***** END EDGES FROM *****");
|
||||
LogHelper.info("***** END EDGES FROM *****");
|
||||
|
||||
LogHelper.log(Level.INFO, "***** START EDGES TO *****");
|
||||
LogHelper.info("***** START EDGES TO *****");
|
||||
nodeIter = graph.iterator();
|
||||
while (nodeIter.hasNext()) {
|
||||
CustomWrappedStack node = nodeIter.next();
|
||||
|
@ -277,13 +327,13 @@ public class DynEMC {
|
|||
Iterator<WeightedEdge<CustomWrappedStack>> edgeIter = edgesTo.iterator();
|
||||
while (edgeIter.hasNext()) {
|
||||
WeightedEdge<CustomWrappedStack> edge = edgeIter.next();
|
||||
LogHelper.log(Level.INFO, "From: " + node);
|
||||
LogHelper.log(Level.INFO, "To: " + edge.getTarget());
|
||||
LogHelper.log(Level.INFO, "Weight: " + edge.getWeight());
|
||||
LogHelper.log(Level.INFO, "");
|
||||
LogHelper.info("From: " + node);
|
||||
LogHelper.info("To: " + edge.getTarget());
|
||||
LogHelper.info("Weight: " + edge.getWeight());
|
||||
LogHelper.info("");
|
||||
}
|
||||
}
|
||||
LogHelper.log(Level.INFO, "***** END EDGES TO *****");
|
||||
LogHelper.info("***** END EDGES TO *****");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -38,10 +38,10 @@ public class EmcBlackList {
|
|||
|
||||
public void add(ItemStack itemStack) {
|
||||
|
||||
CustomWrappedStack customStackWrapper = new CustomWrappedStack(itemStack);
|
||||
CustomWrappedStack customWrappedStack = new CustomWrappedStack(itemStack);
|
||||
|
||||
if (!stackBlackList.contains(customStackWrapper)) {
|
||||
stackBlackList.add(customStackWrapper);
|
||||
if (!stackBlackList.contains(customWrappedStack)) {
|
||||
stackBlackList.add(customWrappedStack);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -97,10 +97,10 @@ public class EmcBlackList {
|
|||
|
||||
public void remove(ItemStack itemStack) {
|
||||
|
||||
CustomWrappedStack customStackWrapper = new CustomWrappedStack(itemStack);
|
||||
CustomWrappedStack customWrappedStack = new CustomWrappedStack(itemStack);
|
||||
|
||||
while (stackBlackList.contains(customStackWrapper)) {
|
||||
stackBlackList.remove(customStackWrapper);
|
||||
while (stackBlackList.contains(customWrappedStack)) {
|
||||
stackBlackList.remove(customWrappedStack);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,9 +35,9 @@ public class EquivalencyGroup {
|
|||
return containsMember(new CustomWrappedStack(itemStack));
|
||||
}
|
||||
|
||||
public boolean containsMember(CustomWrappedStack customStackWrapper) {
|
||||
public boolean containsMember(CustomWrappedStack customWrappedStack) {
|
||||
|
||||
return equivalentItems.contains(customStackWrapper);
|
||||
return equivalentItems.contains(customWrappedStack);
|
||||
}
|
||||
|
||||
public void addMember(ItemStack itemStack) {
|
||||
|
@ -45,10 +45,10 @@ public class EquivalencyGroup {
|
|||
this.addMember(new CustomWrappedStack(itemStack));
|
||||
}
|
||||
|
||||
public void addMember(CustomWrappedStack customStackWrapper) {
|
||||
public void addMember(CustomWrappedStack customWrappedStack) {
|
||||
|
||||
if (!containsMember(customStackWrapper)) {
|
||||
equivalentItems.add(customStackWrapper);
|
||||
if (!containsMember(customWrappedStack)) {
|
||||
equivalentItems.add(customWrappedStack);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,10 +62,10 @@ public class EquivalencyGroup {
|
|||
removeMember(new CustomWrappedStack(itemStack));
|
||||
}
|
||||
|
||||
public void removeMember(CustomWrappedStack customStackWrapper) {
|
||||
public void removeMember(CustomWrappedStack customWrappedStack) {
|
||||
|
||||
while (containsMember(customStackWrapper)) {
|
||||
equivalentItems.remove(customStackWrapper);
|
||||
while (containsMember(customWrappedStack)) {
|
||||
equivalentItems.remove(customWrappedStack);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -92,8 +92,8 @@ public class EquivalencyGroup {
|
|||
StringBuilder stringBuilder = new StringBuilder();
|
||||
|
||||
stringBuilder.append("Equivalent Group Members: ");
|
||||
for (CustomWrappedStack customStackWrapper : equivalentItems) {
|
||||
stringBuilder.append(String.format("%s ", customStackWrapper));
|
||||
for (CustomWrappedStack customWrappedStack : equivalentItems) {
|
||||
stringBuilder.append(String.format("%s ", customWrappedStack));
|
||||
}
|
||||
|
||||
return stringBuilder.toString();
|
||||
|
@ -104,8 +104,8 @@ public class EquivalencyGroup {
|
|||
|
||||
int hashCode = 1;
|
||||
|
||||
for (CustomWrappedStack customStackWrapper : equivalentItems) {
|
||||
hashCode = 37 * hashCode + customStackWrapper.hashCode();
|
||||
for (CustomWrappedStack customWrappedStack : equivalentItems) {
|
||||
hashCode = 37 * hashCode + customWrappedStack.hashCode();
|
||||
}
|
||||
|
||||
return hashCode;
|
||||
|
|
|
@ -11,7 +11,6 @@ import java.util.NoSuchElementException;
|
|||
import java.util.Set;
|
||||
import java.util.SortedSet;
|
||||
import java.util.TreeSet;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import com.pahimar.ee3.core.util.LogHelper;
|
||||
|
||||
|
@ -48,10 +47,10 @@ public class WeightedDirectedGraph<T> implements Iterable<T> {
|
|||
|
||||
if (!(graph.containsKey(from) && graph.containsKey(to))) {
|
||||
if (!(graph.containsKey(from))) {
|
||||
LogHelper.log(Level.SEVERE, "From node doesn't exist: " + from.toString());
|
||||
LogHelper.severe("From node doesn't exist: " + from.toString());
|
||||
}
|
||||
if (!(graph.containsKey(to))) {
|
||||
LogHelper.log(Level.SEVERE, "To node doesn't exist: " + to.toString());
|
||||
LogHelper.severe("To node doesn't exist: " + to.toString());
|
||||
}
|
||||
throw new NoSuchElementException("Missing nodes from graph");
|
||||
}
|
||||
|
@ -83,12 +82,12 @@ public class WeightedDirectedGraph<T> implements Iterable<T> {
|
|||
|
||||
if (!(graph.containsKey(from) && graph.containsKey(to))) {
|
||||
if (!(graph.containsKey(from))) {
|
||||
LogHelper.log(Level.SEVERE, "From node doesn't exist: " + from.toString());
|
||||
LogHelper.log(Level.SEVERE, "To node: " + to.toString());
|
||||
LogHelper.severe("From node doesn't exist: " + from.toString());
|
||||
LogHelper.severe("To node: " + to.toString());
|
||||
}
|
||||
if (!(graph.containsKey(to))) {
|
||||
LogHelper.log(Level.SEVERE, "To node doesn't exist: " + to.toString());
|
||||
LogHelper.log(Level.SEVERE, "From node: " + from.toString());
|
||||
LogHelper.severe("To node doesn't exist: " + to.toString());
|
||||
LogHelper.severe("From node: " + from.toString());
|
||||
}
|
||||
throw new NoSuchElementException("Missing nodes from graph");
|
||||
}
|
||||
|
|
|
@ -43,15 +43,15 @@ public class CustomWrappedStack {
|
|||
|
||||
this.stackSize = stackSize;
|
||||
}
|
||||
|
||||
public ItemStack getItemStack() {
|
||||
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
public OreStack getOreStack() {
|
||||
|
||||
return oreStack;
|
||||
|
||||
public Object getWrappedStack() {
|
||||
|
||||
if (itemStack != null) {
|
||||
return itemStack;
|
||||
}
|
||||
else {
|
||||
return oreStack;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue