blob: a98b791e34d4f3085c0ca0c18aaaaad978b43fb9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
package gtPlusPlus.nei;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.GuiRecipe;
import codechicken.nei.recipe.TemplateRecipeHandler;
import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map;
import gtPlusPlus.core.item.ModItems;
import java.util.List;
import net.minecraft.item.ItemStack;
public class GT_NEI_MultiTreeGrowthSimulator extends GTPP_NEI_DefaultHandler {
public GT_NEI_MultiTreeGrowthSimulator() {
super(GTPP_Recipe_Map.sTreeSimFakeRecipes);
}
@Override
public TemplateRecipeHandler newInstance() {
return new GT_NEI_MultiTreeGrowthSimulator();
}
@Override
public void drawExtras(final int aRecipeIndex) {
if (ModItems.fluidFertBasic != null) {
int y = getDescriptionYOffset();
drawText(5, y, "Chance of Sapling output if", -16777216);
y += 10;
drawText(5, y, "" + ModItems.fluidFertBasic.getLocalizedName() + " is provided.", -16777216);
y += 10;
drawText(5, y, "This is optional.", -16777216);
}
}
@Override
public List<String> handleItemTooltip(
final GuiRecipe<?> gui, final ItemStack aStack, final List<String> currenttip, final int aRecipeIndex) {
final TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex);
if (tObject instanceof CachedDefaultRecipe) {
final CachedDefaultRecipe tRecipe = (CachedDefaultRecipe) tObject;
for (final PositionedStack tStack : tRecipe.mOutputs) {
if (aStack == tStack.item) {
if ((!(tStack instanceof FixedPositionedStack))
|| (((FixedPositionedStack) tStack).mChance <= 0)
|| (((FixedPositionedStack) tStack).mChance == 10000)) {
break;
}
if (ModItems.fluidFertBasic != null) {
currenttip.add(
"Chance output if " + ModItems.fluidFertBasic.getLocalizedName() + " is provided.");
}
break;
}
}
}
return currenttip;
}
}
|