mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-26 14:52:58 +00:00
add DummyWorld to use in Log crafting recipe checks
This commit is contained in:
1 parent
28c13c8322
commit
75d1fd7f12
2 files changed
+37
-4
No files matched your search
@@ -19,6 +19,7 @@ import mekanism.common.recipe.RecipeHandler;
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.StackUtils;
|
||||
import mekanism.common.world.DummyWorld;
|
||||
import net.minecraft.block.BlockPlanks;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -402,6 +403,7 @@ public final class OreDictManager {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
DummyWorld dummyWorld = new DummyWorld();
|
||||
|
||||
InventoryCrafting tempCrafting = new InventoryCrafting(tempContainer, 3, 3);
|
||||
|
||||
@@ -414,17 +416,17 @@ public final class OreDictManager {
|
||||
for (ItemStack logEntry : logs) {
|
||||
if (logEntry.getItemDamage() == OreDictionary.WILDCARD_VALUE) {
|
||||
for (int j = 0; j < 16; j++) {
|
||||
addSawmillLog(tempCrafting, new ItemStack(logEntry.getItem(), 1, j));
|
||||
addSawmillLog(tempCrafting, new ItemStack(logEntry.getItem(), 1, j), dummyWorld);
|
||||
}
|
||||
} else {
|
||||
addSawmillLog(tempCrafting, StackUtils.size(logEntry, 1));
|
||||
addSawmillLog(tempCrafting, StackUtils.size(logEntry, 1), dummyWorld);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void addSawmillLog(InventoryCrafting tempCrafting, ItemStack log) {
|
||||
private static void addSawmillLog(InventoryCrafting tempCrafting, ItemStack log, DummyWorld world) {
|
||||
tempCrafting.setInventorySlotContents(0, log);
|
||||
ItemStack resultEntry = MekanismUtils.findMatchingRecipe(tempCrafting, null);
|
||||
ItemStack resultEntry = MekanismUtils.findMatchingRecipe(tempCrafting, world);
|
||||
|
||||
if (!resultEntry.isEmpty()) {
|
||||
RecipeHandler.addPrecisionSawmillRecipe(log, StackUtils.size(resultEntry, 6), new ItemStack(MekanismItems.Sawdust),
|
||||
|
||||
Reference in new issue
Block a user