mirror of
https://github.com/GTNewHorizons/Electro-Magic-Tools.git
synced 2026-11-22 21:09:49 +00:00
Some stuff
Api derpage apparently... Some new drills, and chainsaws. Started working on omnitools, but I got distracted. I NEED TEXTURES :(
This commit is contained in:
1 parent
f927d596d5
commit
104ecb66bb
196 files changed
+8231
-8092
No files matched your search
@@ -1,71 +1,70 @@
|
||||
package ic2.api.recipe;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class RecipeInputOreDict implements IRecipeInput {
|
||||
public RecipeInputOreDict(String input1) {
|
||||
this(input1, 1);
|
||||
}
|
||||
public RecipeInputOreDict(String input1) {
|
||||
this(input1, 1);
|
||||
}
|
||||
|
||||
public RecipeInputOreDict(String input1, int amount1) {
|
||||
this(input1, amount1, null);
|
||||
}
|
||||
public RecipeInputOreDict(String input1, int amount1) {
|
||||
this(input1, amount1, null);
|
||||
}
|
||||
|
||||
public RecipeInputOreDict(String input1, int amount1, Integer meta) {
|
||||
this.input = input1;
|
||||
this.amount = amount1;
|
||||
this.meta = meta;
|
||||
}
|
||||
public RecipeInputOreDict(String input1, int amount1, Integer meta) {
|
||||
this.input = input1;
|
||||
this.amount = amount1;
|
||||
this.meta = meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(ItemStack subject) {
|
||||
List<ItemStack> inputs = OreDictionary.getOres(input);
|
||||
@Override
|
||||
public boolean matches(ItemStack subject) {
|
||||
List<ItemStack> inputs = OreDictionary.getOres(input);
|
||||
|
||||
for (ItemStack input1 : inputs) {
|
||||
if (input1.getItem() == null) continue; // ignore invalid
|
||||
int metaRequired = meta == null ? input1.getItemDamage() : meta;
|
||||
for (ItemStack input1 : inputs) {
|
||||
if (input1.getItem() == null) continue; // ignore invalid
|
||||
int metaRequired = meta == null ? input1.getItemDamage() : meta;
|
||||
|
||||
if (subject.getItem() == input1.getItem() &&
|
||||
(subject.getItemDamage() == metaRequired || metaRequired == OreDictionary.WILDCARD_VALUE)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (subject.getItem() == input1.getItem() &&
|
||||
(subject.getItemDamage() == metaRequired || metaRequired == OreDictionary.WILDCARD_VALUE)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAmount() {
|
||||
return amount;
|
||||
}
|
||||
@Override
|
||||
public int getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getInputs() {
|
||||
List<ItemStack> ores = OreDictionary.getOres(input);
|
||||
List<ItemStack> ret = new ArrayList<ItemStack>(ores.size());
|
||||
@Override
|
||||
public List<ItemStack> getInputs() {
|
||||
List<ItemStack> ores = OreDictionary.getOres(input);
|
||||
List<ItemStack> ret = new ArrayList<ItemStack>(ores.size());
|
||||
|
||||
for (ItemStack stack : ores) {
|
||||
if (stack.getItem() != null) ret.add(stack); // ignore invalid
|
||||
}
|
||||
for (ItemStack stack : ores) {
|
||||
if (stack.getItem() != null) ret.add(stack); // ignore invalid
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
if (meta == null) {
|
||||
return "RInputOreDict<"+amount+"x"+input+">";
|
||||
} else {
|
||||
return "RInputOreDict<"+amount+"x"+input+"@"+meta+">";
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
if (meta == null) {
|
||||
return "RInputOreDict<" + amount + "x" + input + ">";
|
||||
} else {
|
||||
return "RInputOreDict<" + amount + "x" + input + "@" + meta + ">";
|
||||
}
|
||||
}
|
||||
|
||||
public final String input;
|
||||
public final int amount;
|
||||
public final Integer meta;
|
||||
public final String input;
|
||||
public final int amount;
|
||||
public final Integer meta;
|
||||
}
|
||||
Reference in new issue
Block a user