mirror of
https://github.com/GTNewHorizons/CraftTweaker.git
synced 2026-11-24 22:04:23 +00:00
[ci skip] spotlessApply with the new settings
This commit is contained in:
1 parent
6b208b98bc
commit
a309488cdf
214 files changed
+9283
-9265
No files matched your search
@@ -1,70 +1,75 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
* To change this license header, choose License Headers in Project Properties. To change this template file, choose
|
||||
* Tools | Templates and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.mods.ic2;
|
||||
|
||||
import ic2.api.recipe.IRecipeInput;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import static minetweaker.api.minecraft.MineTweakerMC.getIItemStack;
|
||||
import static minetweaker.api.minecraft.MineTweakerMC.getItemStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import ic2.api.recipe.IRecipeInput;
|
||||
|
||||
/**
|
||||
* Wrapper class for ITweakerItemStackPatterns to IC2 recipe inputs.
|
||||
*
|
||||
* @author Stan Hebben
|
||||
*/
|
||||
public class IC2RecipeInput implements IRecipeInput {
|
||||
private final IIngredient ingredient;
|
||||
|
||||
public IC2RecipeInput(IIngredient ingredient) {
|
||||
this.ingredient = ingredient;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(ItemStack subject) {
|
||||
return ingredient.matches(getIItemStack(subject));
|
||||
}
|
||||
private final IIngredient ingredient;
|
||||
|
||||
@Override
|
||||
public int getAmount() {
|
||||
return ingredient.getAmount();
|
||||
}
|
||||
public IC2RecipeInput(IIngredient ingredient) {
|
||||
this.ingredient = ingredient;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getInputs() {
|
||||
List<ItemStack> items = new ArrayList<ItemStack>();
|
||||
for (IItemStack item : ingredient.getItems()) {
|
||||
items.add(getItemStack(item));
|
||||
}
|
||||
return items;
|
||||
}
|
||||
@Override
|
||||
public boolean matches(ItemStack subject) {
|
||||
return ingredient.matches(getIItemStack(subject));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 7;
|
||||
hash = 89 * hash + (this.ingredient != null ? this.ingredient.hashCode() : 0);
|
||||
return hash;
|
||||
}
|
||||
@Override
|
||||
public int getAmount() {
|
||||
return ingredient.getAmount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final IC2RecipeInput other = (IC2RecipeInput) obj;
|
||||
if (this.ingredient != other.ingredient && (this.ingredient == null || !this.ingredient.equals(other.ingredient))) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public List<ItemStack> getInputs() {
|
||||
List<ItemStack> items = new ArrayList<ItemStack>();
|
||||
for (IItemStack item : ingredient.getItems()) {
|
||||
items.add(getItemStack(item));
|
||||
}
|
||||
return items;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 7;
|
||||
hash = 89 * hash + (this.ingredient != null ? this.ingredient.hashCode() : 0);
|
||||
return hash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final IC2RecipeInput other = (IC2RecipeInput) obj;
|
||||
if (this.ingredient != other.ingredient
|
||||
&& (this.ingredient == null || !this.ingredient.equals(other.ingredient))) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user