mirror of
https://github.com/GTNewHorizons/gendustry.git
synced 2026-11-28 07:55:39 +00:00
Added tooltip to smelting recipes for Samples/Templates
This commit is contained in:
1 parent
129d8d92b2
commit
30aba437a3
3 files changed
+40
No files matched your search
@@ -52,6 +52,7 @@ gendustry.label.flowering=Flowering Chance: %s
|
||||
gendustry.label.production=Production Modifier: %s
|
||||
gendustry.label.territory=Territory: %s
|
||||
|
||||
gendustry.label.erase=Place in furance to erase genetic content
|
||||
gendustry.label.consume=Consume chance: %s%%
|
||||
gendustry.label.mutatron.death=Death chance (ignoble): %s%%
|
||||
gendustry.label.mutatron.degrade=Degrade chance (pristine): %s%%
|
||||
|
||||
@@ -13,6 +13,7 @@ import codechicken.nei.api.{API, IConfigureNEI}
|
||||
import net.bdew.gendustry.config.{Config, Items}
|
||||
import cpw.mods.fml.common.event.FMLInterModComms
|
||||
import net.bdew.gendustry.Gendustry
|
||||
import codechicken.nei.forge.GuiContainerManager
|
||||
|
||||
class NEIGendustryConfig extends IConfigureNEI {
|
||||
def getName: String = "Gendustry"
|
||||
@@ -30,6 +31,9 @@ class NEIGendustryConfig extends IConfigureNEI {
|
||||
addRecipeHandler(new MutagenProducerHandler)
|
||||
addRecipeHandler(new MutatronHandler)
|
||||
addRecipeHandler(new SamplerHandler)
|
||||
|
||||
GuiContainerManager.addTooltipHandler(new SmeltingTooltipHandler)
|
||||
|
||||
FMLInterModComms.sendRuntimeMessage(Gendustry, "NEIPlugins", "register-crafting-handler", "Gendustry@Mutagen Producer@MutagenProducer");
|
||||
FMLInterModComms.sendRuntimeMessage(Gendustry, "NEIPlugins", "register-crafting-handler", "Gendustry@Mutatron@Mutatron");
|
||||
FMLInterModComms.sendRuntimeMessage(Gendustry, "NEIPlugins", "register-crafting-handler", "Gendustry@Sampler@Sampler");
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (c) bdew, 2013
|
||||
* https://github.com/bdew/gendustry
|
||||
*
|
||||
* This mod is distributed under the terms of the Minecraft Mod Public
|
||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||
* https://raw.github.com/bdew/gendustry/master/MMPL-1.0.txt
|
||||
*/
|
||||
|
||||
package net.bdew.gendustry.nei
|
||||
|
||||
import codechicken.nei.forge.IContainerTooltipHandler
|
||||
import net.minecraft.client.gui.inventory.GuiContainer
|
||||
import net.minecraft.item.ItemStack
|
||||
import java.util
|
||||
import codechicken.nei.recipe.{FurnaceRecipeHandler, GuiRecipe}
|
||||
import net.bdew.gendustry.config.Items
|
||||
import net.bdew.lib.Misc
|
||||
|
||||
class SmeltingTooltipHandler extends IContainerTooltipHandler {
|
||||
def handleTooltipFirst(gui: GuiContainer, mousex: Int, mousey: Int, currenttip: util.List[String]) = currenttip
|
||||
def handleItemTooltip(gui: GuiContainer, itemstack: ItemStack, currenttip: util.List[String]) = {
|
||||
if (gui.isInstanceOf[GuiRecipe]) {
|
||||
val gr = gui.asInstanceOf[GuiRecipe]
|
||||
val handler = gr.currenthandlers.get(gr.recipetype)
|
||||
if (handler.isInstanceOf[FurnaceRecipeHandler]) {
|
||||
if (itemstack.itemID == Items.geneSample.itemID)
|
||||
currenttip.add(Misc.toLocal("gendustry.label.erase"))
|
||||
if (itemstack.itemID == Items.geneTemplate.itemID)
|
||||
currenttip.add(Misc.toLocal("gendustry.label.erase"))
|
||||
}
|
||||
}
|
||||
currenttip
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user