Compare commits

...
4 Commits
Author SHA1 Message Date
Dream-MasterXXL 04723371fb gitignore 2019-07-08 11:27:30 +02:00
Martin Robertz ec1adca050 Merge pull request #5 from DeForce/fix-nei-integration
Remove dependency on NEI item cache
2019-07-07 17:50:14 +02:00
Vladislav Ivanov 11fd03a742 Remove dependency on NEI item cache 2019-07-07 12:27:51 +03:00
Dream-Master 22b258f384 add changes 2019-07-06 00:55:18 +02:00
5 changed files with 53 additions and 12 deletions

No files matched your search

+1
View File
@@ -34,3 +34,4 @@ Thumbs.db
usernamecache.json
options.txt
*.bat
+2 -2
View File
@@ -1,5 +1,5 @@
#
#Mon Jun 27 18:00:04 CEST 2016
#Sat Jul 06 00:15:21 CEST 2019
mod_name=BloodMagic
forge_version=10.13.4.1492-1.7.10
ccc_version=1.0.7.47
@@ -12,4 +12,4 @@ mod_version=1.3.3
minetweaker_version=Dev-1.7.10-3.0.9B
chisel_version=2.9.2.8
mc_version=1.7.10
build_number=24
build_number=29
+2 -2
View File
@@ -1,6 +1,6 @@
#Fri Sep 26 11:20:52 CDT 2014
#Sat Jul 06 23:18:00 EEST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.3-all.zip
@@ -83,12 +83,24 @@ public class NEIAlchemyRecipeHandler extends TemplateRecipeHandler {
@Override
public TemplateRecipeHandler newInstance() {
for (ItemStack item : ItemList.items) {
if (item != null && item.getItem() instanceof IBloodOrb) {
bloodOrbs.add(item.getItem());
// We need to populate available blood orbs,
// but don't try to do it more than once
if (bloodOrbs.isEmpty()) {
for (ItemStack item : ItemList.items) {
if (item != null && item.getItem() instanceof IBloodOrb) {
bloodOrbs.add(item.getItem());
}
}
if (bloodOrbs.isEmpty()) {
// If there is NEI no cache - go to item registry
for (Object anItemRegistry : Item.itemRegistry) {
Item item = (Item) anItemRegistry;
if (item != null && item instanceof IBloodOrb) {
bloodOrbs.add(item);
}
}
}
}
return super.newInstance();
}
@@ -2,8 +2,12 @@ package WayofTime.alchemicalWizardry.client.nei;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import codechicken.nei.ItemList;
import codechicken.nei.recipe.TemplateRecipeHandler;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
@@ -15,6 +19,8 @@ import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.ShapedRecipeHandler;
import static WayofTime.alchemicalWizardry.client.nei.NEIConfig.bloodOrbs;
/**
* NEI Blood Orb Shaped Recipe Handler by joshie *
*/
@@ -38,17 +44,15 @@ public class NEIBloodOrbShapedHandler extends ShapedRecipeHandler {
ingredients.add(stack);
} else if (o instanceof Integer) {
ArrayList<ItemStack> orbs = new ArrayList();
for (Item item : NEIConfig.bloodOrbs) {
for (Item item : bloodOrbs) {
if (((IBloodOrb) item).getOrbLevel() >= (Integer) o) {
orbs.add(new ItemStack(item));
}
}
PositionedStack stack = new PositionedStack(orbs, 25 + x * 18, 6 + y * 18, false);
stack.setMaxSize(1);
ingredients.add(stack);
}else if(o instanceof List)
{
} else if(o instanceof List) {
PositionedStack stack = new PositionedStack(o, 25 + x * 18, 6 + y * 18, false);
stack.setMaxSize(1);
ingredients.add(stack);
@@ -138,5 +142,29 @@ public class NEIBloodOrbShapedHandler extends ShapedRecipeHandler {
@Override
public String getRecipeName() {
return StatCollector.translateToLocal("bm.string.crafting.orb.shaped");
}
@Override
public TemplateRecipeHandler newInstance() {
// We need to populate available blood orbs,
// but don't try to do it more than once
if (bloodOrbs.isEmpty()) {
for (ItemStack item : ItemList.items) {
if (item != null && item.getItem() instanceof IBloodOrb) {
bloodOrbs.add(item.getItem());
}
}
if (bloodOrbs.isEmpty()) {
// If there is NEI no cache - go to item registry
for (Object anItemRegistry : Item.itemRegistry) {
Item item = (Item) anItemRegistry;
if (item != null && item instanceof IBloodOrb) {
bloodOrbs.add(item);
}
}
}
}
return super.newInstance();
}
}