mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-18 11:48:02 -04:00
Added NEI option to show items' ore dictionary names in their tooltips.
This commit is contained in:
parent
5f62b15bf2
commit
b324dc300b
@ -334,3 +334,8 @@ tile.oc.redstone.usage=The §oRedstone I/O§r block can be used to remotely read
|
||||
tile.oc.screen.usage=A §oScreen§r is used in combination with a §oGraphics Card§r to allow computers to display text. Different screen tiers have different capabilties, that being that they support different resolutions and color depths, ranging from very low resolution, monochrome displays, to very high resolutions with up to 256 different colors.[nl][nl]The available resolution and color depth depends on the weakest link. When using a tier one graphics card with a tier three screen, only the tier one resolution and color depth is usable.[nl][nl]Screens can be placed next to each other to form multi-block screens. This has no impact on the available resolution. To control how adjacent screens connect, screens can also be dyed using any dye. Screens with different colors will not connect. Screens with different tiers will never connect, even if they have the same color.[nl][nl]Tier two and tier three screens also support mouse input. Clicks can either be performed in a screen's GUI (which can only be opened if a keyboard is connected to the screen), or by sneak-activating a screen empty-handed. Note that whether the GUI opens when sneak- or normally activating a screen can be controlled via the component it exposes to connected computers.
|
||||
tile.oc.serverRack.usage=A §oServer Rack§r houses up to four §oServers§r. A server is a higher tier computer, which can only run when inside a server rack. Servers can be remote controlled using a §oRemote Terminal§r. The number of terminals that can be connected to a single server at a time depends on the tier of the server. The distance up to which the remote terminals work can be configured in the rack's GUI. Higher values have a higher constant energy draw.[nl][nl]Each server in a server rack can only communicate with one "face" of the server rack at a time - or none at all. Which side each server is connected to can be configured in the server rack's GUI. Beware that the sides are from the point of view of the server rack, i.e. if you are looking at the front of the server rack, right will be to your left and vice versa.[nl][nl]Server racks act as §oSwitch§r and §oPower Distributor§r in one. The switch mode of the server rack can be configured in its GUI, with the two options being internal and external. In external mode the server rack will behave like a normal switch. In internal mode, messages are only passed to the servers in the rack, they will not be automatically relayed to the other faces of the rack. Servers will still be able to send messages to each other. This allows using server racks as advanced switches that can perform filter and mapping operations, for example.
|
||||
tile.oc.switch.usage=The §oSwitch§r can be used to allow different subnetworks to send network messages to each other without exposing components to computers in other networks. Keeping components local is usually a good idea, to avoid computers using the wrong screen or to avoid component overflows to happen (in which computers will crash / not start anymore).[nl][nl]There is also a wireless variation of this block, the §oAccess Point§r, which will also relay messages wirelessly.[nl][nl]Switches and access point do §lnot§r keep track of which packets they relayed recently, so avoid cycles in your network, or you may receive the same packet multiple times.[nl][nl]Packets are only re-sent a certain number of times, so chaining an arbitrary number of switches or access points is not possible.
|
||||
|
||||
# NEI Integration
|
||||
nei.options.inventory.oredict=Show OreDictionary names
|
||||
nei.options.inventory.oredict.true=True
|
||||
nei.options.inventory.oredict.false=False
|
||||
|
@ -1,7 +1,10 @@
|
||||
package li.cil.oc.integration.nei
|
||||
|
||||
import codechicken.nei.NEIClientConfig
|
||||
import codechicken.nei.api.API
|
||||
import codechicken.nei.api.IConfigureNEI
|
||||
import codechicken.nei.config.OptionToggleButton
|
||||
import codechicken.nei.guihook.GuiContainerManager
|
||||
import cpw.mods.fml.relauncher.Side
|
||||
import cpw.mods.fml.relauncher.SideOnly
|
||||
import li.cil.oc.integration.util.NEI
|
||||
@ -11,7 +14,7 @@ import net.minecraft.item.ItemStack
|
||||
class NEIOpenComputersConfig extends IConfigureNEI {
|
||||
override def getName = "OpenComputers"
|
||||
|
||||
override def getVersion = "1.0.0"
|
||||
override def getVersion = "1.1.0"
|
||||
|
||||
override def loadConfig() {
|
||||
// Non-alphabetic order haunts my OCD, but I want the "Manual" to show up
|
||||
@ -19,6 +22,12 @@ class NEIOpenComputersConfig extends IConfigureNEI {
|
||||
API.registerUsageHandler(new GeneralUsageHandler())
|
||||
API.registerUsageHandler(new CallbackDocHandler())
|
||||
|
||||
// Add option to show items' ore dictionary name in tooltips.
|
||||
NEIClientConfig.global.config.getTag("inventory.oredict").getBooleanValue(false)
|
||||
val oreDictOption = new OptionToggleButton("inventory.oredict", true)
|
||||
GuiContainerManager.addTooltipHandler(new OredictTooltipHandler())
|
||||
API.addOption(oreDictOption)
|
||||
|
||||
for (block <- NEI.hiddenBlocks) {
|
||||
API.hideItem(new ItemStack(block))
|
||||
}
|
||||
|
@ -0,0 +1,25 @@
|
||||
package li.cil.oc.integration.nei
|
||||
|
||||
import java.util
|
||||
|
||||
import codechicken.nei.NEIClientConfig
|
||||
import codechicken.nei.guihook.IContainerTooltipHandler
|
||||
import net.minecraft.client.gui.inventory.GuiContainer
|
||||
import net.minecraft.item.ItemStack
|
||||
import net.minecraft.util.EnumChatFormatting
|
||||
import net.minecraftforge.oredict.OreDictionary
|
||||
|
||||
class OredictTooltipHandler() extends IContainerTooltipHandler {
|
||||
override def handleTooltip(gui: GuiContainer, x: Int, y: Int, tooltip: util.List[String]) = tooltip
|
||||
|
||||
override def handleItemDisplayName(gui: GuiContainer, stack: ItemStack, tooltip: util.List[String]) = tooltip
|
||||
|
||||
override def handleItemTooltip(gui: GuiContainer, stack: ItemStack, x: Int, y: Int, tooltip: util.List[String]) = {
|
||||
if (NEIClientConfig.getBooleanSetting("inventory.oredict")) {
|
||||
for (oreId <- OreDictionary.getOreIDs(stack)) {
|
||||
tooltip.add(EnumChatFormatting.DARK_GRAY + OreDictionary.getOreName(oreId))
|
||||
}
|
||||
}
|
||||
tooltip
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user