Compare commits

..
165 Commits
Author SHA1 Message Date
Thomas Guimbretiere f28ed4c274 Added coloring for enchanted items. 2013-10-24 18:38:57 +02:00
Thomas Guimbretiere fc3606b71c When adding a widget, it is now possible to specify a render priority (LOW, MEDIUM, HIGH).
Widgets will be rendered in the order of insert in each category (allows to have forground widgets which are not mouse stealing).
Fixed again the Config HUD screen using that.
2013-10-24 17:38:35 +02:00
Thomas Guimbretiere aeff9c1039 Might have fixed IAmOmicron bug.
Fixed HUD config screen.
2013-10-24 17:22:17 +02:00
Thomas Guimbretiere 9fd13c9ca1 Fixed enchant mod detection.
Changed default key from RSHIFT to I
2013-10-24 17:12:42 +02:00
Thomas Guimbretiere ac1cc77258 Item enchantments done. 2013-10-24 16:31:39 +02:00
Thomas Guimbretiere e6005e55af First shot at partial enchant screen. 2013-10-24 15:48:44 +02:00
Thomas Guimbretiere 62ec48ba21 Added a ViewTable widget to display data in a table shape 2013-10-24 15:25:23 +02:00
Thomas Guimbretiere 7ab8981dde All layouts depend on LayoutBase.
LayoutBase now allows for a background gradient. (setBackgroundColors)
To handle multilayers, widget rendering is done from the start of the list to
the end (in the order of insert), but widget lookup is done in revert order (
last inserted widget will be returned first).
Added utility class for reverse lookup (ReverseIterator).
2013-10-24 11:39:35 +02:00
Thomas Guimbretiere f8202e8fa8 Fixed cropping layout. 2013-10-24 03:22:41 +02:00
Thomas Guimbretiere b18fb9df61 Fixed dragging on the HUD. 2013-10-24 02:20:29 +02:00
Thomas Guimbretiere b4ca299115 Better handling of dragging when leaving the widget (moved some dragging identification to canvas). 2013-10-24 02:08:56 +02:00
Thomas Guimbretiere b0104482bb More adjustement on dragging. 2013-10-24 01:58:37 +02:00
Thomas Guimbretiere ef9ee6441d Fixed some mouse handling (keeping the drag going when on the main widget, stopping the drag on leaving, etc). 2013-10-24 01:52:02 +02:00
Thomas Guimbretiere 4ad3e92fae Mouse handling of the escalator. 2013-10-24 01:42:54 +02:00
Thomas Guimbretiere 098c88676e Corrected order of msg sending for GEOM_CHANGED (post change)
Cursor is now working properly.
2013-10-24 01:12:10 +02:00
Thomas Guimbretiere 4b05b017f7 Moved setPos / setSize to IWidget.
Modifying the geometry now triggers a GEOM_CHANGED event.
2013-10-23 22:19:19 +02:00
Thomas Guimbretiere a92a5dde3c ViewportScrollable is now its own class. 2013-10-23 21:21:34 +02:00
Thomas Guimbretiere a6890c5824 Test widget is bounded on mousewheel.
Added a possibility of setting up the steping (in px).
2013-10-23 20:51:26 +02:00
Thomas Guimbretiere e87d08a789 Reverse lookup for mouse move & drag. 2013-10-23 20:39:31 +02:00
Thomas Guimbretiere 65d8ef8c63 Fixed a couple of button bugs. 2013-10-23 20:33:56 +02:00
Thomas Guimbretiere 878a00b16b Reverse lookup on click/release. 2013-10-23 20:28:37 +02:00
Thomas Guimbretiere 984b26c7fd Reverse lookup for MouseEnter/MouseLeave 2013-10-23 20:16:42 +02:00
Thomas Guimbretiere b2cc1e02d7 Added inverted lookup for MouseWheel.
getWidgetAtPosition does return the deepest widget, so mouse events should check the parent for implementation, not the childrens !
2013-10-23 20:09:27 +02:00
Thomas Guimbretiere 83c7ef6aa9 Corrected a position bug in ItemStackDisplay
Added LayoutCropping (cropping layout using scissors).
2013-10-22 12:05:49 +02:00
Thomas Guimbretiere 6fca3468e2 Cleanup 2013-10-22 11:25:51 +02:00
Thomas Guimbretiere d134aba573 Added scalable ItemStack display. 2013-10-22 11:02:41 +02:00
Thomas Guimbretiere 8f32c0c770 Cleanup 2013-10-22 00:32:56 +02:00
Thomas Guimbretiere e0a5da865f Linked the HUD config screen to the Waila config screen. 2013-10-21 22:56:55 +02:00
Thomas Guimbretiere 69a62e6edf And finally, the scale. Can be adjusted between 0.1 and 2.0. 2013-10-21 22:42:26 +02:00
Thomas Guimbretiere a6da4adc08 Alpha is now configurable too.
Colors can be changed from the config file.
2013-10-21 22:09:43 +02:00
Thomas Guimbretiere 2d3768423f Widgets are now stored in a LinkedHashMap (for proper sorting).
Better Save/Load of GL State (includes colors).
Restored all the buttons on the config screen.
Config is now saved properly and used.
Possibility to reset to defaults.
2013-10-21 20:03:24 +02:00
Thomas Guimbretiere cb2491f3f3 Fixed dragging when other widgets are present. 2013-10-21 18:31:45 +02:00
Thomas Guimbretiere 9248b75a0c Draggable picture in the position config screen is now using relative positions.
Should be behaving like you would expect.
2013-10-21 18:08:16 +02:00
Thomas Guimbretiere fc46634fcc Shorter enum names
Mouse pos is now a double for finer control (?)
2013-10-21 02:54:59 +02:00
Thomas Guimbretiere 9df8f252c0 Changed the position/size type to an enum to make it clearer 2013-10-21 02:28:34 +02:00
Thomas Guimbretiere a844fb4815 Added default configs.
Killed the config screen (again)
2013-10-21 01:49:45 +02:00
Thomas Guimbretiere 58266d3cd1 More advance in the hud config screen. 2013-10-20 17:35:48 +02:00
Thomas Guimbretiere 94a22bf6ca Reworked the event system. Now events are pushed upward to the first widget which can treat them.
No more slots. Best practice is to create a LayoutBase derived class, and handle the events in there.
2013-10-20 17:08:08 +02:00
Thomas Guimbretiere 32a50e112b Singals and slots are now enums.
Added a few widgets to the config screen.
2013-10-20 16:34:32 +02:00
Thomas Guimbretiere 6dbcf366bd Added basic inter-widget signal passing.
LabelFixedFont now has a setText slot (to change text to first signal argument).
PictureMovable will emit onDragX/onDragY events when dragged.
WidgetBase now has slots to move the widget around (setPosX, setPosY).
WidgetGeometry allows to change the position of the widget without having to recreate the geom
Added a CounterInteger widget to store integer data. Slots to change the value and signals to advertise the change.
2013-10-20 12:14:48 +02:00
Thomas Guimbretiere 24efba751d Added a PictureMovable widget, that you can drag and drop around. Area of action is constrainted by the parent.
Added getTop() getBottom() to IWidget interface (shortcuts for getPos().getY() and getPos().getY() + getSize().getY() )
2013-10-19 15:38:51 +02:00
Thomas Guimbretiere e681b98231 Fix alignment for Module choice 2013-10-18 20:20:46 +02:00
Thomas Guimbretiere 30d88b4c45 Readded support for remote config keys.
Moved keyboard handling out of the old UI package.
2013-10-18 12:18:51 +02:00
Thomas Guimbretiere 9a13ff7898 Fixed derp in calling wrong recipe method. 2013-10-18 11:59:11 +02:00
Thomas Guimbretiere 91ac3a9e32 Fixed recipe lookup for blocks with metadata. If not recipe is found with meta, we lookup recipes without meta. 2013-10-18 11:56:32 +02:00
Thomas Guimbretiere 1036c7c0c0 Added the final missing config screens. Config keybind now popups up the new screens.
Still need to remake the server bound config buttons.
2013-10-18 11:51:16 +02:00
Thomas Guimbretiere c03d9183a8 Added main config screen.
Added clicky sound on buttons.
2013-10-18 02:25:47 +02:00
Thomas Guimbretiere 5da91bea2d Fixed MouseEnter/MouseLeave and getWidgetAtPosition logic.
Buttons labels now have the proper color.
Fixed ID:Metadata HEADER bug.
2013-10-18 02:05:19 +02:00
Thomas Guimbretiere c2ceb365d9 Derp 2013-10-18 00:58:23 +02:00
Thomas Guimbretiere 4488c37149 Added a ButtonContainer with label handling.
Created the basic Waila config screen.
2013-10-18 00:58:03 +02:00
Thomas Guimbretiere 3c3fcad888 Screen change button
More test classes in gui.testing
2013-10-17 22:17:13 +02:00
Thomas Guimbretiere 391cfe8290 Added buttons linked to config options (specific to Waila). 2013-10-17 21:47:56 +02:00
Thomas Guimbretiere 8c2ff2b56f Vertical spacing of buttons is now absolute 2013-10-17 21:21:38 +02:00
Thomas Guimbretiere d9a16ba7fa Added per-coordinate abs/frac capabilities for pos & size in WidgetGeometry 2013-10-17 21:16:50 +02:00
Thomas Guimbretiere 3b906f4de8 Moved buttons to their own package. 2013-10-17 21:03:49 +02:00
Thomas Guimbretiere 0496543d70 Added a button container for easy grid-layout buttons 2013-10-17 21:01:12 +02:00
Thomas Guimbretiere e9cc68d2b1 Added 2 types of buttons (boolean & integer) to the widgets. 2013-10-17 20:10:16 +02:00
Thomas Guimbretiere 8a5dc45240 Added a PictureSwitch widget, switching between 2 pictures on mouse over. 2013-10-11 22:03:36 +02:00
Thomas Guimbretiere d23855b263 Added show,hide to widgets.
Renamed Label to LabelFixedFont
2013-10-11 21:54:44 +02:00
Thomas Guimbretiere 5601fcdf7b Added Label widget.
Reworked WidgetGeometry to allow for separate pos/size computation method.
2013-10-11 21:43:58 +02:00
Thomas Guimbretiere a87d3b9de7 Nothing is absolute anymore. Everything is relative to the parent, in full or fractional value 2013-10-11 15:24:01 +02:00
Thomas Guimbretiere 67775bad84 Added ENTER and LEAVE events. 2013-10-11 15:19:24 +02:00
Thomas Guimbretiere 3d004700fb Mouse event handling. 2013-10-11 14:50:07 +02:00
Thomas Guimbretiere b3b2024ce7 Generic structure of new widgets is up.
Test screen with a test texture is done.
2013-10-09 22:58:39 +02:00
Thomas Guimbretiere c1cfb94a0d Setup basic testing framework for the new UI system. 2013-10-09 15:52:26 +02:00
Thomas Guimbretiere 029d141872 Bumped version
May have fixed a light prb when looking at ents.
2013-10-04 20:33:58 +02:00
Thomas Guimbretiere ed93c68fb9 Added registration methods for tail changes along with proper calls to the registrated classes. 2013-10-04 20:02:27 +02:00
Thomas Guimbretiere 4b8acb517e Added "getWailaTail" to the API 2013-10-04 19:55:26 +02:00
Thomas Guimbretiere 419308e2ac Rearranged inworld recipe check to prevent crash on NEI cache loading. 2013-10-04 19:48:55 +02:00
Thomas Guimbretiere 8dc890421d More adjusting and desactivation of NEI overlay. 2013-10-04 18:55:19 +02:00
Thomas Guimbretiere fe90900b55 Adjusted the block discovery system a bit. 2013-10-04 16:30:55 +02:00
Thomas Guimbretiere 1d9807e6d6 Added in-world recipe/usage lookup. 2013-10-04 16:02:21 +02:00
Thomas Guimbretiere 58931febc4 Fixed the proxy raytracing. 2013-10-04 15:04:59 +02:00
Thomas Guimbretiere d72dfa5775 Added support for entities.
Added missing files.
2013-10-04 14:55:01 +02:00
Thomas Guimbretiere dbf49534da Added liquid raytracing 2013-10-04 13:33:59 +02:00
Thomas Guimbretiere aad38c1eac Added a new block recovery test by using a fresh block if the block do not have a TE. 2013-10-04 13:07:08 +02:00
Thomas Guimbretiere c0727b2157 Moved overlay renderer from NEI to Waila for easier handling. 2013-10-02 18:00:53 +02:00
Thomas Guimbretiere 3085f7442a Added tag 1.3.9_1.6.2 for changeset 1e7cde94ccce 2013-09-04 00:12:37 +02:00
Thomas Guimbretiere 25cfff7354 Fixed dimension lookup (I guess).
Version bump
2013-09-04 00:12:19 +02:00
Thomas Guimbretiere 13f49db4b7 Renamed Handlers 2013-09-03 17:31:51 +02:00
Thomas Guimbretiere 117808a326 Added try/catch statement for packet 0x01 to prevent a rare case of crash when the server do not know the dimension. 2013-09-03 17:09:18 +02:00
Thomas Guimbretiere 31ee058c87 Added versionBounds statement to @NetworkMod. Should solve the version mismatch prb between client & server. 2013-09-03 16:58:06 +02:00
Thomas Guimbretiere 4d8087fb4c Added tag 1.3.8_1.6.2 for changeset 45e01e7ee1a8 2013-09-02 17:53:37 +02:00
Thomas Guimbretiere cef91a3ef4 Bump version number 2013-09-02 17:53:19 +02:00
Thomas Guimbretiere 9da2402851 Fixed BC module. Removed pipe info for now. 2013-09-02 17:33:16 +02:00
Thomas Guimbretiere 3eaffb5812 Set default NEI key for tooltip handling to None on loading. 2013-09-02 16:35:11 +02:00
Thomas Guimbretiere 643d1bfad2 Updated config string to match new NEI config option. 2013-09-02 15:02:11 +02:00
Thomas Guimbretiere ad6fd7290a Untested 1.6.2 port. 2013-09-02 14:49:08 +02:00
Thomas Guimbretiere 7e012ff6c6 New branch for 1.6.2 dev 2013-09-02 14:18:43 +02:00
Thomas Guimbretiere b547b7ece6 Moved most of the config strings to a constant class.
Added a Reflect class for easy reflection.
2013-09-02 14:07:32 +02:00
Thomas Guimbretiere 022d792d01 [AppEng] Added handling of a null monitor object 2013-09-02 01:46:16 +02:00
Thomas Guimbretiere c4f6b40ea5 Added support for AE 2013-09-02 01:40:24 +02:00
Thomas Guimbretiere 709f750a2a Muted BB module. It is now in BB itself. 2013-09-02 00:25:47 +02:00
Thomas Guimbretiere 281a8f26dd Reworked BB module to match the API
Added a gravestone module to override the normal detection
Added a TwilightForest module to override the normal (and buggy) detection.
2013-08-17 19:59:12 +02:00
Thomas Guimbretiere 03b8097ccb Added stack overlay.
Added support for NEI recipes.
2013-07-09 02:35:17 +02:00
Thomas Guimbretiere 6a2c137bce First nearly working version of the tech tree. 2013-07-08 21:11:30 +02:00
Thomas Guimbretiere e9c43a71fa Added skeleton files for the new screen & widget 2013-07-04 11:51:55 +02:00
Thomas Guimbretiere f7e0e24548 Source cleanup 2013-07-04 11:51:29 +02:00
Thomas Guimbretiere 73c5383d59 Now use name:meta as key.
Wildcards possible in name & meta.
2013-07-04 11:04:39 +02:00
Thomas Guimbretiere 4cbe727b81 Added default block summary.
Added csv reader.
2013-07-03 21:11:50 +02:00
Thomas Guimbretiere 00ea3d77cc New API for left side of description screen
Too much stuff, forgot...
2013-07-03 19:35:25 +02:00
Thomas Guimbretiere bc424e1d01 First shoot at wiki display.
Added registration of files to modules, handler, etc.
2013-07-02 11:55:13 +02:00
Thomas Guimbretiere 3c048e9795 Renamed GuiEnchantScreen (case correction) 2013-07-01 19:53:26 +02:00
Thomas Guimbretiere eeb3c7f48a Added WikiText widget (first version)
Added WikiScreen
Added WikiHandler
Some minor changes
2013-07-01 19:52:47 +02:00
Thomas Guimbretiere ee1118ee4b Added tag 1.3.4 for changeset 2f6144f8e55c 2013-07-01 15:04:44 +02:00
Thomas Guimbretiere 636ae4203e Added focus handling, more passthought and mouse dragging for VBar. 2013-06-29 22:32:02 +02:00
Thomas Guimbretiere 5360475686 [IC2] Capped max input display
[Vanilla] Added disk display for jukeboxes
2013-06-29 15:16:50 +02:00
Thomas Guimbretiere 15f89627c6 [EnderStorage] Module added. Shows chest colors. 2013-06-29 14:52:03 +02:00
Thomas Guimbretiere e42914c721 [Thaumcraft] Added capacitor storage display 2013-06-29 13:25:05 +02:00
Thomas Guimbretiere 394d9cd564 [Thaumcraft] Added CustomPlants stack handler to return proper values 2013-06-29 12:38:07 +02:00
Thomas Guimbretiere f648c41890 Added Thaumcraft module to correct leaves bug. 2013-06-29 12:27:41 +02:00
Thomas Guimbretiere 37498dc0b1 Added a registerStackProvider taking in a class instead of a block ID
Added a StackProvider to IC2 to correct reinforced door wrong stack.
2013-06-29 11:58:05 +02:00
Thomas Guimbretiere ed1a4d010d Move exception handling to its own class.
Try/catch writeToNBT server side ("You don't know your age ?" bug)
2013-06-29 11:22:42 +02:00
Thomas Guimbretiere 83ee66d8a6 Table viewport now move depending on the value of the scrollbar itself.
Clicking above & below the button will move the viewport by 1 step.
2013-06-24 01:09:43 +02:00
Thomas Guimbretiere c4dcdd926a VScrollBar is now a real widget (accept clicks passthrought). 2013-06-24 00:39:42 +02:00
Thomas Guimbretiere 3048dfe09a Added cascading widget handling.
Moved all the old buttons to widget_old until they are turned into proper widgets
2013-06-23 23:58:10 +02:00
Thomas Guimbretiere 6acfa28ef7 Clarified how height is handled in all the class. 2013-06-23 22:43:48 +02:00
Thomas Guimbretiere bac71d0894 First working scroll bar 2013-06-23 22:36:30 +02:00
Thomas Guimbretiere b2dabe7bed Mouse event propagation done. 2013-06-23 18:00:39 +02:00
Thomas Guimbretiere 78a8f92b2f Rework of the GUI part.
First shoot at custom mouse capturing.
2013-06-23 17:25:15 +02:00
Thomas Guimbretiere 137db44e23 Nearly finished version of the enchantment screen. 2013-06-22 20:06:16 +02:00
Thomas Guimbretiere d744bdf25b Readded missing file. 2013-06-21 11:15:04 +02:00
Thomas Guimbretiere 1eb67afea6 Some refactoring.
RShift shows the empty enchant screen.
2013-06-20 13:16:55 +02:00
Thomas Guimbretiere 396dbd734a Merge with default 2013-06-20 11:24:22 +02:00
Thomas Guimbretiere fb00790fdc Merge 2013-06-20 11:10:56 +02:00
Thomas Guimbretiere 39124f153f Added tag 1.3.3 for changeset 8ee781ebab6c 2013-06-19 23:24:02 +02:00
Thomas Guimbretiere acda2b4a85 "Crashes" should show a <ERROR> when looking at a defunc block
Readded array out of bound protection.
2013-06-19 23:06:59 +02:00
Thomas Guimbretiere 5a82bb2a5c Added tag 1.3.2 for changeset 4a92f4e3296c 2013-06-19 22:37:47 +02:00
Thomas Guimbretiere 987d5556ef Added big time protection on API calls. 2013-06-19 22:37:29 +02:00
Thomas Guimbretiere f754ab5fbe Typo fixes 2013-06-19 22:02:07 +02:00
Thomas Guimbretiere 4ebbd2b3e9 Merge with default 2013-06-19 16:54:13 +02:00
Thomas Guimbretiere 6598e693f9 Underped the proxy 2013-06-19 16:52:24 +02:00
Thomas Guimbretiere 4970a268f4 Merge with default 2013-06-19 16:41:29 +02:00
Thomas Guimbretiere a984e2e8bd Added tag v1.3.1 for changeset 38f148ebeb8f 2013-06-19 15:29:17 +02:00
Thomas Guimbretiere 71aba4006b Fix for the nbt casting prb. 2013-06-19 15:28:55 +02:00
Thomas Guimbretiere da64a0a019 First UI screen for enchants. 2013-06-19 14:43:12 +02:00
Thomas Guimbretiere d687bb5383 Included EPlus tooltip request to EnchantmentHandler
EnchantementHandler is now called EnchantmentHandler (for proper english)
2013-06-19 13:34:44 +02:00
Thomas Guimbretiere 37d07ab99f Merged in odininon/waila/default (pull request #1)
Added Enchanting Plus' enchantment description. eplus will nto be required to build as it is impelmented via reflection. :)
2013-06-19 13:29:30 +02:00
Thomas Guimbretiere 172e8ca659 Creating Dev branch 2013-06-19 13:24:25 +02:00
Thomas Guimbretiere 243ca7db20 Added tag v1.3.0 for changeset 137f02853afb 2013-06-19 13:22:10 +02:00
Thomas Guimbretiere 39a979ef62 Complete rework of BC module.
Bugfixes
Code cleanup.
2013-06-19 13:21:59 +02:00
Freyja 73cf134212 Added Enchanting Plus' enchantment description. eplus will nto be required to build as it is impelmented via reflection. :) 2013-06-18 22:39:08 -04:00
Thomas Guimbretiere ae641e642d New handler for power pipes. 2013-06-17 19:03:54 +02:00
Thomas Guimbretiere 58feff48f9 Missing changes. 2013-06-17 18:07:10 +02:00
Thomas Guimbretiere c77306ae4f Refactored IC2 module. Included proper handling of transformers
Refactored BC module to match API.
Fixed TE dumper.
2013-06-17 18:06:57 +02:00
Thomas Guimbretiere 0ce1661a7f Added NBT server data dumper for testing purpose. 2013-06-17 14:30:41 +02:00
Thomas Guimbretiere 95adb69f55 Update limiter is in. It is set to 250ms between updates. 2013-06-17 14:05:26 +02:00
Thomas Guimbretiere b52b110852 Added a new config type : ConfigRemote.
Can be added by IWailaRegistrar.addConfigRemote.
Use as the same as other configs, but will return false if server do not have
waila module & will be desactivated in the config menu.
2013-06-17 11:35:41 +02:00
Thomas Guimbretiere 7f1cb7d710 Finished server nbt data request.
Reworked IC2 module to handle the next type of interface and remote data sync.
Now has 3 modules, for the 3 main interfaces.
2013-06-17 02:20:04 +02:00
Thomas Guimbretiere 94d0f4d681 Added packet handling.
Added server ping on connection (identify if server side is present)
2013-06-16 18:51:23 +02:00
Thomas Guimbretiere 5f168bb1bc Fixed registration by class. 2013-06-16 16:03:30 +02:00
Thomas Guimbretiere d29ecd09ce Added tag v1.2.0 for changeset 28ccc9a07b54 2013-06-16 15:42:49 +02:00
Thomas Guimbretiere 1fd33e8d7c Added registration based on class as well as registration based on IDs 2013-06-16 15:42:26 +02:00
Thomas Guimbretiere f43bfad3d8 Changed the signature of IWailaBlock.
Now the methods are taking in a IWailaDataAccessor instead of 10 arguments.
The IWailaDataAccessor gives access to all the required values for the block
(world, player, Block, id, metadata, entity, etc)
2013-06-16 13:44:32 +02:00
Thomas Guimbretiere 953e255189 Changed API signature to include Block & TileEntity for optimization 2013-06-15 18:17:39 +02:00
Thomas Guimbretiere e953471d3e Added Vanilla module.
Added ID:Metadata display (optional)
2013-06-15 18:09:22 +02:00
Thomas Guimbretiere 78c8c9a2ad Smaller buttons. 2013-06-15 16:57:30 +02:00
Thomas Guimbretiere db75285bc5 Import cleanup
Eclipse source cleanup is NOT RECURSIVE !
2013-06-15 16:50:14 +02:00
Thomas Guimbretiere cbd8b81f90 Added an external module API.
Some refactoring.
2013-06-15 13:03:03 +02:00
Thomas Guimbretiere f7d397211f Added helper method for config registration.
Some interface renaming.
2013-06-14 18:33:52 +02:00
Thomas Guimbretiere 0eb9f813f7 Added API, menus, keybinds and more. 2013-06-14 18:10:05 +02:00
Thomas Guimbretiere 8387373850 Added IC2 integration (In/out voltages) 2013-06-13 00:29:27 +02:00
Thomas Guimbretiere fa6218a526 Updated to match current NEI version.
Should be compatible with NEI 1.5.2.28
2013-06-12 12:13:32 +02:00
Thomas Guimbretiere 5dd15fd727 Removed old versions of modules. 2013-06-09 17:12:29 +02:00
Thomas Guimbretiere 5206ab683e First public push. Internal version 0.0.3 2013-06-09 16:58:28 +02:00
258 changed files with 3088 additions and 12624 deletions

No files matched your search

-387
View File
@@ -1,387 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
APACHE COMMONS MATH DERIVATIVE WORKS:
The Apache commons-math library includes a number of subcomponents
whose implementation is derived from original sources written
in C or Fortran. License terms of the original sources
are reproduced below.
===============================================================================
For the lmder, lmpar and qrsolv Fortran routine from minpack and translated in
the LevenbergMarquardtOptimizer class in package
org.apache.commons.math3.optimization.general
Original source copyright and license statement:
Minpack Copyright Notice (1999) University of Chicago. All rights reserved
Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the
following conditions are met:
1. Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
2. Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
3. The end-user documentation included with the
redistribution, if any, must include the following
acknowledgment:
"This product includes software developed by the
University of Chicago, as Operator of Argonne National
Laboratory.
Alternately, this acknowledgment may appear in the software
itself, if and wherever such third-party acknowledgments
normally appear.
4. WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS"
WITHOUT WARRANTY OF ANY KIND. THE COPYRIGHT HOLDER, THE
UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND
THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE
OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY
OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR
USEFULNESS OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF
THE SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4)
DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION
UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL
BE CORRECTED.
5. LIMITATION OF LIABILITY. IN NO EVENT WILL THE COPYRIGHT
HOLDER, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF
ENERGY, OR THEIR EMPLOYEES: BE LIABLE FOR ANY INDIRECT,
INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF
ANY KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF
PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER
SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT
(INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE,
EVEN IF ANY OF SAID PARTIES HAS BEEN WARNED OF THE
POSSIBILITY OF SUCH LOSS OR DAMAGES.
===============================================================================
Copyright and license statement for the odex Fortran routine developed by
E. Hairer and G. Wanner and translated in GraggBulirschStoerIntegrator class
in package org.apache.commons.math3.ode.nonstiff:
Copyright (c) 2004, Ernst Hairer
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
===============================================================================
Copyright and license statement for the original lapack fortran routines
translated in EigenDecompositionImpl class in package
org.apache.commons.math3.linear:
Copyright (c) 1992-2008 The University of Tennessee. All rights reserved.
$COPYRIGHT$
Additional copyrights may follow
$HEADER$
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer listed
in this license in the documentation and/or other materials
provided with the distribution.
- Neither the name of the copyright holders nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
===============================================================================
Copyright and license statement for the original Mersenne twister C
routines translated in MersenneTwister class in package
org.apache.commons.math3.random:
Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The names of its contributors may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
===============================================================================
The class "org.apache.commons.math3.exception.util.LocalizedFormatsTest" is
an adapted version of "OrekitMessagesTest" test class for the Orekit library
The "org.apache.commons.math3.analysis.interpolation.HermiteInterpolator"
has been imported from the Orekit space flight dynamics library.
Th Orekit library is described at:
https://www.orekit.org/forge/projects/orekit
The original files are distributed under the terms of the Apache 2 license
which is: Copyright 2010 CS Communication & Systèmes
-4
View File
@@ -1,4 +0,0 @@
Waila-1.7.10
============
A port of Prof. Mobius' Minecraft mod, Waila, to Minecraft 1.7.10. Unofficial.
-135
View File
@@ -1,135 +0,0 @@
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
}
}
configurations {
deployerJars
}
//add dependency repositories
repositories {
mavenLocal()
mavenCentral()
maven {
name = "chickenbones"
url = "http://chickenbones.net/maven/"
}
}
apply plugin: 'java'
apply plugin: 'forge'
apply plugin: 'maven'
version = "1.5.2a"
group= "mcp.mobius.waila" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "Waila"
// Define properties file
ext.configFile = file "build.properties"
configFile.withReader {
// Load config. It shall from now be referenced as simply config or project.config
def prop = new Properties()
prop.load(it)
project.ext.config = new ConfigSlurper().parse prop
}
dependencies {
compile "codechicken:CodeChickenLib:${config.mc_version}-${config.ccl_version}:dev"
compile "codechicken:CodeChickenCore:${config.mc_version}-${config.ccc_version}:dev"
compile "codechicken:NotEnoughItems:${config.mc_version}-${config.nei_version}:dev"
deployerJars "org.apache.maven.wagon:wagon-ssh:2.2"
}
minecraft {
version = "1.7.10-10.13.0.1160"
assetDir = "eclipse/assets"
}
def root = project.projectDir.parentFile
sourceSets {
main {
java {
srcDir new File(root, "src")
}
resources {
srcDir new File(root, "resources")
}
}
}
processResources
{
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
jar {
exclude "**/client/gui/inventory/GuiContainer.class"
exclude "**/client/gui/inventory/GuiContainer.java"
}
task sourceJar(type: Jar) {
from sourceSets.main.java
from new File(root, "dev")
classifier = 'sources'
}
task devJar(type: Jar) {
from sourceSets.main.output
classifier = 'dev'
}
artifacts {
archives sourceJar, devJar
}
uploadArchives {
dependsOn 'reobf'
repositories.mavenDeployer {
configuration = configurations.deployerJars
repository(url: "scp://mobiusstrip.eu/home/mobius/web/maven"){
authentication(userName: "mobius")
}
pom {
groupId = project.group
version = project.version
artifactId = project.archivesBaseName
project {
name project.archivesBaseName
packaging 'jar'
description 'Waila '
url 'http://mobiusstrip.eu'
}
}
}
}
-7
View File
@@ -1,7 +0,0 @@
mc_version=1.7.10
forge_version=10.13.0.1160
ccl_version=1.1.1.93
ccc_version=1.0.1.8
nei_version=1.0.2.15
mod_version=1.0
waila_version=1.5.2a
Binary file not shown.
-6
View File
@@ -1,6 +0,0 @@
#Tue May 06 21:57:37 CEST 2014
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-1.12-bin.zip
Vendored
-164
View File
@@ -1,164 +0,0 @@
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
Vendored
-90
View File
@@ -1,90 +0,0 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
+171
View File
@@ -0,0 +1,171 @@
package mcp.mobius.waila;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import org.lwjgl.input.Keyboard;
import codechicken.core.Profiler;
import codechicken.nei.NEIClientUtils;
import codechicken.nei.api.API;
import codechicken.nei.forge.GuiContainerManager;
import codechicken.nei.recipe.GuiCraftingRecipe;
import codechicken.nei.recipe.GuiUsageRecipe;
import codechicken.nei.recipe.ICraftingHandler;
import codechicken.nei.recipe.ProfilerRecipeHandler;
import mcp.mobius.waila.addons.ConfigHandler;
import mcp.mobius.waila.gui.screens.ScreenBase;
import mcp.mobius.waila.gui.screens.config.ScreenConfig;
import mcp.mobius.waila.gui.screens.config.ScreenHUDConfig;
import mcp.mobius.waila.gui.screens.config.ScreenWailaConfig;
import mcp.mobius.waila.gui.screens.info.ScreenEnchants;
import mcp.mobius.waila.gui.testing.ScreenTest;
import mcp.mobius.waila.handlers.nei.HandlerEnchants;
import mcp.mobius.waila.overlay.RayTracing;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.gui.inventory.GuiInventory;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumMovingObjectType;
import cpw.mods.fml.client.registry.KeyBindingRegistry.KeyHandler;
import cpw.mods.fml.common.TickType;
import cpw.mods.fml.common.registry.LanguageRegistry;
public class ConfigKeyHandler extends KeyHandler {
static boolean firstInventory = true;
public ConfigKeyHandler()
{
super(new KeyBinding[]{
new KeyBinding(Constants.BIND_WAILA_CFG, Keyboard.KEY_NUMPAD0),
new KeyBinding(Constants.BIND_WAILA_SHOW, Keyboard.KEY_NUMPAD1),
new KeyBinding(Constants.BIND_WAILA_LIQUID, Keyboard.KEY_NUMPAD2),
new KeyBinding(Constants.BIND_WAILA_RECIPE, Keyboard.KEY_NUMPAD3),
new KeyBinding(Constants.BIND_WAILA_USAGE, Keyboard.KEY_NUMPAD4),
new KeyBinding(Constants.BIND_WAILA_TESTING, Keyboard.KEY_NUMPAD9),
}, new boolean[]{
false,
false,
false,
false,
false,
false
});
LanguageRegistry.instance().addStringLocalization(Constants.BIND_WAILA_CFG, "[Waila] Config screen");
LanguageRegistry.instance().addStringLocalization(Constants.BIND_WAILA_SHOW, "[Waila] Show/Hide");
LanguageRegistry.instance().addStringLocalization(Constants.BIND_WAILA_LIQUID, "[Waila] Show liquids");
LanguageRegistry.instance().addStringLocalization(Constants.BIND_WAILA_RECIPE, "[Waila] Show recipe");
LanguageRegistry.instance().addStringLocalization(Constants.BIND_WAILA_USAGE, "[Waila] Show usage");
LanguageRegistry.instance().addStringLocalization(Constants.BIND_WAILA_TESTING, "[Waila] Testing");
//LanguageRegistry.instance().addStringLocalization(Constants.BIND_SCREEN_ENCH, "[Waila] Show enchant screen");
//LanguageRegistry.instance().addStringLocalization("key.wailatedump", "[Waila] Dump server TE");
GuiContainerManager.addInputHandler(new HandlerEnchants());
API.addKeyBind(Constants.BIND_SCREEN_ENCH, Keyboard.KEY_I);
}
@Override
public void keyDown(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd, boolean isRepeat) {
if (!tickEnd) return;
Minecraft mc = Minecraft.getMinecraft();
if (kb.keyDescription == Constants.BIND_WAILA_CFG){
if(mc.currentScreen == null)
mc.displayGuiScreen(new ScreenConfig(mc.currentScreen));
}
if (kb.keyDescription == Constants.BIND_WAILA_TESTING){
if(mc.currentScreen == null)
mc.displayGuiScreen(new ScreenEnchants(mc.currentScreen));
}
if (mc.currentScreen != null)
return;
if (kb.keyDescription == Constants.BIND_WAILA_SHOW && ConfigHandler.instance().getConfig(Constants.CFG_WAILA_MODE)){
boolean status = ConfigHandler.instance().getConfig(Constants.CFG_WAILA_SHOW);
ConfigHandler.instance().setConfig(Constants.CFG_WAILA_SHOW, !status);
}
else if (kb.keyDescription == Constants.BIND_WAILA_SHOW && !ConfigHandler.instance().getConfig(Constants.CFG_WAILA_MODE)){
ConfigHandler.instance().setConfig(Constants.CFG_WAILA_SHOW, true);
}
else if (kb.keyDescription == Constants.BIND_WAILA_LIQUID){
boolean status = ConfigHandler.instance().getConfig(Constants.CFG_WAILA_LIQUID);
ConfigHandler.instance().setConfig(Constants.CFG_WAILA_LIQUID, !status);
}
else if (kb.keyDescription == Constants.BIND_WAILA_RECIPE){
this.openRecipeGUI(true);
}
else if (kb.keyDescription == Constants.BIND_WAILA_USAGE){
this.openRecipeGUI(false);
}
}
public void openRecipeGUI(boolean recipe){
Minecraft mc = Minecraft.getMinecraft();
boolean uiResult;
String msg;
if ((RayTracing.raytracedTarget != null) && (RayTracing.raytracedTarget.typeOfHit == EnumMovingObjectType.TILE)){
List<ItemStack> stacks = RayTracing.getIdentifierItems();
if (stacks.size() > 0){
mc.displayGuiScreen(new GuiInventory(mc.thePlayer));
if (firstInventory){
try {Thread.sleep(1000);} catch (Exception e){};
firstInventory = false;
}
if(recipe)
if(!GuiCraftingRecipe.openRecipeGui("item", stacks.get(0).copy())){
ItemStack target = stacks.get(0).copy();
target.setItemDamage(0);
if(!GuiCraftingRecipe.openRecipeGui("item", target)){
mc.thePlayer.addChatMessage("\u00a7f\u00a7oNo recipe found.");
mc.displayGuiScreen((GuiScreen)null);
mc.setIngameFocus();
}
}
if(!recipe)
if(!GuiUsageRecipe.openRecipeGui("item", stacks.get(0).copy())){
ItemStack target = stacks.get(0).copy();
target.setItemDamage(0);
if(!GuiUsageRecipe.openRecipeGui("item", target)){
mc.thePlayer.addChatMessage("\u00a7f\u00a7oNo usage found.");
mc.displayGuiScreen((GuiScreen)null);
mc.setIngameFocus();
}
}
}
}
}
@Override
public void keyUp(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd) {
if (!tickEnd) return;
if (kb.keyDescription == Constants.BIND_WAILA_SHOW && !ConfigHandler.instance().getConfig(Constants.CFG_WAILA_MODE)){
ConfigHandler.instance().setConfig(Constants.CFG_WAILA_SHOW, false);
}
}
@Override
public EnumSet<TickType> ticks() {
return EnumSet.of(TickType.CLIENT);
}
@Override
public String getLabel() {
return "Waila Config Screen Keybind";
}
}
+34
View File
@@ -0,0 +1,34 @@
package mcp.mobius.waila;
public final class Constants {
public static String BIND_SCREEN_WIKI = "showwiki";
public static String BIND_SCREEN_TECH = "showtechtree";
public static String BIND_SCREEN_ENCH = "showenchant";
public static String BIND_WAILA_CFG = "key.wailaconfig";
public static String BIND_WAILA_SHOW = "key.wailadisplay";
public static String BIND_WAILA_LIQUID = "waila.key.liquid";
public static String BIND_WAILA_RECIPE = "waila.key.recipe";
public static String BIND_WAILA_USAGE = "waila.key.usage";
public static String BIND_WAILA_TESTING= "waila.key.testing";
public static String CFG_NEI_SHOW = "world.highlight_tips";
public static String BIND_NEI_SHOW = "keys.world.highlight_tips";
public static String CFG_WAILA_SHOW = "waila.cfg.show";
public static String CFG_WAILA_MODE = "waila.cfg.showmode";
public static String CFG_WAILA_LIQUID = "waila.cfg.liquid";
public static String CFG_WAILA_METADATA = "waila.cfg.metadata";
public static String CFG_WAILA_POSX = "waila.cfg.posx";
public static String CFG_WAILA_POSY = "waila.cfg.posy";
public static String CFG_WAILA_SCALE = "waila.cfg.scale";
public static String CFG_WAILA_ALPHA = "waila.cfg.alpha";
public static String CFG_WAILA_BGCOLOR = "waila.cfg.bgcolor";
public static String CFG_WAILA_GRADIENT1 = "waila.cfg.gradient1";
public static String CFG_WAILA_GRADIENT2 = "waila.cfg.gradient2";
public static String CFG_WAILA_FONTCOLOR = "waila.cfg.fontcolor";
}
+92
View File
@@ -0,0 +1,92 @@
package mcp.mobius.waila;
import net.minecraft.item.Item;
import org.lwjgl.input.Keyboard;
import codechicken.nei.NEIClientConfig;
import codechicken.nei.api.API;
import codechicken.nei.api.ItemInfo;
import codechicken.nei.forge.GuiContainerManager;
import cpw.mods.fml.client.registry.KeyBindingRegistry;
import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.relauncher.Side;
import mcp.mobius.waila.addons.ExternalModulesHandler;
import mcp.mobius.waila.addons.appeng.AppEngModule;
import mcp.mobius.waila.addons.betterbarrels.BetterBarrelsModule;
import mcp.mobius.waila.addons.buildcraft.BCModule;
import mcp.mobius.waila.addons.enderstorage.EnderStorageModule;
import mcp.mobius.waila.addons.gravestone.GravestoneModule;
import mcp.mobius.waila.addons.ic2.IC2Module;
import mcp.mobius.waila.addons.thaumcraft.ThaumcraftModule;
import mcp.mobius.waila.addons.twilightforest.TwilightForestModule;
import mcp.mobius.waila.addons.vanillamc.HUDHandlerVanilla;
import mcp.mobius.waila.gui_old.NEI.HandlerTechTree;
import mcp.mobius.waila.gui_old.NEI.HandlerWiki;
import mcp.mobius.waila.handlers.SummaryProviderDefault;
import mcp.mobius.waila.handlers.hud.HUDHandlerExternal;
import mcp.mobius.waila.handlers.hud.HUDHandlerWaila;
import mcp.mobius.waila.handlers.nei.HandlerEnchants;
import mcp.mobius.waila.handlers.tooltip.TooltipHandlerWaila;
import mcp.mobius.waila.overlay.WailaTickHandler;
import mcp.mobius.waila.server.ProxyServer;
public class ProxyClient extends ProxyServer {
public ProxyClient() {}
@Override
public void registerHandlers(){
TickRegistry.registerTickHandler(new WailaTickHandler(), Side.CLIENT);
GuiContainerManager.addTooltipHandler(new TooltipHandlerWaila());
API.registerHighlightHandler(new HUDHandlerExternal(), ItemInfo.Layout.HEADER);
API.registerHighlightHandler(new HUDHandlerExternal(), ItemInfo.Layout.BODY);
API.registerHighlightHandler(new HUDHandlerWaila(), ItemInfo.Layout.FOOTER);
API.registerHighlightHandler(new HUDHandlerWaila(), ItemInfo.Layout.HEADER);
KeyBindingRegistry.registerKeyBinding(new ConfigKeyHandler());
// We mute the default keybind for displaying the tooltip
NEIClientConfig.getSetting(Constants.BIND_NEI_SHOW).setIntValue(Keyboard.KEY_NONE);
NEIClientConfig.getSetting(Constants.CFG_NEI_SHOW).setBooleanValue(false);
//API.addKeyBind(Constants.BIND_WIKI, "Display wiki", Keyboard.KEY_RSHIFT);
//API.addKeyBind(Constants.BIND_TECH, "Display techtree", Keyboard.KEY_RSHIFT);
ExternalModulesHandler.instance().registerShortDataProvider(new SummaryProviderDefault(), Item.class);
this.registerMods();
}
public void registerMods(){
HUDHandlerVanilla.register();
/*BETTER BARRELS*/
//BetterBarrelsModule.register();
/* BUILDCRAFT */
BCModule.register();
/* INDUSTRIALCRAFT2 */
IC2Module.register();
/*Thaumcraft*/
ThaumcraftModule.register();
/*EnderStorage*/
EnderStorageModule.register();
/*Gravestone*/
GravestoneModule.register();
/*Twilight forest*/
TwilightForestModule.register();
/* Applied Energetics */
AppEngModule.register();
}
}
@@ -1,11 +1,9 @@
package mcp.mobius.waila.utils;
package mcp.mobius.waila;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import mcp.mobius.waila.Waila;
public class WailaExceptionHandler {
public WailaExceptionHandler() {}
@@ -15,13 +13,7 @@ public class WailaExceptionHandler {
public static List<String> handleErr(Throwable e, String className, List<String> currenttip){
if (!errs.contains(className)){
errs.add(className);
for (StackTraceElement elem : e.getStackTrace()){
Waila.log.log(Level.WARNING, String.format("%s.%s:%s",elem.getClassName(), elem.getMethodName(), elem.getLineNumber()));
if (elem.getClassName().contains("waila")) break;
}
Waila.log.log(Level.WARNING, String.format("Catched unhandled exception : [%s] %s",className,e));
mod_Waila.log.log(Level.WARNING, String.format("Catched unhandled exception : [%s] %s",className,e));
}
if (currenttip != null)
currenttip.add("<ERROR>");
+103
View File
@@ -0,0 +1,103 @@
package mcp.mobius.waila.addons;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Set;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.api.IWailaConfigHandler;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.Property;
public class ConfigHandler implements IWailaConfigHandler {
private static ConfigHandler instance = null;
private LinkedHashMap<String, ConfigModule> modules = new LinkedHashMap<String, ConfigModule>();
private ArrayList<String> serverconfigs = new ArrayList<String>();
private ConfigHandler() {
instance = this;
}
public static ConfigHandler instance(){
if (ConfigHandler.instance == null)
ConfigHandler.instance = new ConfigHandler();
return ConfigHandler.instance;
}
public void addModule(String modName, HashMap<String, String> options){
this.addModule(modName, new ConfigModule(modName, options));
}
public void addModule(String modName, ConfigModule options){
this.modules.put(modName, options);
}
@Override
public Set<String> getModuleNames(){
return this.modules.keySet();
}
@Override
public HashMap<String, String> getConfigKeys(String modName){
if (this.modules.containsKey(modName))
return this.modules.get(modName).options;
else
return null;
}
public void addConfig(String modName, String key, String name){
if (!this.modules.containsKey(modName))
this.modules.put(modName, new ConfigModule(modName));
this.modules.get(modName).addOption(key, name);
}
public void addConfigServer(String modName, String key, String name){
if (!this.modules.containsKey(modName))
this.modules.put(modName, new ConfigModule(modName));
this.modules.get(modName).addOption(key, name);
this.serverconfigs.add(key);
}
@Override
public boolean getConfig(String key, boolean defvalue){
mod_Waila.instance.config.load();
if (this.serverconfigs.contains(key) && !mod_Waila.instance.serverPresent)
return false;
Property prop = mod_Waila.instance.config.get(Configuration.CATEGORY_GENERAL, key, defvalue);
return prop.getBoolean(defvalue);
}
public boolean isServerRequired(String key){
return this.serverconfigs.contains(key);
}
@Override
public boolean getConfig(String key){
return this.getConfig(key, true);
}
public int getConfigInt(String key){
mod_Waila.instance.config.load();
Property prop = mod_Waila.instance.config.get(Configuration.CATEGORY_GENERAL, key, 0);
return prop.getInt();
}
@Override
public void setConfig(String key, boolean value){
mod_Waila.instance.config.load();
mod_Waila.instance.config.get(Configuration.CATEGORY_GENERAL, key, true).set(value);;
mod_Waila.instance.config.save();
}
public void setConfigInt(String key, int value){
mod_Waila.instance.config.load();
mod_Waila.instance.config.get(Configuration.CATEGORY_GENERAL, key, 0).set(value);;
mod_Waila.instance.config.save();
}
}
@@ -1,4 +1,4 @@
package mcp.mobius.waila.api.impl;
package mcp.mobius.waila.addons;
import java.util.HashMap;
@@ -0,0 +1,343 @@
package mcp.mobius.waila.addons;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Set;
import java.util.logging.Level;
import au.com.bytecode.opencsv.CSVReader;
import net.minecraft.block.Block;
import codechicken.nei.api.API;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.api.IWailaDataProvider;
import mcp.mobius.waila.api.IWailaRegistrar;
import mcp.mobius.waila.api.IWailaSummaryProvider;
import mcp.mobius.waila.handlers.hud.HUDHandlerExternal;
public class ExternalModulesHandler implements IWailaRegistrar {
private static ExternalModulesHandler instance = null;
public LinkedHashMap<Integer, ArrayList<IWailaDataProvider>> headProviders = new LinkedHashMap<Integer, ArrayList<IWailaDataProvider>>();
public LinkedHashMap<Integer, ArrayList<IWailaDataProvider>> bodyProviders = new LinkedHashMap<Integer, ArrayList<IWailaDataProvider>>();
public LinkedHashMap<Integer, ArrayList<IWailaDataProvider>> tailProviders = new LinkedHashMap<Integer, ArrayList<IWailaDataProvider>>();
public LinkedHashMap<Integer, ArrayList<IWailaDataProvider>> stackProviders = new LinkedHashMap<Integer, ArrayList<IWailaDataProvider>>();
public LinkedHashMap<Class, ArrayList<IWailaDataProvider>> headBlockProviders = new LinkedHashMap<Class, ArrayList<IWailaDataProvider>>();
public LinkedHashMap<Class, ArrayList<IWailaDataProvider>> bodyBlockProviders = new LinkedHashMap<Class, ArrayList<IWailaDataProvider>>();
public LinkedHashMap<Class, ArrayList<IWailaDataProvider>> tailBlockProviders = new LinkedHashMap<Class, ArrayList<IWailaDataProvider>>();
public LinkedHashMap<Class, ArrayList<IWailaDataProvider>> stackBlockProviders = new LinkedHashMap<Class, ArrayList<IWailaDataProvider>>();
public LinkedHashMap<String, LinkedHashMap <String, LinkedHashMap <String, String>>> wikiDescriptions = new LinkedHashMap<String, LinkedHashMap <String, LinkedHashMap <String, String>>>();
public LinkedHashMap<Class, ArrayList<IWailaSummaryProvider>> summaryProviders = new LinkedHashMap<Class, ArrayList<IWailaSummaryProvider>>();
private ExternalModulesHandler() {
instance = this;
}
public static ExternalModulesHandler instance(){
if (ExternalModulesHandler.instance == null)
ExternalModulesHandler.instance = new ExternalModulesHandler();
return ExternalModulesHandler.instance;
}
@Override
public void addConfig(String modname, String key, String configname) {
ConfigHandler.instance().addConfig(modname, key, configname);
}
@Override
public void addConfigRemote(String modname, String key, String configname) {
ConfigHandler.instance().addConfigServer(modname, key, configname);
}
@Override
public void registerHeadProvider(IWailaDataProvider dataProvider, int blockID) {
if (!this.headProviders.containsKey(blockID))
this.headProviders.put(blockID, new ArrayList<IWailaDataProvider>());
this.headProviders.get(blockID).add(dataProvider);
}
@Override
public void registerHeadProvider(IWailaDataProvider dataProvider, Class block) {
if (!this.headBlockProviders.containsKey(block))
this.headBlockProviders.put(block, new ArrayList<IWailaDataProvider>());
this.headBlockProviders.get(block).add(dataProvider);
}
@Override
public void registerBodyProvider(IWailaDataProvider dataProvider, int blockID) {
if (!this.bodyProviders.containsKey(blockID))
this.bodyProviders.put(blockID, new ArrayList<IWailaDataProvider>());
this.bodyProviders.get(blockID).add(dataProvider);
}
@Override
public void registerBodyProvider(IWailaDataProvider dataProvider, Class block) {
if (!this.bodyBlockProviders.containsKey(block))
this.bodyBlockProviders.put(block, new ArrayList<IWailaDataProvider>());
this.bodyBlockProviders.get(block).add(dataProvider);
}
@Override
public void registerTailProvider(IWailaDataProvider dataProvider, int blockID) {
if (!this.tailProviders.containsKey(blockID))
this.tailProviders.put(blockID, new ArrayList<IWailaDataProvider>());
this.tailProviders.get(blockID).add(dataProvider);
}
@Override
public void registerTailProvider(IWailaDataProvider dataProvider, Class block) {
if (!this.tailBlockProviders.containsKey(block))
this.tailBlockProviders.put(block, new ArrayList<IWailaDataProvider>());
this.tailBlockProviders.get(block).add(dataProvider);
}
@Override
public void registerStackProvider(IWailaDataProvider dataProvider, int blockID) {
if (!this.stackProviders.containsKey(blockID))
this.stackProviders.put(blockID, new ArrayList<IWailaDataProvider>());
this.stackProviders.get(blockID).add(dataProvider);
API.registerHighlightIdentifier(blockID, new HUDHandlerExternal());
}
@Override
public void registerStackProvider(IWailaDataProvider dataProvider, Class block) {
for (int i = 0; i < Block.blocksList.length; i++)
if (block.isInstance(Block.blocksList[i])){
this.registerStackProvider(dataProvider, i);
}
}
@Override
public void registerShortDataProvider(IWailaSummaryProvider dataProvider, Class item) {
if (!this.summaryProviders.containsKey(item))
this.summaryProviders.put(item, new ArrayList<IWailaSummaryProvider>());
this.summaryProviders.get(item).add(dataProvider);
}
/* Arrays getters */
public ArrayList<IWailaDataProvider> getHeadProviders(int blockID) {
return this.headProviders.get(blockID);
}
public ArrayList<IWailaDataProvider> getBodyProviders(int blockID) {
return this.bodyProviders.get(blockID);
}
public ArrayList<IWailaDataProvider> getTailProviders(int blockID) {
return this.tailProviders.get(blockID);
}
public ArrayList<IWailaDataProvider> getHeadProviders(Object block) {
ArrayList<IWailaDataProvider> returnList = new ArrayList<IWailaDataProvider>();
for (Class clazz : this.headBlockProviders.keySet())
if (clazz.isInstance(block))
returnList.addAll(this.headBlockProviders.get(clazz));
return returnList;
}
public ArrayList<IWailaDataProvider> getBodyProviders(Object block) {
ArrayList<IWailaDataProvider> returnList = new ArrayList<IWailaDataProvider>();
for (Class clazz : this.bodyBlockProviders.keySet())
if (clazz.isInstance(block))
returnList.addAll(this.bodyBlockProviders.get(clazz));
return returnList;
}
public ArrayList<IWailaDataProvider> getTailProviders(Object block) {
ArrayList<IWailaDataProvider> returnList = new ArrayList<IWailaDataProvider>();
for (Class clazz : this.bodyBlockProviders.keySet())
if (clazz.isInstance(block))
returnList.addAll(this.bodyBlockProviders.get(clazz));
return returnList;
}
public ArrayList<IWailaDataProvider> getStackProviders(int blockID) {
return this.stackProviders.get(blockID);
}
public ArrayList<IWailaSummaryProvider> getSummaryProvider(Object item){
ArrayList<IWailaSummaryProvider> returnList = new ArrayList<IWailaSummaryProvider>();
for (Class clazz : this.summaryProviders.keySet())
if (clazz.isInstance(item))
returnList.addAll(this.summaryProviders.get(clazz));
return returnList;
}
/* Providers querry methods */
public boolean hasHeadProviders(int blockID){
return this.headProviders.containsKey(blockID);
}
public boolean hasBodyProviders(int blockID){
return this.bodyProviders.containsKey(blockID);
}
public boolean hasTailProviders(int blockID){
return this.tailProviders.containsKey(blockID);
}
public boolean hasStackProviders(int blockID){
return this.stackProviders.containsKey(blockID);
}
public boolean hasHeadProviders(Object block){
for (Class clazz : this.headBlockProviders.keySet())
if (clazz.isInstance(block))
return true;
return false;
}
public boolean hasBodyProviders(Object block){
for (Class clazz : this.bodyBlockProviders.keySet())
if (clazz.isInstance(block))
return true;
return false;
}
public boolean hasTailProviders(Object block){
for (Class clazz : this.tailBlockProviders.keySet())
if (clazz.isInstance(block))
return true;
return false;
}
public boolean hasSummaryProvider(Class item){
return this.summaryProviders.containsKey(item);
}
@Override
public void registerDocTextFile(String filename) {
List<String[]> docData = null;
int nentries = 0;
try{
docData = this.readFileAsString(filename);
} catch (IOException e){
mod_Waila.log.log(Level.WARNING, String.format("Error while accessing file %s : %s", filename, e));
return;
}
for (String[] ss : docData){
String modid = ss[0];
String name = ss[1];
String meta = ss[2];
String desc = ss[5].replace('$', '\n');
if (!(desc.trim().equals(""))){
if (!this.wikiDescriptions.containsKey(modid))
this.wikiDescriptions.put(modid, new LinkedHashMap <String, LinkedHashMap <String, String>>());
if (!this.wikiDescriptions.get(modid).containsKey(name))
this.wikiDescriptions.get(modid).put(name, new LinkedHashMap<String, String>());
this.wikiDescriptions.get(modid).get(name).put(meta, desc);
System.out.printf("Registered %s %s %s\n", modid, name, meta);
nentries += 1;
}
}
/*
String[] sections = docData.split(">>>>");
for (String s : sections){
s.trim();
if (!s.equals("")){
try{
String name = s.split("\r?\n",2)[0].trim();
String desc = s.split("\r?\n",2)[1].trim();
if (!this.wikiDescriptions.containsKey(modid))
this.wikiDescriptions.put(modid, new LinkedHashMap <String, String>());
this.wikiDescriptions.get(modid).put(name, desc);
nentries += 1;
}catch (Exception e){
System.out.printf("%s\n", e);
}
}
}
*/
mod_Waila.log.log(Level.INFO, String.format("Registered %s entries from %s", nentries, filename));
}
public boolean hasDocTextModID(String modid){
return this.wikiDescriptions.containsKey(modid);
}
public boolean hasDocTextItem(String modid, String item){
if (this.hasDocTextModID(modid))
return this.wikiDescriptions.get(modid).containsKey(item);
return false;
}
public boolean hasDocTextMeta(String modid, String item, String meta){
if (this.hasDocTextItem(modid, item))
return this.wikiDescriptions.get(modid).get(item).containsKey(meta);
return false;
}
public LinkedHashMap<String, String> getDocText(String modid, String name){
return this.wikiDescriptions.get(modid).get(name);
}
public String getDocText(String modid, String name, String meta){
return this.wikiDescriptions.get(modid).get(name).get(meta);
}
public boolean hasDocTextSpecificMeta(String modid, String name, String meta){
for (String s : this.getDocText(modid, name).keySet())
if (s.equals(meta))
return true;
return false;
}
public String getDoxTextWildcardMatch(String modid, String name){
Set<String> keys = this.wikiDescriptions.get(modid).keySet();
for (String s : keys){
String regexed = s;
regexed = regexed.replace(".", "\\.");
regexed = regexed.replace("*", ".*");
if (name.matches(s))
return s;
}
return null;
}
private List<String[]> readFileAsString(String filePath) throws IOException {
// URL fileURL = this.getClass().getResource(filePath);
// File filedata = new File(fileURL);
// Reader paramReader = new InputStreamReader(this.getClass().getResourceAsStream(filePath));
InputStream in = getClass().getResourceAsStream(filePath);
BufferedReader input = new BufferedReader(new InputStreamReader(in));
CSVReader reader = new CSVReader(input);
List<String[]> myEntries = reader.readAll();
reader.close();
return myEntries;
/*
StringBuffer fileData = new StringBuffer();
//BufferedReader reader = new BufferedReader(paramReader);
char[] buf = new char[1024];
int numRead=0;
while((numRead=input.read(buf)) != -1){
String readData = String.valueOf(buf, 0, numRead);
fileData.append(readData);
}
input.close();
return fileData.toString();
*/
}
}
@@ -4,8 +4,9 @@ import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.logging.Level;
import mcp.mobius.waila.Waila;
import mcp.mobius.waila.api.impl.ModuleRegistrar;
import net.minecraftforge.common.ForgeDirection;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.addons.ExternalModulesHandler;
public class AppEngModule {
@@ -24,19 +25,18 @@ public class AppEngModule {
IAEItemStack_getItemStack = IAEItemStack.getMethod("getItemStack");
} catch (ClassNotFoundException e){
Waila.log.log(Level.WARNING, "[AppEng] Class not found. " + e);
mod_Waila.log.log(Level.WARNING, "[AppEng] Class not found. " + e);
return;
} catch (SecurityException e) {
Waila.log.log(Level.WARNING, "[AppEng] Security Exception. " + e);
mod_Waila.log.log(Level.WARNING, "[AppEng] Security Exception. " + e);
return;
} catch (NoSuchMethodException e) {
Waila.log.log(Level.WARNING, "[AppEng] Method not found. " + e);
mod_Waila.log.log(Level.WARNING, "[AppEng] Method not found. " + e);
return;
}
Waila.log.log(Level.INFO, "AppEng mod found.");
ModuleRegistrar.instance().addConfig("Applied Energetic", "appeng.monitorcontent");
ModuleRegistrar.instance().registerBodyProvider(new HUDAppEngMonitor(), TileStorageMonitor);
ModuleRegistrar.instance().registerSyncedNBTKey("*", TileStorageMonitor);
mod_Waila.log.log(Level.INFO, "AppEng mod found.");
ExternalModulesHandler.instance().addConfig("Applied Energetic", "appeng.monitorcontent", "Monitor's content");
ExternalModulesHandler.instance().registerBodyProvider(new HUDAppEngMonitor(), TileStorageMonitor);
}
}
@@ -8,7 +8,6 @@ import net.minecraft.tileentity.TileEntity;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
import mcp.mobius.waila.cbcore.LangUtil;
public class HUDAppEngMonitor implements IWailaDataProvider {
@@ -32,7 +31,7 @@ public class HUDAppEngMonitor implements IWailaDataProvider {
if (stack != null)
currenttip.add(stack.getDisplayName());
else
currenttip.add(LangUtil.translateG("hud.msg.none"));
currenttip.add("<None>");
} catch (Exception e) {
System.out.printf("%s\n", e);
}
@@ -4,8 +4,9 @@ import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.logging.Level;
import mcp.mobius.waila.Waila;
import mcp.mobius.waila.api.impl.ModuleRegistrar;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.addons.ExternalModulesHandler;
import mcp.mobius.waila.addons.buildcraft.HUDHandlerBCPipes;
import codechicken.nei.api.API;
import codechicken.nei.api.ItemInfo;
@@ -23,17 +24,17 @@ public class BetterBarrelsModule {
IBarrelStorage_getItem = IBarrelStorage.getMethod("getItem");
} catch (ClassNotFoundException e){
Waila.log.log(Level.WARNING, "[BB] BetterBarrel classes not found.");
mod_Waila.log.log(Level.WARNING, "[BB] BetterBarrel classes not found.");
} catch (NoSuchFieldException e){
Waila.log.log(Level.WARNING, "[BB] Storage field not found.");
mod_Waila.log.log(Level.WARNING, "[BB] Storage field not found.");
} catch (NoSuchMethodException e){
Waila.log.log(Level.WARNING, "[BB] getItem() not found.");
mod_Waila.log.log(Level.WARNING, "[BB] getItem() not found.");
}
if (IBarrelStorage_getItem != null){
Waila.log.log(Level.INFO, "Waila module BetterBarrel succefully hooked.");
ModuleRegistrar.instance().addConfig("BetterBarrels", "bb.content");
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerBBContent(), TileEntityBarrel);
mod_Waila.log.log(Level.INFO, "Waila module BetterBarrel succefully hooked.");
ExternalModulesHandler.instance().addConfig("BetterBarrels", "bb.content", "Barrel's content");
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerBBContent(), TileEntityBarrel);
}
}
@@ -5,7 +5,7 @@ import java.lang.reflect.Method;
import java.util.List;
import java.util.logging.Level;
import mcp.mobius.waila.Waila;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
@@ -15,7 +15,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import mcp.mobius.waila.cbcore.LangUtil;
import codechicken.nei.api.API;
import codechicken.nei.api.ItemInfo;
import codechicken.nei.api.ItemInfo.Layout;
@@ -43,7 +42,7 @@ public class HUDHandlerBBContent implements IWailaDataProvider {
try {
stack = (ItemStack) BetterBarrelsModule.IBarrelStorage_getItem.invoke(BetterBarrelsModule.TileEntityBarrel_Storage.get(entity));
} catch (Exception e){
Waila.log.log(Level.SEVERE, "[BB] Unhandled exception trying to access a barrel storage for display !.\n" + String.valueOf(e));
mod_Waila.log.log(Level.SEVERE, "[BB] Unhandled exception trying to access a barrel storage for display !.\n" + String.valueOf(e));
currenttip.add("<ERROR!>");
return currenttip;
}
@@ -51,7 +50,7 @@ public class HUDHandlerBBContent implements IWailaDataProvider {
if (stack != null){
currenttip.add(stack.getDisplayName());
} else {
currenttip.add(LangUtil.translateG("hud.msg.empty"));
currenttip.add("<Empty>");
}
}
return currenttip;
@@ -0,0 +1,58 @@
package mcp.mobius.waila.addons.buildcraft;
import java.lang.reflect.Method;
import java.util.logging.Level;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.addons.ExternalModulesHandler;
import net.minecraftforge.common.ForgeDirection;
public class BCModule {
public static Class TileTank = null;
public static Class IPowerReceptor = null;
public static Class PipeTransportPower = null;
public static Class TileGenericPipe = null;
public static Class TileEngine = null;
public static Method TileTank_getTankInfo = null;
//public static Method IPowerReceptor_PowerRequest = null;
public static void register(){
try {
Class ModBuildcraftFactory = Class.forName("buildcraft.BuildCraftFactory");
mod_Waila.log.log(Level.INFO, "Buildcraft|Factory mod found.");
} catch (ClassNotFoundException e){
mod_Waila.log.log(Level.INFO, "Buildcraft|Factory mod not found. Skipping.");
return;
}
try{
TileTank = Class.forName("buildcraft.factory.TileTank");
IPowerReceptor = Class.forName("buildcraft.api.power.IPowerReceptor");
PipeTransportPower = Class.forName("buildcraft.transport.PipeTransportPower");
TileGenericPipe = Class.forName("buildcraft.transport.TileGenericPipe");
TileEngine = Class.forName("buildcraft.energy.TileEngine");
TileTank_getTankInfo = TileTank.getMethod("getTankInfo", ForgeDirection.class);
//IPowerReceptor_PowerRequest = IPowerReceptor.getMethod("powerRequest", ForgeDirection.class);
} catch (ClassNotFoundException e){
mod_Waila.log.log(Level.WARNING, "[BC] Class not found. " + e);
return;
} catch (NoSuchMethodException e){
mod_Waila.log.log(Level.WARNING, "[BC] Method not found." + e);
return;
}
ExternalModulesHandler.instance().addConfig("Buildcraft", "bc.tankamount", "Liquid amount");
ExternalModulesHandler.instance().addConfig("Buildcraft", "bc.tanktype", "Liquid type");
//ExternalModulesHandler.instance().addConfigRemote("Buildcraft", "bc.powerpipe", "Power pipes");
ExternalModulesHandler.instance().registerHeadProvider(new HUDHandlerBCTanks(), TileTank);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerBCTanks(), TileTank);
//ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerBCPipes(), TileGenericPipe);
//ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerBCEngine(), TileEngine);
//ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerBCIPowerReceptor(), PipeTransportPower);
}
}
@@ -1,14 +1,14 @@
package mcp.mobius.waila.addons.magicalcrops;
package mcp.mobius.waila.addons.buildcraft;
import java.util.List;
import mcp.mobius.waila.cbcore.LangUtil;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
public class HUDHandlerMagicalCrops implements IWailaDataProvider {
public class HUDHandlerBCEngine implements IWailaDataProvider {
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
@@ -22,21 +22,22 @@ public class HUDHandlerMagicalCrops implements IWailaDataProvider {
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
if (!config.getConfig("general.showcrop")) return currenttip;
int growthStage = accessor.getMetadata();
float growthValue = (growthStage / 7.0F) * 100.0F;
if (growthValue < 100.0)
currenttip.add(String.format("%s : %.0f %%", LangUtil.translateG("hud.msg.growth"), growthValue));
else
currenttip.add(String.format("%s : %s", LangUtil.translateG("hud.msg.growth"), LangUtil.translateG("hud.msg.mature")));
NBTTagCompound tag = accessor.getNBTData();
if (tag.hasKey("energyF")){
//float output = tag.getFloat("energyF")*tag.getFloat("progress");
float output = tag.getFloat("energyF");
if (output > 1.0F)
currenttip.add(String.format("Output : %.1f MJ",output));
else
currenttip.add(String.format("Output : %.2f MJ",output));
}
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
}
@@ -0,0 +1,49 @@
package mcp.mobius.waila.addons.buildcraft;
import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
public class HUDHandlerBCIPowerReceptor implements IWailaDataProvider {
public HUDHandlerBCIPowerReceptor() {
// TODO Auto-generated constructor stub
}
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
return null;
}
@Override
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
// int powerRequest = 0;
// try{
// powerRequest = (Integer)BCModule.IPowerReceptor_PowerRequest.invoke(BCModule.IPowerReceptor.cast(accessor.getTileEntity()), ForgeDirection.UNKNOWN);
// }
// catch (Exception e){
// mod_Waila.log.log(Level.SEVERE, "[BC] Unhandled exception trying to access a tank for display !.\n" + String.valueOf(e));
// return currenttip;
// }
// currenttip.add(String.valueOf(powerRequest));
// NBTTagCompound tag = accessor.getNBTData();
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
@@ -0,0 +1,56 @@
package mcp.mobius.waila.addons.buildcraft;
import java.util.List;
import java.util.Map;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
import mcp.mobius.waila.tools.Reflect;
public class HUDHandlerBCPipes implements IWailaDataProvider {
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
return null;
}
@Override
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
NBTTagCompound tag = accessor.getNBTData();
if (this.hasPartialKey(tag, "internalNextPower") && config.getConfig("bc.powerpipe")){
double power = Math.max(0, this.getPartialKeySum(tag, "internalNextPower"));
currenttip.add(String.format("Power : %.1f MJ", power));
}
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
public boolean hasPartialKey(NBTTagCompound tag, String key){
Map tagMap = (Map)Reflect.getFieldValue("net.minecraft.nbt.NBTTagCompound", "tagMap", tag);
for (Object k : tagMap.keySet())
if (((String)k).contains(key))
return true;
return false;
}
public double getPartialKeySum(NBTTagCompound tag, String key){
double retVal = 0;
Map tagMap = (Map)Reflect.getFieldValue("net.minecraft.nbt.NBTTagCompound", "tagMap", tag);
for (Object k : tagMap.keySet())
if (((String)k).contains(key))
retVal += tag.getDouble((String)k);
return retVal;
}
}
@@ -5,17 +5,22 @@ import java.util.logging.Level;
//import buildcraft.factory.TileTank;
import mcp.mobius.waila.Waila;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.addons.ConfigHandler;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
import mcp.mobius.waila.api.impl.ConfigHandler;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import mcp.mobius.waila.cbcore.LangUtil;
import net.minecraftforge.liquids.ILiquidTank;
import net.minecraftforge.liquids.LiquidStack;
public class HUDHandlerBCTanks implements IWailaDataProvider {
@@ -34,7 +39,7 @@ public class HUDHandlerBCTanks implements IWailaDataProvider {
if (stack != null && ConfigHandler.instance().getConfig("bc.tanktype"))
name = name + " (" + stack.getFluid().getName() + ")";
else if (stack == null && ConfigHandler.instance().getConfig("bc.tanktype"))
name = name + " " + LangUtil.translateG("hud.msg.empty");
name = name + " <Empty>";
currenttip.set(0, name);
return currenttip;
}
@@ -62,7 +67,7 @@ public class HUDHandlerBCTanks implements IWailaDataProvider {
try{
tank = ((FluidTankInfo[])BCModule.TileTank_getTankInfo.invoke(BCModule.TileTank.cast(accessor.getTileEntity()), ForgeDirection.UNKNOWN))[0];
} catch (Exception e){
Waila.log.log(Level.SEVERE, "[BC] Unhandled exception trying to access a tank for display !.\n" + String.valueOf(e));
mod_Waila.log.log(Level.SEVERE, "[BC] Unhandled exception trying to access a tank for display !.\n" + String.valueOf(e));
return null;
}
return tank;
@@ -4,8 +4,8 @@ import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.logging.Level;
import mcp.mobius.waila.Waila;
import mcp.mobius.waila.api.impl.ModuleRegistrar;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.addons.ExternalModulesHandler;
public class EnderStorageModule {
@@ -15,14 +15,12 @@ public class EnderStorageModule {
public static Class EnderStorageManager = null;
public static Method GetColourFromFreq = null;
public static Class TileEnderTank = null;
public static void register(){
try{
Class EnderStorage = Class.forName("codechicken.enderstorage.EnderStorage");
Waila.log.log(Level.INFO, "EnderStorage mod found.");
mod_Waila.log.log(Level.INFO, "EnderStorage mod found.");
} catch (ClassNotFoundException e){
Waila.log.log(Level.INFO, "[EnderStorage] EnderStorage mod not found.");
mod_Waila.log.log(Level.INFO, "[EnderStorage] EnderStorage mod not found.");
return;
}
@@ -34,24 +32,21 @@ public class EnderStorageModule {
EnderStorageManager = Class.forName("codechicken.enderstorage.api.EnderStorageManager");
GetColourFromFreq = EnderStorageManager.getDeclaredMethod("getColourFromFreq", Integer.TYPE, Integer.TYPE);
TileEnderTank = Class.forName("codechicken.enderstorage.storage.liquid.TileEnderTank");
} catch (ClassNotFoundException e){
Waila.log.log(Level.WARNING, "[EnderStorage] Class not found. " + e);
mod_Waila.log.log(Level.WARNING, "[EnderStorage] Class not found. " + e);
return;
} catch (NoSuchMethodException e){
Waila.log.log(Level.WARNING, "[EnderStorage] Method not found." + e);
mod_Waila.log.log(Level.WARNING, "[EnderStorage] Method not found." + e);
return;
} catch (NoSuchFieldException e){
Waila.log.log(Level.WARNING, "[EnderStorage] Field not found." + e);
mod_Waila.log.log(Level.WARNING, "[EnderStorage] Field not found." + e);
return;
} catch (Exception e){
Waila.log.log(Level.WARNING, "[EnderStorage] Unhandled exception." + e);
mod_Waila.log.log(Level.WARNING, "[EnderStorage] Unhandled exception." + e);
return;
}
ModuleRegistrar.instance().addConfig("EnderStorage", "enderstorage.colors");
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerStorage(), TileFrequencyOwner);
ModuleRegistrar.instance().registerSyncedNBTKey("*", TileFrequencyOwner);
ExternalModulesHandler.instance().addConfig("EnderStorage", "enderstorage.colors", "Colors");
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerStorage(), TileFrequencyOwner);
}
}
@@ -2,33 +2,15 @@ package mcp.mobius.waila.addons.enderstorage;
import java.util.List;
import mcp.mobius.waila.cbcore.LangUtil;
import net.minecraft.item.ItemStack;
import mcp.mobius.waila.WailaExceptionHandler;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
import mcp.mobius.waila.utils.WailaExceptionHandler;
public class HUDHandlerStorage implements IWailaDataProvider {
private static String[] colors = {
LangUtil.translateG("hud.msg.white"),
LangUtil.translateG("hud.msg.orange"),
LangUtil.translateG("hud.msg.magenta"),
LangUtil.translateG("hud.msg.lblue"),
LangUtil.translateG("hud.msg.yellow"),
LangUtil.translateG("hud.msg.lime"),
LangUtil.translateG("hud.msg.pink"),
LangUtil.translateG("hud.msg.gray"),
LangUtil.translateG("hud.msg.lgray"),
LangUtil.translateG("hud.msg.cyan"),
LangUtil.translateG("hud.msg.purple"),
LangUtil.translateG("hud.msg.blue"),
LangUtil.translateG("hud.msg.brown"),
LangUtil.translateG("hud.msg.green"),
LangUtil.translateG("hud.msg.red"),
LangUtil.translateG("hud.msg.black")
};
private static String[] colors = {"White", "Orange", "Magenta", "LBlue", "Yellow", "Lime", "Pink", "Gray", "LGray", "Cyan", "Purple", "Blue", "Brown", "Green", "Red", "Black"};
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
@@ -44,18 +26,12 @@ public class HUDHandlerStorage implements IWailaDataProvider {
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
if(config.getConfig("enderstorage.colors")){
try{
int freq = EnderStorageModule.TileFrequencyOwner_Freq.getInt(accessor.getTileEntity());
int freqLeft = (Integer)EnderStorageModule.GetColourFromFreq.invoke(null, freq, 0);
int freqCenter = (Integer)EnderStorageModule.GetColourFromFreq.invoke(null, freq, 1);
int freqRight = (Integer)EnderStorageModule.GetColourFromFreq.invoke(null, freq, 2);
if (!EnderStorageModule.TileEnderTank.isInstance(accessor.getTileEntity()))
currenttip.add(String.format("%s/%s/%s", colors[freqLeft], colors[freqCenter], colors[freqRight]));
else
currenttip.add(String.format("%s/%s/%s", colors[freqRight], colors[freqCenter], colors[freqLeft]));
currenttip.add(String.format("%s/%s/%s", colors[freqLeft], colors[freqCenter], colors[freqRight]));
} catch (Exception e){
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
}
@@ -2,8 +2,8 @@ package mcp.mobius.waila.addons.gravestone;
import java.util.logging.Level;
import mcp.mobius.waila.Waila;
import mcp.mobius.waila.api.impl.ModuleRegistrar;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.addons.ExternalModulesHandler;
public class GravestoneModule {
@@ -13,21 +13,20 @@ public class GravestoneModule {
try{
Class ModGravestone = Class.forName("GraveStone.ModGraveStone");
Waila.log.log(Level.INFO, "GraveStone mod found.");
mod_Waila.log.log(Level.INFO, "GraveStone mod found.");
} catch (ClassNotFoundException e){
Waila.log.log(Level.INFO, "[GraveStone] GraveStone mod not found.");
mod_Waila.log.log(Level.INFO, "[GraveStone] GraveStone mod not found.");
return;
}
try {
BlockGraveStone = Class.forName("GraveStone.block.BlockGSGraveStone");
} catch (ClassNotFoundException e) {
Waila.log.log(Level.WARNING, "[GraveStone] Class not found. " + e);
mod_Waila.log.log(Level.WARNING, "[GraveStone] Class not found. " + e);
}
ModuleRegistrar.instance().registerStackProvider(new HUDHandlerGravestone(), BlockGraveStone);
ModuleRegistrar.instance().registerSyncedNBTKey("*", BlockGraveStone);
ExternalModulesHandler.instance().registerStackProvider(new HUDHandlerGravestone(), BlockGraveStone);
}
}
@@ -1,36 +1,26 @@
package mcp.mobius.waila.addons.agriculture;
package mcp.mobius.waila.addons.ic2;
import java.util.List;
import mcp.mobius.waila.cbcore.LangUtil;
import net.minecraft.item.ItemStack;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
public class HUDHandlerCrop implements IWailaDataProvider {
public class HUDHandlerDoor implements IWailaDataProvider {
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
return null;
return IC2Module.ReinforcedDoorStack;
}
@Override
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
return currenttip;
}
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
if (!config.getConfig("general.showcrop")) return currenttip;
int growthStage = accessor.getMetadata();
float growthValue = (growthStage / 6.0F) * 100.0F;
if (growthValue < 100.0)
currenttip.add(String.format("%s : %.0f %%", LangUtil.translateG("hud.msg.growth"), growthValue));
else
currenttip.add(String.format("%s : %s", LangUtil.translateG("hud.msg.growth"), LangUtil.translateG("hud.msg.mature")));
return currenttip;
}
@@ -0,0 +1,88 @@
package mcp.mobius.waila.addons.ic2;
import java.util.List;
import java.util.logging.Level;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.addons.ConfigHandler;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
public class HUDHandlerIC2IEnergySink implements IWailaDataProvider {
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
return null;
}
@Override
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
//if (accessor.getTileEntity() != null && TEElectricBlock.isInstance(accessor.getTileEntity())){
int maxinput = -1;
try{
if (IC2Module.IEnergySink.isInstance(accessor.getTileEntity()))
maxinput = (Integer)(IC2Module.IEnergySink_GetInput.invoke(IC2Module.IEnergySink.cast(accessor.getTileEntity())));
} catch (Exception e){
mod_Waila.log.log(Level.SEVERE, "[IC2] Unhandled exception trying to access an IEnergySink for display !.\n" + String.valueOf(e));
return currenttip;
}
int ntransformers = this.getTransformerUpgrades(accessor);
if (ntransformers > 0){
maxinput = maxinput * (int)Math.pow(4.0D, Math.min(3, ntransformers));
}
if (ConfigHandler.instance().getConfig("ic2.inputeuother") && (maxinput > 4096))
currenttip.add("IN : ANY");
else if (ConfigHandler.instance().getConfig("ic2.inputeuother") && (maxinput != -1) && !this.canUpgrade(accessor.getNBTData()))
currenttip.add(String.format("IN : %s EU/t", maxinput));
else if (ConfigHandler.instance().getConfig("ic2.inputeumach") && (maxinput != -1) && this.canUpgrade(accessor.getNBTData()))
currenttip.add(String.format("IN : %s EU/t", maxinput));
if (config.getConfig("ic2.storage"))
if (accessor.getNBTData().hasKey("energy") && !IC2Module.IEnergyStorage.isInstance(accessor.getTileEntity()))
currenttip.add(String.format("Storage : %s EU", accessor.getNBTInteger(accessor.getNBTData(), "energy")));
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
public boolean canUpgrade(NBTTagCompound tag){
if (tag.hasKey("InvSlots"))
if (tag.getCompoundTag("InvSlots").hasKey("upgrade"))
return true;
return false;
}
public int getTransformerUpgrades(IWailaDataAccessor accessor){
NBTTagCompound tag = accessor.getNBTData();
if (!canUpgrade(tag)) return -1;
int ntransformers = 0;
NBTTagList contents = tag.getCompoundTag("InvSlots").getCompoundTag("upgrade").getTagList("Contents");
for (NBTTagCompound subtag : (List<NBTTagCompound>)contents.tagList){
ItemStack currentSlot = new ItemStack(accessor.getNBTInteger(subtag, "id"),accessor.getNBTInteger(subtag, "Count"),accessor.getNBTInteger(subtag, "Damage"));
if (IC2Module.TransformerUpgradeStack.isItemEqual(currentSlot)){
ntransformers += currentSlot.stackSize;
}
}
return ntransformers;
}
}
@@ -0,0 +1,52 @@
package mcp.mobius.waila.addons.ic2;
import java.util.List;
import java.util.logging.Level;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.addons.ConfigHandler;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
import net.minecraft.item.ItemStack;
public class HUDHandlerIC2IEnergySource implements IWailaDataProvider {
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
return null;
}
@Override
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
//if (accessor.getTileEntity() != null && TEElectricBlock.isInstance(accessor.getTileEntity())){
int output = -1;
try{
if (IC2Module.IEnergySource.isInstance(accessor.getTileEntity()))
output = (Integer)(IC2Module.IEnergySource_GetOutput.invoke(IC2Module.IEnergySource.cast(accessor.getTileEntity())));
} catch (Exception e){
mod_Waila.log.log(Level.SEVERE, "[IC2] Unhandled exception trying to access an IEnergySource for display !.\n" + String.valueOf(e));
return currenttip;
}
if (ConfigHandler.instance().getConfig("ic2.outputeu") && (output != -1))
currenttip.add(String.format("OUT : %s EU/t", output));
if (config.getConfig("ic2.storage"))
if (accessor.getNBTData().hasKey("storage") && !IC2Module.IEnergyStorage.isInstance(accessor.getTileEntity()))
currenttip.add(String.format("Storage : %s EU", accessor.getNBTInteger(accessor.getNBTData(), "storage")));
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
@@ -0,0 +1,52 @@
package mcp.mobius.waila.addons.ic2;
import java.util.List;
import java.util.logging.Level;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
import net.minecraft.item.ItemStack;
public class HUDHandlerIC2IEnergyStorage implements IWailaDataProvider {
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
return null;
}
@Override
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
if (!config.getConfig("ic2.storage"))
return currenttip;
int stored = -1;
int capacity = -1;
try{
if (IC2Module.IEnergyStorage.isInstance(accessor.getTileEntity()))
capacity = (Integer)(IC2Module.IEnergyStorage_GetCapacity.invoke(IC2Module.IEnergyStorage.cast(accessor.getTileEntity())));
} catch (Exception e){
mod_Waila.log.log(Level.SEVERE, "[IC2] Unhandled exception trying to access an IEnergyStorage for display !.\n" + String.valueOf(e));
return currenttip;
}
if (accessor.getNBTData().hasKey("energy"))
stored = accessor.getNBTInteger(accessor.getNBTData(), "energy");
if ((capacity != -1) && (stored != -1))
currenttip.add(String.format("%s/%s EU", stored, capacity));
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
@@ -0,0 +1,91 @@
package mcp.mobius.waila.addons.ic2;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.logging.Level;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.addons.ExternalModulesHandler;
import net.minecraft.item.ItemStack;
public class IC2Module {
/* Our interfaces */
public static Class IEnergyStorage = null;
public static Class IEnergySink = null;
public static Class IEnergySource = null;
/* Methods interfaces */
public static Method IEnergyStorage_GetCapacity = null;
public static Method IEnergySink_GetInput = null;
public static Method IEnergySource_GetOutput = null;
/* Some required items */
public static Class IC2Items = null;
public static Field TransformerUpgrade = null;
public static ItemStack TransformerUpgradeStack = null;
public static Field EnergyStorageUpgrade = null;
public static ItemStack EnergyStorageUpgradeStack = null;
/* Fix for doors */
public static Class BlockIC2Door = null;
public static Field ReinforcedDoor = null;
public static ItemStack ReinforcedDoorStack = null;
public static void register(){
try{
Class ModIndustrialCraft = Class.forName("ic2.core.IC2");
mod_Waila.log.log(Level.INFO, "Industrialcraft2 mod found.");
} catch (ClassNotFoundException e){
mod_Waila.log.log(Level.INFO, "[IC2] Industrialcraft2 mod not found.");
return;
}
try{
IEnergyStorage = Class.forName("ic2.api.tile.IEnergyStorage");
IEnergySink = Class.forName("ic2.api.energy.tile.IEnergySink");
IEnergySource = Class.forName("ic2.api.energy.tile.IEnergySource");
IEnergySink_GetInput = IEnergySink.getMethod("getMaxSafeInput");
IEnergySource_GetOutput = IEnergySource.getMethod("getMaxEnergyOutput");
IEnergyStorage_GetCapacity = IEnergyStorage.getMethod("getCapacity");
IC2Items = Class.forName("ic2.core.Ic2Items");
TransformerUpgrade = IC2Items.getDeclaredField("transformerUpgrade");
EnergyStorageUpgrade = IC2Items.getDeclaredField("energyStorageUpgrade");
TransformerUpgradeStack = (ItemStack)TransformerUpgrade.get(null);
EnergyStorageUpgradeStack = (ItemStack)EnergyStorageUpgrade.get(null);
BlockIC2Door = Class.forName("ic2.core.block.BlockIC2Door");
ReinforcedDoor = IC2Items.getDeclaredField("reinforcedDoor");
ReinforcedDoorStack = (ItemStack)ReinforcedDoor.get(null);
} catch (ClassNotFoundException e){
mod_Waila.log.log(Level.WARNING, "[IC2] Class not found. " + e);
return;
} catch (NoSuchMethodException e){
mod_Waila.log.log(Level.WARNING, "[IC2] Method not found." + e);
return;
} catch (NoSuchFieldException e){
mod_Waila.log.log(Level.WARNING, "[IC2] Field not found." + e);
return;
} catch (Exception e){
mod_Waila.log.log(Level.WARNING, "[IC2] Unhandled exception." + e);
return;
}
ExternalModulesHandler.instance().addConfigRemote("IndustrialCraft2", "ic2.inputeumach", "Max EU input [Machines]");
ExternalModulesHandler.instance().addConfig("IndustrialCraft2", "ic2.inputeuother", "Max EU input [Other]");
ExternalModulesHandler.instance().addConfig("IndustrialCraft2", "ic2.outputeu", "Max EU output");
ExternalModulesHandler.instance().addConfigRemote("IndustrialCraft2", "ic2.storage", "Energy stored");
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerIC2IEnergySink(), IEnergySink);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerIC2IEnergySource(), IEnergySource);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerIC2IEnergyStorage(), IEnergyStorage);
ExternalModulesHandler.instance().registerStackProvider(new HUDHandlerDoor(), BlockIC2Door);
}
}
@@ -1,15 +1,14 @@
package mcp.mobius.waila.addons.thermalexpansion;
package mcp.mobius.waila.addons.thaumcraft;
import java.util.List;
import mcp.mobius.waila.cbcore.LangUtil;
import net.minecraft.item.ItemStack;
import mcp.mobius.waila.WailaExceptionHandler;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
import mcp.mobius.waila.utils.WailaExceptionHandler;
import net.minecraft.item.ItemStack;
public class HUDHandlerEnergyCell implements IWailaDataProvider {
public class HUDHandlerCapacitor implements IWailaDataProvider {
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
@@ -23,19 +22,22 @@ public class HUDHandlerEnergyCell implements IWailaDataProvider {
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
if (!config.getConfig("thermalexpansion.energycell")) return currenttip;
int energyReceive = accessor.getNBTInteger(accessor.getNBTData(), "Recv");
int energySend = accessor.getNBTInteger(accessor.getNBTData(), "Send");
currenttip.add(String.format("%s/%s : %d / %d RF/t", LangUtil.translateG("hud.msg.in"), LangUtil.translateG("hud.msg.out"), energyReceive, energySend));
if (config.getConfig("thaumcraft.storedvis")){
try{
short storedVis = ThaumcraftModule.TileCrystalCapacitor_StoredVis.getShort(accessor.getTileEntity());
short maxVis = ThaumcraftModule.TileCrystalCapacitor_MaxVis.getShort(accessor.getTileEntity());
currenttip.add(String.format("%s/%s vis", storedVis, maxVis));
}catch (Exception e){
currenttip = WailaExceptionHandler.handleErr(e, accessor.getClass().getName(), currenttip);
}
}
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
}
@@ -1,19 +1,17 @@
package mcp.mobius.waila.addons.harvestcraft;
package mcp.mobius.waila.addons.thaumcraft;
import java.util.List;
import mcp.mobius.waila.cbcore.LangUtil;
import net.minecraft.item.ItemStack;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
import mcp.mobius.waila.utils.NBTUtil;
public class HUDHandlerPamCrop implements IWailaDataProvider {
public class HUDHandlerLeaves implements IWailaDataProvider {
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
return null;
return new ItemStack(accessor.getBlock(), 0, accessor.getMetadata());
}
@Override
@@ -23,22 +21,11 @@ public class HUDHandlerPamCrop implements IWailaDataProvider {
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
if (!config.getConfig("general.showcrop")) return currenttip;
int growthStage = NBTUtil.getNBTInteger(accessor.getNBTData(), "growthStage");
float growthValue = (growthStage / 2.0F) * 100.0F;
if (growthValue < 100.0)
currenttip.add(String.format("%s : %.0f %%", LangUtil.translateG("hud.msg.growth"), growthValue));
else
currenttip.add(String.format("%s : %s", LangUtil.translateG("hud.msg.growth"), LangUtil.translateG("hud.msg.mature")));
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
}
@@ -0,0 +1,30 @@
package mcp.mobius.waila.addons.thaumcraft;
import java.util.List;
import net.minecraft.item.ItemStack;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
public class HUDHandlerPlants implements IWailaDataProvider {
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
return new ItemStack(accessor.getBlock(), 0, accessor.getMetadata());
}
@Override
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
@@ -0,0 +1,57 @@
package mcp.mobius.waila.addons.thaumcraft;
import java.lang.reflect.Field;
import java.util.logging.Level;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.addons.ExternalModulesHandler;
public class ThaumcraftModule {
public static Class BlockMagicalLeaves = null;
public static Class BlockCustomPlant = null;
public static Class TileCrystalCapacitor = null;
public static Field TileCrystalCapacitor_StoredVis = null;
public static Field TileCrystalCapacitor_MaxVis = null;
public static void register(){
try{
Class ModThaumcraft = Class.forName("thaumcraft.common.Thaumcraft");
mod_Waila.log.log(Level.INFO, "Thaumcraft mod found.");
} catch (ClassNotFoundException e){
mod_Waila.log.log(Level.INFO, "[Thaumcraft] Thaumcraft mod not found.");
return;
}
try{
BlockMagicalLeaves = Class.forName("thaumcraft.common.world.BlockMagicalLeaves");
BlockCustomPlant = Class.forName("thaumcraft.common.world.BlockCustomPlant");
TileCrystalCapacitor = Class.forName("thaumcraft.common.tiles.TileCrystalCapacitor");
TileCrystalCapacitor_StoredVis = TileCrystalCapacitor.getField("storedVis");
TileCrystalCapacitor_MaxVis = TileCrystalCapacitor.getField("maxVis");
} catch (ClassNotFoundException e){
mod_Waila.log.log(Level.WARNING, "[Thaumcraft] Class not found. " + e);
return;
// } catch (NoSuchMethodException e){
// mod_Waila.log.log(Level.WARNING, "[Thaumcraft] Method not found." + e);
// return;
} catch (NoSuchFieldException e){
mod_Waila.log.log(Level.WARNING, "[Thaumcraft] Field not found." + e);
return;
// } catch (Exception e){
// mod_Waila.log.log(Level.WARNING, "[Thaumcraft] Unhandled exception." + e);
// return;
}
ExternalModulesHandler.instance().addConfig("Thaumcraft", "thaumcraft.storedvis", "Capacitor storage");
ExternalModulesHandler.instance().registerStackProvider(new HUDHandlerLeaves(), BlockMagicalLeaves);
ExternalModulesHandler.instance().registerStackProvider(new HUDHandlerPlants(), BlockCustomPlant);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerCapacitor(), TileCrystalCapacitor);
}
}
@@ -2,8 +2,8 @@ package mcp.mobius.waila.addons.twilightforest;
import java.util.logging.Level;
import mcp.mobius.waila.Waila;
import mcp.mobius.waila.api.impl.ModuleRegistrar;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.addons.ExternalModulesHandler;
public class TwilightForestModule {
@@ -15,9 +15,9 @@ public class TwilightForestModule {
try{
Class TwilightForestMod = Class.forName("twilightforest.TwilightForestMod");
Waila.log.log(Level.INFO, "TwilightForestMod mod found.");
mod_Waila.log.log(Level.INFO, "TwilightForestMod mod found.");
} catch (ClassNotFoundException e){
Waila.log.log(Level.INFO, "[TwilightForestMod] TwilightForestMod mod not found.");
mod_Waila.log.log(Level.INFO, "[TwilightForestMod] TwilightForestMod mod not found.");
return;
}
@@ -26,16 +26,13 @@ public class TwilightForestModule {
BlockTFPlant = Class.forName("twilightforest.block.BlockTFPlant");
BlockTFSapling = Class.forName("twilightforest.block.BlockTFSapling");
} catch (ClassNotFoundException e) {
Waila.log.log(Level.WARNING, "[TwilightForestMod] Class not found. " + e);
mod_Waila.log.log(Level.WARNING, "[TwilightForestMod] Class not found. " + e);
}
ModuleRegistrar.instance().registerStackProvider(new TwilightForestGenericOverride(), BlockTFRoots);
ModuleRegistrar.instance().registerStackProvider(new TwilightForestGenericOverride(), BlockTFPlant);
//ExternalModulesHandler.instance().registerStackProvider(new TwilightForestGenericOverride(), BlockTFSapling);
ModuleRegistrar.instance().registerSyncedNBTKey("*", BlockTFRoots);
ModuleRegistrar.instance().registerSyncedNBTKey("*", BlockTFPlant);
ExternalModulesHandler.instance().registerStackProvider(new TwilightForestGenericOverride(), BlockTFRoots);
ExternalModulesHandler.instance().registerStackProvider(new TwilightForestGenericOverride(), BlockTFPlant);
//ExternalModulesHandler.instance().registerStackProvider(new TwilightForestGenericOverride(), BlockTFSapling);
}
}
@@ -0,0 +1,151 @@
package mcp.mobius.waila.addons.vanillamc;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemRecord;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntityMobSpawner;
import mcp.mobius.waila.addons.ExternalModulesHandler;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
public class HUDHandlerVanilla implements IWailaDataProvider {
static int mobSpawnerID = Block.mobSpawner.blockID;
static int cropsID = Block.crops.blockID;
static int melonStemID = Block.melonStem.blockID;
static int pumpkinStemID = Block.pumpkinStem.blockID;
static int carrotID = Block.carrot.blockID;
static int potatoID = Block.potato.blockID;
static int leverID = Block.lever.blockID;
static int repeaterIdle = Block.redstoneRepeaterIdle.blockID;
static int repeaterActv = Block.redstoneRepeaterActive.blockID;
static int comparatorIdl = Block.redstoneComparatorIdle.blockID;
static int comparatorAct = Block.redstoneComparatorActive.blockID;
static int redstone = Block.redstoneWire.blockID;
static int jukebox = Block.jukebox.blockID;
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
return null;
}
@Override
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
int blockID = accessor.getBlockID();
/* Mob spawner handler */
if (blockID == mobSpawnerID && accessor.getTileEntity() instanceof TileEntityMobSpawner && config.getConfig("vanilla.spawntype")){
String name = currenttip.get(0);
String mobname = ((TileEntityMobSpawner)accessor.getTileEntity()).getSpawnerLogic().getEntityNameToSpawn();
currenttip.set(0, String.format("%s (%s)", name, mobname));
}
if (blockID == redstone){
String name = currenttip.get(0).replaceFirst(String.format(" %s", accessor.getMetadata()), "");
currenttip.set(0, name);
}
return currenttip;
}
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
int blockID = accessor.getBlockID();
/* Crops */
if (config.getConfig("vanilla.growthvalue"))
if (blockID == cropsID || blockID == melonStemID || blockID == pumpkinStemID || blockID == carrotID || blockID == potatoID){
float growthValue = (accessor.getMetadata() / 7.0F) * 100.0F;
if (growthValue != 100.0)
currenttip.add(String.format("Growth : %.0f %%", growthValue));
else
currenttip.add("Growth : Mature");
return currenttip;
}
if (config.getConfig("vanilla.leverstate"))
if (blockID == leverID){
String redstoneOn = (accessor.getMetadata() & 8) == 0 ? "Off" : "On";
currenttip.add("State : " + redstoneOn);
return currenttip;
}
if (config.getConfig("vanilla.repeater"))
if ((blockID == repeaterIdle) ||(blockID == repeaterActv)){
int tick = (accessor.getMetadata() >> 2) + 1 ;
if (tick == 1)
currenttip.add(String.format("Delay : %s tick", tick));
else
currenttip.add(String.format("Delay : %s ticks", tick));
return currenttip;
}
if (config.getConfig("vanilla.comparator"))
if ((blockID == comparatorIdl) ||(blockID == comparatorAct)){
String mode = ((accessor.getMetadata() >> 2) & 1) == 0 ? "Comparator" : "Subtractor";
//int outputSignal = ((TileEntityComparator)entity).func_96100_a();
currenttip.add("Mode : " + mode);
//currenttip.add(String.format("Out : %s", outputSignal));
return currenttip;
}
if (config.getConfig("vanilla.redstone"))
if (blockID == redstone){
currenttip.add(String.format("Power : %s" , accessor.getMetadata()));
return currenttip;
}
if (config.getConfig("vanilla.jukebox"))
if (blockID == jukebox){
NBTTagCompound tag = accessor.getNBTData();
Item record = null;
if (tag.hasKey("Record")){
record = Item.itemsList[accessor.getNBTInteger(tag, "Record")];
currenttip.add(((ItemRecord)record).getRecordTitle());
} else {
currenttip.add("<Empty>");
}
}
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
public static void register(){
ExternalModulesHandler.instance().addConfig("VanillaMC", "vanilla.spawntype", "Spawner type");
ExternalModulesHandler.instance().addConfig("VanillaMC", "vanilla.growthvalue", "Growth value");
ExternalModulesHandler.instance().addConfig("VanillaMC", "vanilla.leverstate", "Lever state");
ExternalModulesHandler.instance().addConfig("VanillaMC", "vanilla.repeater", "Repeater delay");
ExternalModulesHandler.instance().addConfig("VanillaMC", "vanilla.comparator", "Comparator mode");
ExternalModulesHandler.instance().addConfig("VanillaMC", "vanilla.redstone", "Redstone power");
ExternalModulesHandler.instance().addConfigRemote("VanillaMC", "vanilla.jukebox", "Jukebox disk");
ExternalModulesHandler.instance().registerHeadProvider(new HUDHandlerVanilla(), mobSpawnerID);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerVanilla(), cropsID);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerVanilla(), melonStemID);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerVanilla(), pumpkinStemID);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerVanilla(), carrotID);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerVanilla(), potatoID);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerVanilla(), leverID);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerVanilla(), repeaterIdle);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerVanilla(), repeaterActv);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerVanilla(), comparatorIdl);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerVanilla(), comparatorAct);
ExternalModulesHandler.instance().registerHeadProvider(new HUDHandlerVanilla(), redstone);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerVanilla(), redstone);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerVanilla(), jukebox);
ExternalModulesHandler.instance().registerDocTextFile("/mcp/mobius/waila/addons/vanillamc/WikiData.csv");
}
}
@@ -4,7 +4,6 @@ import java.util.List;
import net.minecraft.item.ItemStack;
@Deprecated
public interface IWailaBlock {
/*
* Use this method to return an item stack in case the default lookup system fails.
@@ -24,5 +24,5 @@ public interface IWailaConfigHandler {
/* Returns the current value of an option (true/false) with a default value true if not set*/
public boolean getConfig(String key);
//public void setConfig(String key, boolean value);
public void setConfig(String key, boolean value);
}
@@ -0,0 +1,20 @@
package mcp.mobius.waila.api;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public interface IWailaDataAccessor {
World getWorld();
EntityPlayer getPlayer();
Block getBlock();
int getBlockID();
int getMetadata();
TileEntity getTileEntity();
MovingObjectPosition getPosition();
NBTTagCompound getNBTData();
int getNBTInteger(NBTTagCompound tag, String keyname);
}
@@ -0,0 +1,4 @@
package mcp.mobius.waila.api;
public interface IWailaDataProvider extends IWailaBlock{
}
+26
View File
@@ -0,0 +1,26 @@
package mcp.mobius.waila.api;
public interface IWailaRegistrar {
/* Add a config option in the section modname with displayed text configtext and access key keyname */
public void addConfig(String modname, String keyname, String configtext);
public void addConfigRemote(String modname, String keyname, String configtext);
/* Register a IWailaDataProvider for the given blockID, either for the Head section or the Body section */
public void registerHeadProvider (IWailaDataProvider dataProvider, int blockID);
public void registerBodyProvider (IWailaDataProvider dataProvider, int blockID);
public void registerTailProvider (IWailaDataProvider dataProvider, int blockID);
/* Register a stack overrider for the given blockID */
public void registerStackProvider(IWailaDataProvider dataProvider, int blockID);
public void registerStackProvider(IWailaDataProvider dataProvider, Class block);
/* Same thing, but works on a class hierarchy instead */
public void registerHeadProvider (IWailaDataProvider dataProvider, Class block);
public void registerBodyProvider (IWailaDataProvider dataProvider, Class block);
public void registerTailProvider (IWailaDataProvider dataProvider, Class block);
public void registerDocTextFile (String filename);
public void registerShortDataProvider (IWailaSummaryProvider dataProvider, Class item);
}
@@ -0,0 +1,58 @@
package mcp.mobius.waila.gui.helpers;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.renderer.Tessellator;
public class UIHelper {
public static void drawTexture(int posX, int posY, int sizeX, int sizeY)
{
UIHelper.drawTexture(posX, posY, sizeX, sizeY, 0, 0, 256, 256);
}
public static void drawTexture(int posX, int posY, int sizeX, int sizeY, int texU, int texV, int texSizeU, int texSizeV)
{
float zLevel = 0.0F;
float f = 0.00390625F;
Tessellator tess = Tessellator.instance;
tess.startDrawingQuads();
tess.addVertexWithUV((double)(posX + 0), (double)(posY + sizeY), (double)zLevel, texU*f, (texV + texSizeV)*f);
tess.addVertexWithUV((double)(posX + sizeX), (double)(posY + sizeY), (double)zLevel, (texU + texSizeU)*f, (texV + texSizeV)*f);
tess.addVertexWithUV((double)(posX + sizeX), (double)(posY + 0), (double)zLevel, (texU + texSizeU)*f, texV*f);
tess.addVertexWithUV((double)(posX + 0), (double)(posY + 0), (double)zLevel, texU*f, texV*f);
tess.draw();
}
public static void drawGradientRect(int minx, int miny, int maxx, int maxy, int zlevel, int color1, int color2)
{
float alpha1 = (float)(color1 >> 24 & 255) / 255.0F;
float red1 = (float)(color1 >> 16 & 255) / 255.0F;
float green1 = (float)(color1 >> 8 & 255) / 255.0F;
float blue1 = (float)(color1 & 255) / 255.0F;
float alpha2 = (float)(color2 >> 24 & 255) / 255.0F;
float red2 = (float)(color2 >> 16 & 255) / 255.0F;
float green2 = (float)(color2 >> 8 & 255) / 255.0F;
float blue2 = (float)(color2 & 255) / 255.0F;
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_ALPHA_TEST);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glShadeModel(GL11.GL_SMOOTH);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(red1, green1, blue1, alpha1);
tessellator.addVertex((double)maxx, (double)miny, (double)zlevel);
tessellator.addVertex((double)minx, (double)miny, (double)zlevel);
tessellator.setColorRGBA_F(red2, green2, blue2, alpha2);
tessellator.addVertex((double)minx, (double)maxy, (double)zlevel);
tessellator.addVertex((double)maxx, (double)maxy, (double)zlevel);
tessellator.draw();
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glEnable(GL11.GL_TEXTURE_2D);
}
}
@@ -1,5 +1,6 @@
package mcp.mobius.waila.gui.screens.config;
import mcp.mobius.waila.Constants;
import mcp.mobius.waila.gui.interfaces.CType;
import mcp.mobius.waila.gui.interfaces.WAlign;
import mcp.mobius.waila.gui.screens.ScreenBase;
@@ -9,7 +10,6 @@ import mcp.mobius.waila.gui.widgets.buttons.ButtonBooleanConfig;
import mcp.mobius.waila.gui.widgets.buttons.ButtonContainer;
import mcp.mobius.waila.gui.widgets.buttons.ButtonContainerLabel;
import mcp.mobius.waila.gui.widgets.buttons.ButtonScreenChange;
import mcp.mobius.waila.utils.Constants;
import net.minecraft.client.gui.GuiScreen;
public class ScreenConfig extends ScreenBase {
@@ -21,12 +21,12 @@ public class ScreenConfig extends ScreenBase {
ButtonContainer buttonContainer = ((ButtonContainer)this.getRoot().getWidget("ButtonContainer"));
buttonContainer.addButton( new ButtonScreenChange(this.getRoot(), "screen.button.waila", new ScreenWailaConfig(this)));
buttonContainer.addButton( new ButtonScreenChange(this.getRoot(), "screen.button.modules", new ScreenModuleChoice(this)));
buttonContainer.addButton( new ButtonScreenChange(this.getRoot(), "Waila", new ScreenWailaConfig(this)));
buttonContainer.addButton( new ButtonScreenChange(this.getRoot(), "Modules", new ScreenModuleChoice(this)));
this.getRoot().addWidget("LayoutBack", new LayoutBase(this.getRoot()));
this.getRoot().getWidget("LayoutBack").setGeometry(new WidgetGeometry(0.0, 80.0, 100.0, 20.0, CType.RELXY, CType.RELXY));
this.getRoot().getWidget("LayoutBack").addWidget("ButtonBack", new ButtonScreenChange(this.getRoot().getWidget("LayoutBack"), "screen.button.back", this.parent));
this.getRoot().getWidget("LayoutBack").addWidget("ButtonBack", new ButtonScreenChange(this.getRoot().getWidget("LayoutBack"), "Back", this.parent));
this.getRoot().getWidget("LayoutBack").getWidget("ButtonBack").setGeometry(new WidgetGeometry(50.0, 50.0, 100.0, 20.0, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
}
}
@@ -2,8 +2,9 @@ package mcp.mobius.waila.gui.screens.config;
import org.lwjgl.util.Point;
import mcp.mobius.waila.Waila;
import mcp.mobius.waila.api.impl.ConfigHandler;
import mcp.mobius.waila.Constants;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.addons.ConfigHandler;
import mcp.mobius.waila.gui.events.MouseEvent;
import mcp.mobius.waila.gui.interfaces.CType;
import mcp.mobius.waila.gui.interfaces.IWidget;
@@ -18,10 +19,7 @@ import mcp.mobius.waila.gui.widgets.WidgetGeometry;
import mcp.mobius.waila.gui.widgets.buttons.ButtonLabel;
import mcp.mobius.waila.gui.widgets.buttons.ButtonScreenChange;
import mcp.mobius.waila.gui.widgets.movable.PictureMovableRC;
import mcp.mobius.waila.overlay.OverlayConfig;
import mcp.mobius.waila.utils.Constants;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.common.config.Configuration;
public class ScreenHUDConfig extends ScreenBase {
@@ -50,17 +48,17 @@ public class ScreenHUDConfig extends ScreenBase {
layoutY.addWidget("ValueDisplayY", new LabelFixedFont(null, "0")).setGeometry(new WidgetGeometry(50.0,50.0,20,20, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
*/
double picX = ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_POSX,0) / 100.0;
double picY = ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_POSY,0) / 100.0;
float picAlpha = ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_ALPHA,0) / 100.0f;
scale = ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SCALE,0) / 100.0f;
double picX = ConfigHandler.instance().getConfigInt(Constants.CFG_WAILA_POSX) / 100.0;
double picY = ConfigHandler.instance().getConfigInt(Constants.CFG_WAILA_POSY) / 100.0;
float picAlpha = ConfigHandler.instance().getConfigInt(Constants.CFG_WAILA_ALPHA) / 100.0f;
scale = ConfigHandler.instance().getConfigInt(Constants.CFG_WAILA_SCALE) / 100.0f;
int picSX = (int)(180 / this.rez.getScaleFactor() * scale), picSY = (int)(62 / this.rez.getScaleFactor() * scale);
this.addWidget("Layout", new LayoutMargin(null), RenderPriority.HIGH);
((LayoutMargin)this.getWidget("Layout")).setMargins(picSX/2, picSX/2, picSY/2, picSY/2);
this.getWidget("Layout").addWidget("Picture", new PictureMovableRC(null, "waila:textures/config_template.png")).setGeometry(new WidgetGeometry(picX, picY, picSX, picSY,CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
this.addWidget("TextTuto1", new LabelFixedFont(null, "screen.label.dragtuto")).setGeometry(new WidgetGeometry(50.0, 30.0,20,20, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));;
this.addWidget("TextTuto1", new LabelFixedFont(null, "Drag the HUD to setup its position.")).setGeometry(new WidgetGeometry(50.0, 30.0,20,20, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));;
IWidget layoutX = this.addWidget("LayoutX", new LayoutBase(this));
layoutX.setGeometry(new WidgetGeometry(35.0,50.0,20,80,CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
@@ -85,15 +83,15 @@ public class ScreenHUDConfig extends ScreenBase {
IWidget layoutScale = this.addWidget("LayoutScale", new LayoutBase(this));
layoutScale.setGeometry(new WidgetGeometry(65.0,50.0,20,80,CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
layoutScale.addWidget("LabelScale", new LabelFixedFont(null, "screen.label.scale")).setGeometry(new WidgetGeometry(50.0, 0.0,20,20, CType.REL_X, CType.ABSXY, WAlign.CENTER, WAlign.TOP));
layoutScale.addWidget("LabelScale", new LabelFixedFont(null, "Scale")).setGeometry(new WidgetGeometry(50.0, 0.0,20,20, CType.REL_X, CType.ABSXY, WAlign.CENTER, WAlign.TOP));
layoutScale.addWidget("ButtonScaleAdd", new ButtonLabel(null, "+")) .setGeometry(new WidgetGeometry(0.0, 10.0,20,20, CType.REL_X, CType.ABSXY, WAlign.LEFT, WAlign.TOP));
layoutScale.addWidget("ValueDisplayScale", new LabelFixedFont(null, "0")) .setGeometry(new WidgetGeometry(50.0, 40.0,20,20, CType.REL_X, CType.ABSXY, WAlign.CENTER, WAlign.TOP));
layoutScale.addWidget("ButtonScaleSub", new ButtonLabel(null, "-")) .setGeometry(new WidgetGeometry(0.0, 60.0,20,20, CType.REL_X, CType.ABSXY, WAlign.LEFT, WAlign.TOP));
this.addWidget("ButtonCancel", new ButtonScreenChange(null, "screen.button.cancel", prevScreen)).setGeometry(new WidgetGeometry(70.0,97.0,75,20, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.BOTTOM));
this.addWidget("ButtonOk", new ButtonScreenChange(null, "screen.button.ok", prevScreen)).setGeometry(new WidgetGeometry(30.0,97.0,75,20, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.BOTTOM));
this.addWidget("ButtonDefault",new ButtonLabel(null, "screen.button.default")).setGeometry(new WidgetGeometry(50.0,97.0,75,20, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.BOTTOM));
this.addWidget("ButtonCancel", new ButtonScreenChange(null, "Cancel", prevScreen)).setGeometry(new WidgetGeometry(70.0,97.0,75,20, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.BOTTOM));
this.addWidget("ButtonOk", new ButtonScreenChange(null, "Ok", prevScreen)).setGeometry(new WidgetGeometry(30.0,97.0,75,20, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.BOTTOM));
this.addWidget("ButtonDefault",new ButtonLabel(null, "Default")).setGeometry(new WidgetGeometry(50.0,97.0,75,20, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.BOTTOM));
@@ -221,17 +219,17 @@ public class ScreenHUDConfig extends ScreenBase {
}
if (srcwidget.equals(this.getWidget("ButtonOk")) && signal == Signal.CLICKED){
ConfigHandler.instance().setConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_POSX, (int)(this.getWidget("Layout").getWidget("Picture").getGeometry().getRawPos().getX() * 100.0));
ConfigHandler.instance().setConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_POSY, (int)(this.getWidget("Layout").getWidget("Picture").getGeometry().getRawPos().getY() * 100.0));
ConfigHandler.instance().setConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_ALPHA, (int)(this.getWidget("Layout").getWidget("Picture").getAlpha() * 100.0));
ConfigHandler.instance().setConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SCALE, (int)(scale * 100.0));
ConfigHandler.instance().setConfigInt(Constants.CFG_WAILA_POSX, (int)(this.getWidget("Layout").getWidget("Picture").getGeometry().getRawPos().getX() * 100.0));
ConfigHandler.instance().setConfigInt(Constants.CFG_WAILA_POSY, (int)(this.getWidget("Layout").getWidget("Picture").getGeometry().getRawPos().getY() * 100.0));
ConfigHandler.instance().setConfigInt(Constants.CFG_WAILA_ALPHA, (int)(this.getWidget("Layout").getWidget("Picture").getAlpha() * 100.0));
ConfigHandler.instance().setConfigInt(Constants.CFG_WAILA_SCALE, (int)(scale * 100.0));
OverlayConfig.alpha = ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_ALPHA,0);
OverlayConfig.posX = ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_POSX, 0);
OverlayConfig.posY = ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_POSY, 0);
OverlayConfig.scale = ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SCALE,0) / 100.0f;
mod_Waila.alpha = ConfigHandler.instance().getConfigInt(Constants.CFG_WAILA_ALPHA);
mod_Waila.posX = ConfigHandler.instance().getConfigInt(Constants.CFG_WAILA_POSX);
mod_Waila.posY = ConfigHandler.instance().getConfigInt(Constants.CFG_WAILA_POSY);
mod_Waila.scale = ConfigHandler.instance().getConfigInt(Constants.CFG_WAILA_SCALE) / 100.0f;
OverlayConfig.updateColors();
mod_Waila.updateColors();
}
if (srcwidget.equals(this.getWidget("ButtonDefault")) && signal == Signal.CLICKED){
@@ -1,6 +1,6 @@
package mcp.mobius.waila.gui.screens.config;
import mcp.mobius.waila.api.impl.ConfigHandler;
import mcp.mobius.waila.addons.ConfigHandler;
import mcp.mobius.waila.gui.interfaces.CType;
import mcp.mobius.waila.gui.interfaces.WAlign;
import mcp.mobius.waila.gui.screens.ScreenBase;
@@ -8,6 +8,7 @@ import mcp.mobius.waila.gui.widgets.LayoutBase;
import mcp.mobius.waila.gui.widgets.WidgetGeometry;
import mcp.mobius.waila.gui.widgets.buttons.ButtonContainer;
import mcp.mobius.waila.gui.widgets.buttons.ButtonScreenChange;
import mcp.mobius.waila.gui_old.widget_old.ButtonChangeScreen;
import net.minecraft.client.gui.GuiScreen;
public class ScreenModuleChoice extends ScreenBase {
@@ -1,6 +1,6 @@
package mcp.mobius.waila.gui.screens.config;
import mcp.mobius.waila.api.impl.ConfigHandler;
import mcp.mobius.waila.addons.ConfigHandler;
import mcp.mobius.waila.gui.interfaces.CType;
import mcp.mobius.waila.gui.interfaces.WAlign;
import mcp.mobius.waila.gui.screens.ScreenBase;
@@ -11,7 +11,8 @@ import mcp.mobius.waila.gui.widgets.buttons.ButtonBooleanConfigRemote;
import mcp.mobius.waila.gui.widgets.buttons.ButtonContainer;
import mcp.mobius.waila.gui.widgets.buttons.ButtonContainerLabel;
import mcp.mobius.waila.gui.widgets.buttons.ButtonScreenChange;
import mcp.mobius.waila.utils.Constants;
import mcp.mobius.waila.gui_old.widget_old.ButtonConfigOption;
import mcp.mobius.waila.gui_old.widget_old.ButtonConfigRemote;
import net.minecraft.client.gui.GuiScreen;
public class ScreenModuleConfig extends ScreenBase {
@@ -30,9 +31,9 @@ public class ScreenModuleConfig extends ScreenBase {
for (String key:ConfigHandler.instance().getConfigKeys(this.modName).keySet()){
if (ConfigHandler.instance().isServerRequired(key))
buttonContainer.addButton(new ButtonBooleanConfigRemote(this.getRoot(), Constants.CATEGORY_MODULES, key, "screen.button.no", "screen.button.yes"), ConfigHandler.instance().getConfigKeys(this.modName).get(key));
buttonContainer.addButton(new ButtonBooleanConfigRemote(this.getRoot(), key, "No", "Yes"), ConfigHandler.instance().getConfigKeys(this.modName).get(key));
else
buttonContainer.addButton(new ButtonBooleanConfig(this.getRoot(), Constants.CATEGORY_MODULES, key, "screen.button.no", "screen.button.yes"), ConfigHandler.instance().getConfigKeys(this.modName).get(key));
buttonContainer.addButton(new ButtonBooleanConfig(this.getRoot(), key, "No", "Yes"), ConfigHandler.instance().getConfigKeys(this.modName).get(key));
//buttonContainer.addButton(new ButtonConfigRemote(-1, "No", "Yes", ConfigHandler.instance().getConfigKeys(this.modName).get(key), key ));
//else
//buttonContainer.addButton(new ButtonConfigOption(-1, "No", "Yes", ConfigHandler.instance().getConfigKeys(this.modName).get(key), key ));
@@ -40,7 +41,7 @@ public class ScreenModuleConfig extends ScreenBase {
this.getRoot().addWidget("LayoutBack", new LayoutBase(this.getRoot()));
this.getRoot().getWidget("LayoutBack").setGeometry(new WidgetGeometry(0.0, 80.0, 100.0, 20.0, CType.RELXY, CType.RELXY));
this.getRoot().getWidget("LayoutBack").addWidget("ButtonBack", new ButtonScreenChange(this.getRoot().getWidget("LayoutBack"), "screen.button.back", this.parent));
this.getRoot().getWidget("LayoutBack").addWidget("ButtonBack", new ButtonScreenChange(this.getRoot().getWidget("LayoutBack"), "Back", this.parent));
this.getRoot().getWidget("LayoutBack").getWidget("ButtonBack").setGeometry(new WidgetGeometry(50.0, 50.0, 100.0, 20.0, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
}
@@ -1,7 +1,7 @@
package mcp.mobius.waila.gui.screens.config;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.common.config.Configuration;
import mcp.mobius.waila.Constants;
import mcp.mobius.waila.gui.interfaces.CType;
import mcp.mobius.waila.gui.interfaces.WAlign;
import mcp.mobius.waila.gui.screens.ScreenBase;
@@ -11,7 +11,6 @@ import mcp.mobius.waila.gui.widgets.buttons.ButtonBooleanConfig;
import mcp.mobius.waila.gui.widgets.buttons.ButtonContainerLabel;
import mcp.mobius.waila.gui.widgets.buttons.ButtonIntegerConfig;
import mcp.mobius.waila.gui.widgets.buttons.ButtonScreenChange;
import mcp.mobius.waila.utils.Constants;
public class ScreenWailaConfig extends ScreenBase {
public ScreenWailaConfig(GuiScreen parent){
@@ -22,22 +21,20 @@ public class ScreenWailaConfig extends ScreenBase {
ButtonContainerLabel buttonContainer = ((ButtonContainerLabel)this.getRoot().getWidget("ButtonContainer"));
buttonContainer.addButton( new ButtonBooleanConfig(this.getRoot(), Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, true, true, "screen.button.hidden", "screen.button.visible"), "choice.showhidewaila");
buttonContainer.addButton( new ButtonBooleanConfig(this.getRoot(), Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_MODE, true, true, "screen.button.maintained", "screen.button.toggled"), "choice.toggledmaintained");
buttonContainer.addButton( new ButtonBooleanConfig(this.getRoot(), Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_METADATA, true, false,"screen.button.hidden", "screen.button.visible"), "choice.showhideidmeta");
buttonContainer.addButton( new ButtonBooleanConfig(this.getRoot(), Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_LIQUID, true, false,"screen.button.hidden", "screen.button.visible"), "choice.showliquids");
buttonContainer.addButton( new ButtonBooleanConfig(this.getRoot(), Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHIFTBLOCK, true, false,"screen.button.no", "screen.button.yes"), "choice.shifttoggledblock");
buttonContainer.addButton( new ButtonBooleanConfig(this.getRoot(), Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHIFTENTS, true, false,"screen.button.no", "screen.button.yes"), "choice.shifttoggledents");
buttonContainer.addButton( new ButtonBooleanConfig(this.getRoot(), Constants.CFG_WAILA_SHOW, true, true, "Hidden", "Visible"), "Show/Hide Waila");
buttonContainer.addButton( new ButtonBooleanConfig(this.getRoot(), Constants.CFG_WAILA_MODE, true, true, "Maintained", "Toggled"), "Toggled/Maintained");
buttonContainer.addButton( new ButtonBooleanConfig(this.getRoot(), Constants.CFG_WAILA_METADATA, true, false,"Hidden", "Visible"), "Show ID:Metadata");
buttonContainer.addButton( new ButtonBooleanConfig(this.getRoot(), Constants.CFG_WAILA_LIQUID, true, false,"Hidden", "Visible"), "Liquids");
this.getRoot().addWidget("LayoutConfigPos", new LayoutBase(this.getRoot()));
this.getRoot().getWidget("LayoutConfigPos").setGeometry(new WidgetGeometry(0.0, 50.0, 100.0, 20.0, CType.RELXY, CType.RELXY));
this.getRoot().getWidget("LayoutConfigPos").addWidget("ButtonConfigPos", new ButtonScreenChange(null, "screen.button.configureaspect", new ScreenHUDConfig(this)));
this.getRoot().getWidget("LayoutConfigPos").addWidget("ButtonConfigPos", new ButtonScreenChange(null, "Configure aspect ...", new ScreenHUDConfig(this)));
this.getRoot().getWidget("LayoutConfigPos").getWidget("ButtonConfigPos").setGeometry(new WidgetGeometry(50.0, 50.0, 150.0, 20.0, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
this.getRoot().addWidget("LayoutBack", new LayoutBase(this.getRoot()));
this.getRoot().getWidget("LayoutBack").setGeometry(new WidgetGeometry(0.0, 80.0, 100.0, 20.0, CType.RELXY, CType.RELXY));
this.getRoot().getWidget("LayoutBack").addWidget("ButtonBack", new ButtonScreenChange(null, "screen.button.back", this.parent));
this.getRoot().getWidget("LayoutBack").addWidget("ButtonBack", new ButtonScreenChange(null, "Back", this.parent));
this.getRoot().getWidget("LayoutBack").getWidget("ButtonBack").setGeometry(new WidgetGeometry(50.0, 50.0, 100.0, 20.0, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
}
}
@@ -1,6 +1,5 @@
package mcp.mobius.waila.gui.screens.info;
import mcp.mobius.waila.cbcore.LangUtil;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.item.ItemStack;
import mcp.mobius.waila.gui.interfaces.CType;
@@ -30,15 +29,10 @@ public class ScreenEnchants extends ScreenBase {
.setGeometry(new WidgetGeometry(40.0, 22.0, 16.0, 16.0, CType.ABSXY, CType.REL_X, WAlign.LEFT, WAlign.BOTTOM));
this.getRoot().addWidget("Table", new ViewTable(null))
.setGeometry(new WidgetGeometry(50.0, 50.0, 90.0, 80.0, CType.REL_X, CType.RELXY, WAlign.CENTER, WAlign.TOP));
.setGeometry(new WidgetGeometry(50.0, 50.0, 90.0, 90.0, CType.REL_X, CType.RELXY, WAlign.CENTER, WAlign.TOP));
String columnName = "\u00a7a\u00a7o" + LangUtil.translateG("enchant.title.name");
String columnMinLvl= "\u00a7a\u00a7o" + LangUtil.translateG("enchant.title.minlvl");;
String columnMaxLvl= "\u00a7a\u00a7o" + LangUtil.translateG("enchant.title.maxlvl");;
String columnWeight= "\u00a7a\u00a7o" + LangUtil.translateG("enchant.title.weight");;
((ViewTable)this.getRoot().getWidget("Table"))
.setColumnsTitle(columnName, columnMinLvl, columnMaxLvl, columnWeight, "\u00a7a\u00a7oMod")
.setColumnsTitle("\u00a7a\u00a7oName","\u00a7a\u00a7oMin lvl","\u00a7a\u00a7oMax lvl","\u00a7a\u00a7oWeight", "\u00a7a\u00a7oMod")
.setColumnsWidth(35.0, 10.0, 10.0, 10.0, 35.0)
.setColumnsAlign(WAlign.LEFT, WAlign.CENTER, WAlign.CENTER, WAlign.CENTER, WAlign.LEFT);
}
@@ -65,7 +59,7 @@ public class ScreenEnchants extends ScreenBase {
}
public ScreenEnchants setEnchantability(String value){
((LabelFixedFont)this.getRoot().getWidget("Layout_Title").getWidget("LabelEnchantability")).setText(String.format("%s : %s", LangUtil.translateG("enchant.label.enchantability"), value));
((LabelFixedFont)this.getRoot().getWidget("Layout_Title").getWidget("LabelEnchantability")).setText(String.format("Enchantability : %s", value));
this.getRoot().getWidget("Layout_Title").adjustSize();
return this;
}
@@ -7,7 +7,7 @@ import net.minecraft.item.ItemStack;
import org.lwjgl.opengl.GL11;
import org.lwjgl.util.Point;
import codechicken.nei.guihook.GuiContainerManager;
import codechicken.nei.forge.GuiContainerManager;
public class ItemStackDisplay extends WidgetBase {
@@ -8,8 +8,6 @@ import net.minecraft.util.ResourceLocation;
import org.lwjgl.util.Point;
import mcp.mobius.waila.cbcore.LangUtil;
public class LabelFixedFont extends WidgetBase {
protected String text = "";
@@ -35,7 +33,7 @@ public class LabelFixedFont extends WidgetBase {
}
public void setText(String text){
this.text = LangUtil.translateG(text);
this.text = text;
this.updateGeometry();
}
@@ -54,7 +52,6 @@ public class LabelFixedFont extends WidgetBase {
public void draw(Point pos) {
this.saveGLState();
this.mc.fontRenderer.drawString(this.text, pos.getX(), pos.getY(), this.color);
//this.mc.fontRenderer.drawString(this.text, pos.getX(), pos.getY(), this.color);
this.loadGLState();
}
}
@@ -25,7 +25,7 @@ public class LayoutCanvas extends LayoutBase{
@Override
public void draw(){
this.rez = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
this.rez = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
this.setGeometry(0, 0, this.rez.getScaledWidth(), this.rez.getScaledHeight(), CType.ABSXY, CType.ABSXY);
/*
@@ -22,7 +22,7 @@ public class LayoutCropping extends LayoutBase {
@Override
public void draw(){
this.rez = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
this.rez = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
this.saveGLState();
GL11.glEnable(GL11.GL_BLEND);
@@ -22,7 +22,7 @@ public class PictureDisplay extends WidgetBase {
this.saveGLState();
GL11.glPushMatrix();
this.texManager.bindTexture(texture);
this.texManager.func_110577_a(texture);
UIHelper.drawTexture(pos.getX(), pos.getY(), this.getSize().getX(), this.getSize().getY());
GL11.glPopMatrix();
@@ -27,7 +27,7 @@ public class PictureSwitch extends WidgetBase {
ResourceLocation texture = mouseOver ? this.texture2 : this.texture1;
GL11.glPushMatrix();
this.texManager.bindTexture(texture);
this.texManager.func_110577_a(texture);
UIHelper.drawTexture(pos.getX(), pos.getY(), this.getSize().getX(), this.getSize().getY());
GL11.glPopMatrix();
@@ -43,7 +43,7 @@ public abstract class WidgetBase implements IWidget {
public WidgetBase(){
this.setParent(null);
this.mc = Minecraft.getMinecraft();
this.rez = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
this.rez = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
this.texManager = this.mc.renderEngine;
this.setGeometry(new WidgetGeometry(0, 0, 50, 50, CType.ABSXY, CType.ABSXY));
}
@@ -51,7 +51,7 @@ public abstract class WidgetBase implements IWidget {
public WidgetBase(IWidget parent){
this.setParent(parent);
this.mc = Minecraft.getMinecraft();
this.rez = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
this.rez = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
this.texManager = this.mc.renderEngine;
this.setGeometry(new WidgetGeometry(0, 0, 50, 50, CType.ABSXY, CType.ABSXY));
}
@@ -6,7 +6,6 @@ import mcp.mobius.waila.gui.interfaces.IWidget;
import mcp.mobius.waila.gui.interfaces.Signal;
import mcp.mobius.waila.gui.widgets.LabelFixedFont;
import mcp.mobius.waila.gui.widgets.WidgetBase;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
@@ -43,7 +42,7 @@ public abstract class ButtonBase extends WidgetBase {
if (this.mouseOver)
texOffset = 1;
this.mc.getTextureManager().bindTexture(widgetsTexture);
this.mc.func_110434_K().func_110577_a(widgetsTexture);
UIHelper.drawTexture(this.getPos().getX(), this.getPos().getY(), this.getSize().getX(), this.getSize().getY(), 0, 66 + texOffset*20, 200, 20);
this.loadGLState();
@@ -67,7 +66,7 @@ public abstract class ButtonBase extends WidgetBase {
@Override
public void onMouseClick(MouseEvent event){
if (event.button == 0)
this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
this.mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
this.emit(Signal.CLICKED, event.button);
}
@@ -0,0 +1,46 @@
package mcp.mobius.waila.gui.widgets.buttons;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.Property;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.gui.events.MouseEvent;
import mcp.mobius.waila.gui.interfaces.IWidget;
public class ButtonBooleanConfig extends ButtonBoolean {
private String configKey;
private boolean instant;
public ButtonBooleanConfig(IWidget parent, String configKey, String textFalse, String textTrue){
this(parent, configKey, true, true, textFalse, textTrue);
}
public ButtonBooleanConfig(IWidget parent, String configKey, boolean instant, boolean state_, String textFalse, String textTrue){
super(parent, textFalse, textTrue);
this.configKey = configKey;
this.instant = instant;
mod_Waila.instance.config.load();
Property prop = mod_Waila.instance.config.get(Configuration.CATEGORY_GENERAL, this.configKey, state_);
this.state = prop.getBoolean(state_);
if (this.state){
this.getWidget("LabelTrue").show();
this.getWidget("LabelFalse").hide();
} else {
this.getWidget("LabelTrue").hide();
this.getWidget("LabelFalse").show();
}
}
@Override
public void onMouseClick(MouseEvent event){
super.onMouseClick(event);
if (this.instant){
mod_Waila.instance.config.getCategory(Configuration.CATEGORY_GENERAL).put(this.configKey, new Property(this.configKey,String.valueOf(this.state),Property.Type.BOOLEAN));
mod_Waila.instance.config.save();
}
}
}
@@ -3,9 +3,9 @@ package mcp.mobius.waila.gui.widgets.buttons;
import org.lwjgl.opengl.GL11;
import org.lwjgl.util.Point;
import net.minecraftforge.common.config.Configuration;
import mcp.mobius.waila.Waila;
import mcp.mobius.waila.api.impl.ConfigHandler;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.Property;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.gui.events.MouseEvent;
import mcp.mobius.waila.gui.helpers.UIHelper;
import mcp.mobius.waila.gui.interfaces.IWidget;
@@ -13,13 +13,13 @@ import mcp.mobius.waila.gui.widgets.LabelFixedFont;
public class ButtonBooleanConfigRemote extends ButtonBooleanConfig {
public ButtonBooleanConfigRemote(IWidget parent, String category, String configKey, String textFalse, String textTrue){
this(parent, category, configKey, true, true, textFalse, textTrue);
public ButtonBooleanConfigRemote(IWidget parent, String configKey, String textFalse, String textTrue){
this(parent, configKey, true, true, textFalse, textTrue);
}
public ButtonBooleanConfigRemote(IWidget parent, String category, String configKey, boolean instant, boolean state_, String textFalse, String textTrue){
super(parent, category, configKey, instant, state_, textFalse, textTrue);
if (!Waila.instance.serverPresent)
public ButtonBooleanConfigRemote(IWidget parent, String configKey, boolean instant, boolean state_, String textFalse, String textTrue){
super(parent, configKey, instant, state_, textFalse, textTrue);
if (!mod_Waila.instance.serverPresent)
this.state = false;
if (this.state){
@@ -33,18 +33,18 @@ public class ButtonBooleanConfigRemote extends ButtonBooleanConfig {
@Override
public void onMouseClick(MouseEvent event){
if ((Waila.instance.serverPresent) && !ConfigHandler.instance().forcedConfigs.containsKey(this.configKey))
if (mod_Waila.instance.serverPresent)
super.onMouseClick(event);
}
@Override
public void draw(Point pos) {
if ((Waila.instance.serverPresent) && !ConfigHandler.instance().forcedConfigs.containsKey(this.configKey))
if (mod_Waila.instance.serverPresent)
super.draw(pos);
else{
this.saveGLState();
int texOffset = -1;
this.mc.getTextureManager().bindTexture(widgetsTexture);
this.mc.func_110434_K().func_110577_a(widgetsTexture);
UIHelper.drawTexture(this.getPos().getX(), this.getPos().getY(), this.getSize().getX(), this.getSize().getY(), 0, 66 + texOffset*20, 200, 20);
this.loadGLState();
}
@@ -0,0 +1,47 @@
package mcp.mobius.waila.gui.widgets.buttons;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.Property;
import org.lwjgl.util.Point;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.gui.events.MouseEvent;
import mcp.mobius.waila.gui.interfaces.IWidget;
import mcp.mobius.waila.gui.widgets.WidgetBase;
public class ButtonIntegerConfig extends ButtonInteger {
private String configKey;
private boolean instant;
public ButtonIntegerConfig(IWidget parent, String configKey, String... texts){
this(parent, configKey, true, 0, texts);
}
public ButtonIntegerConfig(IWidget parent, String configKey, boolean instant, int state_, String... texts){
super(parent, texts);
this.configKey = configKey;
this.instant = instant;
mod_Waila.instance.config.load();
Property prop = mod_Waila.instance.config.get(Configuration.CATEGORY_GENERAL, this.configKey, state_);
this.state = prop.getInt();
for (int i = 0; i < this.nStates; i++)
this.getWidget(String.format("Label_%d", i)).hide();
this.getWidget(String.format("Label_%d", state)).show();
}
@Override
public void onMouseClick(MouseEvent event){
super.onMouseClick(event);
if (this.instant){
mod_Waila.instance.config.getCategory(Configuration.CATEGORY_GENERAL).put(this.configKey, new Property(this.configKey,String.valueOf(this.state),Property.Type.INTEGER));
mod_Waila.instance.config.save();
}
}
}
@@ -58,7 +58,7 @@ public class PictureMovableRC extends WidgetBase {
this.saveGLState();
GL11.glPushMatrix();
this.texManager.bindTexture(texture);
this.texManager.func_110577_a(texture);
UIHelper.drawTexture(pos.getX(), pos.getY(), this.getSize().getX(), this.getSize().getY());
GL11.glPopMatrix();
@@ -0,0 +1,57 @@
package mcp.mobius.waila.gui_old;
import mcp.mobius.waila.gui_old.widget.ContainerTable;
import mcp.mobius.waila.gui_old.widget.Label;
import mcp.mobius.waila.gui_old.widget.StackDisplay;
import net.minecraft.client.gui.GuiScreen;
public class GuiEnchantScreen extends BaseWailaScreen {
public ContainerTable widTable;
public StackDisplay widStackDisplay;
public Label widStackName;
public Label widStackEnchantability;
public GuiEnchantScreen(GuiScreen _parentGui) {
super(_parentGui);
this.zLevel = -1.0F;
this.widTable = new ContainerTable(this);
this.widStackDisplay = new StackDisplay(this);
this.widStackName = new Label(this);
this.widStackEnchantability = new Label(this);
this.widTable.setColumns(8, "\u00a7a\u00a7oName", "\u00a7a\u00a7oMin lvl", "\u00a7a\u00a7oMax lvl", "\u00a7a\u00a7oMod");
this.widTable.setHeight(this.res.getScaledHeight() - 16 - 32);
this.addWidget("datatable", this.widTable);
this.addWidget("stackdisplay", this.widStackDisplay);
this.addWidget("stackname", this.widStackName);
this.addWidget("stackenchant", this.widStackEnchantability);
}
@Override
/* Here we draw anything special, and super takes care of the buttons for us */
public void drawScreen(int i, int j, float f)
{
//this.parentGui.drawScreen(i, j, f);
//this.parentGui.allowUserInput = false;
super.drawScreen(i, j, f);
widTable.draw(this.getXCentered(widTable.getWidth()), 32, 0);
widStackDisplay.draw(this.getXCentered(widTable.getWidth()), 0, 0);
widStackName.draw(this.getXCentered(widTable.getWidth())+32, 0, 0);
widStackEnchantability.draw(this.getXCentered(widTable.getWidth())+32, 8, 0);
}
@Override
public void initGui()
{
}
@Override
public void drawDefaultBackground()
{
this.drawGradientRect(0, 0, this.width, this.height, 0xdd000000, 0xdd000000);
}
}
@@ -3,6 +3,8 @@ package mcp.mobius.waila.gui_old.NEI;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import codechicken.core.ReflectionManager;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.FuelRecipeHandler;
@@ -12,7 +14,13 @@ import codechicken.nei.recipe.TemplateRecipeHandler;
import codechicken.nei.recipe.TemplateRecipeHandler.CachedRecipe;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.ShapedRecipes;
import net.minecraft.item.crafting.ShapelessRecipes;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
public class CraftingTreeNode {
@@ -161,7 +169,6 @@ public class CraftingTreeNode {
return curratedStacks;
}
@Override
public String toString(){
return this.elements.toString();
}
@@ -0,0 +1,171 @@
package mcp.mobius.waila.gui_old.NEI;
import java.lang.reflect.Method;
import mcp.mobius.waila.Constants;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.gui_old.GuiEnchantScreen;
import mcp.mobius.waila.gui_old.widget.Label;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import codechicken.nei.NEIClientConfig;
import codechicken.nei.forge.IContainerInputHandler;
public class HandlerEnchantment implements IContainerInputHandler {
static Class EplusApi;
static Method Tooltip;
@Override
public boolean keyTyped(GuiContainer gui, char keyChar, int keyCode) {
// TODO Auto-generated method stub
return false;
}
@Override
public void onKeyTyped(GuiContainer gui, char keyChar, int keyID) {
// TODO Auto-generated method stub
}
@Override
public boolean lastKeyTyped(GuiContainer gui, char keyChar, int keyID) {
ItemStack stackover = gui.manager.getStackMouseOver();
if(stackover == null)
return false;
if(keyID == NEIClientConfig.getKeyBinding(Constants.BIND_SCREEN_ENCH)){
//try{
int itemEnchantability = stackover.getItem().getItemEnchantability();
if (itemEnchantability == 0){return false;}
Minecraft mc = Minecraft.getMinecraft();
GuiEnchantScreen enchantScreen = new GuiEnchantScreen(mc.currentScreen);
enchantScreen.widStackDisplay.setStack(stackover);
enchantScreen.widStackName.setLabel("\u00a7f" + stackover.getDisplayName());
enchantScreen.widStackEnchantability.setLabel(String.format("\u00a7fEnchantability : %s", itemEnchantability));
Enchantment[] enchants = null;
if (stackover.getItem() == Item.book)
enchants = Enchantment.enchantmentsBookList;
else
enchants = Enchantment.enchantmentsList;
for(Enchantment enchant : enchants){
if (enchant == null){continue;}
if (enchant.canApplyAtEnchantingTable(stackover) || stackover.getItem() == Item.book){
for (int lvl = enchant.getMinLevel(); lvl <= enchant.getMaxLevel(); lvl++){
int minEnchantEnchantability = enchant.getMinEnchantability(lvl);
int maxEnchantEnchantability = enchant.getMaxEnchantability(lvl);
int minItemEnchantability = 1;
int meanItemEnchantability = 1 + itemEnchantability/4;
int maxItemEnchantability = 1 + itemEnchantability/2;
int minModifiedEnchantability = (int)(0.85*minItemEnchantability + 0.5);
int meanModifiedEnchantability = (int)(1.00*meanItemEnchantability + 0.5);
int maxModifiedEnchantability = (int)(1.15*maxItemEnchantability + 0.5);
int minLevel = (int) ((minEnchantEnchantability - minModifiedEnchantability)/1.15);
int maxLevel = (int) ((maxEnchantEnchantability - maxModifiedEnchantability)/0.85);
int meanMinLevel = (int) ((minEnchantEnchantability - meanModifiedEnchantability)/1.0);
int meanMaxLevel = (int) ((maxEnchantEnchantability - meanModifiedEnchantability)/1.0);
enchantScreen.widTable.addRow(new Label(enchant.getTranslatedName(lvl)),
new Label(String.valueOf(minLevel)),
new Label(String.valueOf(maxLevel)),
//new Label(String.valueOf(meanMinLevel)),
//new Label(String.valueOf(meanMaxLevel)),
new Label("\u00a79\u00a7o"+ this.getEnchantModName(enchant))
);
//String description = this.getEnchantmentToolTip(enchant);
}
}
}
mc.displayGuiScreen(enchantScreen);
//}
//catch (NullPointerException e){
// System.out.printf("%s\n", e);
//}
}
return false;
}
public String getEnchantModName(Enchantment enchant){
String enchantPath = enchant.getClass().getProtectionDomain().getCodeSource().getLocation().toString();
String enchantModName = "<Unknown>";
for (String s: mod_Waila.instance.modSourceList.keySet())
if (enchantPath.contains(s))
enchantModName = mod_Waila.instance.modSourceList.get(s);
if (enchantModName.equals("Minecraft Coder Pack"))
enchantModName = "Minecraft";
return enchantModName;
}
@Override
public boolean mouseClicked(GuiContainer gui, int mousex, int mousey,
int button) {
// TODO Auto-generated method stub
return false;
}
@Override
public void onMouseClicked(GuiContainer gui, int mousex, int mousey,
int button) {
// TODO Auto-generated method stub
}
@Override
public void onMouseUp(GuiContainer gui, int mousex, int mousey, int button) {
// TODO Auto-generated method stub
}
@Override
public boolean mouseScrolled(GuiContainer gui, int mousex, int mousey,
int scrolled) {
// TODO Auto-generated method stub
return false;
}
@Override
public void onMouseScrolled(GuiContainer gui, int mousex, int mousey,
int scrolled) {
// TODO Auto-generated method stub
}
@Override
public void onMouseDragged(GuiContainer gui, int mousex, int mousey,
int button, long heldTime) {
// TODO Auto-generated method stub
}
private String getEnchantmentToolTip(Enchantment enchantment) {
try {
if (EplusApi == null) {
EplusApi = Class.forName("eplus.api.EplusApi");
}
if (Tooltip == null) {
Tooltip = EplusApi.getMethod("getEnchantmentToolTip", Enchantment.class);
}
return String.valueOf(Tooltip.invoke(null, enchantment));
} catch (Exception e) {
return "";
}
}
}
@@ -2,12 +2,23 @@ package mcp.mobius.waila.gui_old.NEI;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import mcp.mobius.waila.Constants;
import mcp.mobius.waila.gui_old.GuiIngameWiki;
import mcp.mobius.waila.gui_old.GuiTechTree;
import mcp.mobius.waila.gui_old.widget.ComponentDisplay;
import mcp.mobius.waila.gui_old.widget.StackDisplay;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.ShapedRecipes;
import net.minecraft.item.crafting.ShapelessRecipes;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import codechicken.nei.NEIClientConfig;
import codechicken.nei.forge.IContainerInputHandler;
@@ -4,12 +4,12 @@ import java.util.LinkedHashMap;
import mcp.mobius.waila.Constants;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.api.impl.ConfigHandler;
import mcp.mobius.waila.api.impl.ModuleRegistrar;
import mcp.mobius.waila.addons.ConfigHandler;
import mcp.mobius.waila.addons.ExternalModulesHandler;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.gui_old.GuiIngameWiki;
import mcp.mobius.waila.gui_old.widget.Label;
import mcp.mobius.waila.handlers.SummaryProvider;
import mcp.mobius.waila.tools.ModIdentification;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
@@ -19,26 +19,26 @@ import codechicken.nei.forge.IContainerInputHandler;
public class HandlerWiki implements IContainerInputHandler {
public String getDescriptionString(String modid, String name, String meta){
if (ModuleRegistrar.instance().hasDocTextModID(modid)){
if (ExternalModulesHandler.instance().hasDocTextModID(modid)){
//Do we have an direct entry for this item ?
if (ModuleRegistrar.instance().hasDocTextItem(modid, name)){
if (ExternalModulesHandler.instance().hasDocTextItem(modid, name)){
//We check if we have an exact match, a wildcard match and finally, an meta 0 match
if (ModuleRegistrar.instance().hasDocTextMeta(modid, name, meta)){
return ModuleRegistrar.instance().getDocText(modid, name, meta);
} else if (ModuleRegistrar.instance().hasDocTextSpecificMeta(modid, name, "*")){
return ModuleRegistrar.instance().getDocText(modid, name, "*");
} else if (ModuleRegistrar.instance().hasDocTextSpecificMeta(modid, name, "0")){
return ModuleRegistrar.instance().getDocText(modid, name, "0");
if (ExternalModulesHandler.instance().hasDocTextMeta(modid, name, meta)){
return ExternalModulesHandler.instance().getDocText(modid, name, meta);
} else if (ExternalModulesHandler.instance().hasDocTextSpecificMeta(modid, name, "*")){
return ExternalModulesHandler.instance().getDocText(modid, name, "*");
} else if (ExternalModulesHandler.instance().hasDocTextSpecificMeta(modid, name, "0")){
return ExternalModulesHandler.instance().getDocText(modid, name, "0");
}
} else if (ModuleRegistrar.instance().getDoxTextWildcardMatch(modid, name) != null) {
String key = ModuleRegistrar.instance().getDoxTextWildcardMatch(modid, name);
if (ModuleRegistrar.instance().hasDocTextMeta(modid, key, meta)){
return ModuleRegistrar.instance().getDocText(modid, key, meta);
} else if (ModuleRegistrar.instance().hasDocTextSpecificMeta(modid, key, "*")){
return ModuleRegistrar.instance().getDocText(modid, key, "*");
} else if (ModuleRegistrar.instance().hasDocTextSpecificMeta(modid, key, "0")){
return ModuleRegistrar.instance().getDocText(modid, key, "0");
} else if (ExternalModulesHandler.instance().getDoxTextWildcardMatch(modid, name) != null) {
String key = ExternalModulesHandler.instance().getDoxTextWildcardMatch(modid, name);
if (ExternalModulesHandler.instance().hasDocTextMeta(modid, key, meta)){
return ExternalModulesHandler.instance().getDocText(modid, key, meta);
} else if (ExternalModulesHandler.instance().hasDocTextSpecificMeta(modid, key, "*")){
return ExternalModulesHandler.instance().getDocText(modid, key, "*");
} else if (ExternalModulesHandler.instance().hasDocTextSpecificMeta(modid, key, "0")){
return ExternalModulesHandler.instance().getDocText(modid, key, "0");
}
}
@@ -58,7 +58,7 @@ public class HandlerWiki implements IContainerInputHandler {
Minecraft mc = Minecraft.getMinecraft();
GuiIngameWiki wikiScreen = new GuiIngameWiki(mc.currentScreen);
wikiScreen.widReader.setText(this.getDescriptionString(ModIdentification.idFromStack(stackover), stackover.getItemName(), String.valueOf(stackover.getItemDamage())));
wikiScreen.widReader.setText(this.getDescriptionString(mod_Waila.instance.getModID(stackover), stackover.getItemName(), String.valueOf(stackover.getItemDamage())));
wikiScreen.widStack.setStack(stackover);
wikiScreen.widItemName.setLabel(stackover.getDisplayName());
Loaded 100 of 258 files, more files were not shown because too many files have changed in this diff. Show more