Compare commits

...
17 Commits
Author SHA1 Message Date
D-Cysteine dd18d2b775 Properly fix NEI quantity text field behavior (#152)
* Always show quantity text box
* Increment version
* Properly fix quantity text field
2021-08-22 10:15:23 -07:00
DreamMasterXXL 1cf8f4c1d2 bump version 2021-08-14 21:44:47 +02:00
D-Cysteine a016795056 Always show quantity text box (#150) 2021-08-14 21:42:11 +02:00
Andrey f8d492e5f5 Added couple of useful events (#149)
* Added some useful events
* 2.1.8
2021-08-13 12:49:00 -07:00
TimeConqueror 8b073543b3 Added shaded libs to dev-jar 2021-08-13 12:48:31 -07:00
Jason Mitchell 8ef7978044 Add toString() for PositionedStack 2021-08-08 11:56:59 -07:00
YuRaNnNzZZ afd25919c5 added more handlers (gt4, td covers and NER) (#146) 2021-08-04 18:00:34 +02:00
Kiwiand[Kiwi233] 1bd64bc1b8 Update zh_CN.lang (#145)
Co-authored-by: [Kiwi233] <[[email protected]]>
2021-08-02 15:11:34 +02:00
Martin Robertz 45d0621da4 Merge pull request #144 from D-Cysteine/master
Wrap string with comma in double-quotes
2021-08-01 10:21:51 +02:00
D-Cysteine 4a34aa1796 Wrap string with comma in double-quotes 2021-08-01 00:42:15 -06:00
Jason Mitchell fe7066eeb8 Bmp version 2021-07-07 00:00:31 -07:00
Glease c80ab9d6ab fix tab icon lighting
Signed-off-by: Glease <[email protected]>
2021-07-07 00:00:00 -07:00
Jakub Szewczyk 475fda6ceb Don't take ghost slots into account when looking for present items (#136)
Fixes always-present items in forestry worktables
2021-06-14 17:14:06 -07:00
Jason Mitchell ae2cc2c600 Fix some CMEs that pop up when opening inventory immediately after logging in. (#135) 2021-06-05 19:47:58 +02:00
Jason Mitchell 37a571d878 Version bump 2021-05-23 09:55:18 -07:00
GlodBlock 3c9b801e74 add handle for Naquadah Fuel Refine Factory (#132) 2021-05-22 21:07:38 -07:00
Jakub Szewczyk e123ab2f30 Add JEI-style item presence overlay when hovering over the ? button (#130)
Indicates which items are missing and which ones are present in your inventory with small X/checkmark symbols when you hover over the ? button in a recipe gui.
2021-05-22 10:31:40 -07:00
22 changed files with 329 additions and 120 deletions

No files matched your search

+6
View File
@@ -145,6 +145,12 @@ task devJar(type: Jar) {
from sourceSets.main.output
getArchiveClassifier().set("dev")
manifest commonManifest
configurations.shade.each { dep ->
from(project.zipTree(dep)){
exclude 'META-INF', 'META-INF/**'
}
}
}
// Tell the artifact system about our extra jars
+1 -1
View File
@@ -2,4 +2,4 @@ mc_version=1.7.10
forge_version=10.13.4.1614-1.7.10
ccl_version=1.1.3.138
ccc_version=1.0.7.+
mod_version=2.1.3-GTNH
mod_version=2.1.10-GTNH
+29 -1
View File
@@ -25,6 +25,7 @@ WayofTime.alchemicalWizardry.client.nei.NEIBloodOrbShapelessHandler,Blood Magic,
bw.fuels.acidgens,BartWorks,gregtech:gt.blockmachines:12726,,bartworks,TRUE,,,145,,2,,,,,,
bw.recipe.cal,BartWorks,gregtech:gt.blockmachines:12735,,bartworks,TRUE,,,135,,2,,,,,,
gg.recipe.naquadah_reactor,Good Generator,gregtech:gt.blockmachines:12732,,GoodGenerator,TRUE,,,145,,1,,,,,,
gg.recipe.naquadah_fuel_refine_factory,Good Generator,gregtech:gt.blockmachines:16999,,GoodGenerator,TRUE,,,145,,1,,,,,,
com.github.bartimaeusnek.bartworks.neiHandler.BW_NEI_BioLabHandler,BartWorks,gregtech:gt.blockmachines:12699,,bartworks,TRUE,,,145,,2,,,,,,
com.github.bartimaeusnek.bartworks.neiHandler.BW_NEI_BioVatHandler,BartWorks,gregtech:gt.blockmachines:12712,,bartworks,TRUE,,,140,,2,,,,,,
com.github.bartimaeusnek.bartworks.neiHandler.BW_NEI_OreHandler,BartWorks,bartworks:bw.blockores.01:89,,bartworks,TRUE,,,135,,2,,,,,,
@@ -178,7 +179,7 @@ ic2.neiIntegration.core.recipehandler.MetalFormerRecipeHandlerRolling,Industrial
ic2.neiIntegration.core.recipehandler.OreWashingRecipeHandler,IndustrialCraft 2,IC2:blockMachine2:5,,IC2,TRUE,,,,,,,,,,,
ic2.neiIntegration.core.recipehandler.ScrapboxRecipeHandler,IndustrialCraft 2,IC2:itemScrapbox,,IC2,TRUE,,,50,,6,,,,,,
ic2.neiIntegration.core.recipehandler.SolidCannerRecipeHandler,IndustrialCraft 2,IC2:blockMachine2:9,,IC2,TRUE,,,,,,,,,,,
speiger.src.crops.prediction.NEIPlugin,IC2CropsNEI,IC2:blockCrop,,Ic2Nei,TRUE,,,135,,2,,,,,,Not actual recipes, just info
speiger.src.crops.prediction.NEIPlugin,IC2CropsNEI,IC2:blockCrop,,Ic2Nei,TRUE,,,135,,2,,,,,,"Not actual recipes, just info"
tonius.neiintegration.mods.mcforge.RecipeHandlerFluidRegistry,Minecraft,minecraft:water,,minecraft,FALSE,,,,,,,,,,,
tonius.neiintegration.mods.mcforge.RecipeHandlerOreDictionary,Minecraft,minecraft:iron_ore,,minecraft,FALSE,,,,,,,,,,,
gt.recipe.alloyblastsmelter,GT++,gregtech:gt.blockmachines:810,,miscutils,TRUE,,6,135,166,2,,,,,,ABS
@@ -421,3 +422,30 @@ mekanism.client.nei.SolarNeutronRecipeHandler,Mekanism,Mekanism:MachineBlock3:1,
mekanism.client.nei.ThermalEvaporationRecipeHandler,Mekanism,Mekanism:BasicBlock:14,,Mekanism,TRUE,,,62,,5,,,,,,
exnihilo.compatibility.nei.RecipeHandlerHammer,Ex Nihilo,exnihilo:hammer_iron,,exnihilo,TRUE,,,58,,5,,,,,,
exnihilo.compatibility.nei.RecipeHandlerSieve,Ex Nihilo,exnihilo:sifting_table,,exnihilo,TRUE,,,130,,2,,,,,,
gregtechmod.mistaqur.nei.handlers.AlloySmelterRecipeHandler,GregTech-Addon,gregtech_addon:machine:56,,gregtech_addon,TRUE,,15,145,166,2,,,,,,
gregtechmod.mistaqur.nei.handlers.AssemblerRecipeHandler,GregTech-Addon,gregtech_addon:machine:60,,gregtech_addon,TRUE,,15,145,166,2,,,,,,
gregtechmod.mistaqur.nei.handlers.BenderRecipeHandler,GregTech-Addon,gregtech_addon:machine:59,,gregtech_addon,TRUE,,15,145,166,2,,,,,,
gregtechmod.mistaqur.nei.handlers.BlastRecipeHandler,GregTech-Addon,gregtech_addon:machine:29,,gregtech_addon,TRUE,,15,145,166,2,,,,,,
gregtechmod.mistaqur.nei.handlers.BronzeBlastRecipeHandler,GregTech-Addon,gregtech_addon:machine:136,,gregtech_addon,TRUE,,15,145,166,2,,,,,,
gregtechmod.mistaqur.nei.handlers.CannerRecipeHandler,GregTech-Addon,gregtech_addon:machine:57,,gregtech_addon,TRUE,,15,145,166,2,,,,,,
gregtechmod.mistaqur.nei.handlers.CentrifugeRecipeHandler,GregTech-Addon,gregtech_addon:machine:62,,gregtech_addon,TRUE,,15,145,166,2,,,,,,
gregtechmod.mistaqur.nei.handlers.ChemicalRecipeHandler,GregTech-Addon,gregtech_addon:machine:41,,gregtech_addon,TRUE,,15,145,166,2,,,,,,
gregtechmod.mistaqur.nei.handlers.CutterRecipeHandler,GregTech-Addon,gregtech_addon:machine:113,,gregtech_addon,TRUE,,15,145,166,2,,,,,,
gregtechmod.mistaqur.nei.handlers.DistillationRecipeHandler,GregTech-Addon,gregtech_addon:machine:44,,gregtech_addon,TRUE,,15,145,166,2,,,,,,
gregtechmod.mistaqur.nei.handlers.ElectrolyzerRecipeHandler,GregTech-Addon,gregtech_addon:machine:25,,gregtech_addon,TRUE,,15,145,166,2,,,,,,
gregtechmod.mistaqur.nei.handlers.ExtruderRecipeHandler,GregTech-Addon,gregtech_addon:machine:115,,gregtech_addon,TRUE,,15,145,166,2,,,,,,
gregtechmod.mistaqur.nei.handlers.FusionRecipeHandler,GregTech-Addon,gregtech_addon:machine:80,,gregtech_addon,TRUE,,15,145,166,2,,,,,,
gregtechmod.mistaqur.nei.handlers.GeneratorHandler,GregTech-Addon,,,gregtech_addon,TRUE,,15,145,166,2,nei:textures/nei_tabbed_sprites.png,80,0,14,14,
gregtechmod.mistaqur.nei.handlers.GrinderRecipeHandler,GregTech-Addon,gregtech_addon:machine:28,,gregtech_addon,TRUE,,15,145,166,2,,,,,,
gregtechmod.mistaqur.nei.handlers.ImplosionRecipeHandler,GregTech-Addon,gregtech_addon:machine:31,,gregtech_addon,TRUE,,15,145,166,2,,,,,,
gregtechmod.mistaqur.nei.handlers.LatheRecipeHandler,GregTech-Addon,gregtech_addon:machine:111,,gregtech_addon,TRUE,,15,145,166,2,,,,,,
gregtechmod.mistaqur.nei.handlers.SawmillRecipeHandler,GregTech-Addon,gregtech_addon:machine:32,,gregtech_addon,TRUE,,15,145,166,2,,,,,,
gregtechmod.mistaqur.nei.handlers.VacuumFreezerRecipeHandler,GregTech-Addon,gregtech_addon:machine:38,,gregtech_addon,TRUE,,15,145,166,2,,,,,,
gregtechmod.mistaqur.nei.handlers.WiremillRecipeHandler,GregTech-Addon,gregtech_addon:machine:55,,gregtech_addon,TRUE,,15,145,166,2,,,,,,
cofh.thermaldynamics.plugins.nei.RecipeHandlerCover,Thermal Dynamics,ThermalDynamics:cover,"{Block:""minecraft:glass"",Meta:0b}",ThermalDynamics,TRUE,,,65,166,5,,,,,,
neresources.nei.NEIAdvSeedHandler,Not Enough Resources,minecraft:wheat,,neresources,TRUE,,,65,166,5,,,,,,
neresources.nei.NEIDungeonHandler,Not Enough Resources,minecraft:chest,,neresources,TRUE,,,130,166,2,,,,,,
neresources.nei.NEIEnchantmentHandler,Not Enough Resources,minecraft:anvil,,neresources,TRUE,,,130,166,2,,,,,,
neresources.nei.NEIMobHandler,Not Enough Resources,minecraft:skull:4,,neresources,TRUE,,,130,166,2,,,,,,
neresources.nei.NEIOreHandler,Not Enough Resources,minecraft:diamond_ore,,neresources,TRUE,,,65,166,5,,,,,,
neresources.nei.NEIPlantHandler,Not Enough Resources,minecraft:wheat,,neresources,TRUE,,,130,166,2,,,,,,
1 handler modName itemName nbtInfo modId modRequired excludedModId yShift handlerHeight handlerWidth maxRecipesPerPage imageResource imageX imageY imageWidth imageHeight itemNotes
25 bw.fuels.acidgens BartWorks gregtech:gt.blockmachines:12726 bartworks TRUE 145 2
26 bw.recipe.cal BartWorks gregtech:gt.blockmachines:12735 bartworks TRUE 135 2
27 gg.recipe.naquadah_reactor Good Generator gregtech:gt.blockmachines:12732 GoodGenerator TRUE 145 1
28 gg.recipe.naquadah_fuel_refine_factory Good Generator gregtech:gt.blockmachines:16999 GoodGenerator TRUE 145 1
29 com.github.bartimaeusnek.bartworks.neiHandler.BW_NEI_BioLabHandler BartWorks gregtech:gt.blockmachines:12699 bartworks TRUE 145 2
30 com.github.bartimaeusnek.bartworks.neiHandler.BW_NEI_BioVatHandler BartWorks gregtech:gt.blockmachines:12712 bartworks TRUE 140 2
31 com.github.bartimaeusnek.bartworks.neiHandler.BW_NEI_OreHandler BartWorks bartworks:bw.blockores.01:89 bartworks TRUE 135 2
179 ic2.neiIntegration.core.recipehandler.OreWashingRecipeHandler IndustrialCraft 2 IC2:blockMachine2:5 IC2 TRUE
180 ic2.neiIntegration.core.recipehandler.ScrapboxRecipeHandler IndustrialCraft 2 IC2:itemScrapbox IC2 TRUE 50 6
181 ic2.neiIntegration.core.recipehandler.SolidCannerRecipeHandler IndustrialCraft 2 IC2:blockMachine2:9 IC2 TRUE
182 speiger.src.crops.prediction.NEIPlugin IC2CropsNEI IC2:blockCrop Ic2Nei TRUE 135 2 Not actual recipes Not actual recipes, just info
183 tonius.neiintegration.mods.mcforge.RecipeHandlerFluidRegistry Minecraft minecraft:water minecraft FALSE
184 tonius.neiintegration.mods.mcforge.RecipeHandlerOreDictionary Minecraft minecraft:iron_ore minecraft FALSE
185 gt.recipe.alloyblastsmelter GT++ gregtech:gt.blockmachines:810 miscutils TRUE 6 135 166 2 ABS
422 mekanism.client.nei.ThermalEvaporationRecipeHandler Mekanism Mekanism:BasicBlock:14 Mekanism TRUE 62 5
423 exnihilo.compatibility.nei.RecipeHandlerHammer Ex Nihilo exnihilo:hammer_iron exnihilo TRUE 58 5
424 exnihilo.compatibility.nei.RecipeHandlerSieve Ex Nihilo exnihilo:sifting_table exnihilo TRUE 130 2
425 gregtechmod.mistaqur.nei.handlers.AlloySmelterRecipeHandler GregTech-Addon gregtech_addon:machine:56 gregtech_addon TRUE 15 145 166 2
426 gregtechmod.mistaqur.nei.handlers.AssemblerRecipeHandler GregTech-Addon gregtech_addon:machine:60 gregtech_addon TRUE 15 145 166 2
427 gregtechmod.mistaqur.nei.handlers.BenderRecipeHandler GregTech-Addon gregtech_addon:machine:59 gregtech_addon TRUE 15 145 166 2
428 gregtechmod.mistaqur.nei.handlers.BlastRecipeHandler GregTech-Addon gregtech_addon:machine:29 gregtech_addon TRUE 15 145 166 2
429 gregtechmod.mistaqur.nei.handlers.BronzeBlastRecipeHandler GregTech-Addon gregtech_addon:machine:136 gregtech_addon TRUE 15 145 166 2
430 gregtechmod.mistaqur.nei.handlers.CannerRecipeHandler GregTech-Addon gregtech_addon:machine:57 gregtech_addon TRUE 15 145 166 2
431 gregtechmod.mistaqur.nei.handlers.CentrifugeRecipeHandler GregTech-Addon gregtech_addon:machine:62 gregtech_addon TRUE 15 145 166 2
432 gregtechmod.mistaqur.nei.handlers.ChemicalRecipeHandler GregTech-Addon gregtech_addon:machine:41 gregtech_addon TRUE 15 145 166 2
433 gregtechmod.mistaqur.nei.handlers.CutterRecipeHandler GregTech-Addon gregtech_addon:machine:113 gregtech_addon TRUE 15 145 166 2
434 gregtechmod.mistaqur.nei.handlers.DistillationRecipeHandler GregTech-Addon gregtech_addon:machine:44 gregtech_addon TRUE 15 145 166 2
435 gregtechmod.mistaqur.nei.handlers.ElectrolyzerRecipeHandler GregTech-Addon gregtech_addon:machine:25 gregtech_addon TRUE 15 145 166 2
436 gregtechmod.mistaqur.nei.handlers.ExtruderRecipeHandler GregTech-Addon gregtech_addon:machine:115 gregtech_addon TRUE 15 145 166 2
437 gregtechmod.mistaqur.nei.handlers.FusionRecipeHandler GregTech-Addon gregtech_addon:machine:80 gregtech_addon TRUE 15 145 166 2
438 gregtechmod.mistaqur.nei.handlers.GeneratorHandler GregTech-Addon gregtech_addon TRUE 15 145 166 2 nei:textures/nei_tabbed_sprites.png 80 0 14 14
439 gregtechmod.mistaqur.nei.handlers.GrinderRecipeHandler GregTech-Addon gregtech_addon:machine:28 gregtech_addon TRUE 15 145 166 2
440 gregtechmod.mistaqur.nei.handlers.ImplosionRecipeHandler GregTech-Addon gregtech_addon:machine:31 gregtech_addon TRUE 15 145 166 2
441 gregtechmod.mistaqur.nei.handlers.LatheRecipeHandler GregTech-Addon gregtech_addon:machine:111 gregtech_addon TRUE 15 145 166 2
442 gregtechmod.mistaqur.nei.handlers.SawmillRecipeHandler GregTech-Addon gregtech_addon:machine:32 gregtech_addon TRUE 15 145 166 2
443 gregtechmod.mistaqur.nei.handlers.VacuumFreezerRecipeHandler GregTech-Addon gregtech_addon:machine:38 gregtech_addon TRUE 15 145 166 2
444 gregtechmod.mistaqur.nei.handlers.WiremillRecipeHandler GregTech-Addon gregtech_addon:machine:55 gregtech_addon TRUE 15 145 166 2
445 cofh.thermaldynamics.plugins.nei.RecipeHandlerCover Thermal Dynamics ThermalDynamics:cover {Block:"minecraft:glass",Meta:0b} ThermalDynamics TRUE 65 166 5
446 neresources.nei.NEIAdvSeedHandler Not Enough Resources minecraft:wheat neresources TRUE 65 166 5
447 neresources.nei.NEIDungeonHandler Not Enough Resources minecraft:chest neresources TRUE 130 166 2
448 neresources.nei.NEIEnchantmentHandler Not Enough Resources minecraft:anvil neresources TRUE 130 166 2
449 neresources.nei.NEIMobHandler Not Enough Resources minecraft:skull:4 neresources TRUE 130 166 2
450 neresources.nei.NEIOreHandler Not Enough Resources minecraft:diamond_ore neresources TRUE 65 166 5
451 neresources.nei.NEIPlantHandler Not Enough Resources minecraft:wheat neresources TRUE 130 166 2
+3
View File
@@ -114,6 +114,9 @@ nei.options.inventory.bookmarksEnabled.false=Hidden
nei.options.inventory.jei_style_tabs=JEI Style Tabs
nei.options.inventory.jei_style_tabs.true=Yes
nei.options.inventory.jei_style_tabs.false=No [Weirdo]
nei.options.inventory.jei_style_item_presence_overlay=JEI Style Item Overlay on ?-Hover
nei.options.inventory.jei_style_item_presence_overlay.true=Yes
nei.options.inventory.jei_style_item_presence_overlay.false=No
nei.options.inventory.creative_tab_style=Creative or JEI tab style
nei.options.inventory.creative_tab_style.true=Creative
nei.options.inventory.creative_tab_style.false=JEI
+47 -8
View File
@@ -1,6 +1,13 @@
nei.load=载入
nei.save=保存
# PC/Linux Control Key
nei.key.ctrl=CTRL
# Mac Command Key
nei.key.ctrl.mac=CMD
nei.bookmark.toggle=书签
nei.bookmark.toggle.tip=显示/隐藏书签页
nei.enchant=附魔
nei.enchant.level=等级
@@ -12,6 +19,11 @@ nei.potion.duration=持续时间
nei.potion.level=等级
nei.inventory.options=选项
nei.inventory.options.tip=NEI设置
nei.inventory.options.tip.cheatmode.0=合成模式
nei.inventory.options.tip.cheatmode.1=实用模式
nei.inventory.options.tip.cheatmode.2=作弊模式
nei.inventory.options.tip.cheatmode.disable=%s-点击此处以循环切换合成/实用/作弊模式.
nei.inventory.prev=上一页
nei.inventory.next=下一页
nei.inventory.item_subsets=物品分类
@@ -36,10 +48,15 @@ nei.inventory.dusk.set=设置时间为黄昏
nei.inventory.midnight.enable=激活午夜时间设置
nei.inventory.midnight.set=设置时间为午夜
nei.inventory.heal=治愈玩家并回满饱食度
nei.inventory.gamemode.0=设置为生存模式
nei.inventory.gamemode.1=设置为创造模式
nei.inventory.gamemode.2=设置为创造模式+
nei.inventory.gamemode.3=设置为冒险模式
nei.inventory.current.gamemode.0=当前游戏模式: 生存
nei.inventory.current.gamemode.1=当前游戏模式: 创造
nei.inventory.current.gamemode.2=当前游戏模式: 创造+
nei.inventory.current.gamemode.3=当前游戏模式: 冒险
nei.inventory.gamemode.0=点击设置为生存模式
nei.inventory.gamemode.1=点击设置为创造模式
nei.inventory.gamemode.2=点击设置为创造+模式
nei.inventory.gamemode.3=点击设置为冒险模式
nei.chat.gamemode.0=生存模式开启
nei.chat.gamemode.1=创造模式开启
@@ -76,6 +93,7 @@ nei.options.keys.gui.next_machine=下一机器
nei.options.keys.gui.prev_machine=上一机器
nei.options.keys.gui.search=跳转到搜索框
nei.options.keys.gui.bookmark=添加书签
nei.options.keys.gui.hide_bookmarks=显示/隐藏书签页
nei.options.keys.world=世界
nei.options.keys.world.chunkoverlay=区块(chunks)边界显示
nei.options.keys.world.moboverlay=刷怪区域显示
@@ -90,12 +108,23 @@ nei.options.keys.world.creative=游戏模式
nei.options.keys.world.creative.tip=循环游戏模式
nei.options.inventory=物品栏
nei.options.inventory.bookmarksEnabled=显示/隐藏书签页
nei.options.inventory.bookmarksEnabled.true=显示
nei.options.inventory.bookmarksEnabled.false=隐藏
nei.options.inventory.jei_style_tabs=JEI标签页
nei.options.inventory.jei_style_tabs.true=是
nei.options.inventory.jei_style_tabs.false=否 [不会吧]
nei.options.inventory.jei_style_item_presence_overlay=JEI风格物品覆盖?-悬停
nei.options.inventory.jei_style_item_presence_overlay.true=是
nei.options.inventory.jei_style_item_presence_overlay.false=否
nei.options.inventory.creative_tab_style=创造模式/JEI标签页
nei.options.inventory.creative_tab_style.true=创造模式
nei.options.inventory.creative_tab_style.false=JEI
nei.options.inventory.widgetsenabled.true=激活NEI
nei.options.inventory.widgetsenabled.false=禁用NEI
nei.options.inventory.cheatmode.0=合成模式
nei.options.inventory.cheatmode.1=实用模式
nei.options.inventory.cheatmode.2=作弊模式
nei.options.inventory.layoutstyle=界面风格
nei.options.inventory.profileRecipes=合成查阅性能分析
nei.options.inventory.profileRecipes.true=开启
nei.options.inventory.profileRecipes.false=关闭
@@ -124,6 +153,12 @@ nei.options.inventory.gamemodes.tip=选择游戏模式循环调整时的选项
nei.options.inventory.gamemodes.creative=创造模式
nei.options.inventory.gamemodes.creative+=创造模式+
nei.options.inventory.gamemodes.adventure=冒险模式
nei.options.inventory.disableMouseScrollTransfer=禁用鼠标滚轮移动物品
nei.options.inventory.disableMouseScrollTransfer.true=开启
nei.options.inventory.disableMouseScrollTransfer.false=关闭
nei.options.inventory.invertMouseScrollTransfer=反转鼠标滚轮方向
nei.options.inventory.invertMouseScrollTransfer.true=开启
nei.options.inventory.invertMouseScrollTransfer.false=关闭
nei.options.command=指令
nei.options.command.creative=游戏模式
@@ -143,6 +178,9 @@ nei.options.world.highlight_tips.show=显示
nei.options.world.highlight_tips.sample=样本
nei.options.tools=工具
nei.options.tools.handler_load_from_config=从Config加载预设(handler)
nei.options.tools.handler_load_from_config.true=Config
nei.options.tools.handler_load_from_config.false=JAR
nei.options.tools.dump=数据存储
nei.options.tools.dump.dump=存储
nei.options.tools.dump.dumped=%s ID已保存到.minecraft/%s
@@ -167,9 +205,10 @@ nei.options.tools.dump.itempanel.mode.2=Json
nei.options.tools.dump.itempanel.mode.3=PNG
nei.options.tools.dump.itempanel.icon.dumped=物品面板图标已保存到.minecraft/e%s
nei.options.tools.dump.itempanel.icon.cancelled=保存取消
nei.layoutstyle.minecraft=Minecraft风格
nei.layoutstyle.oldtmi=老式TMI风格
nei.options.tools.dump.handlers=NEI预设
nei.options.tools.dump.handlers.dumped=预设(handlers)已存至 %s
nei.options.tools.dump.handlers.mode.0=CSV
nei.options.tools.dump.handlers.mode.1=Json
nei.recipe.page=页数 %s/%s
nei.recipe.tooltip=合成表
Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

+32 -22
View File
@@ -136,14 +136,7 @@ public class ItemPanel extends Widget {
}
public int getHeight(GuiContainer gui) {
return gui.height - 15 - y + getHightAdjustment();
}
public int getHightAdjustment() {
int hAdj = 0;
if (!canPerformAction("item"))
hAdj += 15;
return hAdj;
return gui.height - 15 - y;
}
public int getWidth(GuiContainer gui) {
@@ -231,9 +224,13 @@ public class ItemPanel extends Widget {
private boolean slotValid(GuiContainer gui, int i) {
Rectangle4i rect = getSlotRect(i);
for (INEIGuiHandler handler : GuiInfo.guiHandlers)
if (handler.hideItemPanelSlot(gui, rect.x, rect.y, rect.w, rect.h))
try {
GuiInfo.readLock.lock();
if(GuiInfo.guiHandlers.stream().anyMatch(handler -> handler.hideItemPanelSlot(gui, rect.x, rect.y, rect.w, rect.h)))
return false;
} finally {
GuiInfo.readLock.unlock();
}
return true;
}
@@ -297,9 +294,13 @@ public class ItemPanel extends Widget {
return true;
if (NEIClientUtils.getHeldItem() != null) {
for (INEIGuiHandler handler : GuiInfo.guiHandlers)
if (handler.hideItemPanelSlot(NEIClientUtils.getGuiContainer(), mousex, mousey, 1, 1))
try {
GuiInfo.readLock.lock();
if (GuiInfo.guiHandlers.stream().anyMatch(handler -> handler.hideItemPanelSlot(NEIClientUtils.getGuiContainer(), mousex, mousey, 1, 1)))
return false;
} finally {
GuiInfo.readLock.unlock();
}
if (NEIClientConfig.canPerformAction("delete") && NEIClientConfig.canPerformAction("item"))
if (button == 1)
@@ -337,15 +338,21 @@ public class ItemPanel extends Widget {
GuiContainer gui = NEIClientUtils.getGuiContainer();
boolean handled = false;
for (INEIGuiHandler handler : GuiInfo.guiHandlers)
if (handler.handleDragNDrop(gui, mousex, mousey, draggedStack, button)) {
handled = true;
if (draggedStack.stackSize == 0) {
draggedStack = null;
return true;
try {
GuiInfo.readLock.lock();
for (INEIGuiHandler handler : GuiInfo.guiHandlers) {
if (handler.handleDragNDrop(gui, mousex, mousey, draggedStack, button)) {
handled = true;
if (draggedStack.stackSize == 0) {
draggedStack = null;
return true;
}
}
}
} finally {
GuiInfo.readLock.unlock();
}
if (handled)
return true;
@@ -470,10 +477,13 @@ public class ItemPanel extends Widget {
public boolean contains(int px, int py) {
GuiContainer gui = NEIClientUtils.getGuiContainer();
Rectangle4i rect = new Rectangle4i(px, py, 1, 1);
for (INEIGuiHandler handler : GuiInfo.guiHandlers)
if (handler.hideItemPanelSlot(gui, rect.x, rect.y, rect.w, rect.h))
try {
GuiInfo.readLock.lock();
if(GuiInfo.guiHandlers.stream().anyMatch(handler -> handler.hideItemPanelSlot(gui, rect.x, rect.y, rect.w, rect.h)))
return false;
} finally {
GuiInfo.readLock.unlock();
}
return super.contains(px, py);
}
}
+9 -15
View File
@@ -7,30 +7,25 @@ public class ItemQuantityField extends TextField
centered = true;
}
// Find a way to work this this back in
public boolean isValid(String string) {
if (string.equals(""))
return true;
try {
return Integer.parseInt(string) >= 0;
} catch (NumberFormatException nfe) {
return false;
}
}
public int intValue() {
return intValue(text());
}
public int intValue(String s) {
try {
return Integer.parseInt(s);
return Math.max(0, Integer.parseInt(s));
} catch (NumberFormatException nfe) {
return 0;
}
}
@Override
public void gainFocus() {
if (text().equals("0")) {
setText("");
}
}
@Override
public void loseFocus() {
setText(Integer.toString(NEIClientConfig.getItemQuantity()));
@@ -38,7 +33,6 @@ public class ItemQuantityField extends TextField
@Override
public void onTextChange(String oldText) {
if (intValue(oldText) != intValue())//hacky recursion stopper
NEIClientUtils.setItemQuantity(intValue());
NEIClientUtils.setItemQuantity(intValue());
}
}
+22 -26
View File
@@ -108,6 +108,11 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
public static boolean itemsLoaded = false;
/**
* Not present, Present
*/
public static Image[] itemPresenceOverlays = new Image[2];
public static void load() {
API.addLayoutStyle(0, new LayoutStyleMinecraft());
@@ -312,10 +317,13 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
if (gui.guiLeft - 4 < 76)
visiblity.showWidgets = false;
for (INEIGuiHandler handler : GuiInfo.guiHandlers)
handler.modifyVisiblity(gui, visiblity);
try {
GuiInfo.readLock.lock();
GuiInfo.guiHandlers.forEach(handler -> handler.modifyVisiblity(gui, visiblity));
} finally {
GuiInfo.readLock.unlock();
}
visiblity.translateDependancies();
getLayoutStyle().layout(gui, visiblity);
@@ -415,7 +423,7 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
if (quantity < 0)
quantity = 0;
setItemQuantity(quantity);
LayoutManager.quantity.setText(Integer.toString(quantity));
return true;
}
};
@@ -432,7 +440,7 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
if (quantity < 0)
quantity = 0;
setItemQuantity(quantity);
LayoutManager.quantity.setText(Integer.toString(quantity));
return true;
}
};
@@ -618,8 +626,6 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
@Override
public void load(GuiContainer gui) {
if (isEnabled()) {
setInputFocused(null);
if(!itemsLoaded) {
ItemList.loadItems.restart();
itemsLoaded = true;
@@ -665,11 +671,9 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
addWidget(itemPanel);
itemPanel.setVisible();
if (canPerformAction("item")) {
addWidget(more);
addWidget(less);
addWidget(quantity);
}
addWidget(more);
addWidget(less);
addWidget(quantity);
}
if (visiblity.showBookmarkPanel) {
@@ -756,19 +760,6 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
return itemPanel.draggedStack == null;
}
public static Widget getInputFocused() {
return inputFocused;
}
public static void setInputFocused(Widget widget) {
if (inputFocused != null)
inputFocused.loseFocus();
inputFocused = widget;
if (inputFocused != null)
inputFocused.gainFocus();
}
@Override
public void renderSlotUnderlay(GuiContainer gui, Slot slot) {
if (overlayRenderer != null)
@@ -843,6 +834,11 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
drawTexturedModalRect(x2, y2, tx2, ty2, w2, h2);//bottom right
}
public static void drawItemPresenceOverlay(int slotX, int slotY, boolean isPresent) {
Image icon = itemPresenceOverlays[isPresent ? 1 : 0];
drawIcon(slotX + 16 - icon.width, slotY + 16 - icon.height, icon);
}
public static LayoutManager instance() {
return instance;
}
@@ -1,6 +1,7 @@
package codechicken.nei;
import codechicken.nei.api.LayoutStyle;
import codechicken.nei.drawable.DrawableBuilder;
import net.minecraft.client.gui.inventory.GuiContainer;
import org.lwjgl.opengl.GL11;
@@ -12,6 +13,7 @@ import static codechicken.nei.LayoutManager.dropDown;
import static codechicken.nei.LayoutManager.gamemode;
import static codechicken.nei.LayoutManager.heal;
import static codechicken.nei.LayoutManager.itemPanel;
import static codechicken.nei.LayoutManager.itemPresenceOverlays;
import static codechicken.nei.LayoutManager.less;
import static codechicken.nei.LayoutManager.magnet;
import static codechicken.nei.LayoutManager.more;
@@ -49,6 +51,8 @@ public class LayoutStyleMinecraft extends LayoutStyle
timeButtons[2].icon = new Image(144, 24, 12, 12);
timeButtons[3].icon = new Image(156, 24, 12, 12);
heal.icon = new Image(168, 24, 12, 12);
itemPresenceOverlays[0] = new DrawableBuilder("nei:textures/nei_tabbed_sprites.png", 0, 40, 8, 8).build();
itemPresenceOverlays[1] = new DrawableBuilder("nei:textures/nei_tabbed_sprites.png", 8, 40, 8, 8).build();
}
@Override
+9
View File
@@ -24,6 +24,7 @@ import codechicken.nei.config.OptionTextField;
import codechicken.nei.config.OptionToggleButton;
import codechicken.nei.config.OptionToggleButtonBoubs;
import codechicken.nei.config.OptionUtilities;
import codechicken.nei.event.NEIConfigsLoadedEvent;
import codechicken.nei.recipe.GuiRecipeTab;
import codechicken.nei.recipe.RecipeInfo;
import codechicken.obfuscator.ObfuscationRun;
@@ -33,6 +34,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraft.world.storage.SaveFormatComparator;
import net.minecraftforge.common.MinecraftForge;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.lwjgl.input.Keyboard;
@@ -146,6 +148,8 @@ public class NEIClientConfig {
API.addOption(new OptionToggleButton("inventory.bookmarksEnabled", true));
tag.getTag("inventory.jei_style_tabs").setComment("Enable/disable JEI Style Tabs").getBooleanValue(true);
API.addOption(new OptionToggleButtonBoubs("inventory.jei_style_tabs", true));
tag.getTag("inventory.jei_style_item_presence_overlay").setComment("Enable/disable JEI Style item presence overlay on ?-hover").getBooleanValue(true);
API.addOption(new OptionToggleButton("inventory.jei_style_item_presence_overlay", true));
tag.getTag("inventory.creative_tab_style").setComment("Creative or JEI style tabs").getBooleanValue(false);
API.addOption(new OptionToggleButton("inventory.creative_tab_style", true));
@@ -295,6 +299,8 @@ public class NEIClientConfig {
logger.error("Failed to Load " + clazz.getName(), e);
}
}
MinecraftForge.EVENT_BUS.post(new NEIConfigsLoadedEvent());
}
}.start();
ItemSorter.loadConfig();
@@ -323,6 +329,9 @@ public class NEIClientConfig {
public static boolean areJEIStyleTabsVisible() {
return getBooleanSetting("inventory.jei_style_tabs");
}
public static boolean isJEIStyleItemPresenceOverlayVisible() {
return getBooleanSetting("inventory.jei_style_item_presence_overlay");
}
public static boolean useCreativeTabStyle() {
return getBooleanSetting("inventory.creative_tab_style");
}
+8 -4
View File
@@ -27,6 +27,7 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;
import static codechicken.nei.NEIClientConfig.canCheatItem;
import static codechicken.nei.NEIClientConfig.canPerformAction;
@@ -157,9 +158,13 @@ public class NEIClientUtils extends NEIServerUtils
ItemStack typestack = copyStack(stack, 1);
if (!infinite && !canItemFitInInventory(mc().thePlayer, stack) && (mc().currentScreen instanceof GuiContainer)) {
GuiContainer gui = getGuiContainer();
List<Iterable<Integer>> handlerSlots = new LinkedList<>();
for(INEIGuiHandler handler : GuiInfo.guiHandlers)
handlerSlots.add(handler.getItemSpawnSlots(gui, typestack));
final List<Iterable<Integer>> handlerSlots;
try {
GuiInfo.readLock.lock();
handlerSlots = GuiInfo.guiHandlers.stream().map(handler -> handler.getItemSpawnSlots(gui, typestack)).collect(Collectors.toCollection(LinkedList::new));
} finally {
GuiInfo.readLock.unlock();
}
int increment = typestack.getMaxStackSize();
int given = 0;
@@ -347,7 +352,6 @@ public class NEIClientUtils extends NEIServerUtils
public static void setItemQuantity(int i) {
world.nbt.setInteger("quantity", i);
world.saveNBT();
LayoutManager.quantity.setText(Integer.toString(i));
}
public static GuiContainer getGuiContainer() {
+16 -22
View File
@@ -22,8 +22,7 @@ public class PositionedStack
private boolean permutated = false;
public PositionedStack(Object object, int x, int y, boolean genPerms)
{
public PositionedStack(Object object, int x, int y, boolean genPerms) {
items = NEIServerUtils.extractRecipeItems(object);
relx = x;
rely = y;
@@ -39,27 +38,22 @@ public class PositionedStack
this(object, x, y, true);
}
public void generatePermutations()
{
public void generatePermutations() {
if(permutated)
return;
ArrayList<ItemStack> stacks = new ArrayList<>();
for(ItemStack item : items)
{
for(ItemStack item : items) {
if(item == null || item.getItem() == null)
continue;
if(item.getItemDamage() == Short.MAX_VALUE)
{
if(item.getItemDamage() == Short.MAX_VALUE) {
List<ItemStack> permutations = ItemList.itemMap.get(item.getItem());
if(!permutations.isEmpty())
{
if(!permutations.isEmpty()) {
for(ItemStack stack : permutations)
stacks.add(stack.copy());
}
else
{
else {
ItemStack base = new ItemStack(item.getItem(), item.stackSize);
base.stackTagCompound = item.stackTagCompound;
stacks.add(base);
@@ -78,20 +72,17 @@ public class PositionedStack
setPermutationToRender(0);
}
public void setMaxSize(int i)
{
public void setMaxSize(int i) {
for(ItemStack item : items)
if(item.stackSize > i)
item.stackSize = i;
}
public PositionedStack copy()
{
public PositionedStack copy() {
return new PositionedStack(items, relx, rely);
}
public void setPermutationToRender(int index)
{
public void setPermutationToRender(int index) {
item = items[index].copy();
if(item.getItem() == null)
item = new ItemStack(Blocks.fire);
@@ -99,8 +90,7 @@ public class PositionedStack
item.setItemDamage(0);
}
public boolean contains(ItemStack ingredient)
{
public boolean contains(ItemStack ingredient) {
for(ItemStack item : items)
if(NEIServerUtils.areStacksSameTypeCrafting(item, ingredient))
return true;
@@ -108,12 +98,16 @@ public class PositionedStack
return false;
}
public boolean contains(Item ingred)
{
public boolean contains(Item ingred) {
for(ItemStack item : items)
if(item.getItem() == ingred)
return true;
return false;
}
@Override
public String toString() {
return "PositionedStack(output='" + item.toString() + "')";
}
}
+4 -1
View File
@@ -79,6 +79,7 @@ public abstract class TextField extends Widget
if (!focused())
return false;
String oldText = text();
boolean handled = field.textboxKeyTyped(keyChar, keyID);
if(!handled) {
if (keyID == Keyboard.KEY_RETURN || keyID == Keyboard.KEY_NUMPADENTER || keyID == Keyboard.KEY_ESCAPE) {
@@ -88,7 +89,7 @@ public abstract class TextField extends Widget
}
if(handled) {
onTextChange(text());
onTextChange(oldText);
}
return handled;
@@ -120,8 +121,10 @@ public abstract class TextField extends Widget
if (focus) {
previousKeyboardRepeatEnabled = Keyboard.areRepeatEventsEnabled();
Keyboard.enableRepeatEvents(true);
gainFocus();
} else {
Keyboard.enableRepeatEvents(previousKeyboardRepeatEnabled);
loseFocus();
}
}
@@ -55,8 +55,11 @@ public class ThreadOperationTimer extends Thread
while (thread.isAlive()) {
synchronized (this) {
if (operation != null && System.currentTimeMillis() - opTime > limit)
thread.stop(new TimeoutException("Operation took too long", operation));
if (operation != null && System.currentTimeMillis() - opTime > limit) {
// Thread.stop(Throwable) is hard-deprecated and IntelliJ complains about it.
//thread.stop(new TimeoutException("Operation took too long", operation));
thread.stop();
}
}
try {
Thread.sleep(50);
+6 -1
View File
@@ -112,7 +112,12 @@ public class API
}
public static void registerNEIGuiHandler(INEIGuiHandler handler) {
GuiInfo.guiHandlers.add(handler);
try {
GuiInfo.writeLock.lock();
GuiInfo.guiHandlers.add(handler);
} finally {
GuiInfo.writeLock.unlock();
}
}
/**
+13 -5
View File
@@ -9,11 +9,16 @@ import net.minecraft.client.gui.inventory.GuiContainerCreative;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
public class GuiInfo
{
public class GuiInfo {
public static final LinkedList<INEIGuiHandler> guiHandlers = new LinkedList<>();
public static final HashSet<Class<? extends GuiContainer>> customSlotGuis = new HashSet<>();
public static ReentrantReadWriteLock guiHandlersLock = new ReentrantReadWriteLock();
public static Lock writeLock = guiHandlersLock.writeLock();
public static Lock readLock = guiHandlersLock.readLock();
public static void load() {
API.registerNEIGuiHandler(new NEICreativeGuiHandler());
@@ -23,9 +28,12 @@ public class GuiInfo
}
public static void clearGuiHandlers() {
for (Iterator<INEIGuiHandler> iterator = guiHandlers.iterator(); iterator.hasNext(); )
if (iterator.next() instanceof GuiContainer)
iterator.remove();
try {
GuiInfo.writeLock.lock();
guiHandlers.removeIf(ineiGuiHandler -> ineiGuiHandler instanceof GuiContainer);
} finally {
GuiInfo.writeLock.unlock();
}
}
public static boolean hasCustomSlots(GuiContainer gui) {
@@ -0,0 +1,15 @@
package codechicken.nei.event;
import codechicken.nei.api.IConfigureNEI;
import cpw.mods.fml.common.eventhandler.Event;
import net.minecraftforge.common.MinecraftForge;
/**
* Event is posted from <font color=red>NEI Plugin Loader Thread</font> after all {@link IConfigureNEI} were loaded.
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
*/
public class NEIConfigsLoadedEvent extends Event {
}
@@ -0,0 +1,27 @@
package codechicken.nei.event;
import codechicken.nei.NEIClientConfig;
import codechicken.nei.recipe.GuiRecipeTab;
import codechicken.nei.recipe.HandlerInfo;
import codechicken.nei.recipe.IRecipeHandler;
import cpw.mods.fml.common.eventhandler.Event;
import net.minecraftforge.common.MinecraftForge;
/**
* Event is posted every time the handler infos got registered or reloaded.
* During it, you can safely register your custom handler info.
*
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
*/
public class RegisterHandlerInfosEvent extends Event {
public void registerHandlerInfo(Class<? extends IRecipeHandler> handlerClazz, HandlerInfo info) {
if (GuiRecipeTab.handlerMap.put(handlerClazz.getName(), info) != null) {
NEIClientConfig.logger.info("Replaced handler info for {}", handlerClazz.getName());
} else {
NEIClientConfig.logger.info("Added handler info for {}", handlerClazz.getName());
}
}
}
@@ -19,6 +19,7 @@ import java.awt.Point;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
@@ -249,12 +250,12 @@ public class GuiContainerManager
}
private int clickHandled = 0;
private List<IContainerTooltipHandler> instanceTooltipHandlers;
private final List<IContainerTooltipHandler> instanceTooltipHandlers;
public GuiContainerManager(GuiContainer screen) {
window = screen;
if (screen instanceof IContainerTooltipHandler) {
instanceTooltipHandlers = new LinkedList<>();
instanceTooltipHandlers = Collections.synchronizedList(new LinkedList<>());
instanceTooltipHandlers.add((IContainerTooltipHandler) screen);
instanceTooltipHandlers.addAll(tooltipHandlers);
} else
@@ -398,17 +399,21 @@ public class GuiContainerManager
List<String> tooltip = new LinkedList<>();
FontRenderer font = GuiDraw.fontRenderer;
for (IContainerTooltipHandler handler : instanceTooltipHandlers)
tooltip = handler.handleTooltip(window, mousex, mousey, tooltip);
synchronized (instanceTooltipHandlers) {
for (IContainerTooltipHandler handler : instanceTooltipHandlers)
tooltip = handler.handleTooltip(window, mousex, mousey, tooltip);
}
if (tooltip.isEmpty() && shouldShowTooltip(window)) {//mouseover tip, not holding an item
ItemStack stack = getStackMouseOver(window);
font = getFontRenderer(stack);
if (stack != null)
tooltip = itemDisplayNameMultiline(stack, window, true);
for (IContainerTooltipHandler handler : instanceTooltipHandlers)
tooltip = handler.handleItemTooltip(window, stack, mousex, mousey, tooltip);
synchronized (instanceTooltipHandlers) {
for (IContainerTooltipHandler handler : instanceTooltipHandlers)
tooltip = handler.handleItemTooltip(window, stack, mousex, mousey, tooltip);
}
}
if (tooltip.size() > 0)
+52 -3
View File
@@ -34,6 +34,8 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOverlay, IGuiClientSide, IGuiHandleMouseWheel, IContainerTooltipHandler, INEIGuiHandler {
// Background image calculations
@@ -148,6 +150,7 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve
"?");
}
Collections.addAll(buttonList, overlayButtons);
itemPresenceCacheRecipe = -1;
}
@@ -296,16 +299,14 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve
setRecipePage(--recipetype);
}
public HandlerInfo getHandlerInfo(IRecipeHandler handler) {
final String handlerName = handler.toString().split("@")[0];
final String handlerID;
if(handler instanceof TemplateRecipeHandler) {
handlerID = (((TemplateRecipeHandler)handler).getOverlayIdentifier());
} else {
handlerID = null;
}
HandlerInfo info = GuiRecipeTab.getHandlerInfo(handlerName, handlerID);
HandlerInfo info = GuiRecipeTab.getHandlerInfo(handler.getClass().getName(), handlerID);
if (info == null)
return GuiRecipeTab.DEFAULT_HANDLER_INFO;
@@ -380,6 +381,30 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve
}
}
private int itemPresenceCacheRecipe = -1;
private ArrayList<Boolean> itemPresenceCacheSlots;
private void updateItemPresenceCache(int recipe) {
if (itemPresenceCacheSlots == null) {
itemPresenceCacheSlots = new ArrayList<>();
}
itemPresenceCacheRecipe = recipe;
itemPresenceCacheSlots.clear();
List<PositionedStack> ingredients = handler.getIngredientStacks(recipe);
ArrayList<ItemStack> invStacks = ((List<Slot>) firstGui.inventorySlots.inventorySlots).stream()
.filter(s -> s != null && s.getStack() != null && s.getStack().stackSize > 0 && s.isItemValid(s.getStack()) && s.canTakeStack(mc.thePlayer))
.map(s -> s.getStack().copy())
.collect(Collectors.toCollection(ArrayList::new));
for (PositionedStack stack : ingredients) {
Optional<ItemStack> used = invStacks.stream().filter(is -> is.stackSize > 0 && stack.contains(is)).findFirst();
itemPresenceCacheSlots.add(used.isPresent());
if (used.isPresent()) {
ItemStack is = used.get();
is.stackSize -= 1;
}
}
}
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
GuiContainerManager.enable2DRender();
@@ -388,11 +413,24 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve
fontRendererObj.drawStringWithShadow(s, (xSize - fontRendererObj.getStringWidth(s)) / 2, 5, 0xffffff);
s = NEIClientUtils.translate("recipe.page", page + 1, (handler.numRecipes() - 1) / recipesPerPage + 1);
fontRendererObj.drawStringWithShadow(s, (xSize - fontRendererObj.getStringWidth(s)) / 2, 19, 0xffffff);
final boolean drawItemPresence = NEIClientConfig.isJEIStyleItemPresenceOverlayVisible();
GL11.glPushMatrix();
GL11.glTranslatef(5, 32 + yShift, 0);
for (int i = page * recipesPerPage; i < handler.numRecipes() && i < (page + 1) * recipesPerPage; i++) {
handler.drawForeground(i);
if (drawItemPresence && isMouseOverOverlayButton(i - page * recipesPerPage)
&& firstGui.inventorySlots != null) {
List<PositionedStack> ingredients = handler.getIngredientStacks(i);
if (itemPresenceCacheRecipe != i || itemPresenceCacheSlots == null || itemPresenceCacheSlots.size() != ingredients.size()) {
updateItemPresenceCache(i);
}
for (int j = 0; j < ingredients.size(); j++) {
PositionedStack stack = ingredients.get(j);
boolean isPresent = itemPresenceCacheSlots.get(j);
LayoutManager.drawItemPresenceOverlay(stack.relx, stack.rely, isPresent);
}
}
GL11.glTranslatef(0, handlerInfo.getHeight(), 0);
}
GL11.glPopMatrix();
@@ -471,6 +509,17 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve
return stackSlot == mouseoverSlot;
}
private boolean isMouseOverOverlayButton(int buttonId) {
if(buttonId >= 0 && buttonId < overlayButtons.length) {
GuiButton button = overlayButtons[buttonId];
Point mousePos = GuiDraw.getMousePosition();
return button.visible && mousePos.x >= button.xPosition && mousePos.y >= button.yPosition
&& mousePos.x < button.xPosition + button.width && mousePos.y < button.yPosition + button.height;
} else {
return false;
}
}
private int getRecipesPerPage() {
if(handlerInfo != null)
+9 -2
View File
@@ -5,20 +5,22 @@ import codechicken.lib.gui.GuiDraw;
import codechicken.nei.NEIClientConfig;
import codechicken.nei.Widget;
import codechicken.nei.drawable.DrawableResource;
import codechicken.nei.event.RegisterHandlerInfosEvent;
import codechicken.nei.guihook.GuiContainerManager;
import cpw.mods.fml.common.Loader;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.common.MinecraftForge;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVParser;
import org.apache.commons.csv.CSVRecord;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
@@ -100,9 +102,13 @@ public abstract class GuiRecipeTab extends Widget {
if (icon != null) {
icon.draw(iconX + 1, iconY + 1);
} else if (itemStack != null) {
boolean isEnabled = GL11.glIsEnabled(GL12.GL_RESCALE_NORMAL);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GuiContainerManager.drawItems.zLevel += 100;
GuiContainerManager.drawItem(iconX, iconY, itemStack);
GuiContainerManager.drawItems.zLevel -= 100;
if (!isEnabled)
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
} else {
// Text fallback
String text = handler.getRecipeName();
@@ -254,9 +260,10 @@ public abstract class GuiRecipeTab extends Widget {
} catch (Exception e) {
NEIClientConfig.logger.info("Error parsing CSV");
e.printStackTrace();
}
NEIClientConfig.logger.info("Sending {}", RegisterHandlerInfosEvent.class.getSimpleName());
MinecraftForge.EVENT_BUS.post(new RegisterHandlerInfosEvent());
}
private static HandlerInfo getDefaultHandlerInfo() {