aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/nei/GT_NEI_MultiTreeGrowthSimulator.java
blob: ea175f4ddb83b1003c0c9401949f222999da06be (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
package gtPlusPlus.nei;

import java.util.List;

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 net.minecraft.item.ItemStack;

public class GT_NEI_MultiTreeGrowthSimulator extends GT_NEI_MultiNoCell {
	
	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) {		
			drawText(5, 90, "Chance of Sapling output if", -16777216);
			drawText(5, 100, ""+ModItems.fluidFertBasic.getLocalizedName()+" is provided.", -16777216);
			drawText(5, 110, "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;
	}
}