aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/goodgenerator/crossmod/nei/NeutronActivatorHandler.java
blob: 44a15747788bce60405a0047aca247a2927ae044 (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
58
59
60
61
62
63
64
package goodgenerator.crossmod.nei;

import codechicken.nei.recipe.GuiCraftingRecipe;
import codechicken.nei.recipe.GuiUsageRecipe;
import codechicken.nei.recipe.TemplateRecipeHandler;
import cpw.mods.fml.common.event.FMLInterModComms;
import gregtech.api.enums.GT_Values;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.nei.GT_NEI_DefaultHandler;
import java.awt.*;
import net.minecraft.util.StatCollector;

public class NeutronActivatorHandler extends GT_NEI_DefaultHandler {

    public NeutronActivatorHandler(GT_Recipe.GT_Recipe_Map aRecipeMap) {
        super(aRecipeMap);
        if (!NEI_Config.isAdded) {
            FMLInterModComms.sendRuntimeMessage(
                    GT_Values.GT,
                    "NEIPlugins",
                    "register-crafting-handler",
                    "gregtech@" + this.getRecipeName() + "@" + this.getOverlayIdentifier());
            GuiCraftingRecipe.craftinghandlers.add(this);
            GuiUsageRecipe.usagehandlers.add(this);
        }
    }

    @Override
    public TemplateRecipeHandler newInstance() {
        return new NeutronActivatorHandler(this.mRecipeMap);
    }

    @Override
    public void drawExtras(int aRecipeIndex) {
        int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration;
        int minNKE = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue % 10000;
        int maxNKE = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue / 10000;
        int y = getDescriptionYOffset();
        drawText(
                10,
                y,
                this.trans("158", "Time: ")
                        + GT_Utility.formatNumbers((float) tDuration / 20.0)
                        + this.trans("161", " secs"),
                -16777216);
        y += 10;
        drawText(10, y, StatCollector.translateToLocal("value.neutron_activator.0"), -16777216);
        y += 10;
        drawText(
                10,
                y,
                GT_Utility.formatNumbers(minNKE) + StatCollector.translateToLocal("value.neutron_activator.2"),
                -16777216);
        y += 10;
        drawText(10, y, StatCollector.translateToLocal("value.neutron_activator.1"), -16777216);
        y += 10;
        drawText(
                10,
                y,
                GT_Utility.formatNumbers(maxNKE) + StatCollector.translateToLocal("value.neutron_activator.2"),
                -16777216);
    }
}