Oredict base code
This commit is contained in:
@@ -81,7 +81,7 @@ public class CraftingPattern implements ICraftingPattern {
|
||||
|
||||
@Override
|
||||
public boolean isOredict() {
|
||||
return true;
|
||||
return ItemPattern.isOredict(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -32,6 +32,7 @@ public class ItemPattern extends ItemBase implements ICraftingPatternProvider {
|
||||
|
||||
private static final String NBT_SLOT = "Slot_%d";
|
||||
private static final String NBT_OUTPUTS = "Outputs";
|
||||
private static final String NBT_OREDICT = "Oredict";
|
||||
|
||||
public ItemPattern() {
|
||||
super("pattern");
|
||||
@@ -63,6 +64,10 @@ public class ItemPattern extends ItemBase implements ICraftingPatternProvider {
|
||||
}
|
||||
|
||||
combineItems(tooltip, true, Iterables.toArray(pattern.getOutputs(), ItemStack.class));
|
||||
|
||||
if (isOredict(stack)) {
|
||||
tooltip.add(TextFormatting.BLUE + I18n.format("misc.refinedstorage:pattern.oredict") + TextFormatting.RESET);
|
||||
}
|
||||
} else {
|
||||
tooltip.add(TextFormatting.RED + I18n.format("misc.refinedstorage:pattern.invalid") + TextFormatting.RESET);
|
||||
|
||||
@@ -148,6 +153,18 @@ public class ItemPattern extends ItemBase implements ICraftingPatternProvider {
|
||||
return pattern.hasTagCompound() && pattern.getTagCompound().hasKey(NBT_OUTPUTS);
|
||||
}
|
||||
|
||||
public static boolean isOredict(ItemStack pattern) {
|
||||
return pattern.hasTagCompound() && pattern.getTagCompound().hasKey(NBT_OREDICT) && pattern.getTagCompound().getBoolean(NBT_OREDICT);
|
||||
}
|
||||
|
||||
public static void setOredict(ItemStack pattern, boolean oredict) {
|
||||
if (!pattern.hasTagCompound()) {
|
||||
pattern.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
pattern.getTagCompound().setBoolean(NBT_OREDICT, oredict);
|
||||
}
|
||||
|
||||
public static void combineItems(List<String> tooltip, boolean displayAmount, ItemStack... stacks) {
|
||||
Set<Integer> combinedIndices = new HashSet<>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user