mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-27 07:13:14 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b8c17fb3c | ||
|
|
1fddcd5b40 | ||
|
|
ae654620bb | ||
|
|
00f9ac485b | ||
|
|
63289fe116 | ||
|
|
67062474fa |
No files matched your search
+1
-1
@@ -12,4 +12,4 @@ mod_version=1.3.3
|
||||
minetweaker_version=Dev-1.7.10-3.2.2-GTNH
|
||||
chisel_version=2.9.2.8
|
||||
mc_version=1.7.10
|
||||
build_number=43
|
||||
build_number=44
|
||||
@@ -1,6 +1,6 @@
|
||||
package WayofTime.alchemicalWizardry.client.nei;
|
||||
|
||||
import static WayofTime.alchemicalWizardry.client.nei.NEIConfig.bloodOrbs;
|
||||
import static WayofTime.alchemicalWizardry.client.nei.NEIConfig.getBloodOrbs;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
@@ -57,7 +57,7 @@ public class NEIAlchemyRecipeHandler extends TemplateRecipeHandler {
|
||||
this.output = new PositionedStack(recipe.getResult(), 76, 25);
|
||||
this.lp = recipe.getAmountNeeded() * 100;
|
||||
this.orbs = new ArrayList<BloodOrbs>();
|
||||
for (Item orb : bloodOrbs) {
|
||||
for (Item orb : getBloodOrbs()) {
|
||||
if (((IBloodOrb) orb).getOrbLevel() >= recipe.getOrbLevel()) {
|
||||
orbs.add(new BloodOrbs(new ItemStack(orb)));
|
||||
}
|
||||
@@ -81,29 +81,6 @@ public class NEIAlchemyRecipeHandler extends TemplateRecipeHandler {
|
||||
}
|
||||
}
|
||||
|
||||
@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();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOverlayIdentifier() {
|
||||
return "alchemicalwizardry.alchemy";
|
||||
|
||||
+12
-37
@@ -1,25 +1,23 @@
|
||||
package WayofTime.alchemicalWizardry.client.nei;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.ShapedBloodOrbRecipe;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
|
||||
import codechicken.nei.ItemList;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.ShapedRecipeHandler;
|
||||
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;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import WayofTime.alchemicalWizardry.api.items.ShapedBloodOrbRecipe;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.ShapedRecipeHandler;
|
||||
|
||||
import static WayofTime.alchemicalWizardry.client.nei.NEIConfig.bloodOrbs;
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static WayofTime.alchemicalWizardry.client.nei.NEIConfig.getBloodOrbs;
|
||||
|
||||
/**
|
||||
* NEI Blood Orb Shaped Recipe Handler by joshie *
|
||||
@@ -43,8 +41,8 @@ public class NEIBloodOrbShapedHandler extends ShapedRecipeHandler {
|
||||
stack.setMaxSize(1);
|
||||
ingredients.add(stack);
|
||||
} else if (o instanceof Integer) {
|
||||
ArrayList<ItemStack> orbs = new ArrayList();
|
||||
for (Item item : bloodOrbs) {
|
||||
ArrayList<ItemStack> orbs = new ArrayList<>();
|
||||
for (Item item : getBloodOrbs()) {
|
||||
if (((IBloodOrb) item).getOrbLevel() >= (Integer) o) {
|
||||
orbs.add(new ItemStack(item));
|
||||
}
|
||||
@@ -144,27 +142,4 @@ public class NEIBloodOrbShapedHandler extends ShapedRecipeHandler {
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
||||
+2
-2
@@ -34,8 +34,8 @@ public class NEIBloodOrbShapelessHandler extends ShapelessRecipeHandler {
|
||||
stack.setMaxSize(1);
|
||||
ingredients.add(stack);
|
||||
} else if (o instanceof Integer) {
|
||||
ArrayList<ItemStack> orbs = new ArrayList();
|
||||
for (Item item : NEIConfig.bloodOrbs) {
|
||||
ArrayList<ItemStack> orbs = new ArrayList<>();
|
||||
for (Item item : NEIConfig.getBloodOrbs()) {
|
||||
if (((IBloodOrb) item).getOrbLevel() >= (Integer) o) {
|
||||
orbs.add(new ItemStack(item));
|
||||
}
|
||||
|
||||
@@ -2,13 +2,46 @@ package WayofTime.alchemicalWizardry.client.nei;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
|
||||
import codechicken.nei.ItemList;
|
||||
import net.minecraft.item.Item;
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.IConfigureNEI;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class NEIConfig implements IConfigureNEI {
|
||||
private static ArrayList<Item> bloodOrbs = null;
|
||||
|
||||
public static ArrayList<Item> getBloodOrbs() {
|
||||
if (bloodOrbs == null) {
|
||||
synchronized (NEIConfig.class) {
|
||||
if (bloodOrbs == null) {
|
||||
bloodOrbs = collectAllBloodOrbs();
|
||||
}
|
||||
}
|
||||
}
|
||||
return bloodOrbs;
|
||||
}
|
||||
|
||||
private static ArrayList<Item> collectAllBloodOrbs() {
|
||||
ArrayList<Item> bloodOrbsTemp = new ArrayList<>();
|
||||
for (ItemStack item : ItemList.items) {
|
||||
if (item != null && item.getItem() instanceof IBloodOrb) {
|
||||
bloodOrbsTemp.add(item.getItem());
|
||||
}
|
||||
}
|
||||
if (bloodOrbsTemp.isEmpty()) {
|
||||
// If there is NEI no cache - go to item registry
|
||||
for (Object anItemRegistry : Item.itemRegistry) {
|
||||
Item item = (Item) anItemRegistry;
|
||||
if (item instanceof IBloodOrb) {
|
||||
bloodOrbsTemp.add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
return bloodOrbsTemp;
|
||||
}
|
||||
|
||||
public class NEIConfig implements IConfigureNEI {
|
||||
public static ArrayList<Item> bloodOrbs = new ArrayList<Item>();
|
||||
|
||||
@Override
|
||||
public void loadConfig() {
|
||||
API.registerRecipeHandler(new NEIAlchemyRecipeHandler());
|
||||
|
||||
@@ -146,10 +146,11 @@ public class TETeleposer extends TEInventory
|
||||
{
|
||||
entityCount = 0;
|
||||
}
|
||||
|
||||
SoulNetworkHandler.syphonFromNetwork(focus, damage * transportCount + damage * entityCount);
|
||||
//Teleport
|
||||
|
||||
|
||||
//Teleport with minimum cost of 2000 LP.
|
||||
int cost = Math.max(damage * transportCount + damage * entityCount, 2000);
|
||||
SoulNetworkHandler.syphonFromNetwork(focus, cost);
|
||||
|
||||
if (worldF.equals(worldObj))
|
||||
{
|
||||
iterator1 = list1.iterator();
|
||||
|
||||
Reference in new issue
Block a user