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<>();
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ gui.refinedstorage:crafting_preview.to_craft=To craft: %d
|
||||
gui.refinedstorage:crafting_preview.available=Available: %d
|
||||
gui.refinedstorage:crafting_preview.missing=Missing: %d
|
||||
gui.refinedstorage:crafting_preview.circular=Circular dependency!
|
||||
gui.refinedstorage:crafting_preview.loop=loop in processing...
|
||||
gui.refinedstorage:crafting_preview.loop=Loop in processing...
|
||||
|
||||
misc.refinedstorage:energy_stored=%d / %d RS
|
||||
misc.refinedstorage:energy_usage=Usage: %d RS/t
|
||||
@@ -68,6 +68,7 @@ misc.refinedstorage:network_card.tooltip=Linked to %d, %d, %d.
|
||||
misc.refinedstorage:pattern.inputs=Inputs
|
||||
misc.refinedstorage:pattern.outputs=Outputs
|
||||
misc.refinedstorage:pattern.invalid=Invalid pattern
|
||||
misc.refinedstorage:pattern.oredict=Uses ore dictionary
|
||||
|
||||
misc.refinedstorage:start=Start
|
||||
misc.refinedstorage:clear=Clear
|
||||
|
||||
Reference in New Issue
Block a user