Compare commits

...
163 Commits
Author SHA1 Message Date
Thomas Guimbretiere 42170ca050 Fixed wrong msgs on empty and microblocks. 2013-12-23 13:40:21 +01:00
Thomas Guimbretiere f9868afde1 Added support for Railcraft tanks. 2013-12-21 00:09:53 +01:00
Thomas Guimbretiere 4e79797cd1 Added support for OpenBlocks tanks. 2013-12-20 23:16:11 +01:00
Thomas Guimbretiere 921b245273 Added support for ExtraUtilities drums 2013-12-20 22:31:09 +01:00
Thomas Guimbretiere 2cbaeca169 Fixed Thermal Expansion conduits. 2013-12-20 21:52:53 +01:00
Thomas Guimbretiere bc344cab41 Added tag 1.4.3 for changeset 1c391d52f3d9 2013-12-17 18:59:24 +01:00
Thomas Guimbretiere 7a2fd4363c Mute the discovery errors from IC2.
Moved the module registration to very late events.
2013-12-17 18:40:55 +01:00
Thomas Guimbretiere 11d0f86320 Updated RU translation
Removed fluked file.
2013-12-12 16:26:28 +01:00
Thomas Guimbretiere d83fb8fe76 Added side getter to the accessor.
Version bump.
2013-12-09 14:08:18 +01:00
Thomas Guimbretiere a36013c28c Fixed a derp with air blocks... 2013-12-09 14:01:52 +01:00
Thomas Guimbretiere 1934171e5a Merge 2013-12-07 01:34:18 +01:00
Thomas Guimbretiere 4b2e873261 Merged in Vexatos/waila-1/Vexatos/de_delang-edited-online-with-bitbucket-1386187266977 (pull request #5)
de_DE.lang edited online with Bitbucket
2013-12-07 01:38:27 +01:00
Thomas Guimbretiere 6319cbd425 Localization 2013-12-07 01:33:57 +01:00
Vexatos 72ae5eccb3 de_DE.lang edited online with Bitbucket 2013-12-04 20:01:17 +00:00
Thomas Guimbretiere 5d1c7d532f Added tag 1.4.1 for changeset f9daea609042 2013-11-26 16:29:14 +01:00
Thomas Guimbretiere afb9549da9 Done with options & localization. 2013-11-26 16:28:54 +01:00
Thomas Guimbretiere 0d749d80ae [IC2] Added trade-o-mat display. 2013-11-26 01:57:29 +01:00
Thomas Guimbretiere 050fd992c6 [IC2] Fixed display for geothermal & semifluid generators. 2013-11-26 01:35:12 +01:00
Thomas Guimbretiere 3694992eb5 Working revisited IC2 module. 2013-11-26 00:37:40 +01:00
Thomas Guimbretiere 6f0301667d Check for MOP diff in the NBT sync packet sending block. 2013-11-23 19:45:28 +01:00
Thomas Guimbretiere d2606bfc25 Fixed ETB module (early lookup).
Removed IC2 module for now (pending rewrite).
Caching providers lookup data for optimization.
2013-11-23 19:38:54 +01:00
Thomas Guimbretiere 299ef5307e Added tag v1.4.0 for changeset e8b1906c3f51 2013-11-23 15:40:38 +01:00
Thomas Guimbretiere a750f76a5d Merge 2013-11-22 18:42:00 +01:00
Thomas Guimbretiere cd587ee8ca Fixed orientation prbs & IC2 2013-11-22 18:41:00 +01:00
Thomas Guimbretiere 987254caca Readded Repeater
Fixed mod identification by jar for Forge.
2013-11-22 16:43:42 +01:00
Thomas Guimbretiere ef5ff0c6ed Small orientation bugfix 2013-11-22 16:30:55 +01:00
Thomas Guimbretiere e9947e3960 Merged in Vexatos/waila-2/Vexatos/updated-de_delang-1385130888171 (pull request #4)
Fixed Itemduct typo
2013-11-22 15:41:37 +01:00
Vexatos 95bf99a24a fr_FR.lang edited online with Bitbucket 2013-11-22 14:38:28 +00:00
Vexatos be530da970 en_US.lang edited online with Bitbucket 2013-11-22 14:37:08 +00:00
Vexatos 5d82ebf0d5 Updated de_DE.lang 2013-11-22 14:34:53 +00:00
Thomas Guimbretiere 165cb1003c Merged in Vexatos/waila-1/Vexatos/updated-de_delang-with-project-red-stuff-1385130448150 (pull request #3)
Updated de_DE.lang with Project: Red stuff
2013-11-22 15:28:50 +01:00
Vexatos 5388d1bea0 Updated de_DE.lang with Project: Red stuff 2013-11-22 14:27:33 +00:00
Thomas Guimbretiere c40c032531 Added tag Nightly_131121a for changeset c7e3d16cb236 2013-11-21 01:50:26 +01:00
Thomas Guimbretiere bf0bb6e0c7 Added config options. 2013-11-21 01:50:05 +01:00
Thomas Guimbretiere 42c35d2b69 Added full support for P:R
Updated a few lang files
Added conduits to TE3
2013-11-21 00:40:46 +01:00
Thomas Guimbretiere e9b440616e FR_fr localization 2013-11-20 19:01:16 +01:00
Thomas Guimbretiere d1b354f05e Class name fix for TE3
Exception now shows the first line containing a Waila reference.
2013-11-20 18:50:44 +01:00
Thomas Guimbretiere 0742ef2422 Working proto of P:R module.
Added stacktrace to ExceptionHandler
2013-11-20 18:24:57 +01:00
Thomas Guimbretiere 8e45cb8064 Added billboard helper, floating text help
Accessor contains a bit more information (like the partial frame)
Added a project red module with basic block highlight.
2013-11-19 14:13:09 +01:00
Thomas Guimbretiere 6896998934 Added test decorator on Vanilla crop (desactivated) 2013-11-19 02:13:31 +01:00
Thomas Guimbretiere 74a2805844 IWailaBlockDecorators are now called in the event, with proper safeguards. 2013-11-19 01:37:57 +01:00
Thomas Guimbretiere c95daee0e2 Moved client side stuff to client package.
Added a client event handler for renderLast events.
Basic coordinate gathering in the renderLast event.
Added API to register block decorators.
2013-11-19 00:54:20 +01:00
Thomas Guimbretiere bb5cd6cbfa Added tag Nightly_131118 for changeset d2ec5e84d19f 2013-11-19 00:53:06 +01:00
Thomas Guimbretiere 3dde25b1a4 Added tag Nightly_13111 for changeset 9280666656c7 2013-11-19 00:52:32 +01:00
Thomas Guimbretiere 66649fa9dd Small fixes in the localization engine. 2013-11-18 17:56:01 +01:00
Vexatos a87c29bb2f Created de_DE.lang 2013-11-18 17:26:49 +01:00
Thomas Guimbretiere 3a057e4aba Moved IPowerReceptor to BCAPI module (new module)
Cleaned up all the broken BC parts.
Smaller textures for the test pics.
EnderIO tesseracts are now showing chans/owner
Localization all over the place & a couple new strings.
2013-11-18 14:57:12 +01:00
Thomas Guimbretiere b50df6af26 Added BC power receptor API hooks. 2013-11-18 03:57:21 +01:00
Thomas Guimbretiere 8e8fd7f2bd Basic support for EnderIO capacitors
Added options to ETB
2013-11-18 02:50:33 +01:00
Thomas Guimbretiere d9f209a1d4 Added support for Engineer Toolbox. 2013-11-18 01:11:51 +01:00
Thomas Guimbretiere 5e6ccc5ff8 Done implementing the localization 2013-11-17 20:44:45 +01:00
Thomas Guimbretiere bbfcc3b3ad My bad 2013-11-17 20:33:47 +01:00
Thomas Guimbretiere d4a7b62644 Partial localization 2013-11-17 20:31:39 +01:00
Thomas Guimbretiere 417a75a896 Localized everything up to ConfigKeys. 2013-11-17 19:03:55 +01:00
Thomas Guimbretiere b551d54e5c Attempt at getting TTF font support (failed). 2013-11-17 17:47:15 +01:00
Thomas Guimbretiere 16ca8f2917 Added Minecraftia as default font & loaded it. 2013-11-17 17:26:20 +01:00
Thomas Guimbretiere e7f2cab192 Added TrueTyper 2013-11-17 17:14:55 +01:00
Thomas Guimbretiere 40063f3799 Vanilla Cocoa & Netherwarts are now handled properly (growth) 2013-11-17 17:05:30 +01:00
Thomas Guimbretiere 326d2b519b Removed RF energy display for IEnergyHandler if the NBT data is not there.
Fixed EnderStorage tanks color display.
2013-11-17 15:03:28 +01:00
Thomas Guimbretiere a7668e321c Fixed tooltip size error.
Added a exception throwing getField (so you can test multiple combinaisons => obf vs srg)
2013-11-17 14:33:44 +01:00
Thomas Guimbretiere 79af54e8cf Added tag Nightly_131116 for changeset 246642120b36 2013-11-17 14:09:09 +01:00
Thomas Guimbretiere 09f8bbe33e Full TE3 support 2013-11-17 14:08:54 +01:00
Thomas Guimbretiere 1908f39995 Added support for TE
Added some stuff to the reflection helper.
2013-11-16 15:14:30 +01:00
Thomas Guimbretiere 748fc3fffa Added License 2013-11-12 23:53:20 +01:00
Thomas Guimbretiere 250dc6ac2a Added try/catch around getPickBlock in the raytracing. Was crashing on some circunstances. 2013-10-26 13:53:39 +02:00
Thomas Guimbretiere b81d2d3709 Added tag Nightly_131025 for changeset bc4937f3a7d4 2013-10-26 13:53:05 +02:00
Thomas Guimbretiere a873131d2f Removed some wrong imports. 2013-10-26 12:54:37 +02:00
Thomas Guimbretiere b5689428e8 Added assets folder 2013-10-26 12:48:13 +02:00
Thomas Guimbretiere d6285e2932 Fixed enchant table rendering out of screen. 2013-10-25 14:57:41 +02:00
Thomas Guimbretiere eb348d10fc Fixed string discovery for keybind config screen.
Adding tag is controlled by a config option.
2013-10-25 14:22:29 +02:00
Thomas Guimbretiere 7eb3ddb50c Added an helper for reflection.
Moved all mod identification to a static class.
Dump of KeyHandler string + mod on startup.
2013-10-25 13:35:01 +02:00
Thomas Guimbretiere fde934363c Cleanup 2013-10-24 21:54:33 +02:00
Thomas Guimbretiere dce9809205 Cleanup 2013-10-24 21:51:32 +02:00
Thomas Guimbretiere 15bee287f3 Added tag Nightly_131024 for changeset 02ebbb4aeebe 2013-10-24 18:39:41 +02:00
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
164 changed files with 9031 additions and 1130 deletions

No files matched your search

+387
View File
@@ -0,0 +1,387 @@
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
Binary file not shown.
+137
View File
@@ -0,0 +1,137 @@
screen.button.waila=Waila
screen.button.modules=Module
screen.label.scale=Maße
screen.label.dragtuto=Verschiebe das HUD, um seine Position zu ändern.
screen.button.default=Standard
screen.button.cancel=Abbrechen
screen.button.ok=Ok
screen.button.yes=Ja
screen.button.no=Nein
screen.button.back=Zurück
screen.button.hidden=Versteckt
screen.button.visible=Sichtbar
screen.button.maintained=Gewartet
screen.button.toggled=Geschaltet
choice.showhidewaila=Zeige/Verstecke Waila
choice.showhideidmeta=Zeige ID:Metadata
choice.toggledmaintained=Geschaltet/Gewartet
choice.showliquids=Flüssigkeiten
screen.button.configureaspect=Konfiguriere Aspekt...
enchant.title.name=Name
enchant.title.minlvl=Min lvl
enchant.title.maxlvl=Max lvl
enchant.title.weight=Gewicht
enchant.label.enchantability=Verzauberbarkeit
waila.keybind.wailaconfig=[Waila] Config-Bildschirm
waila.keybind.wailadisplay=[Waila] Zeigen/Verstecken
waila.keybind.liquid=[Waila] Zeige Flüssigkeiten
waila.keybind.recipe=[Waila] Zeige Rezept
waila.keybind.usage=[Waila] Zeige Nutzung
waila.keybind.testing=[Waila] Testen
client.msg.norecipe=Kein Rezept gefunden.
client.msg.nousage=Keine Nutzung gefunden.
hud.msg.none=<Nichts>
hud.msg.empty=<Leer>
hud.msg.output=Output
hud.msg.input=Input
hud.msg.out=Out
hud.msg.in=In
hud.msg.power=Energie
hud.msg.storage=Speicher
hud.msg.stored=Gespeichert
hud.msg.any=Jegliches
hud.msg.mode=Modus
hud.msg.maxpower=Max Energie
hud.msg.trigger=Trigger
hud.msg.maxio=Max IO
hud.msg.send=Senden
hud.msg.recv=Empfangen
hud.msg.item=Item
hud.msg.fluid=Flüssigk.
hud.msg.energ=Energie
hud.msg.frequency=Frequenz
hud.msg.owner=Besitzer
hud.msg.public=Öffentlich
hud.msg.restricted=Eingeschränkt
hud.msg.private=Privat
hud.msg.white=Weiß
hud.msg.orange=Orange
hud.msg.magenta=Magenta
hud.msg.lblue=HBlau
hud.msg.yellow=Gelb
hud.msg.lime=HGrün
hud.msg.pink=Pink
hud.msg.gray=Grau
hud.msg.lgray=HGrau
hud.msg.cyan=Türkis
hud.msg.purple=Violett
hud.msg.blue=Blau
hud.msg.brown=Braun
hud.msg.green=Grün
hud.msg.red=Rot
hud.msg.black=Schwarz
hud.msg.growth=Wachstum
hud.msg.mature=Erwachsen
hud.msg.off=Aus
hud.msg.on=An
hud.msg.state=Status
hud.msg.delay=Verzögerung
hud.msg.comparator=Komparator
hud.msg.substractor=Substraktor
hud.msg.record=Platte
hud.msg.offers=Angebote
hud.msg.demands=Bedarf
option.appeng.monitorcontent=Monitorinhalt
option.bb.content=Fassinhalt
option.bc.tankamount=Flüssigk.-Menge
option.bc.tanktype=Flüssigk.-Typ
option.enderstorage.colors=Farben
option.ic2.inputeumach=Max EU-Input [Maschinen]
option.ic2.inputeuother=Max EU-Input [Anderes]
option.ic2.inputeu=Max EU-Input
option.ic2.outputeu=Max EU-Output
option.ic2.storage=Energie gespeichert
option.ic2.consump=Zeige Verbrauch
option.ic2.tradeomat=Zeige Tauschautomaten-Forderung
option.thaumcraft.storedvis=Kondensatorspeicher
option.thermalexpansion.energyhandler=Zeige RO-Speicher
option.thermalexpansion.energycell=Zeige EZellen IN/OUT
option.thermalexpansion.fluidtype=Zeige Flüssigk.-Typ
option.thermalexpansion.fluidamount=Zeige Flüssigk.-Menge
option.thermalexpansion.tankmode=Zeige Tankmodus
option.thermalexpansion.tesssendrecv=Tesseraktmodus
option.thermalexpansion.tessfreq=Tesseraktfrequenz
option.thermalexpansion.owner=Zeige Besitzer
option.thermalexpansion.conditemmode=Zeige Itemduktmodus
option.vanilla.spawntype=Spawner-Typ
option.vanilla.growthvalue=Wachstumswert
option.vanilla.leverstate=Hebelstatus
option.vanilla.repeater=Repeater-Verzögerung
option.vanilla.comparator=Komparatormodus
option.vanilla.redstone=Redstone-Stärke
option.vanilla.jukebox=Musikbox-Platte
option.etb.displaydata=Zeige Sockeldaten
option.enderio.inout=Zeige Input/Output
option.enderio.storage=Zeige gespeicherte MJ
option.enderio.owner=Zeige Block-Besitzer
option.enderio.channel=Zeige Hypercube-Kanal
option.bcapi.storage=Zeige gespeicherte MJ
option.bcapi.consump=Zeige maximale Energie
option.bcapi.trigger=Zeige Startenergie
option.pr.showio=Zeige Gatter IO
option.pr.showdata=Zeige Gatterdaten
option.extrautilities.fluidamount=Zeige Flüssigk.-Menge
option.openblocks.fluidamount=Zeige Flüssigk.-Menge
option.railcraft.fluidamount=Zeige Flüssigk.-Menge
+137
View File
@@ -0,0 +1,137 @@
screen.button.waila=Waila
screen.button.modules=Modules
screen.label.scale=Scale
screen.label.dragtuto=Drag the HUD to setup its position.
screen.button.default=Default
screen.button.cancel=Cancel
screen.button.ok=Ok
screen.button.yes=Yes
screen.button.no=No
screen.button.back=Back
screen.button.hidden=Hidden
screen.button.visible=Visible
screen.button.maintained=Maintained
screen.button.toggled=Toggled
choice.showhidewaila=Show/Hide Waila
choice.showhideidmeta=Show ID:Metadata
choice.toggledmaintained=Toggled/Maintained
choice.showliquids=Liquids
screen.button.configureaspect=Configure aspect...
enchant.title.name=Name
enchant.title.minlvl=Min lvl
enchant.title.maxlvl=Max lvl
enchant.title.weight=Weight
enchant.label.enchantability=Enchantability
waila.keybind.wailaconfig=[Waila] Config screen
waila.keybind.wailadisplay=[Waila] Show/Hide
waila.keybind.liquid=[Waila] Show liquids
waila.keybind.recipe=[Waila] Show recipe
waila.keybind.usage=[Waila] Show usage
waila.keybind.testing=[Waila] Testing
client.msg.norecipe=No recipe found.
client.msg.nousage=No usage found.
hud.msg.none=<None>
hud.msg.empty=<Empty>
hud.msg.output=Output
hud.msg.input=Input
hud.msg.out=Out
hud.msg.in=In
hud.msg.power=Power
hud.msg.storage=Storage
hud.msg.stored=Stored
hud.msg.any=Any
hud.msg.mode=Mode
hud.msg.maxpower=Max Power
hud.msg.trigger=Trigger
hud.msg.maxio=Max IO
hud.msg.send=Send
hud.msg.recv=Recv
hud.msg.item=Item
hud.msg.fluid=Fluid
hud.msg.energ=Energy
hud.msg.frequency=Frequency
hud.msg.owner=Owner
hud.msg.public=Public
hud.msg.restricted=Restricted
hud.msg.private=Private
hud.msg.white=White
hud.msg.orange=Orange
hud.msg.magenta=Magenta
hud.msg.lblue=LBlue
hud.msg.yellow=Yellow
hud.msg.lime=Lime
hud.msg.pink=Pink
hud.msg.gray=Gray
hud.msg.lgray=LGray
hud.msg.cyan=Cyan
hud.msg.purple=Purple
hud.msg.blue=Blue
hud.msg.brown=Brown
hud.msg.green=Green
hud.msg.red=Red
hud.msg.black=Black
hud.msg.growth=Growth
hud.msg.mature=Mature
hud.msg.off=Off
hud.msg.on=On
hud.msg.state=State
hud.msg.delay=Delay
hud.msg.comparator=Comparator
hud.msg.substractor=Substractor
hud.msg.record=Record
hud.msg.offers=Offers
hud.msg.demands=Demands
option.appeng.monitorcontent=Monitor's content
option.bb.content=Barrel's content
option.bc.tankamount=Liquid amount
option.bc.tanktype=Liquid type
option.enderstorage.colors=Colors
option.ic2.inputeumach=Max EU input [Machines]
option.ic2.inputeuother=Max EU input [Other]
option.ic2.inputeu=Max EU input
option.ic2.outputeu=Max EU output
option.ic2.storage=Energy stored
option.ic2.consump=Show consumption
option.ic2.tradeomat=Show Trade-O-Mat request
option.thaumcraft.storedvis=Capacitor storage
option.thermalexpansion.energyhandler=Show RF storage
option.thermalexpansion.energycell=Show ECell IN/OUT
option.thermalexpansion.fluidtype=Show fluid type
option.thermalexpansion.fluidamount=Show fluid amount
option.thermalexpansion.tankmode=Show tank mode
option.thermalexpansion.tesssendrecv=Tesseract mode
option.thermalexpansion.tessfreq=Tesseract frequency
option.thermalexpansion.owner=Show owner
option.thermalexpansion.conditemmode=Show Itemduct mode
option.vanilla.spawntype=Spawner type
option.vanilla.growthvalue=Growth value
option.vanilla.leverstate=Lever state
option.vanilla.repeater=Repeater delay
option.vanilla.comparator=Comparator mode
option.vanilla.redstone=Redstone power
option.vanilla.jukebox=Jukebox disk
option.etb.displaydata=Show socket data
option.enderio.inout=Show input/output
option.enderio.storage=Show stored MJ
option.enderio.owner=Show block owner
option.enderio.channel=Show hypercube channel
option.bcapi.storage=Show stored MJ
option.bcapi.consump=Show maximum power
option.bcapi.trigger=Show triggering energy
option.pr.showio=Show gates IO
option.pr.showdata=Show gates data
option.extrautilities.fluidamount=Show fluid amount
option.openblocks.fluidamount=Show fluid amount
option.railcraft.fluidamount=Show fluid amount
+136
View File
@@ -0,0 +1,136 @@
screen.button.waila=Waila
screen.button.modules=Modules
screen.label.scale=Echelle
screen.label.dragtuto=Faites glisser le HUD pour paramétrer la position.
screen.button.default=Défaut
screen.button.cancel=Annuler
screen.button.ok=Ok
screen.button.yes=Oui
screen.button.no=Non
screen.button.back=Retour
screen.button.hidden=Masquer
screen.button.visible=Afficher
screen.button.maintained=Maintenu
screen.button.toggled=Switché
choice.showhidewaila=Afficher/Masquer Waila
choice.showhideidmeta=Afficher ID:Metadata
choice.toggledmaintained= Switché/Maintenu
choice.showliquids=Liquides
screen.button.configureaspect=Configurer l'aspect…
enchant.title.name=Nom
enchant.title.minlvl=Min lvl
enchant.title.maxlvl=Max lvl
enchant.title.weight=Poids
enchant.label.enchantability=Enchantabilitée
waila.keybind.wailaconfig=[Waila] Ecran de config
waila.keybind.wailadisplay=[Waila] Afficher/Masquer
waila.keybind.liquid=[Waila] Afficher les liquides
waila.keybind.recipe=[Waila] Afficher les recettes
waila.keybind.usage=[Waila] Afficher l'utilisation
waila.keybind.testing=[Waila] Test
client.msg.norecipe=Pas de recette trouvée.
client.msg.nousage=Pas d'utilisation trouvée.
hud.msg.none=<Aucun>
hud.msg.empty=<Vide>
hud.msg.output=Sortie
hud.msg.input=Entrée
hud.msg.out=Sortie
hud.msg.in=Entrée
hud.msg.power=Energie
hud.msg.storage=Stockage
hud.msg.stored=Stocké
hud.msg.any=Tout
hud.msg.mode=Mode
hud.msg.maxpower=Max Puissance
hud.msg.trigger=Déclencheur
hud.msg.maxio=Max Entrée/Sortie
hud.msg.send=Envoyer
hud.msg.recv=Recevoir
hud.msg.item=Objet
hud.msg.fluid=Fluide
hud.msg.energ=Energie
hud.msg.frequency=Fréquence
hud.msg.owner=Propriétaire
hud.msg.public=Publique
hud.msg.restricted=Limité
hud.msg.private=Privée
hud.msg.white=Blanc
hud.msg.orange=Orange
hud.msg.magenta=Magenta
hud.msg.lblue=Bleu clair
hud.msg.yellow=Jaune
hud.msg.lime=Vert clair
hud.msg.pink=Rose
hud.msg.gray=Gris
hud.msg.lgray=Gris clair
hud.msg.cyan=Cyan
hud.msg.purple=Violet
hud.msg.blue=Bleu
hud.msg.brown=Marron
hud.msg.green=Vert
hud.msg.red=Rouge
hud.msg.black=Noir
hud.msg.growth=Croissance
hud.msg.mature=Mature
hud.msg.off=Off
hud.msg.on=On
hud.msg.state=Etat
hud.msg.delay=Retard
hud.msg.comparator=Comparateur
hud.msg.substractor=Soustracteur
hud.msg.record=Disque
hud.msg.offers=Offre
hud.msg.demands=Demande
option.appeng.monitorcontent=Contenu des écrans
option.bb.content=Contenu des barils
option.bc.tankamount=Niveau de liquide
option.bc.tanktype=Sorte de liquide
option.enderstorage.colors=Couleurs
option.ic2.inputeumach=Max EU en entrée [Machines]
option.ic2.inputeuother=Max EU en entrée [Autres]
option.ic2.inputeu=Max EU en entrée
option.ic2.outputeu=Max EU en sortie
option.ic2.storage=Energie stockée
option.ic2.consump=Afficher consommation
option.thaumcraft.storedvis=Condensateur de stockage
option.thermalexpansion.energyhandler=Afficher stockage RF
option.thermalexpansion.energycell=Afficher ECell Entrée/Sortie
option.thermalexpansion.fluidtype=Afficher sorte fluides
option.thermalexpansion.fluidamount=Afficher niveau fluides
option.thermalexpansion.tankmode=Afficher mode Réservoir
option.thermalexpansion.tesssendrecv=Tesseract mode
option.thermalexpansion.tessfreq=Tesseract fréquence
option.thermalexpansion.owner=Afficher propriétaire
option.thermalexpansion.conditemmode=Afficher Itemduct mode
option.vanilla.spawntype=Spawner type
option.vanilla.growthvalue=Niveau de croissance
option.vanilla.leverstate=Etat Levier
option.vanilla.repeater=Répeteur retard
option.vanilla.comparator=Comparateur mode
option.vanilla.redstone=Redstone puissance
option.vanilla.jukebox=Jukebox disque
option.etb.displaydata=Afficher données socket
option.enderio.inout=Afficher Entrée/Sortie
option.enderio.storage=Afficher MJ stocké
option.enderio.owner=Afficher propriétaire du bloc
option.enderio.channel=Afficher hypercube canal
option.bcapi.storage=Afficher MJ stocké
option.bcapi.consump=Afficher puissance maximale
option.bcapi.trigger=Energie déclanchement
option.pr.showio=Afficher plaques IO
option.pr.showdata=Afficher plaques data
option.extrautilities.fluidamount=Afficher niveau fluides
option.openblocks.fluidamount=Afficher niveau fluides
option.railcraft.fluidamount=Afficher niveau fluides
+117
View File
@@ -0,0 +1,117 @@
screen.button.waila=Waila
screen.button.modules=Modules
screen.label.scale=Schaal
screen.label.dragtuto=Sleep de HUD om zijn positie in te stellen.
screen.button.default=Standaard
screen.button.cancel=Annuleren
screen.button.ok=Ok
screen.button.yes=Ja
screen.button.no=Nee
screen.button.back=Terug
screen.button.hidden=Verborgen
screen.button.visible=Zichtbaar
screen.button.maintained=Gehandhaafd
screen.button.toggled=Omgeschakeld
choice.showhidewaila=Toon/Verberg Waila
choice.showhideidmeta=Toon ID:Metadata
choice.toggledmaintained=Omgeschakeld/Gehandhaafd
choice.showliquids=Vloeistoffen
screen.button.configureaspect=Configureer aspect...
enchant.title.name=Naam
enchant.title.minlvl=Min lvl
enchant.title.maxlvl=Max lvl
enchant.title.weight=Gewicht
enchant.label.enchantability=Enchantbaarheid
keybind.configscreen=[Waila] Configuratiescherm
keybind.showhide=[Waila] Toon/Verberg
keybind.showliquid=[Waila] Toon vloeistoffen
keybind.showrecipe=[Waila] Toon recepten
keybind.showusage=[Waila] Toon gebruik
keybind.testing=[Waila] Testen
client.msg.norecipe=Geen recept gevonden.
client.msg.nousage=Geen gebruik gevonden.
hud.msg.none=<Geen>
hud.msg.empty=<Leeg>
hud.msg.output=Uitvoer
hud.msg.input=Invoer
hud.msg.out=Uit
hud.msg.in=In
hud.msg.power=Vermogen
hud.msg.storage=Opslag
hud.msg.any=Om het even welke
hud.msg.mode=Modus
hud.msg.send=Zend
hud.msg.recv=Ontv
hud.msg.item=Item
hud.msg.fluid=Vloeistof
hud.msg.energ=Energie
hud.msg.frequency=Frequentie
hud.msg.owner=Eigenaar
hud.msg.public=Publiek
hud.msg.restricted=Begrensd
hud.msg.private=Privé
hud.msg.white=Wit
hud.msg.orange=Oranje
hud.msg.magenta=Magenta
hud.msg.lblue=LBlauw
hud.msg.yellow=Geel
hud.msg.lime=Limoen
hud.msg.pink=Roze
hud.msg.gray=Grijs
hud.msg.lgray=LGrijs
hud.msg.cyan=Cyaan
hud.msg.purple=Paars
hud.msg.blue=Blauw
hud.msg.brown=Bruin
hud.msg.green=Groen
hud.msg.red=Rood
hud.msg.black=Zwart
hud.msg.growth=Groei
hud.msg.mature=Volwassen
hud.msg.off=Af
hud.msg.on=Aan
hud.msg.state=Status
hud.msg.delay=Vertraging
hud.msg.comparator=Vergelijker
hud.msg.substractor=Aftrekker
hud.msg.record=Neem op
option.appeng.monitorcontent=Scherm inhoud
option.bb.content=Ton inhoud
option.bc.tankamount=Vloeistofhoeveelheid
option.bc.tanktype=Vloeistoftype
option.enderstorage.colors=Kleuren
option.ic2.inputeumach=Max EU invoer [Machines]
option.ic2.inputeuother=Max EU invoer [Andere]
option.ic2.inputeu=Max EU invoer
option.ic2.outputeu=Max EU uitvoer
option.ic2.storage=Opgeslagen energie
option.thaumcraft.storedvis=Condensator opslag
option.thermalexpansion.energyhandler=Toon RF opslag
option.thermalexpansion.energycell=Toon ECell IN/UIT
option.thermalexpansion.fluidtype=Toon vloeistoftype
option.thermalexpansion.fluidamount=Toon vloeistofhoeveelheid
option.thermalexpansion.tankmode=Toon tank modus
option.thermalexpansion.tesssendrecv=Tesseract modus
option.thermalexpansion.tessfreq=Tesseract frequentie
option.thermalexpansion.owner=Toon eigenaar
option.vanilla.spawntype=Spawner type
option.vanilla.growthvalue=Groei hoeveelheid
option.vanilla.leverstate=Hendel status
option.vanilla.repeater=Herhaler vertraging
option.vanilla.comparator=Vergelijker modus
option.vanilla.redstone=Redstone vermogen
option.vanilla.jukebox=Jukebox schijf
option.extrautilities.fluidamount=Toon vloeistofhoeveelheid
option.openblocks.fluidamount=Toon vloeistofhoeveelheid
option.railcraft.fluidamount=Toon vloeistofhoeveelheid
+131
View File
@@ -0,0 +1,131 @@
screen.button.waila=Waila
screen.button.modules=Модули
screen.label.scale=Размер
screen.label.dragtuto=Перетащите интерфейс, чтобы изменить позицию.
screen.button.default=По умолчанию
screen.button.cancel=Отмена
screen.button.ok=Ок
screen.button.yes=Да
screen.button.no=Нет
screen.button.back=Назад
screen.button.hidden=Скрывать
screen.button.visible=Показывать
screen.button.maintained=При нажатой клавише
screen.button.toggled=Вкл./Выкл. гор. клавишей
choice.showhidewaila=Показать/Скрыть Waila
choice.showhideidmeta=Показать ID:Метаданные
choice.toggledmaintained=Переключ./Нажатая клав.
choice.showliquids=Жидкости
screen.button.configureaspect=Настроить индикатор...
enchant.title.name=Название
enchant.title.minlvl=Мин. уровень
enchant.title.maxlvl=Макс. уровень
enchant.title.weight=Вес
enchant.label.enchantability=Зачарование
waila.keybind.wailaconfig=[Waila] Меню настроек
waila.keybind.wailadisplay=[Waila] Показать/Скрыть
waila.keybind.liquid=[Waila] Показать жидкости
waila.keybind.recipe=[Waila] Показать рецепт
waila.keybind.usage=[Waila] Показать применение
waila.keybind.testing=[Waila] Тестировать
client.msg.norecipe=Рецептов не найдено.
client.msg.nousage=Применений не найдено.
hud.msg.none=<Ничего>
hud.msg.empty=<Пусто>
hud.msg.output=Вывод
hud.msg.input=Ввод
hud.msg.out=Из
hud.msg.in=В
hud.msg.power=Энергия
hud.msg.storage=Хранилище
hud.msg.any=Всё
hud.msg.mode=Режим
hud.msg.maxpower=Макс. энергия
hud.msg.trigger=Триггер
hud.msg.maxio=Макс. ввод/вывод
hud.msg.send=Передача
hud.msg.recv=Приём
hud.msg.item=Предмет
hud.msg.fluid=Жидкость
hud.msg.energ=Энергия
hud.msg.frequency=Частота
hud.msg.owner=Владелец
hud.msg.public=Публичный
hud.msg.restricted=Ограниченный
hud.msg.private=Приватный
hud.msg.white=Белый
hud.msg.orange=Оранжевый
hud.msg.magenta=Сиреневый
hud.msg.lblue=Светло-синий
hud.msg.yellow=Жёлтый
hud.msg.lime=Светло-зелёный
hud.msg.pink=Розовый
hud.msg.gray=Серый
hud.msg.lgray=Светло-серый
hud.msg.cyan=Бирюзовый
hud.msg.purple=Фиолетовый
hud.msg.blue=Синий
hud.msg.brown=Коричневый
hud.msg.green=Зелёный
hud.msg.red=Красный
hud.msg.black=Чёрный
hud.msg.growth=Рост
hud.msg.mature=Вырос
hud.msg.off=Выкл.
hud.msg.on=Вкл.
hud.msg.state=Статус
hud.msg.delay=Задержка
hud.msg.comparator=Компаратор
hud.msg.substractor=Вычитатель
hud.msg.record=Пластинка
option.appeng.monitorcontent=Содержимое монитора
option.bb.content=Содержимое бочки
option.bc.tankamount=Кол-во жидкости
option.bc.tanktype=Тип жидкости
option.enderstorage.colors=Цвета
option.ic2.inputeumach=Макс. ввод еЭ [Машины]
option.ic2.inputeuother=Макс. ввод еЭ [Другое]
option.ic2.inputeu=Макс. ввод еЭ
option.ic2.outputeu=Макс. вывод еЭ
option.ic2.storage=Заряд энергии
option.thaumcraft.storedvis=Заряд конденсатора
option.thermalexpansion.energyhandler=Показывать заряд заряжателя
option.thermalexpansion.energycell=Показывать Ввод/Вывод Р.батареи
option.thermalexpansion.fluidtype=Показывать тип жидкости
option.thermalexpansion.fluidamount=Показывать кол-во жидкости
option.thermalexpansion.tankmode=Режим цистерны
option.thermalexpansion.tesssendrecv=Режим тессеракта
option.thermalexpansion.tessfreq=Частота тессеракта
option.thermalexpansion.owner=Показывать владельца
option.thermalexpansion.conditemmode=Показывать режим труб
option.vanilla.spawntype=Тип спаунера
option.vanilla.growthvalue=Стадия роста
option.vanilla.leverstate=Положение рычага
option.vanilla.repeater=Задержка повторителя
option.vanilla.comparator=Режим компаратора
option.vanilla.redstone=Сила красного камня
option.vanilla.jukebox=Пластинка в проигрывателе
option.etb.displaydata=Показывать инф. о сокетах
option.enderio.inout=Показывать ввод/вывод
option.enderio.storage=Показывать заряд MJ
option.enderio.owner=Показывать владельца блока
option.enderio.channel=Показывать канал гиперкуба
option.bcapi.storage=Показывать заряд MJ
option.bcapi.consump=Показывать макс. энергию
option.bcapi.trigger=Показывать энергию активации
option.pr.showio=Показывать ввод/вывод схем
option.pr.showdata=Показывать инф. о схемах
option.extrautilities.fluidamount=Показывать кол-во жидкости
option.openblocks.fluidamount=Показывать кол-во жидкости
option.railcraft.fluidamount=Показывать кол-во жидкости
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

+25 -4
View File
@@ -5,10 +5,31 @@ public final class Constants {
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_CFG = "waila.keybind.wailaconfig";
public static String BIND_WAILA_SHOW = "waila.keybind.wailadisplay";
public static String BIND_WAILA_LIQUID = "waila.keybind.liquid";
public static String BIND_WAILA_RECIPE = "waila.keybind.recipe";
public static String BIND_WAILA_USAGE = "waila.keybind.usage";
public static String BIND_WAILA_TESTING= "waila.keybind.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_KEYBIND = "waila.cfg.keybind";
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";
public static String CFG_NEI_SHOW = "options.inworld tooltips";
}
@@ -13,6 +13,12 @@ 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()){
mod_Waila.log.log(Level.WARNING, String.format("%s.%s:%s",elem.getClassName(), elem.getMethodName(), elem.getLineNumber()));
if (elem.getClassName().contains("waila")) break;
}
mod_Waila.log.log(Level.WARNING, String.format("Catched unhandled exception : [%s] %s",className,e));
}
if (currenttip != null)
+20 -1
View File
@@ -80,5 +80,24 @@ public class ConfigHandler implements IWailaConfigHandler {
@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();
}
}
@@ -11,16 +11,15 @@ import java.util.Set;
import java.util.logging.Level;
import au.com.bytecode.opencsv.CSVReader;
import net.minecraft.block.Block;
import codechicken.lib.lang.LangUtil;
import codechicken.nei.api.API;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.api.IWailaBlockDecorator;
import mcp.mobius.waila.api.IWailaDataProvider;
import mcp.mobius.waila.api.IWailaRegistrar;
import mcp.mobius.waila.api.IWailaSummaryProvider;
import mcp.mobius.waila.handlers.HUDHandlerExternal;
import mcp.mobius.waila.handlers.hud.HUDHandlerExternal;
public class ExternalModulesHandler implements IWailaRegistrar {
@@ -35,6 +34,9 @@ public class ExternalModulesHandler implements IWailaRegistrar {
public LinkedHashMap<Class, ArrayList<IWailaDataProvider>> tailBlockProviders = new LinkedHashMap<Class, ArrayList<IWailaDataProvider>>();
public LinkedHashMap<Class, ArrayList<IWailaDataProvider>> stackBlockProviders = new LinkedHashMap<Class, ArrayList<IWailaDataProvider>>();
public LinkedHashMap<Integer, ArrayList<IWailaBlockDecorator>> blockIdDecorators = new LinkedHashMap<Integer, ArrayList<IWailaBlockDecorator>>();
public LinkedHashMap<Class, ArrayList<IWailaBlockDecorator>> blockClassDecorators = new LinkedHashMap<Class, ArrayList<IWailaBlockDecorator>>();
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>>();
@@ -51,12 +53,22 @@ public class ExternalModulesHandler implements IWailaRegistrar {
@Override
public void addConfig(String modname, String key, String configname) {
ConfigHandler.instance().addConfig(modname, key, configname);
ConfigHandler.instance().addConfig(modname, key, LangUtil.translateG(configname));
}
@Override
public void addConfigRemote(String modname, String key, String configname) {
ConfigHandler.instance().addConfigServer(modname, key, configname);
ConfigHandler.instance().addConfigServer(modname, key, LangUtil.translateG(configname));
}
@Override
public void addConfig(String modname, String key) {
ConfigHandler.instance().addConfig(modname, key, LangUtil.translateG("option." + key));
}
@Override
public void addConfigRemote(String modname, String key) {
ConfigHandler.instance().addConfigServer(modname, key, LangUtil.translateG("option." + key));
}
@Override
@@ -87,12 +99,14 @@ public class ExternalModulesHandler implements IWailaRegistrar {
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>());
@@ -122,6 +136,20 @@ public class ExternalModulesHandler implements IWailaRegistrar {
this.summaryProviders.get(item).add(dataProvider);
}
@Override
public void registerBlockDecorator(IWailaBlockDecorator decorator, int blockID) {
if (!this.blockIdDecorators.containsKey(blockID))
this.blockIdDecorators.put(blockID, new ArrayList<IWailaBlockDecorator>());
this.blockIdDecorators.get(blockID).add(decorator);
}
@Override
public void registerBlockDecorator(IWailaBlockDecorator decorator, Class block) {
if (!this.blockClassDecorators.containsKey(block))
this.blockClassDecorators.put(block, new ArrayList<IWailaBlockDecorator>());
this.blockClassDecorators.get(block).add(decorator);
}
/* Arrays getters */
public ArrayList<IWailaDataProvider> getHeadProviders(int blockID) {
@@ -176,6 +204,19 @@ public class ExternalModulesHandler implements IWailaRegistrar {
return returnList;
}
public ArrayList<IWailaBlockDecorator> getBlockDecorators(int blockID){
return this.blockIdDecorators.get(blockID);
}
public ArrayList<IWailaBlockDecorator> getBlockDecorators(Object block){
ArrayList<IWailaBlockDecorator> returnList = new ArrayList<IWailaBlockDecorator>();
for (Class clazz : this.blockClassDecorators.keySet())
if (clazz.isInstance(block))
returnList.addAll(this.blockClassDecorators.get(clazz));
return returnList;
}
/* Providers querry methods */
public boolean hasHeadProviders(int blockID){
@@ -219,6 +260,18 @@ public class ExternalModulesHandler implements IWailaRegistrar {
return this.summaryProviders.containsKey(item);
}
public boolean hasBlockDecorator(int blockID){
return this.blockIdDecorators.containsKey(blockID);
}
public boolean hasBlockDecorator(Object block){
for (Class clazz : this.blockClassDecorators.keySet())
if (clazz.isInstance(block))
return true;
return false;
}
/* ----------------- */
@Override
public void registerDocTextFile(String filename) {
List<String[]> docData = null;
@@ -4,6 +4,7 @@ import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.logging.Level;
import codechicken.lib.lang.LangUtil;
import net.minecraftforge.common.ForgeDirection;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.addons.ExternalModulesHandler;
@@ -35,8 +36,8 @@ public class AppEngModule {
return;
}
mod_Waila.log.log(Level.WARNING, "Waila module AppEng succefully hooked.");
ExternalModulesHandler.instance().addConfig("Applied Energetic", "appeng.monitorcontent", "Monitor's content");
mod_Waila.log.log(Level.INFO, "AppEng mod found.");
ExternalModulesHandler.instance().addConfig("Applied Energetic", "appeng.monitorcontent");
ExternalModulesHandler.instance().registerBodyProvider(new HUDAppEngMonitor(), TileStorageMonitor);
}
}
@@ -3,6 +3,7 @@ package mcp.mobius.waila.addons.appeng;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import codechicken.lib.lang.LangUtil;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import mcp.mobius.waila.api.IWailaConfigHandler;
@@ -31,7 +32,7 @@ public class HUDAppEngMonitor implements IWailaDataProvider {
if (stack != null)
currenttip.add(stack.getDisplayName());
else
currenttip.add("<None>");
currenttip.add(LangUtil.translateG("hud.msg.none"));
} catch (Exception e) {
System.out.printf("%s\n", e);
}
@@ -41,4 +42,9 @@ public class HUDAppEngMonitor implements IWailaDataProvider {
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
@@ -6,7 +6,7 @@ import java.util.logging.Level;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.addons.ExternalModulesHandler;
import mcp.mobius.waila.addons.buildcraft.HUDHandlerBCPipes;
import codechicken.lib.lang.LangUtil;
import codechicken.nei.api.API;
import codechicken.nei.api.ItemInfo;
@@ -33,7 +33,7 @@ public class BetterBarrelsModule {
if (IBarrelStorage_getItem != null){
mod_Waila.log.log(Level.INFO, "Waila module BetterBarrel succefully hooked.");
ExternalModulesHandler.instance().addConfig("BetterBarrels", "bb.content", "Barrel's content");
ExternalModulesHandler.instance().addConfig("BetterBarrels", "bb.content");
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerBBContent(), TileEntityBarrel);
}
}
@@ -15,7 +15,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import codechicken.lib.lang.LangUtil;
import codechicken.nei.api.API;
import codechicken.nei.api.ItemInfo;
import codechicken.nei.api.ItemInfo.Layout;
@@ -51,9 +51,14 @@ public class HUDHandlerBBContent implements IWailaDataProvider {
if (stack != null){
currenttip.add(stack.getDisplayName());
} else {
currenttip.add("<Empty>");
currenttip.add(LangUtil.translateG("hud.msg.empty"));
}
}
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
@@ -15,8 +15,7 @@ public class BCModule {
public static Class TileGenericPipe = null;
public static Class TileEngine = null;
public static Method TileTank_GetTanks = null;
public static Method IPowerReceptor_PowerRequest = null;
public static Method TileTank_getTankInfo = null;
public static void register(){
try {
@@ -29,13 +28,7 @@ public class BCModule {
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_GetTanks = TileTank.getMethod("getTanks", ForgeDirection.class);
IPowerReceptor_PowerRequest = IPowerReceptor.getMethod("powerRequest", ForgeDirection.class);
TileTank_getTankInfo = TileTank.getMethod("getTankInfo", ForgeDirection.class);
} catch (ClassNotFoundException e){
mod_Waila.log.log(Level.WARNING, "[BC] Class not found. " + e);
@@ -45,14 +38,10 @@ public class BCModule {
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().addConfig("Buildcraft", "bc.tankamount");
ExternalModulesHandler.instance().addConfig("Buildcraft", "bc.tanktype");
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);
}
}
@@ -0,0 +1,79 @@
package mcp.mobius.waila.addons.buildcraft;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.logging.Level;
import net.minecraftforge.common.ForgeDirection;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.addons.ExternalModulesHandler;
public class BCPowerAPIModule {
public static Class PowerHandler = null;
public static Method PH_getMinEnergyReceived = null;
public static Method PH_getMaxEnergyReceived = null;
public static Method PH_getMaxEnergyStored = null;
public static Method PH_getEnergyStored = null;
public static Method PH_getActivationEnergy = null;
public static Class IPowerReceptor = null;
public static Method IPowerReceptor_getPowerReceiver = null;
public static Class PowerReceiver = null;
public static Method PR_getMinEnergyReceived = null;
public static Method PR_getMaxEnergyReceived = null;
public static Method PR_getMaxEnergyStored = null;
public static Method PR_getEnergyStored = null;
public static Method PR_getActivationEnergy = null;
public static void register(){
try{
Class ModClass = Class.forName("buildcraft.api.power.IPowerReceptor");
mod_Waila.log.log(Level.INFO, "Buildcraft Power API found.");
} catch (ClassNotFoundException e){
mod_Waila.log.log(Level.INFO, "[Buildcraft Power API] Buildcraft Power API mod not found.");
return;
}
try{
PowerHandler = Class.forName("buildcraft.api.power.PowerHandler");
PH_getMinEnergyReceived = PowerHandler.getMethod("getMinEnergyReceived");
PH_getMaxEnergyReceived = PowerHandler.getMethod("getMaxEnergyReceived");
PH_getMaxEnergyStored = PowerHandler.getMethod("getMaxEnergyStored");
PH_getEnergyStored = PowerHandler.getMethod("getEnergyStored");
PH_getActivationEnergy = PowerHandler.getMethod("getActivationEnergy");
IPowerReceptor = Class.forName("buildcraft.api.power.IPowerReceptor");
IPowerReceptor_getPowerReceiver = IPowerReceptor.getMethod("getPowerReceiver", ForgeDirection.class);
PowerReceiver = Class.forName("buildcraft.api.power.PowerHandler$PowerReceiver");
PR_getMinEnergyReceived = PowerReceiver.getMethod("getMinEnergyReceived");
PR_getMaxEnergyReceived = PowerReceiver.getMethod("getMaxEnergyReceived");
PR_getMaxEnergyStored = PowerReceiver.getMethod("getMaxEnergyStored");
PR_getEnergyStored = PowerReceiver.getMethod("getEnergyStored");
PR_getActivationEnergy = PowerReceiver.getMethod("getActivationEnergy");
} catch (ClassNotFoundException e){
mod_Waila.log.log(Level.WARNING, "[EnderStorage] Class not found. " + e);
return;
} catch (NoSuchMethodException e){
mod_Waila.log.log(Level.WARNING, "[EnderStorage] Method not found." + e);
return;
// } catch (NoSuchFieldException e){
// mod_Waila.log.log(Level.WARNING, "[EnderStorage] Field not found." + e);
// return;
} catch (Exception e){
mod_Waila.log.log(Level.WARNING, "[EnderStorage] Unhandled exception." + e);
return;
}
ExternalModulesHandler.instance().addConfigRemote("BuildcraftAPI", "bcapi.storage");
ExternalModulesHandler.instance().addConfig("BuildcraftAPI", "bcapi.consump");
ExternalModulesHandler.instance().addConfig("BuildcraftAPI", "bcapi.trigger");
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerIPowerReceptor(), IPowerReceptor);
}
}
@@ -1,38 +0,0 @@
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 HUDHandlerBCEngine 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 (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;
}
}
@@ -1,43 +0,0 @@
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;
}
}
@@ -1,47 +0,0 @@
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 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;
}
public boolean hasPartialKey(NBTTagCompound tag, String key){
for (Object k : tag.tagMap.keySet())
if (((String)k).contains(key))
return true;
return false;
}
public double getPartialKeySum(NBTTagCompound tag, String key){
double retVal = 0;
for (Object k : tag.tagMap.keySet())
if (((String)k).contains(key))
retVal += tag.getDouble((String)k);
return retVal;
}
}
@@ -5,6 +5,12 @@ import java.util.logging.Level;
//import buildcraft.factory.TileTank;
import codechicken.lib.lang.LangUtil;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.addons.ConfigHandler;
import mcp.mobius.waila.api.IWailaConfigHandler;
@@ -12,6 +18,9 @@ import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import net.minecraftforge.liquids.ILiquidTank;
import net.minecraftforge.liquids.LiquidStack;
@@ -24,35 +33,41 @@ public class HUDHandlerBCTanks implements IWailaDataProvider {
@Override
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
ILiquidTank tank = this.getTank(accessor);
LiquidStack stack = tank != null ? tank.getLiquid() : null;
FluidTankInfo tank = this.getTank(accessor);
FluidStack stack = tank != null ? tank.fluid : null;
String name = currenttip.get(0);
if (stack != null && ConfigHandler.instance().getConfig("bc.tanktype"))
name = name + " (" + stack.asItemStack().getDisplayName() + ")";
name = name + " (" + stack.getFluid().getName() + ")";
else if (stack == null && ConfigHandler.instance().getConfig("bc.tanktype"))
name = name + " <Empty>";
name = name + " " + LangUtil.translateG("hud.msg.empty");
currenttip.set(0, name);
return currenttip;
}
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
ILiquidTank tank = this.getTank(accessor);
LiquidStack stack = tank != null ? tank.getLiquid() : null;
int liquidAmount = stack != null ? stack.amount:0;
int capacity = tank != null ? tank.getCapacity() : 0;
FluidTankInfo tank = this.getTank(accessor);
FluidStack stack = tank != null ? tank.fluid : null;
int liquidAmount = stack != null ? stack.amount:0;
int capacity = tank != null ? tank.capacity : 0;
if (ConfigHandler.instance().getConfig("bc.tankamount"))
currenttip.add(String.valueOf(liquidAmount) + "/" + String.valueOf(capacity) + " mB");
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
public ILiquidTank getTank(IWailaDataAccessor accessor){
ILiquidTank tank = null;
public FluidTankInfo getTank(IWailaDataAccessor accessor){
FluidTankInfo tank = null;
try{
tank = ((ILiquidTank[])BCModule.TileTank_GetTanks.invoke(BCModule.TileTank.cast(accessor.getTileEntity()), ForgeDirection.UNKNOWN))[0];
tank = ((FluidTankInfo[])BCModule.TileTank_getTankInfo.invoke(BCModule.TileTank.cast(accessor.getTileEntity()), ForgeDirection.UNKNOWN))[0];
} catch (Exception e){
mod_Waila.log.log(Level.SEVERE, "[BC] Unhandled exception trying to access a tank for display !.\n" + String.valueOf(e));
return null;
@@ -0,0 +1,76 @@
package mcp.mobius.waila.addons.buildcraft;
import java.util.List;
import codechicken.lib.lang.LangUtil;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.ForgeDirection;
import mcp.mobius.waila.WailaExceptionHandler;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
public class HUDHandlerIPowerReceptor 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) {
try{
String maxPowerStr = LangUtil.translateG("hud.msg.maxpower");
String triggerStr = LangUtil.translateG("hud.msg.trigger");
Object powerReceiver = BCPowerAPIModule.IPowerReceptor_getPowerReceiver.invoke(accessor.getTileEntity(), ForgeDirection.UNKNOWN);
if (powerReceiver != null){
Float minEnergyRecv = (Float)BCPowerAPIModule.PR_getMinEnergyReceived.invoke(powerReceiver);
Float maxEnergyRecv = (Float)BCPowerAPIModule.PR_getMaxEnergyReceived.invoke(powerReceiver);
Float activation = (Float)BCPowerAPIModule.PR_getActivationEnergy.invoke(powerReceiver);
if(accessor.getNBTData().hasKey("powerProvider") && accessor.getNBTData().getCompoundTag("powerProvider").hasKey("storedEnergy") && config.getConfig("bcapi.storage")){
Float energyStored = (Float)accessor.getNBTData().getCompoundTag("powerProvider").getFloat("storedEnergy");
Float maxEnergyStor = (Float)BCPowerAPIModule.PR_getMaxEnergyStored.invoke(powerReceiver);
if (maxEnergyStor != 0.0f)
currenttip.add(String.format("%.1f / %.1f MJ", energyStored, maxEnergyStor));
}
if(accessor.getNBTData().hasKey("storedEnergy") && config.getConfig("bcapi.storage")){
Float energyStored = (Float)accessor.getNBTData().getFloat("storedEnergy");
Float maxEnergyStor = (Float)BCPowerAPIModule.PR_getMaxEnergyStored.invoke(powerReceiver);
if (maxEnergyStor != 0.0f)
currenttip.add(String.format("%.1f / %.1f MJ", energyStored, maxEnergyStor));
}
if (maxEnergyRecv != 0.0f && config.getConfig("bcapi.consump"))
//currenttip.add(String.format("Min/Max Input : %.1f / %.1f MJ/t", minEnergyRecv, maxEnergyRecv));
currenttip.add(String.format("%s : %.1f MJ/t", maxPowerStr, maxEnergyRecv));
if (activation != 0.0f && config.getConfig("bcapi.trigger"))
currenttip.add(String.format("%s : %.1f MJ", triggerStr, activation));
}
} catch (Exception e) {
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
}
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
@@ -0,0 +1,64 @@
package mcp.mobius.waila.addons.enderio;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.logging.Level;
import net.minecraftforge.common.ForgeDirection;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.addons.ExternalModulesHandler;
public class EnderIOModule {
public static Class TileCapacitorBank = null;
public static Method TCB_getMaxInput = null;
public static Method TCB_getMaxOutput = null;
public static Method TCB_getEnergyStored = null;
public static Method TCB_getMaxEnergyStored = null;
public static Method TCB_getMaxIO = null;
public static Class TileTesseract = null;
public static void register(){
try{
Class ModClass = Class.forName("crazypants.enderio.EnderIO");
mod_Waila.log.log(Level.INFO, "EnderIO mod found.");
} catch (ClassNotFoundException e){
mod_Waila.log.log(Level.INFO, "[EnderIO] EnderIO mod not found.");
return;
}
try{
TileCapacitorBank = Class.forName("crazypants.enderio.machine.power.TileCapacitorBank");
TCB_getEnergyStored = TileCapacitorBank.getMethod("getEnergyStored");
TCB_getMaxInput = TileCapacitorBank.getMethod("getMaxInput");
TCB_getMaxOutput = TileCapacitorBank.getMethod("getMaxOutput");
TCB_getMaxEnergyStored = TileCapacitorBank.getMethod("getMaxEnergyStored");
TCB_getMaxIO = TileCapacitorBank.getMethod("getMaxIO");
TileTesseract = Class.forName("crazypants.enderio.machine.hypercube.TileHyperCube");
} catch (ClassNotFoundException e){
mod_Waila.log.log(Level.WARNING, "[EnderStorage] Class not found. " + e);
return;
} catch (NoSuchMethodException e){
mod_Waila.log.log(Level.WARNING, "[EnderStorage] Method not found." + e);
return;
// } catch (NoSuchFieldException e){
// mod_Waila.log.log(Level.WARNING, "[EnderStorage] Field not found." + e);
// return;
} catch (Exception e){
mod_Waila.log.log(Level.WARNING, "[EnderStorage] Unhandled exception." + e);
return;
}
ExternalModulesHandler.instance().addConfig("EnderIO", "enderio.inout");
ExternalModulesHandler.instance().addConfig("EnderIO", "enderio.storage");
ExternalModulesHandler.instance().addConfig("EnderIO", "enderio.owner");
ExternalModulesHandler.instance().addConfig("EnderIO", "enderio.channel");
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerCapacitor(), TileCapacitorBank);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerTesseract(), TileTesseract);
}
}
@@ -0,0 +1,61 @@
package mcp.mobius.waila.addons.enderio;
import java.util.List;
import codechicken.lib.lang.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;
public class HUDHandlerCapacitor 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) {
try{
String maxIOStr = LangUtil.translateG("hud.msg.maxio");
String inputStr = LangUtil.translateG("hud.msg.input");
String outputStr = LangUtil.translateG("hud.msg.output");
Integer maxEnergyStored = (Integer)EnderIOModule.TCB_getMaxEnergyStored.invoke(accessor.getTileEntity());
Float energyStored = (Float)EnderIOModule.TCB_getEnergyStored.invoke(accessor.getTileEntity());
Integer maxIO = (Integer)EnderIOModule.TCB_getMaxIO.invoke(accessor.getTileEntity());
Integer maxInput = (Integer)EnderIOModule.TCB_getMaxInput.invoke(accessor.getTileEntity());
Integer maxOutput = (Integer)EnderIOModule.TCB_getMaxOutput.invoke(accessor.getTileEntity());
if (config.getConfig("enderio.storage"))
currenttip.add(String.format("%.1f / %d MJ", energyStored, maxEnergyStored));
if (config.getConfig("enderio.inout")){
currenttip.add(String.format("%s : %d MJ/t ", maxIOStr, maxIO));
currenttip.add(String.format("%s : %d MJ/t ", inputStr, maxInput));
currenttip.add(String.format("%s : %d MJ/t ", outputStr, maxOutput));
}
} catch (Exception e) {
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
}
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
@@ -0,0 +1,63 @@
package mcp.mobius.waila.addons.enderio;
import java.util.List;
import codechicken.lib.lang.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 HUDHandlerTesseract 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) {
String channel = "%s : \u00a7f%s\u00a7r %s";
String freq;
String frequser;
String owner;
if (config.getConfig("enderio.channel")){
if (accessor.getNBTData().hasKey("channelName")){
freq = accessor.getNBTData().getString("channelName");
if (accessor.getNBTData().hasKey("channelUser"))
frequser = "[ \u00a7f" + accessor.getNBTData().getString("channelUser") + " \u00a7r]";
else
frequser = "[ \u00a7f" + LangUtil.translateG("hud.msg.public") + " \u00a7r]";
}
else{
freq = LangUtil.translateG("hud.msg.none");
frequser = "";
}
currenttip.add(String.format(channel, LangUtil.translateG("hud.msg.frequency"), freq, frequser));
}
if (config.getConfig("enderio.owner")){
if (accessor.getNBTData().hasKey("owner"))
currenttip.add(String.format("%s : \u00a7f%s", LangUtil.translateG("hud.msg.owner"), accessor.getNBTData().getString("owner")));
}
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
@@ -15,6 +15,8 @@ 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");
@@ -32,6 +34,8 @@ 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){
mod_Waila.log.log(Level.WARNING, "[EnderStorage] Class not found. " + e);
return;
@@ -46,7 +50,7 @@ public class EnderStorageModule {
return;
}
ExternalModulesHandler.instance().addConfig("EnderStorage", "enderstorage.colors", "Colors");
ExternalModulesHandler.instance().addConfig("EnderStorage", "enderstorage.colors");
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerStorage(), TileFrequencyOwner);
}
}
@@ -2,6 +2,7 @@ package mcp.mobius.waila.addons.enderstorage;
import java.util.List;
import codechicken.lib.lang.LangUtil;
import net.minecraft.item.ItemStack;
import mcp.mobius.waila.WailaExceptionHandler;
import mcp.mobius.waila.api.IWailaConfigHandler;
@@ -10,7 +11,24 @@ import mcp.mobius.waila.api.IWailaDataProvider;
public class HUDHandlerStorage implements IWailaDataProvider {
private static String[] colors = {"White", "Orange", "Magenta", "LBlue", "Yellow", "Lime", "Pink", "Gray", "LGray", "Cyan", "Purple", "Blue", "Brown", "Green", "Red", "Black"};
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")
};
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
@@ -26,12 +44,18 @@ 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);
currenttip.add(String.format("%s/%s/%s", colors[freqLeft], colors[freqCenter], colors[freqRight]));
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]));
} catch (Exception e){
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
}
@@ -41,4 +65,9 @@ public class HUDHandlerStorage implements IWailaDataProvider {
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
@@ -0,0 +1,83 @@
package mcp.mobius.waila.addons.etb;
import java.lang.reflect.Field;
import java.util.logging.Level;
import net.minecraft.item.Item;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.addons.ExternalModulesHandler;
public class ETBModule {
public static Class TileSocket = null;
public static Field Socket_sides = null;
public static Field Socket_configs = null;
//public static Field Socket_sideID = null;
//public static Field Socket_sideMeta = null;
//public static Field Socket_facID = null;
//public static Field Socket_facMeta = null;
public static Class SocketsMod = null;
public static Field module = null;
public static Class SideConfig = null;
public static Field SC_tank = null;
public static Field SC_inventory = null;
public static Field SC_rsControl = null;
public static Field SC_rsLatch = null;
public static void register(){
try{
Class ModClass = Class.forName("emasher.sockets.TileSocket");
mod_Waila.log.log(Level.INFO, "Engineer Toolbox mod found.");
} catch (ClassNotFoundException e){
mod_Waila.log.log(Level.INFO, "[Engineer Toolbox] Engineer Toolbox mod not found.");
return;
}
try{
TileSocket = Class.forName("emasher.sockets.TileSocket");
Socket_sides = TileSocket.getField("sides");
Socket_configs = TileSocket.getField("configs");
//Socket_sideID = TileSocket.getField("sideID");
//Socket_sideMeta = TileSocket.getField("sideMeta");
//Socket_facID = TileSocket.getField("facID");
//Socket_facMeta = TileSocket.getField("facMeta");
SocketsMod = Class.forName("emasher.sockets.SocketsMod");
module = SocketsMod.getField("module");
//module = (Item)SocketsMod.getField("module").get(null);
/*
if (module == null){
mod_Waila.log.log(Level.WARNING, "[Engineer Toolbox] module field is null !");
return;
}
*/
SideConfig = Class.forName("emasher.api.SideConfig");
SC_tank = SideConfig.getField("tank");
SC_inventory = SideConfig.getField("inventory");
SC_rsControl = SideConfig.getField("rsControl");
SC_rsLatch = SideConfig.getField("rsLatch");
} catch (ClassNotFoundException e){
mod_Waila.log.log(Level.WARNING, "[Engineer Toolbox] Class not found. " + e);
return;
// } catch (NoSuchMethodException e){
// mod_Waila.log.log(Level.WARNING, "[Engineer Toolbox] Method not found." + e);
// return;
} catch (NoSuchFieldException e){
mod_Waila.log.log(Level.WARNING, "[Engineer Toolbox] Field not found." + e);
return;
} catch (Exception e){
mod_Waila.log.log(Level.WARNING, "[Engineer Toolbox] Unhandled exception." + e);
return;
}
ExternalModulesHandler.instance().addConfig("Engineer Toolbox", "etb.displaydata");
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerSocket(), TileSocket);
}
}
@@ -0,0 +1,104 @@
package mcp.mobius.waila.addons.etb;
import java.util.Arrays;
import java.util.List;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.ForgeDirection;
import mcp.mobius.waila.WailaExceptionHandler;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
public class HUDHandlerSocket 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("etb.displaydata")) return currenttip;
try {
int[] sides = (int[])ETBModule.Socket_sides.get(accessor.getTileEntity());
Object[] configs = (Object[])ETBModule.Socket_configs.get(accessor.getTileEntity());
Item module = (Item)ETBModule.module.get(null);
for( int s = 0; s < 6; s++){
if (sides[s] != 0){
int tank = (Integer)ETBModule.SC_tank.get(configs[s]);
int inventory = (Integer)ETBModule.SC_inventory.get(configs[s]);
boolean[] rsControl = (boolean[])ETBModule.SC_rsControl.get(configs[s]);
boolean[] rsLatch = (boolean[])ETBModule.SC_rsLatch.get(configs[s]);
ItemStack stack = new ItemStack(module, 1, sides[s]);
String tipstr = String.format("%-5s : %s ", ForgeDirection.getOrientation(s), stack.getDisplayName());
String configstr = "[ ";
if (tank != -1)
configstr += "\u00a79" + String.valueOf(tank) + " ";
if (inventory != -1)
configstr += "\u00a7a" + String.valueOf(inventory) + " ";
if (rsControl[0] || rsControl[1] || rsControl[2]){
configstr += "\u00a7c";
configstr += rsControl[0] ? "1" : "0";
configstr += rsControl[1] ? "1" : "0";
configstr += rsControl[2] ? "1" : "0";
configstr += " ";
}
if (rsLatch[0] || rsLatch[1] || rsLatch[2]){
configstr += "\u00a75";
configstr += rsLatch[0] ? "1" : "0";
configstr += rsLatch[1] ? "1" : "0";
configstr += rsLatch[2] ? "1" : "0";
configstr += " ";
}
configstr += "\u00a7r]";
if (!configstr.equals("[ \u00a7r]"))
tipstr += " " + configstr;
/*
if ((tank != -1) && (inventory != -1))
tipstr += String.format("[ \u00a79%d \u00a7a%d \u00a7r]", tank, inventory);
else if (tank != -1)
tipstr += String.format("[ \u00a79%d \u00a7r]", tank);
else if (inventory != -1)
tipstr += String.format("[ \u00a7a%d \u00a7r]", inventory);
*/
currenttip.add(tipstr);
}
}
} catch (Exception e) {
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
}
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
@@ -0,0 +1,34 @@
package mcp.mobius.waila.addons.exu;
import java.util.logging.Level;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.addons.ExternalModulesHandler;
public class ExtraUtilitiesModule {
public static Class ModExtraUtilities = null;
public static Class TileEntityDrum = null;
public static void register(){
try{
Class ModExtraUtilities = Class.forName("extrautils.ExtraUtils");
mod_Waila.log.log(Level.INFO, "ExtraUtilities mod found.");
} catch (ClassNotFoundException e){
mod_Waila.log.log(Level.INFO, "[ExtraUtilities] ExtraUtilities mod not found.");
return;
}
try{
TileEntityDrum = Class.forName("extrautils.tileentity.TileEntityDrum");
} catch (ClassNotFoundException e){
mod_Waila.log.log(Level.WARNING, "[ExtraUtilities] Class not found. " + e);
return;
}
ExternalModulesHandler.instance().addConfigRemote("ExtraUtilities", "extrautilities.fluidamount");
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerDrum(), TileEntityDrum);
}
}
@@ -0,0 +1,53 @@
package mcp.mobius.waila.addons.exu;
import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
public class HUDHandlerDrum 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("extrautilities.fluidamount")) return currenttip;
int amount = 0;
NBTTagCompound subtag = accessor.getNBTData().getCompoundTag("tank");
if (subtag.hasKey("Amount"))
amount = accessor.getNBTInteger(subtag, "Amount");
IFluidHandler handler = (IFluidHandler)accessor.getTileEntity();
if (handler == null) return currenttip;
FluidTankInfo[] tanks = handler.getTankInfo(ForgeDirection.UNKNOWN);
if (tanks.length != 1) return currenttip;
currenttip.add(String.format("%d / %d mB", amount, tanks[0].capacity));
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
@@ -24,4 +24,9 @@ public class HUDHandlerGravestone implements IWailaDataProvider {
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
@@ -1,29 +0,0 @@
package mcp.mobius.waila.addons.ic2;
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 HUDHandlerDoor implements IWailaDataProvider {
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
return IC2Module.ReinforcedDoorStack;
}
@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;
}
}
@@ -1,83 +0,0 @@
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;
}
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;
}
}
@@ -1,47 +0,0 @@
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;
}
}
@@ -1,47 +0,0 @@
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;
}
}
@@ -0,0 +1,76 @@
package mcp.mobius.waila.addons.ic2;
import java.util.List;
import codechicken.lib.lang.LangUtil;
import net.minecraft.item.ItemStack;
import mcp.mobius.waila.WailaExceptionHandler;
import mcp.mobius.waila.addons.ConfigHandler;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
public class HUDHandlerTEBaseGenerator 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) {
try{
int storage = -1;
int production = -1;
if (IC2Module.TileEntityBaseGenerator.isInstance(accessor.getTileEntity())){
storage = IC2Module.TEBG_MaxStorage.getShort(accessor.getTileEntity());
production = IC2Module.TEBG_Production.getInt(accessor.getTileEntity());
}
else if (IC2Module.TileEntityGeoGenerator.isInstance(accessor.getTileEntity())){
storage = IC2Module.TEGG_MaxStorage.getShort(accessor.getTileEntity());
production = IC2Module.TEGG_Production.getInt(accessor.getTileEntity());
}
else if (IC2Module.TileEntitySemifluidGenerator.isInstance(accessor.getTileEntity())){
storage = IC2Module.TESG_MaxStorage.getShort(accessor.getTileEntity());
production = (int)IC2Module.TESG_Production.getDouble(accessor.getTileEntity());
}
String storedStr = LangUtil.translateG("hud.msg.stored");
String outputStr = LangUtil.translateG("hud.msg.output");
/* EU Storage */
if (ConfigHandler.instance().getConfig("ic2.storage")){
double stored = IC2Module.getStoredEnergy(accessor);
if ( stored >= 0.0 && storage > 0)
currenttip.add(String.format("%s : \u00a7f%d\u00a7r / \u00a7f%d\u00a7r EU", storedStr, Math.round(Math.min(stored,storage)), storage));
//else if (stored >= 0.0)
// currenttip.add(String.format("Stored : %d EU", stored));
}
if (ConfigHandler.instance().getConfig("ic2.outputeu")){
if ( production > 0)
currenttip.add(String.format("%s : \u00a7f%d\u00a7r EU/t", outputStr, production));
}
} catch (Exception e){
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
}
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
@@ -0,0 +1,61 @@
package mcp.mobius.waila.addons.ic2;
import java.util.List;
import codechicken.lib.lang.LangUtil;
import net.minecraft.item.ItemStack;
import mcp.mobius.waila.WailaExceptionHandler;
import mcp.mobius.waila.addons.ConfigHandler;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
public class HUDHandlerTEElectricBlock implements IWailaDataProvider {
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor,
IWailaConfigHandler config) {
// TODO Auto-generated method stub
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) {
try{
String storedStr = LangUtil.translateG("hud.msg.stored");
String outputStr = LangUtil.translateG("hud.msg.output");
/* EU Storage */
if (ConfigHandler.instance().getConfig("ic2.storage")){
double stored = IC2Module.getStoredEnergy(accessor);
int storage = IC2Module.TEEB_MaxStorage.getInt(accessor.getTileEntity());
if ( stored >= 0.0 )
currenttip.add(String.format("%s : \u00a7f%d\u00a7r / \u00a7f%d\u00a7r EU", storedStr, Math.round(Math.min(stored,storage)), storage));
}
if (ConfigHandler.instance().getConfig("ic2.outputeu")){
int production = IC2Module.TEEB_Output.getInt(accessor.getTileEntity());
if ( production > 0)
currenttip.add(String.format("%s : \u00a7f%d\u00a7r EU/t", outputStr, production));
}
} catch (Exception e){
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
}
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
@@ -0,0 +1,81 @@
package mcp.mobius.waila.addons.ic2;
import java.util.List;
import codechicken.lib.lang.LangUtil;
import net.minecraft.item.ItemStack;
import mcp.mobius.waila.WailaExceptionHandler;
import mcp.mobius.waila.addons.ConfigHandler;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
public class HUDHandlerTEStandardMachine implements IWailaDataProvider {
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor,
IWailaConfigHandler config) {
// TODO Auto-generated method stub
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) {
try{
IC2Upgrades upgrades = IC2Module.getUpgrades(accessor);
int baseConsumption = IC2Module.TESM_DefaultEnergyConsume.getInt(accessor.getTileEntity());
int baseOpTime = IC2Module.TESM_DefaultOperationLength.getInt(accessor.getTileEntity());
int baseStorage = IC2Module.TESM_DefaultEnergyStorage.getInt(accessor.getTileEntity());
long consumption = Math.round(Math.min(baseConsumption * Math.pow(1.6D, upgrades.overclocker), 2147483647));
double stackOpLen = baseOpTime * 64.0D * Math.pow(0.7D, upgrades.overclocker);
int opPerTick = ((int)Math.min(Math.ceil(64.0D / stackOpLen), 2147483647.0D));
int opTime = ((int)Math.round(stackOpLen * opPerTick / 64.0D));
int storage = Math.round(Math.min(baseStorage + 10000 * upgrades.storage + opTime * consumption, 2147483647));;
int maxinput = (Integer)IC2Module.IES_GetMaxSafeInput.invoke(accessor.getTileEntity()) * (int)Math.pow(4.0D, Math.min(4, upgrades.transform));
double stored = IC2Module.getStoredEnergy(accessor);
String storedStr = LangUtil.translateG("hud.msg.stored");
String powerStr = LangUtil.translateG("hud.msg.power");
String maxPowerStr = LangUtil.translateG("hud.msg.maxpower");
/* EU Storage */
if (ConfigHandler.instance().getConfig("ic2.storage")){
if ( stored >= 0.0 )
currenttip.add(String.format("%s : \u00a7f%d\u00a7r / \u00a7f%d\u00a7r EU", storedStr, Math.round(Math.min(stored,storage)), storage));
}
if (ConfigHandler.instance().getConfig("ic2.consump")){
if ( consumption > 0)
currenttip.add(String.format("%s : \u00a7f%d\u00a7r EU/t", powerStr, consumption ));
}
if (ConfigHandler.instance().getConfig("ic2.inputeu")){
if ( maxinput > 0)
currenttip.add(String.format("%s : \u00a7f%d\u00a7r EU/t", maxPowerStr, maxinput ));
}
} catch (Exception e){
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
}
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
@@ -0,0 +1,58 @@
package mcp.mobius.waila.addons.ic2;
import java.util.List;
import codechicken.lib.lang.LangUtil;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import mcp.mobius.waila.addons.ConfigHandler;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
public class HUDHandlerTETradeOMat 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 (!ConfigHandler.instance().getConfig("ic2.tradeomat")) return currenttip;
NBTTagCompound slots = accessor.getNBTData().getCompoundTag("InvSlots");
NBTTagList offer = slots.getCompoundTag("offer").getTagList("Contents");
NBTTagList demand = slots.getCompoundTag("demand").getTagList("Contents");
String offersStr = LangUtil.translateG("hud.msg.offers");
String demandsStr = LangUtil.translateG("hud.msg.demands");
if (offer.tagCount() == 1){
NBTTagCompound subtag = (NBTTagCompound)offer.tagAt(0);
ItemStack is = new ItemStack(subtag.getShort("id"), subtag.getByte("Count"), subtag.getShort("Damage"));
currenttip.add(String.format("%s : \u00a7f%d\u00a7r x \u00a7f%s\u00a7r", offersStr, is.stackSize, is.getDisplayName()));
}
if (demand.tagCount() == 1){
NBTTagCompound subtag = (NBTTagCompound)demand.tagAt(0);
ItemStack is = new ItemStack(subtag.getShort("id"), subtag.getByte("Count"), subtag.getShort("Damage"));
currenttip.add(String.format("%s : \u00a7f%d\u00a7r x \u00a7f%s\u00a7r", demandsStr, is.stackSize, is.getDisplayName()));
}
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
+126 -49
View File
@@ -4,88 +4,165 @@ 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;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.addons.ConfigHandler;
import mcp.mobius.waila.addons.ExternalModulesHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
public class IC2Module {
/* Our interfaces */
public static Class IEnergyStorage = null;
public static Class IEnergySink = null;
public static Class IEnergySource = null;
public static Class TileEntityStandardMachine = null;
public static Field TESM_DefaultEnergyStorage = null;
public static Field TESM_DefaultEnergyConsume = null;
public static Field TESM_DefaultOperationLength = null;
public static Field TESM_MaxEnergy = null;
/* Methods interfaces */
public static Method IEnergyStorage_GetCapacity = null;
public static Method IEnergySink_GetInput = null;
public static Method IEnergySource_GetOutput = null;
public static Class TileEntityBaseGenerator = null;
public static Field TEBG_MaxStorage = null;
public static Field TEBG_Production = null;
public static Class TileEntitySemifluidGenerator = null;
public static Field TESG_MaxStorage = null;
public static Field TESG_Production = null;
public static Class TileEntityGeoGenerator = null;
public static Field TEGG_MaxStorage = null;
public static Field TEGG_Production = null;
public static Class TileEntityElectricBlock = null;
public static Field TEEB_MaxStorage = null;
public static Field TEEB_Output = null;
public static Class IEnergySink = null;
public static Method IES_GetMaxSafeInput = null;
public static Class TileEntityTradeOMat = 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 ItemStack TransformerUpgradeStack = null;
public static Field EnergyStorageUpgrade = null;
public static ItemStack EnergyStorageUpgradeStack = null;
public static Field OverclockerUpgrade = null;
public static ItemStack OverclockerUpgradeStack = 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{
TileEntityStandardMachine = Class.forName("ic2.core.block.machine.tileentity.TileEntityStandardMachine");
TESM_DefaultEnergyStorage = TileEntityStandardMachine.getField("defaultEnergyStorage");
TESM_DefaultEnergyConsume = TileEntityStandardMachine.getField("defaultEnergyConsume");
TESM_DefaultOperationLength = TileEntityStandardMachine.getField("defaultOperationLength");
TESM_MaxEnergy = TileEntityStandardMachine.getField("maxEnergy");
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");
TileEntityBaseGenerator = Class.forName("ic2.core.block.generator.tileentity.TileEntityBaseGenerator");
TEBG_MaxStorage = TileEntityBaseGenerator.getField("maxStorage");
TEBG_Production = TileEntityBaseGenerator.getField("production");
TileEntitySemifluidGenerator = Class.forName("ic2.core.block.generator.tileentity.TileEntitySemifluidGenerator");
TESG_MaxStorage = TileEntitySemifluidGenerator.getDeclaredField("maxStorage");
TESG_Production = TileEntitySemifluidGenerator.getDeclaredField("production");
TESG_MaxStorage.setAccessible(true);
TESG_Production.setAccessible(true);
IC2Items = Class.forName("ic2.core.Ic2Items");
TransformerUpgrade = IC2Items.getDeclaredField("transformerUpgrade");
EnergyStorageUpgrade = IC2Items.getDeclaredField("energyStorageUpgrade");
TileEntityGeoGenerator = Class.forName("ic2.core.block.generator.tileentity.TileEntityGeoGenerator");
TEGG_MaxStorage = TileEntityGeoGenerator.getField("maxStorage");
TEGG_Production = TileEntityGeoGenerator.getField("production");
TileEntityElectricBlock = Class.forName("ic2.core.block.wiring.TileEntityElectricBlock");
TEEB_MaxStorage = TileEntityElectricBlock.getField("maxStorage");
TEEB_Output = TileEntityElectricBlock.getField("output");
IEnergySink = Class.forName("ic2.api.energy.tile.IEnergySink");
IES_GetMaxSafeInput = IEnergySink.getMethod("getMaxSafeInput");
IC2Items = Class.forName("ic2.core.Ic2Items");
TransformerUpgrade = IC2Items.getField("transformerUpgrade");
EnergyStorageUpgrade = IC2Items.getField("energyStorageUpgrade");
OverclockerUpgrade = IC2Items.getField("overclockerUpgrade");
TransformerUpgradeStack = (ItemStack)TransformerUpgrade.get(null);
EnergyStorageUpgradeStack = (ItemStack)EnergyStorageUpgrade.get(null);
EnergyStorageUpgradeStack = (ItemStack)EnergyStorageUpgrade.get(null);
OverclockerUpgradeStack = (ItemStack)OverclockerUpgrade.get(null);
BlockIC2Door = Class.forName("ic2.core.block.BlockIC2Door");
ReinforcedDoor = IC2Items.getDeclaredField("reinforcedDoor");
ReinforcedDoorStack = (ItemStack)ReinforcedDoor.get(null);
TileEntityTradeOMat = Class.forName("ic2.core.block.personal.TileEntityTradeOMat");
} catch (ClassNotFoundException e){
//e.printStackTrace();
mod_Waila.log.log(Level.WARNING, "[IC2] Class not found. " + e);
return;
} catch (NoSuchMethodException e){
//e.printStackTrace();
mod_Waila.log.log(Level.WARNING, "[IC2] Method not found." + e);
return;
} catch (NoSuchFieldException e){
//e.printStackTrace();
mod_Waila.log.log(Level.WARNING, "[IC2] Field not found." + e);
return;
} catch (Exception e){
//e.printStackTrace();
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);
ExternalModulesHandler.instance().addConfigRemote("IndustrialCraft2", "ic2.storage");
ExternalModulesHandler.instance().addConfig("IndustrialCraft2", "ic2.outputeu");
ExternalModulesHandler.instance().addConfigRemote("IndustrialCraft2", "ic2.inputeu");
ExternalModulesHandler.instance().addConfigRemote("IndustrialCraft2", "ic2.consump");
ExternalModulesHandler.instance().addConfigRemote("IndustrialCraft2", "ic2.tradeomat");
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerTEStandardMachine(), TileEntityStandardMachine);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerTEBaseGenerator(), TileEntityBaseGenerator);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerTEBaseGenerator(), TileEntitySemifluidGenerator);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerTEBaseGenerator(), TileEntityGeoGenerator);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerTEElectricBlock(), TileEntityElectricBlock);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerTETradeOMat(), TileEntityTradeOMat);
}
/* Retuns the current stored energy if available in the nbt and config is true */
public static double getStoredEnergy(IWailaDataAccessor accessor){
if (ConfigHandler.instance().getConfig("ic2.storage")){
if (accessor.getNBTData().hasKey("energy"))
return accessor.getNBTData().getDouble("energy");
else if (accessor.getNBTData().hasKey("storage"))
return accessor.getNBTData().getDouble("storage");
}
return -1.0;
}
public static IC2Upgrades getUpgrades(IWailaDataAccessor accessor){
NBTTagCompound nbt = accessor.getNBTData();
IC2Upgrades upgrades = new IC2Upgrades();
if (!nbt.hasKey("InvSlots")) return null;
NBTTagCompound inventory = nbt.getCompoundTag("InvSlots");
if (!inventory.hasKey("upgrade")) return null;
NBTTagList nbtupgrades = inventory.getCompoundTag("upgrade").getTagList("Contents");
for (Object subobj : nbtupgrades.tagList){
NBTTagCompound subtag = (NBTTagCompound)subobj;
int id = subtag.getShort("id");
int meta = subtag.getShort("Damage");
int count = subtag.getByte("Count");
//ItemStack is = new ItemStack(id, 1, count);
if (TransformerUpgradeStack.getItemDamage() == meta && TransformerUpgradeStack.itemID == id)
upgrades.transform += count;
if (EnergyStorageUpgradeStack.getItemDamage() == meta && EnergyStorageUpgradeStack.itemID == id)
upgrades.storage += count;
if (OverclockerUpgradeStack.getItemDamage() == meta && OverclockerUpgradeStack.itemID == id)
upgrades.overclocker += count;
}
return upgrades;
}
}
@@ -0,0 +1,7 @@
package mcp.mobius.waila.addons.ic2;
public class IC2Upgrades {
public int transform = 0;
public int storage = 0;
public int overclocker = 0;
}
@@ -0,0 +1,69 @@
package mcp.mobius.waila.addons.openblocks;
import java.util.List;
import codechicken.lib.lang.LangUtil;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
public class HUDHandlerTank 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) {
if (!config.getConfig("openblocks.fluidamount")) return currenttip;
IFluidHandler handler = (IFluidHandler)accessor.getTileEntity();
if (handler == null) return currenttip;
FluidTankInfo[] tanks = handler.getTankInfo(ForgeDirection.UNKNOWN);
if (tanks.length != 1) return currenttip;
FluidStack fluid = tanks[0].fluid;
String name = currenttip.get(0);
try{
name += String.format(" < %s >", fluid.getFluid().getLocalizedName());
} catch (NullPointerException f){
name += " " + LangUtil.translateG("hud.msg.empty");
}
currenttip.set(0, name);
return currenttip;
}
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
if (!config.getConfig("openblocks.fluidamount")) return currenttip;
IFluidHandler handler = (IFluidHandler)accessor.getTileEntity();
if (handler == null) return currenttip;
FluidTankInfo[] tanks = handler.getTankInfo(ForgeDirection.UNKNOWN);
if (tanks.length != 1) return currenttip;
if(tanks[0].fluid != null)
currenttip.add(String.format("%d / %d mB", tanks[0].fluid.amount, tanks[0].capacity));
else
currenttip.add(String.format("0 / %d mB", tanks[0].capacity));
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
@@ -0,0 +1,33 @@
package mcp.mobius.waila.addons.openblocks;
import java.util.logging.Level;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.addons.ExternalModulesHandler;
public class OpenBlocksModule {
public static Class ModOpenBlocks = null;
public static Class TileEntityTank = null;
public static void register(){
try{
Class ModOpenBlocks = Class.forName("openblocks.OpenBlocks");
mod_Waila.log.log(Level.INFO, "OpenBlocks mod found.");
} catch (ClassNotFoundException e){
mod_Waila.log.log(Level.INFO, "[OpenBlocks] OpenBlocks mod not found.");
return;
}
try{
TileEntityTank = Class.forName("openblocks.common.tileentity.TileEntityTank");
} catch (ClassNotFoundException e){
mod_Waila.log.log(Level.WARNING, "[OpenBlocks] Class not found. " + e);
return;
}
ExternalModulesHandler.instance().addConfigRemote("OpenBlocks", "openblocks.fluidamount");
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerTank(), TileEntityTank);
ExternalModulesHandler.instance().registerHeadProvider(new HUDHandlerTank(), TileEntityTank);
}
}
@@ -0,0 +1,202 @@
package mcp.mobius.waila.addons.projectred;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraftforge.common.ForgeDirection;
import mcp.mobius.waila.api.IWailaBlockDecorator;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.gui.helpers.UIHelper;
public class HUDDecoratorRsGateLogic implements IWailaBlockDecorator {
static byte[][] IOARRAY={
{1,1,2,1} /* OR */, {1,1,2,1} /* NOR */, {1,2,2,2} /* NOT */, {1,1,2,1} /* AND */,
{1,1,2,1} /* NAND */, {0,1,2,1} /* XOR */, {0,1,2,1} /* XNOR */, {1,2,2,2} /* Buf */,
{3,4,2,5} /* Multi */, {1,0,2,0} /* Pulse */, {1,0,2,0} /* Repeat */, {1,2,2,2} /* Rand */,
{2,1,2,1} /* Latch */, {2,1,2,1} /* Toggle*/, {6,1,2,2} /* Transp */, {2,0,0,0} /* Light */,
{2,0,0,0} /* Rain */, {1,7,2,7} /* Timer */, {2,2,2,2} /* Sequen */, {2,9,2,8} /* Count */,
{1,2,2,6} /* State */, {6,1,2,1} /* Sync */, {10,1,10,1} /* Bus */, {11,12,11,12} /* Null */,
{11,12,11,12} /* Inver */, {11,12,11,12} /* Buff */, {1,9,2,8} /* Cmp */, {1,12,2,12} /* And */,
};
static String[] IONAMES={ "", "IN", "OUT", "SWAP", "IN_A", "IN_B", "LOCK", "IO", "POS", "NEG", "BUS", "A", "B"};
@Override
public void decorateBlock(ItemStack itemStack, IWailaDataAccessor accessor, IWailaConfigHandler config) {
if (!config.getConfig("pr.showio")) return;
int orient = 0;
int subID = 0;
int shape = 0;
boolean found = false;
if (!accessor.getNBTData().hasKey("parts")) return;
NBTTagList parts = accessor.getNBTData().getTagList("parts");
for (int i = 0; i < parts.tagCount(); i++){
NBTTagCompound subtag = (NBTTagCompound)parts.tagAt(i);
String id = subtag.getString("id");
if (id.equals("pr_sgate") || id.equals("pr_igate") ||
id.equals("pr_tgate") || id.equals("pr_bgate") ||
id.equals("pr_agate") || id.equals("pr_rgate")){
orient = accessor.getNBTInteger(subtag, "orient");
subID = accessor.getNBTInteger(subtag, "subID");
shape = accessor.getNBTInteger(subtag, "shape");
found = true;
}
}
if (!found) return;
//orient = orient - ((orient & 0x10) + (orient & 0x8) + (orient & 0x4));
int hOrient = orient & 0x3;
ForgeDirection vOrient = ForgeDirection.getOrientation((orient - (orient & 0x3)) >> 2);
//System.out.printf("%s\n", ForgeDirection.getOrientation(vOrient));
if (vOrient == ForgeDirection.EAST)
hOrient -= 1;
if (vOrient == ForgeDirection.WEST)
hOrient += 1;
if (hOrient == -1)
hOrient = 3;
String[] IOStr = new String[4];
for (int i = 0; i < 4; i++)
IOStr[i] = IONAMES[IOARRAY[subID][i]];
String[] IOStrRot = new String[4];
for (int i = 0; i < 4 ; i++){
int j = i + hOrient;
if (j >= 4) j -= 4;
IOStrRot[j] = IOStr[i];
}
switch(vOrient){
case DOWN:
UIHelper.drawFloatingText(IOStrRot[0], accessor.getRenderingPosition(), 0.5F, 0.2F, 1.4F, 90F, 0F, 0F); // Orient 0
UIHelper.drawFloatingText(IOStrRot[1], accessor.getRenderingPosition(), -0.4F, 0.2F, 0.5F, 90F, 270F, 0F); // Orient 1
UIHelper.drawFloatingText(IOStrRot[2], accessor.getRenderingPosition(), 0.5F, 0.2F, -0.4F, 90F, 180F, 0F); // Orient 2
UIHelper.drawFloatingText(IOStrRot[3], accessor.getRenderingPosition(), 1.4F, 0.2F, 0.5F, 90F, 90F, 0F); // Orient 3
break;
case EAST:
UIHelper.drawFloatingText(IOStrRot[0], accessor.getRenderingPosition(), 0.8F, 0.5F, 1.4F, 0F, 90F, 90F);
UIHelper.drawFloatingText(IOStrRot[1], accessor.getRenderingPosition(), 0.8F, -0.4F, 0.5F, 0F, 90F, 180F);
UIHelper.drawFloatingText(IOStrRot[2], accessor.getRenderingPosition(), 0.8F, 0.5F, -0.4F, 0F, 90F, 270F);
UIHelper.drawFloatingText(IOStrRot[3], accessor.getRenderingPosition(), 0.8F, 1.4F, 0.5F, 0F, 90F, 0F);
break;
case NORTH:
UIHelper.drawFloatingText(IOStrRot[0], accessor.getRenderingPosition(), 0.5F, 1.4F, 0.2F, 0F, 180F, 0F);
UIHelper.drawFloatingText(IOStrRot[1], accessor.getRenderingPosition(), 1.4F, 0.5F, 0.2F, 0F, 180F, 90F);
UIHelper.drawFloatingText(IOStrRot[2], accessor.getRenderingPosition(), 0.5F, -0.4F, 0.2F, 0F, 180F, 180F);
UIHelper.drawFloatingText(IOStrRot[3], accessor.getRenderingPosition(), -0.4F, 0.5F, 0.2F, 0F, 180F, 270F);
break;
case SOUTH:
UIHelper.drawFloatingText(IOStrRot[0], accessor.getRenderingPosition(), 0.5F, 1.4F, 0.8F, 0F, 0F, 0F);
UIHelper.drawFloatingText(IOStrRot[1], accessor.getRenderingPosition(), -0.4F, 0.5F, 0.8F, 0F, 0F, 90F);
UIHelper.drawFloatingText(IOStrRot[2], accessor.getRenderingPosition(), 0.5F, -0.4F, 0.8F, 0F, 0F, 180F);
UIHelper.drawFloatingText(IOStrRot[3], accessor.getRenderingPosition(), 1.4F, 0.5F, 0.8F, 0F, 0F, 270F);
break;
case UP:
UIHelper.drawFloatingText(IOStrRot[0], accessor.getRenderingPosition(), 0.5F, 0.8F, 1.4F, 270F, 180F, 0F);
UIHelper.drawFloatingText(IOStrRot[1], accessor.getRenderingPosition(), 1.4F, 0.8F, 0.5F, 270F, 270F, 0F);
UIHelper.drawFloatingText(IOStrRot[2], accessor.getRenderingPosition(), 0.5F, 0.8F, -0.4F, 270F, 0F, 0F);
UIHelper.drawFloatingText(IOStrRot[3], accessor.getRenderingPosition(), -0.4F, 0.8F, 0.5F, 270F, 90F, 0F);
break;
case WEST:
UIHelper.drawFloatingText(IOStrRot[0], accessor.getRenderingPosition(), 0.2F, 0.5F, 1.4F, 180F, 90F, 90F);
UIHelper.drawFloatingText(IOStrRot[1], accessor.getRenderingPosition(), 0.2F, 1.4F, 0.5F, 180F, 90F, 180F);
UIHelper.drawFloatingText(IOStrRot[2], accessor.getRenderingPosition(), 0.2F, 0.5F, -0.4F, 180F, 90F, 270F);
UIHelper.drawFloatingText(IOStrRot[3], accessor.getRenderingPosition(), 0.2F, -0.4F, 0.5F, 180F, 90F, 0F);
break;
default:
break;
}
double x = accessor.getRenderingPosition().xCoord;
double y = accessor.getRenderingPosition().yCoord;
double z = accessor.getRenderingPosition().zCoord;
switch(vOrient){
case DOWN:
UIHelper.drawRectangle(x - 0.1, y + 0.1, z, x, y + 0.1, z + 0.35, 255, 255, 255, 150 );
UIHelper.drawRectangle(x - 0.1, y + 0.1, z + 0.65, x, y + 0.1, z + 1.0, 255, 255, 255, 150 );
UIHelper.drawRectangle(x + 1.0, y + 0.1, z, x + 1.1, y + 0.1, z + 0.35, 255, 255, 255, 150 );
UIHelper.drawRectangle(x + 1.0, y + 0.1, z + 0.65, x + 1.1, y + 0.1, z + 1.0, 255, 255, 255, 150 );
UIHelper.drawRectangle(x - 0.1, y + 0.1, z - 0.1, x + 0.35, y + 0.1, z + 0.1, 255, 255, 255, 150 );
UIHelper.drawRectangle(x + 0.65, y + 0.1, z - 0.1, x + 1.1, y + 0.1, z + 0.1, 255, 255, 255, 150 );
UIHelper.drawRectangle(x - 0.1, y + 0.1, z + 1.0, x + 0.35, y + 0.1, z + 1.1, 255, 255, 255, 150 );
UIHelper.drawRectangle(x + 0.65, y + 0.1, z + 1.0, x + 1.1, y + 0.1, z + 1.1, 255, 255, 255, 150 );
break;
case EAST:
UIHelper.drawRectangleEW(x + 0.9, y, z - 0.1, x + 0.9, y + 0.35, z, 255, 255, 255, 150 );
UIHelper.drawRectangleEW(x + 0.9, y + 0.65, z - 0.1, x + 0.9, y + 1.0, z, 255, 255, 255, 150 );
UIHelper.drawRectangleEW(x + 0.9, y, z + 1.0, x + 0.9, y + 0.35, z + 1.1, 255, 255, 255, 150 );
UIHelper.drawRectangleEW(x + 0.9, y + 0.65, z + 1.0, x + 0.9, y + 1.0, z + 1.1, 255, 255, 255, 150 );
UIHelper.drawRectangleEW(x + 0.9, y - 0.1, z - 0.1, x + 0.9, y, z + 0.35, 255, 255, 255, 150 );
UIHelper.drawRectangleEW(x + 0.9, y - 0.1, z + 0.65, x + 0.9, y, z + 1.1, 255, 255, 255, 150 );
UIHelper.drawRectangleEW(x + 0.9, y + 1.0, z - 0.1, x + 0.9, y + 1.1, z + 0.35, 255, 255, 255, 150 );
UIHelper.drawRectangleEW(x + 0.9, y + 1.0, z + 0.65, x + 0.9, y + 1.1, z + 1.1, 255, 255, 255, 150 );
break;
case NORTH:
UIHelper.drawRectangle(x - 0.1, y, z + 0.1, x, y + 0.35, z + 0.1, 255, 255, 255, 150 );
UIHelper.drawRectangle(x - 0.1, y + 0.65, z + 0.1, x, y + 1.0, z + 0.1, 255, 255, 255, 150 );
UIHelper.drawRectangle(x + 1.0, y, z + 0.1, x + 1.1, y + 0.35, z + 0.1, 255, 255, 255, 150 );
UIHelper.drawRectangle(x + 1.0, y + 0.65, z + 0.1, x + 1.1, y + 1.0, z + 0.1, 255, 255, 255, 150 );
UIHelper.drawRectangle(x - 0.1, y - 0.1, z + 0.1, x + 0.35, y, z + 0.1, 255, 255, 255, 150 );
UIHelper.drawRectangle(x + 0.65, y - 0.1, z + 0.1, x + 1.1, y, z + 0.1, 255, 255, 255, 150 );
UIHelper.drawRectangle(x - 0.1, y + 1.0, z + 0.1, x + 0.35, y + 1.1, z + 0.1, 255, 255, 255, 150 );
UIHelper.drawRectangle(x + 0.65, y + 1.0, z + 0.1, x + 1.1, y + 1.1, z + 0.1, 255, 255, 255, 150 );
break;
case SOUTH:
UIHelper.drawRectangle(x, y, z + 0.9, x - 0.1, y + 0.35, z + 0.9, 255, 255, 255, 150 );
UIHelper.drawRectangle(x, y + 0.65, z + 0.9, x - 0.1, y + 1.0, z + 0.9, 255, 255, 255, 150 );
UIHelper.drawRectangle(x + 1.1, y, z + 0.9, x + 1.0, y + 0.35, z + 0.9, 255, 255, 255, 150 );
UIHelper.drawRectangle(x + 1.1, y + 0.65, z + 0.9, x + 1.0, y + 1.0, z + 0.9, 255, 255, 255, 150 );
UIHelper.drawRectangle(x + 0.35, y - 0.1, z + 0.9, x - 0.1, y, z + 0.9, 255, 255, 255, 150 );
UIHelper.drawRectangle(x + 1.10, y - 0.1, z + 0.9, x + 0.65, y, z + 0.9, 255, 255, 255, 150 );
UIHelper.drawRectangle(x + 0.35, y + 1.0, z + 0.9, x - 0.1, y + 1.1, z + 0.9, 255, 255, 255, 150 );
UIHelper.drawRectangle(x + 1.1, y + 1.0, z + 0.9, x + 0.65, y + 1.1, z + 0.9, 255, 255, 255, 150 );
break;
case UP:
UIHelper.drawRectangle(x, y + 0.9, z, x - 0.1, y + 0.9, z + 0.35, 255, 255, 255, 150 );
UIHelper.drawRectangle(x, y + 0.9, z + 0.65, x - 0.1, y + 0.9, z + 1.0, 255, 255, 255, 150 );
UIHelper.drawRectangle(x + 1.1, y + 0.9, z, x + 1.0, y + 0.9, z + 0.35, 255, 255, 255, 150 );
UIHelper.drawRectangle(x + 1.1, y + 0.9, z + 0.65, x + 1.0, y + 0.9, z + 1.0, 255, 255, 255, 150 );
UIHelper.drawRectangle(x + 0.35, y + 0.9, z - 0.1, x - 0.1, y + 0.9, z + 0.1, 255, 255, 255, 150 );
UIHelper.drawRectangle(x + 1.1, y + 0.9, z - 0.1, x + 0.65, y + 0.9, z + 0.1, 255, 255, 255, 150 );
UIHelper.drawRectangle(x +0.35, y + 0.9, z + 1.0, x - 0.1, y + 0.9, z + 1.1, 255, 255, 255, 150 );
UIHelper.drawRectangle(x + 1.1, y + 0.9, z + 1.0, x + 0.65, y + 0.9, z + 1.1, 255, 255, 255, 150 );
break;
case WEST:
UIHelper.drawRectangleEW(x + 0.1, y+ 0.35, z - 0.1, x + 0.1, y , z, 255, 255, 255, 150 );
UIHelper.drawRectangleEW(x + 0.1, y + 1.0, z - 0.1, x + 0.1, y + 0.65, z, 255, 255, 255, 150 );
UIHelper.drawRectangleEW(x + 0.1, y + 0.35, z + 1.0, x + 0.1, y, z + 1.1, 255, 255, 255, 150 );
UIHelper.drawRectangleEW(x + 0.1, y + 1.0, z + 1.0, x + 0.1, y + 0.65, z + 1.1, 255, 255, 255, 150 );
UIHelper.drawRectangleEW(x + 0.1, y, z - 0.1, x + 0.1, y - 0.1, z + 0.35, 255, 255, 255, 150 );
UIHelper.drawRectangleEW(x + 0.1, y, z + 0.65, x + 0.1, y - 0.1, z + 1.1, 255, 255, 255, 150 );
UIHelper.drawRectangleEW(x + 0.1, y + 1.1, z - 0.1, x + 0.1, y + 1.0, z + 0.35, 255, 255, 255, 150 );
UIHelper.drawRectangleEW(x + 0.1, y + 1.1, z + 0.65, x + 0.1, y + 1.0, z + 1.1, 255, 255, 255, 150 );
break;
default:
break;
}
}
}
@@ -0,0 +1,105 @@
package mcp.mobius.waila.addons.projectred;
import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
public class HUDHandlerRsGateLogic 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("pr.showdata")) return currenttip;
int orient = 0;
int subID = 0;
int shape = 0;
int pmax = 0;
int val = 0;
int max = 0;
int dec = 0;
int inc = 0;
boolean found = false;
if (!accessor.getNBTData().hasKey("parts")) return currenttip;
NBTTagList parts = accessor.getNBTData().getTagList("parts");
for (int i = 0; i < parts.tagCount(); i++){
NBTTagCompound subtag = (NBTTagCompound)parts.tagAt(i);
String id = subtag.getString("id");
if (id.equals("pr_sgate") || id.equals("pr_igate") ||
id.equals("pr_tgate") || id.equals("pr_bgate") ||
id.equals("pr_agate") || id.equals("pr_rgate")){
orient = accessor.getNBTInteger(subtag, "orient");
subID = accessor.getNBTInteger(subtag, "subID");
shape = accessor.getNBTInteger(subtag, "shape");
if (subID == 17)
pmax = accessor.getNBTInteger(subtag, "pmax");
if (subID == 19){
val = accessor.getNBTInteger(subtag, "val");
max = accessor.getNBTInteger(subtag, "max");
dec = accessor.getNBTInteger(subtag, "dec");
inc = accessor.getNBTInteger(subtag, "inc");
}
found = true;
}
}
if (!found) return currenttip;
switch(subID){
case 10:
currenttip.add(String.format("Delay : \u00a7f%d ticks", (int)Math.pow(2, shape)));
break;
case 15:
if (shape == 0)
currenttip.add("Shape : \u00a7fOpen");
if (shape == 1)
currenttip.add("Shape : \u00a7fHalf closed");
if (shape == 2)
currenttip.add("Shape : \u00a7fclosed");
break;
case 17:
currenttip.add(String.format("Timer : \u00a7f%d \u00a7rms", (pmax + 2) * 50));
break;
case 19:
currenttip.add(String.format("Value : \u00a7f%d \u00a7r/ \u00a7f%d", val, max));
currenttip.add(String.format("Step : \u00a7f-%d \u00a7r/ \u00a7f+%d", dec, inc));
default:
break;
}
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
@@ -0,0 +1,51 @@
package mcp.mobius.waila.addons.projectred;
import java.io.File;
import java.util.logging.Level;
import net.minecraft.block.Block;
import net.minecraftforge.common.Configuration;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.addons.ExternalModulesHandler;
public class ProjectRedModule {
public static Class BlockMultipart = null;
public static void register(){
try{
Class ModClass = Class.forName("mrtjp.projectred.ProjectRedIntegration");
mod_Waila.log.log(Level.INFO, "ProjectRed|Integration mod found.");
} catch (ClassNotFoundException e){
mod_Waila.log.log(Level.INFO, "[ProjectRed] ProjectRed|Integration mod not found.");
return;
}
try{
//InstancedRsGateLogic = Class.forName("mrtjp.projectred.integration.InstancedRsGateLogic");
BlockMultipart = Class.forName("codechicken.multipart.BlockMultipart");
} catch (ClassNotFoundException e){
mod_Waila.log.log(Level.WARNING, "[EnderStorage] Class not found. " + e);
return;
// } catch (NoSuchMethodException e){
// mod_Waila.log.log(Level.WARNING, "[EnderStorage] Method not found." + e);
// return;
// } catch (NoSuchFieldException e){
// mod_Waila.log.log(Level.WARNING, "[EnderStorage] Field not found." + e);
// return;
} catch (Exception e){
mod_Waila.log.log(Level.WARNING, "[EnderStorage] Unhandled exception." + e);
return;
}
ExternalModulesHandler.instance().addConfigRemote("Project:Red", "pr.showio");
ExternalModulesHandler.instance().addConfigRemote("Project:Red", "pr.showdata");
ExternalModulesHandler.instance().registerBlockDecorator(new HUDDecoratorRsGateLogic(), BlockMultipart);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerRsGateLogic(), BlockMultipart);
}
}
@@ -0,0 +1,74 @@
package mcp.mobius.waila.addons.railcraft;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import codechicken.lib.lang.LangUtil;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidTank;
import mcp.mobius.waila.WailaExceptionHandler;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
public class HUDHandlerTank 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) {
if (!config.getConfig("railcraft.fluidamount")) return currenttip;
try {
IFluidTank tank = (IFluidTank)RailcraftModule.ITankTile_getTank.invoke(RailcraftModule.ITankTile.cast(accessor.getTileEntity()));
if (tank == null) return currenttip;
FluidStack fluid = tank.getFluid();
String name = currenttip.get(0);
try{
name += String.format(" < %s >", fluid.getFluid().getLocalizedName());
} catch (NullPointerException f){
name += " " + LangUtil.translateG("hud.msg.empty");
}
currenttip.set(0, name);
} catch (Exception e){
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
}
return currenttip;
}
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
if (!config.getConfig("railcraft.fluidamount")) return currenttip;
try {
IFluidTank tank = (IFluidTank)RailcraftModule.ITankTile_getTank.invoke(RailcraftModule.ITankTile.cast(accessor.getTileEntity()));
if (tank == null) return currenttip;
FluidStack fluid = tank.getFluid();
if (fluid != null)
currenttip.add(String.format("%d / %d mB", fluid.amount, tank.getInfo().capacity));
else
currenttip.add(String.format("0 / %d mB", tank.getInfo().capacity));
} catch (Exception e){
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
}
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
@@ -0,0 +1,42 @@
package mcp.mobius.waila.addons.railcraft;
import java.lang.reflect.Method;
import java.util.logging.Level;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.addons.ExternalModulesHandler;
public class RailcraftModule {
public static Class TileTankBase = null;
public static Class ITankTile = null;
public static Method ITankTile_getTank = null;
//public static Class StandardTank = null;
public static void register(){
try{
Class ModRailcraft = Class.forName("mods.railcraft.common.core.Railcraft");
mod_Waila.log.log(Level.INFO, "Railcraft mod found.");
} catch (ClassNotFoundException e){
mod_Waila.log.log(Level.INFO, "[Railcraft] Railcraft mod not found.");
return;
}
try{
TileTankBase = Class.forName("mods.railcraft.common.blocks.machine.beta.TileTankBase");
ITankTile = Class.forName("mods.railcraft.common.blocks.machine.ITankTile");
ITankTile_getTank = ITankTile.getMethod("getTank");
//StandardTank = Class.forName("mods.railcraft.common.fluids.tanks.StandardTank");
} catch (ClassNotFoundException e){
mod_Waila.log.log(Level.WARNING, "[Railcraft] Class not found. " + e);
return;
} catch (NoSuchMethodException e){
mod_Waila.log.log(Level.WARNING, "[Railcraft] Method not found." + e);
return;
}
ExternalModulesHandler.instance().addConfigRemote("Railcraft", "railcraft.fluidamount");
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerTank(), TileTankBase);
ExternalModulesHandler.instance().registerHeadProvider(new HUDHandlerTank(), TileTankBase);
}
}
@@ -35,4 +35,9 @@ public class HUDHandlerCapacitor implements IWailaDataProvider {
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
@@ -24,4 +24,8 @@ public class HUDHandlerLeaves implements IWailaDataProvider {
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
@@ -23,4 +23,8 @@ public class HUDHandlerPlants implements IWailaDataProvider {
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
@@ -47,7 +47,7 @@ public class ThaumcraftModule {
// mod_Waila.log.log(Level.WARNING, "[Thaumcraft] Unhandled exception." + e);
// return;
}
ExternalModulesHandler.instance().addConfig("Thaumcraft", "thaumcraft.storedvis", "Capacitor storage");
ExternalModulesHandler.instance().addConfig("Thaumcraft", "thaumcraft.storedvis");
ExternalModulesHandler.instance().registerStackProvider(new HUDHandlerLeaves(), BlockMagicalLeaves);
ExternalModulesHandler.instance().registerStackProvider(new HUDHandlerPlants(), BlockCustomPlant);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerCapacitor(), TileCrystalCapacitor);
@@ -0,0 +1,63 @@
package mcp.mobius.waila.addons.thermalexpansion;
import java.util.List;
import codechicken.lib.lang.LangUtil;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraftforge.fluids.FluidStack;
import mcp.mobius.waila.WailaExceptionHandler;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
public class HUDHandlerConduitFluid 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("thermalexpansion.fluidtype")) return currenttip;
boolean found = false;
FluidStack fluid = null;
if (!accessor.getNBTData().hasKey("parts")) return currenttip;
NBTTagList parts = accessor.getNBTData().getTagList("parts");
for (int i = 0; i < parts.tagCount(); i++){
NBTTagCompound subtag = (NBTTagCompound)parts.tagAt(i);
String id = subtag.getString("id");
if (id.contains("ConduitFluid")){
found = true;
NBTTagCompound fluidTag = subtag.getCompoundTag("ConnFluid");
fluid = FluidStack.loadFluidStackFromNBT(fluidTag);
}
}
if (!found) return currenttip;
if (fluid != null)
currenttip.add(fluid.getFluid().getLocalizedName());
else
currenttip.add(LangUtil.translateG("hud.msg.empty"));
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
@@ -0,0 +1,64 @@
package mcp.mobius.waila.addons.thermalexpansion;
import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
public class HUDHandlerConduitItem 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("thermalexpansion.conditemmode")) return currenttip;
boolean found = false;
int mode = -1;
if (!accessor.getNBTData().hasKey("parts")) return currenttip;
NBTTagList parts = accessor.getNBTData().getTagList("parts");
for (int i = 0; i < parts.tagCount(); i++){
NBTTagCompound subtag = (NBTTagCompound)parts.tagAt(i);
String id = subtag.getString("id");
if (id.contains("ConduitItem")){
mode = accessor.getNBTInteger(subtag, "Mode");
found = true;
}
}
if (!found) return currenttip;
if (mode == 0){}
else if (mode == 1)
currenttip.add("Mode : \u00a7fDense");
else if (mode == 2)
currenttip.add("Mode : \u00a7fVacuum");
else if (mode == 3)
currenttip.add("Mode : \u00a7fRound-Robin");
else
currenttip.add("Mode : <UNKNOWN>");
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
@@ -0,0 +1,41 @@
package mcp.mobius.waila.addons.thermalexpansion;
import java.util.List;
import codechicken.lib.lang.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;
public class HUDHandlerEnergyCell 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("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));
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
@@ -0,0 +1,48 @@
package mcp.mobius.waila.addons.thermalexpansion;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.ForgeDirection;
import mcp.mobius.waila.WailaExceptionHandler;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
public class HUDHandlerIEnergyHandler 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("thermalexpansion.energyhandler")) return currenttip;
if (!accessor.getNBTData().hasKey("Energy")) return currenttip;
int energy = accessor.getNBTInteger(accessor.getNBTData(), "Energy");
try {
Integer maxEnergy = (Integer)ThermalExpansionModule.IEnergyHandler_getMaxStorage.invoke(accessor.getTileEntity(), ForgeDirection.UNKNOWN);
if (maxEnergy != 0)
currenttip.add(String.format("%d / %d RF", energy, maxEnergy));
} catch (Exception e){
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
}
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
@@ -0,0 +1,59 @@
package mcp.mobius.waila.addons.thermalexpansion;
import java.util.List;
import codechicken.lib.lang.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 HUDHandlerISecureTile 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("thermalexpansion.owner")){
String owner = accessor.getNBTData().getString("Owner");
int iaccess = accessor.getNBTInteger(accessor.getNBTData(), "Access");
String access = "INVALID";
switch(iaccess){
case 0:
access = LangUtil.translateG("hud.msg.public");
break;
case 1:
access = LangUtil.translateG("hud.msg.restricted");
break;
case 2:
access = LangUtil.translateG("hud.msg.private");
break;
}
currenttip.add(String.format("%s : \u00a7f%s\u00a7r [ %s ]", LangUtil.translateG("hud.msg.owner"), owner, access));
}
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
@@ -0,0 +1,82 @@
package mcp.mobius.waila.addons.thermalexpansion;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import codechicken.lib.lang.LangUtil;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import mcp.mobius.waila.WailaExceptionHandler;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
public class HUDHandlerTank 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) {
if (!config.getConfig("thermalexpansion.fluidtype")) return currenttip;
try {
FluidStack fluid = (FluidStack)ThermalExpansionModule.TileTank_getTankFluid.invoke(accessor.getTileEntity());
String name = currenttip.get(0);
try{
name += String.format(" < %s >", fluid.getFluid().getLocalizedName());
} catch (NullPointerException f){
name += " " + LangUtil.translateG("hud.msg.empty");
}
currenttip.set(0, name);
} catch (Exception e){
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
}
return currenttip;
}
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
try {
if (config.getConfig("thermalexpansion.fluidamount")){
int amount = 0;
if (accessor.getNBTData().hasKey("Amount"))
amount = accessor.getNBTInteger(accessor.getNBTData(), "Amount");
Integer capacity = (Integer)ThermalExpansionModule.TileTank_getTankCapacity.invoke(accessor.getTileEntity());
currenttip.add(String.format("%d / %d mB", amount, capacity));
}
if (config.getConfig("thermalexpansion.tankmode")){
Byte mode = (Byte)ThermalExpansionModule.TileTank_mode.get(accessor.getTileEntity());
if (mode == 0)
currenttip.add(String.format("%s : \u00a7a%s", LangUtil.translateG("hud.msg.mode"), LangUtil.translateG("hud.msg.input")));
else if (mode == 1)
currenttip.add(String.format("%s : \u00a7c%s", LangUtil.translateG("hud.msg.mode"), LangUtil.translateG("hud.msg.output")));
else
currenttip.add(String.format("Mode : Unknown (%d)", mode));
}
} catch (Exception e){
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
}
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.thermalexpansion;
import java.util.List;
import codechicken.lib.lang.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 HUDHandlerTesseract 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("thermalexpansion.tesssendrecv")){
String send = String.format("%s : ", LangUtil.translateG("hud.msg.send"));
String recv = String.format("%s : ", LangUtil.translateG("hud.msg.recv"));
String item = String.format("\u00a7a%s ", LangUtil.translateG("hud.msg.item"));
String fluid= String.format("\u00a79%s ", LangUtil.translateG("hud.msg.fluid"));
String energ= String.format("\u00a7c%s ", LangUtil.translateG("hud.msg.energ"));
switch (accessor.getNBTInteger(accessor.getNBTData(), "Item.Mode")){
case 0:
send += item;
break;
case 1:
recv += item;
break;
case 2:
send += item;
recv += item;
break;
}
switch (accessor.getNBTInteger(accessor.getNBTData(), "Fluid.Mode")){
case 0:
send += fluid;
break;
case 1:
recv += fluid;
break;
case 2:
send += fluid;
recv += fluid;
break;
}
switch (accessor.getNBTInteger(accessor.getNBTData(), "Energy.Mode")){
case 0:
send += energ;
break;
case 1:
recv += energ;
break;
case 2:
send += energ;
recv += energ;
break;
}
if (!send.equals(String.format("%s : ", LangUtil.translateG("hud.msg.send"))))
currenttip.add(send);
if (!send.equals(String.format("%s : ", LangUtil.translateG("hud.msg.recv"))))
currenttip.add(recv);
}
if (config.getConfig("thermalexpansion.tessfreq"))
currenttip.add(String.format("%s : %d",LangUtil.translateG("hud.msg.frequency"), accessor.getNBTInteger(accessor.getNBTData(), "Frequency")));
return currenttip;
}
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return currenttip;
}
}
@@ -0,0 +1,126 @@
package mcp.mobius.waila.addons.thermalexpansion;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.logging.Level;
import net.minecraftforge.common.ForgeDirection;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.addons.ExternalModulesHandler;
public class ThermalExpansionModule {
public static Class IEnergyHandler = null;
public static Method IEnergyHandler_getMaxStorage = null;
public static Class TileEnergyCell = null;
public static Class TileTank = null;
public static Method TileTank_getTankFluid = null;
public static Method TileTank_getTankCapacity = null;
public static Field TileTank_mode = null;
//public static Class TileConduitFluid = null;
//public static Method TileConduitFluid_getRenderFluid = null;
//public static Method TileConduitFluid_getRenderFluidLevel = null;
//public static Class TileConduitItems = null;
public static Class TileTesseract = null;
public static Class ISecureTile = null;
public static Class BlockMultipart = null;
//public static Field TileTesseract_modItem = null;
//public static Field TileTesseract_modFluid = null;
//public static Field TileTesseract_modEnergy = null;
//public static Class TileConduitBase = null;
//public static Field TileConduitBase_isInput = null;
//public static Field TileConduitBase_isOutput = null;
public static void register(){
try{
Class ModThermalExpansion = Class.forName("thermalexpansion.ThermalExpansion");
mod_Waila.log.log(Level.INFO, "Thermal Expansion mod found.");
} catch (ClassNotFoundException e){
mod_Waila.log.log(Level.INFO, "[Thermal Expansion] ThermalExpansion mod not found.");
return;
}
try{
IEnergyHandler = Class.forName("cofh.api.energy.IEnergyHandler");
IEnergyHandler_getMaxStorage = IEnergyHandler.getMethod("getMaxEnergyStored", ForgeDirection.class);
TileEnergyCell = Class.forName("thermalexpansion.block.energycell.TileEnergyCell");
TileTank = Class.forName("thermalexpansion.block.tank.TileTank");
TileTank_getTankFluid = TileTank.getMethod("getTankFluid");
TileTank_getTankCapacity = TileTank.getMethod("getTankCapacity");
TileTank_mode = TileTank.getField("mode");
//TileConduitFluid = Class.forName("thermalexpansion.block.conduit.fluid.TileConduitFluid");
//TileConduitFluid_getRenderFluid = TileConduitFluid.getMethod("getRenderFluid");
//TileConduitFluid_getRenderFluidLevel = TileConduitFluid.getMethod("getRenderFluidLevel");
//TileConduitItems = Class.forName("thermalexpansion.block.conduit.item.TileConduitItem");
TileTesseract = Class.forName("thermalexpansion.block.tesseract.TileTesseract");
ISecureTile = Class.forName("cofh.api.tileentity.ISecureTile");
BlockMultipart = Class.forName("codechicken.multipart.BlockMultipart");
//TileTesseract_modItem = TileTesseract.getField("modItem");
//TileTesseract_modFluid = TileTesseract.getField("modFluid");
//TileTesseract_modEnergy = TileTesseract.getField("modEnergy");
//TileConduitBase = Class.forName("thermalexpansion.block.conduit.TileConduitBase");
//TileConduitBase_isInput = TileConduitBase.getField("isInput");
//TileConduitBase_isOutput = TileConduitBase.getField("isOutput");
//TileEnergyCell_energyReceive = TileEnergyCell.getField("energyReceive");
//TileEnergyCell_energySend = TileEnergyCell.getField("energySend");
} catch (ClassNotFoundException e){
mod_Waila.log.log(Level.WARNING, "[Thermal Expansion] Class not found. " + e);
return;
} catch (NoSuchMethodException e){
mod_Waila.log.log(Level.WARNING, "[Thermal Expansion] Method not found." + e);
return;
} catch (NoSuchFieldException e){
mod_Waila.log.log(Level.WARNING, "[Thermal Expansion] Field not found." + e);
return;
// } catch (Exception e){
// mod_Waila.log.log(Level.WARNING, "[Thermal Expansion] Unhandled exception." + e);
// return;
}
ExternalModulesHandler.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.energyhandler");
ExternalModulesHandler.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.energycell");
ExternalModulesHandler.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.fluidtype");
ExternalModulesHandler.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.fluidamount");
ExternalModulesHandler.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.conditemmode");
ExternalModulesHandler.instance().addConfig("Thermal Expansion", "thermalexpansion.tankmode");
ExternalModulesHandler.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.tesssendrecv");
ExternalModulesHandler.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.tessfreq");
ExternalModulesHandler.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.owner");
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerIEnergyHandler(), IEnergyHandler);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerEnergyCell(), TileEnergyCell);
ExternalModulesHandler.instance().registerHeadProvider(new HUDHandlerTank(), TileTank);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerTank(), TileTank);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerTesseract(), TileTesseract);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerISecureTile(), ISecureTile);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerConduitFluid(), BlockMultipart);
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerConduitItem(), BlockMultipart);
}
}
@@ -23,5 +23,9 @@ public class TwilightForestGenericOverride implements IWailaDataProvider {
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,85 @@
package mcp.mobius.waila.addons.vanillamc;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import mcp.mobius.waila.api.IWailaBlockDecorator;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.gui.helpers.UIHelper;
public class HUDDecoratorVanilla implements IWailaBlockDecorator {
@Override
public void decorateBlock(ItemStack itemStack, IWailaDataAccessor accessor, IWailaConfigHandler config) {
Tessellator tessellator = Tessellator.instance;
//UIHelper.drawBillboardText(itemStack.getDisplayName(), accessor.getRenderingPosition(), 0.5F, 1.5F, 0.5F, accessor.getPartialFrame());
UIHelper.drawFloatingText("IN", accessor.getRenderingPosition(), 0.5F, 0.2F, -0.2F, 90F, 0F, 0F);
UIHelper.drawFloatingText("OUT", accessor.getRenderingPosition(), -0.2F, 0.2F, 0.5F, 90F, 90F, 0F);
UIHelper.drawFloatingText("OUT", accessor.getRenderingPosition(), 1.2F, 0.2F, 0.5F, 90F, -90F, 0F);
UIHelper.drawFloatingText("OUT", accessor.getRenderingPosition(), 0.5F, 0.2F, 1.2F, 90F, -180F, 0F);
double offset = 0.1;
double delta = 1 + 2 * offset;
double x = accessor.getRenderingPosition().xCoord - offset;
double y = accessor.getRenderingPosition().yCoord - offset;
double z = accessor.getRenderingPosition().zCoord - offset;
tessellator.startDrawingQuads();
tessellator.setColorRGBA(255, 255, 255, 150);
tessellator.addVertex(x, y + 0.2 , z);
tessellator.addVertex(x, y + 0.2 , z + delta/2 - 0.1);
tessellator.addVertex(x + offset, y + 0.2, z + delta/2 - 0.1);
tessellator.addVertex(x + offset, y + 0.2, z);
tessellator.addVertex(x, y + 0.2 , z + delta/2 + 0.1);
tessellator.addVertex(x, y + 0.2 , z + delta);
tessellator.addVertex(x + offset, y + 0.2, z + delta);
tessellator.addVertex(x + offset, y + 0.2, z + delta/2 + 0.1);
tessellator.addVertex(x + delta - 0.1, y + 0.2 , z + 0.1);
tessellator.addVertex(x + delta - 0.1, y + 0.2 , z + delta/2 - 0.1);
tessellator.addVertex(x + delta + offset - 0.1, y + 0.2, z + delta/2 - 0.1);
tessellator.addVertex(x + delta + offset - 0.1, y + 0.2, z + 0.1);
tessellator.addVertex(x + delta - 0.1, y + 0.2 , z + delta/2 + 0.1);
tessellator.addVertex(x + delta - 0.1, y + 0.2 , z + delta);
tessellator.addVertex(x + delta + offset - 0.1, y + 0.2, z + delta);
tessellator.addVertex(x + delta + offset - 0.1, y + 0.2, z + delta/2 + 0.1);
tessellator.addVertex(x+ 0.1, y + 0.2, z);
tessellator.addVertex(x+ 0.1, y + 0.2, z+ offset);
tessellator.addVertex(x+ delta/2 - 0.1, y + 0.2, z+ offset);
tessellator.addVertex(x+ delta/2 - 0.1, y + 0.2, z);
tessellator.addVertex(x+ delta/2 + 0.1, y + 0.2, z);
tessellator.addVertex(x+ delta/2 + 0.1, y + 0.2, z+ offset);
tessellator.addVertex(x+ delta, y + 0.2, z+ offset);
tessellator.addVertex(x+ delta, y + 0.2, z);
tessellator.addVertex(x + 0.1, y + 0.2, z+ delta - 0.1);
tessellator.addVertex(x + 0.1, y + 0.2, z+ offset+ delta - 0.1);
tessellator.addVertex(x+ delta/2 - 0.1, y + 0.2, z+ offset+ delta - 0.1);
tessellator.addVertex(x+ delta/2 - 0.1, y + 0.2, z+ delta - 0.1);
tessellator.addVertex(x+ delta/2 + 0.1, y + 0.2, z+ delta - 0.1);
tessellator.addVertex(x+ delta/2 + 0.1, y + 0.2, z+ offset+ delta - 0.1);
tessellator.addVertex(x+ delta - 0.1, y + 0.2, z+ offset+ delta - 0.1);
tessellator.addVertex(x+ delta - 0.1, y + 0.2, z+ delta - 0.1);
tessellator.draw();
}
}
@@ -2,7 +2,9 @@ package mcp.mobius.waila.addons.vanillamc;
import java.util.List;
import codechicken.lib.lang.LangUtil;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSilverfish;
import net.minecraft.item.Item;
import net.minecraft.item.ItemRecord;
import net.minecraft.item.ItemStack;
@@ -28,11 +30,31 @@ public class HUDHandlerVanilla implements IWailaDataProvider {
static int comparatorAct = Block.redstoneComparatorActive.blockID;
static int redstone = Block.redstoneWire.blockID;
static int jukebox = Block.jukebox.blockID;
static int cocoa = Block.cocoaPlant.blockID;
static int netherwart = Block.netherStalk.blockID;
static int silverfish = Block.silverfish.blockID;
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
int blockID = accessor.getBlockID();
if (blockID == silverfish){
int metadata = accessor.getMetadata();
switch(metadata){
case 0:
return new ItemStack(Block.stone);
case 1:
return new ItemStack(Block.cobblestone);
case 2:
return new ItemStack(Block.stoneBrick);
default:
return null;
}
}
return null;
}
@Override
@@ -42,7 +64,7 @@ public class HUDHandlerVanilla implements IWailaDataProvider {
/* Mob spawner handler */
if (blockID == mobSpawnerID && accessor.getTileEntity() instanceof TileEntityMobSpawner && config.getConfig("vanilla.spawntype")){
String name = currenttip.get(0);
String mobname = ((TileEntityMobSpawner)accessor.getTileEntity()).func_98049_a().getEntityNameToSpawn();
String mobname = ((TileEntityMobSpawner)accessor.getTileEntity()).getSpawnerLogic().getEntityNameToSpawn();
currenttip.set(0, String.format("%s (%s)", name, mobname));
}
@@ -61,17 +83,36 @@ public class HUDHandlerVanilla implements IWailaDataProvider {
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));
if (growthValue < 100.0)
currenttip.add(String.format("%s : %.0f %%", LangUtil.translateG("hud.msg.growth"), growthValue));
else
currenttip.add("Growth : Mature");
currenttip.add(String.format("%s : %s", LangUtil.translateG("hud.msg.growth"), LangUtil.translateG("hud.msg.mature")));
return currenttip;
}
if (blockID == cocoa){
float growthValue = ((accessor.getMetadata() >> 2) / 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;
}
if (blockID == netherwart){
float growthValue = (accessor.getMetadata() / 3.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;
}
if (config.getConfig("vanilla.leverstate"))
if (blockID == leverID){
String redstoneOn = (accessor.getMetadata() & 8) == 0 ? "Off" : "On";
currenttip.add("State : " + redstoneOn);
String redstoneOn = (accessor.getMetadata() & 8) == 0 ? LangUtil.translateG("hud.msg.off") : LangUtil.translateG("hud.msg.on");
currenttip.add(String.format("%s : %s", LangUtil.translateG("hud.msg.state"), redstoneOn));
return currenttip;
}
@@ -79,15 +120,15 @@ public class HUDHandlerVanilla implements IWailaDataProvider {
if ((blockID == repeaterIdle) ||(blockID == repeaterActv)){
int tick = (accessor.getMetadata() >> 2) + 1 ;
if (tick == 1)
currenttip.add(String.format("Delay : %s tick", tick));
currenttip.add(String.format("%s : %s tick", LangUtil.translateG("hud.msg.delay"), tick));
else
currenttip.add(String.format("Delay : %s ticks", tick));
currenttip.add(String.format("%s : %s ticks", LangUtil.translateG("hud.msg.delay"), tick));
return currenttip;
}
if (config.getConfig("vanilla.comparator"))
if ((blockID == comparatorIdl) ||(blockID == comparatorAct)){
String mode = ((accessor.getMetadata() >> 2) & 1) == 0 ? "Comparator" : "Subtractor";
String mode = ((accessor.getMetadata() >> 2) & 1) == 0 ? LangUtil.translateG("hud.msg.comparator") : LangUtil.translateG("hud.msg.substractor");
//int outputSignal = ((TileEntityComparator)entity).func_96100_a();
currenttip.add("Mode : " + mode);
//currenttip.add(String.format("Out : %s", outputSignal));
@@ -96,7 +137,7 @@ public class HUDHandlerVanilla implements IWailaDataProvider {
if (config.getConfig("vanilla.redstone"))
if (blockID == redstone){
currenttip.add(String.format("Power : %s" , accessor.getMetadata()));
currenttip.add(String.format("%s : %s" , LangUtil.translateG("hud.msg.power"), accessor.getMetadata()));
return currenttip;
}
@@ -108,37 +149,50 @@ public class HUDHandlerVanilla implements IWailaDataProvider {
record = Item.itemsList[accessor.getNBTInteger(tag, "Record")];
currenttip.add(((ItemRecord)record).getRecordTitle());
} else {
currenttip.add("<Empty>");
currenttip.add(LangUtil.translateG("hud.msg.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().addConfig("VanillaMC", "vanilla.spawntype");
ExternalModulesHandler.instance().addConfig("VanillaMC", "vanilla.growthvalue");
ExternalModulesHandler.instance().addConfig("VanillaMC", "vanilla.leverstate");
ExternalModulesHandler.instance().addConfig("VanillaMC", "vanilla.repeater");
ExternalModulesHandler.instance().addConfig("VanillaMC", "vanilla.comparator");
ExternalModulesHandler.instance().addConfig("VanillaMC", "vanilla.redstone");
ExternalModulesHandler.instance().addConfigRemote("VanillaMC", "vanilla.jukebox");
ExternalModulesHandler.instance().registerDocTextFile("/mcp/mobius/waila/addons/vanillamc/WikiData.csv");
IWailaDataProvider provider = new HUDHandlerVanilla();
ExternalModulesHandler.instance().registerStackProvider(provider, silverfish);
ExternalModulesHandler.instance().registerHeadProvider(provider, mobSpawnerID);
ExternalModulesHandler.instance().registerBodyProvider(provider, cropsID);
ExternalModulesHandler.instance().registerBodyProvider(provider, melonStemID);
ExternalModulesHandler.instance().registerBodyProvider(provider, pumpkinStemID);
ExternalModulesHandler.instance().registerBodyProvider(provider, carrotID);
ExternalModulesHandler.instance().registerBodyProvider(provider, potatoID);
ExternalModulesHandler.instance().registerBodyProvider(provider, leverID);
ExternalModulesHandler.instance().registerBodyProvider(provider, repeaterIdle);
ExternalModulesHandler.instance().registerBodyProvider(provider, repeaterActv);
ExternalModulesHandler.instance().registerBodyProvider(provider, comparatorIdl);
ExternalModulesHandler.instance().registerBodyProvider(provider, comparatorAct);
ExternalModulesHandler.instance().registerHeadProvider(provider, redstone);
ExternalModulesHandler.instance().registerBodyProvider(provider, redstone);
ExternalModulesHandler.instance().registerBodyProvider(provider, jukebox);
ExternalModulesHandler.instance().registerBodyProvider(provider, cocoa);
ExternalModulesHandler.instance().registerBodyProvider(provider, netherwart);
ExternalModulesHandler.instance().registerDocTextFile("/mcp/mobius/waila/addons/vanillamc/WikiData.csv");
//ExternalModulesHandler.instance().registerBlockDecorator(new HUDDecoratorVanilla(), repeaterIdle);
}
+1
View File
@@ -29,4 +29,5 @@ public interface IWailaBlock {
List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);
List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);
List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);
}
@@ -0,0 +1,11 @@
package mcp.mobius.waila.api;
import java.util.List;
import net.minecraft.item.ItemStack;
public interface IWailaBlockDecorator {
void decorateBlock(ItemStack itemStack, IWailaDataAccessor accessor, IWailaConfigHandler config);
}
@@ -23,4 +23,6 @@ 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);
}
+10 -5
View File
@@ -5,16 +5,21 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
public interface IWailaDataAccessor {
World getWorld();
EntityPlayer getPlayer();
Block getBlock();
int getBlockID();
int getMetadata();
World getWorld();
EntityPlayer getPlayer();
Block getBlock();
int getBlockID();
int getMetadata();
TileEntity getTileEntity();
MovingObjectPosition getPosition();
Vec3 getRenderingPosition();
NBTTagCompound getNBTData();
int getNBTInteger(NBTTagCompound tag, String keyname);
double getPartialFrame();
ForgeDirection getSide();
}
+8 -1
View File
@@ -4,19 +4,26 @@ 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);
public void addConfig(String modname, String keyname);
public void addConfigRemote(String modname, String keyname);
/* 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);
/* The block decorators */
public void registerBlockDecorator (IWailaBlockDecorator decorator, int blockID);
public void registerBlockDecorator (IWailaBlockDecorator decorator, Class block);
public void registerDocTextFile (String filename);
@@ -0,0 +1,166 @@
package mcp.mobius.waila.client;
import java.util.EnumSet;
import java.util.List;
import mcp.mobius.waila.Constants;
import mcp.mobius.waila.addons.ConfigHandler;
import mcp.mobius.waila.gui.screens.config.ScreenConfig;
import mcp.mobius.waila.gui.screens.info.ScreenEnchants;
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.GuiInventory;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumMovingObjectType;
import org.lwjgl.input.Keyboard;
import codechicken.lib.lang.LangUtil;
import codechicken.nei.api.API;
import codechicken.nei.forge.GuiContainerManager;
import codechicken.nei.recipe.GuiCraftingRecipe;
import codechicken.nei.recipe.GuiUsageRecipe;
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, LangUtil.translateG("keybind.configscreen"));
LanguageRegistry.instance().addStringLocalization(Constants.BIND_WAILA_SHOW, LangUtil.translateG("keybind.showhide"));
LanguageRegistry.instance().addStringLocalization(Constants.BIND_WAILA_LIQUID, LangUtil.translateG("keybind.showliquid"));
LanguageRegistry.instance().addStringLocalization(Constants.BIND_WAILA_RECIPE, LangUtil.translateG("keybind.showrecipe"));
LanguageRegistry.instance().addStringLocalization(Constants.BIND_WAILA_USAGE, LangUtil.translateG("keybind.showusage"));
LanguageRegistry.instance().addStringLocalization(Constants.BIND_WAILA_TESTING, LangUtil.translateG("keybind.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\u00a7o" + LangUtil.translateG("client.msg.norecipe"));
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\u00a7o" + LangUtil.translateG("client.msg.nousage"));
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";
}
}
@@ -1,39 +1,63 @@
package mcp.mobius.waila;
package mcp.mobius.waila.client;
import mcp.mobius.waila.Constants;
import mcp.mobius.waila.addons.ExternalModulesHandler;
import mcp.mobius.waila.addons.appeng.AppEngModule;
import mcp.mobius.waila.addons.buildcraft.BCModule;
import mcp.mobius.waila.addons.buildcraft.BCPowerAPIModule;
import mcp.mobius.waila.addons.enderio.EnderIOModule;
import mcp.mobius.waila.addons.enderstorage.EnderStorageModule;
import mcp.mobius.waila.addons.etb.ETBModule;
import mcp.mobius.waila.addons.exu.ExtraUtilitiesModule;
import mcp.mobius.waila.addons.gravestone.GravestoneModule;
import mcp.mobius.waila.addons.ic2.IC2Module;
import mcp.mobius.waila.addons.openblocks.OpenBlocksModule;
import mcp.mobius.waila.addons.projectred.ProjectRedModule;
import mcp.mobius.waila.addons.railcraft.RailcraftModule;
import mcp.mobius.waila.addons.thaumcraft.ThaumcraftModule;
import mcp.mobius.waila.addons.thermalexpansion.ThermalExpansionModule;
import mcp.mobius.waila.addons.twilightforest.TwilightForestModule;
import mcp.mobius.waila.addons.vanillamc.HUDHandlerVanilla;
import mcp.mobius.waila.gui.truetyper.FontLoader;
import mcp.mobius.waila.gui.truetyper.TrueTypeFont;
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.tooltip.TooltipHandlerWaila;
import mcp.mobius.waila.overlay.WailaTickHandler;
import mcp.mobius.waila.server.ProxyServer;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.input.Keyboard;
import codechicken.lib.lang.LangUtil;
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 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.ConfigKeyHandler;
import mcp.mobius.waila.handlers.HUDHandlerExternal;
import mcp.mobius.waila.handlers.HUDHandlerWaila;
import mcp.mobius.waila.handlers.SummaryProviderDefault;
import mcp.mobius.waila.handlers.TechTreeHandler;
import mcp.mobius.waila.handlers.TooltipHandlerWaila;
import mcp.mobius.waila.handlers.WikiHandler;
import mcp.mobius.waila.server.ProxyServer;
import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.relauncher.Side;
public class ProxyClient extends ProxyServer {
TrueTypeFont minecraftiaFont;
//public static LangUtil lang = LangUtil.loadLangDir("waila");
public ProxyClient() {}
@Override
public void registerHandlers(){
LangUtil.instance.loadLangDir("waila");
minecraftiaFont = FontLoader.createFont(new ResourceLocation("waila", "fonts/Minecraftia.ttf"), 14, true);
TickRegistry.registerTickHandler(new WailaTickHandler(), Side.CLIENT);
GuiContainerManager.addTooltipHandler(new TooltipHandlerWaila());
API.registerHighlightHandler(new HUDHandlerExternal(), ItemInfo.Layout.HEADER);
API.registerHighlightHandler(new HUDHandlerExternal(), ItemInfo.Layout.BODY);
@@ -42,16 +66,17 @@ public class ProxyClient extends ProxyServer {
KeyBindingRegistry.registerKeyBinding(new ConfigKeyHandler());
//GuiContainerManager.addInputHandler(new TechTreeHandler());
//API.addKeyBind(Constants.BIND_ENCH, "Display enchantements", Keyboard.KEY_RSHIFT);
// 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();
}
@Override
public void registerMods(){
HUDHandlerVanilla.register();
@@ -79,6 +104,32 @@ public class ProxyClient extends ProxyServer {
/* Applied Energetics */
AppEngModule.register();
/* Thermal Expansion */
ThermalExpansionModule.register();
/* ETB */
ETBModule.register();
/* EnderIO */
EnderIOModule.register();
/* Buildcraft Power API */
BCPowerAPIModule.register();
/* ProjectRed API */
ProjectRedModule.register();
/* ExtraUtilities */
ExtraUtilitiesModule.register();
/* OpenBlocks */
OpenBlocksModule.register();
/* Railcraft */
RailcraftModule.register();
}
@Override
public Object getFont(){return this.minecraftiaFont;}
}
@@ -0,0 +1,81 @@
package mcp.mobius.waila.client;
import java.util.ArrayList;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mcp.mobius.waila.WailaExceptionHandler;
import mcp.mobius.waila.addons.ConfigHandler;
import mcp.mobius.waila.addons.ExternalModulesHandler;
import mcp.mobius.waila.api.IWailaBlockDecorator;
import mcp.mobius.waila.handlers.DataAccessor;
import mcp.mobius.waila.overlay.RayTracing;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.event.ForgeSubscribe;
public class WailaClientEventHandler {
@ForgeSubscribe
@SideOnly(Side.CLIENT)
public void onRenderWorldLast(RenderWorldLastEvent event) {
if (RayTracing.raytracedTarget == null || RayTracing.raytracedStack == null) return;
double partialTicks = event.partialTicks;
DataAccessor accessor = DataAccessor.instance;
World world = Minecraft.getMinecraft().theWorld;
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
EntityLivingBase viewEntity = Minecraft.getMinecraft().renderViewEntity;
if (world == null || player == null || viewEntity == null) return;
accessor.set(world, player, RayTracing.raytracedTarget, viewEntity, partialTicks);
Block block = accessor.getBlock();
int blockID = accessor.getBlockID();
if (!ExternalModulesHandler.instance().hasBlockDecorator(blockID) && !ExternalModulesHandler.instance().hasBlockDecorator(block)) return;
GL11.glPushAttrib(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glDepthMask(false);
if (ExternalModulesHandler.instance().hasBlockDecorator(blockID)){
for (IWailaBlockDecorator decorator : ExternalModulesHandler.instance().getBlockDecorators(blockID))
try{
GL11.glPushMatrix();
decorator.decorateBlock(RayTracing.raytracedStack, accessor, ConfigHandler.instance());
GL11.glPopMatrix();
} catch (Throwable e){
GL11.glPopMatrix();
WailaExceptionHandler.handleErr(e, decorator.getClass().toString(), null);
}
}
if (ExternalModulesHandler.instance().hasBlockDecorator(block)){
for (IWailaBlockDecorator decorator : ExternalModulesHandler.instance().getBlockDecorators(block))
try{
GL11.glPushMatrix();
decorator.decorateBlock(RayTracing.raytracedStack, accessor, ConfigHandler.instance());
GL11.glPopMatrix();
} catch (Throwable e){
GL11.glPopMatrix();
WailaExceptionHandler.handleErr(e, decorator.getClass().toString(), null);
}
}
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glPopAttrib();
}
}
@@ -1,72 +0,0 @@
package mcp.mobius.waila.gui;
import java.util.EnumSet;
import org.lwjgl.input.Keyboard;
import codechicken.nei.NEIClientConfig;
import mcp.mobius.waila.Constants;
import mcp.mobius.waila.addons.ConfigHandler;
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.KeyBinding;
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 {
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("key.wailatedump", Keyboard.KEY_NUMPAD1),
}, new boolean[]{
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("key.wailatedump", "[Waila] Dump server TE");
}
@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 GuiConfigScreen(mc.currentScreen));
}
else if (kb.keyDescription == Constants.BIND_WAILA_SHOW && ConfigHandler.instance().getConfig("waila.showmode")){
boolean status = NEIClientConfig.getSetting(Constants.CFG_NEI_SHOW).getBooleanValue();
NEIClientConfig.getSetting(Constants.CFG_NEI_SHOW).setBooleanValue(!status);
}
else if (kb.keyDescription == Constants.BIND_WAILA_SHOW && !ConfigHandler.instance().getConfig("waila.showmode")){
NEIClientConfig.getSetting(Constants.CFG_NEI_SHOW).setBooleanValue(true);
}
}
@Override
public void keyUp(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd) {
if (!tickEnd) return;
if (kb.keyDescription == Constants.BIND_WAILA_SHOW && !ConfigHandler.instance().getConfig("waila.showmode")){
NEIClientConfig.getSetting(Constants.CFG_NEI_SHOW).setBooleanValue(false);
}
}
@Override
public EnumSet<TickType> ticks() {
return EnumSet.of(TickType.CLIENT);
}
@Override
public String getLabel() {
return "Waila Config Screen Keybind";
}
}
-23
View File
@@ -1,23 +0,0 @@
package mcp.mobius.waila.gui;
import mcp.mobius.waila.gui.widget_old.ButtonChangeScreen;
import mcp.mobius.waila.gui.widget_old.ContainerButtons;
import net.minecraft.client.gui.GuiScreen;
public class GuiConfigScreen extends BaseWailaScreen {
public GuiConfigScreen(GuiScreen _parentGui) {
super(_parentGui);
}
@Override
/* We init the GUI data here (buttons, etc) */
public void initGui()
{
buttonList.add(new ButtonChangeScreen(200, width / 2 - 100, height / 6 + 168, "Done", null));
ContainerButtons container = new ContainerButtons(this, 5, height/2-10, width - 10, height);
container.addButton(new ButtonChangeScreen(201, "Waila", new GuiWailaConfig(this) ));
container.addButton(new ButtonChangeScreen(202, "Modules", new GuiModules(this)));
}
}
@@ -1,57 +0,0 @@
package mcp.mobius.waila.gui;
import mcp.mobius.waila.gui.widget.ContainerTable;
import mcp.mobius.waila.gui.widget.Label;
import mcp.mobius.waila.gui.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);
}
}
@@ -1,33 +0,0 @@
package mcp.mobius.waila.gui;
import mcp.mobius.waila.addons.ConfigHandler;
import mcp.mobius.waila.gui.widget_old.ButtonChangeScreen;
import mcp.mobius.waila.gui.widget_old.ButtonConfigOption;
import mcp.mobius.waila.gui.widget_old.ButtonConfigRemote;
import mcp.mobius.waila.gui.widget_old.ContainerButtons;
import net.minecraft.client.gui.GuiScreen;
public class GuiModuleOptions extends BaseWailaScreen {
private String modName;
public GuiModuleOptions(GuiScreen _parentGui, String _modName) {
super(_parentGui);
this.modName = _modName;
}
@Override
public void initGui()
{
buttonList.add(new ButtonChangeScreen(200, width / 2 - 100, height / 6 + 168, "Back", this.parentGui));
ContainerButtons container = new ContainerButtons(this, 5, 0, width - 10, height);
for (String key:ConfigHandler.instance().getConfigKeys(this.modName).keySet()){
if (ConfigHandler.instance().isServerRequired(key))
container.addButton(new ButtonConfigRemote(-1, "No", "Yes", ConfigHandler.instance().getConfigKeys(this.modName).get(key), key ));
else
container.addButton(new ButtonConfigOption(-1, "No", "Yes", ConfigHandler.instance().getConfigKeys(this.modName).get(key), key ));
}
}
}
-31
View File
@@ -1,31 +0,0 @@
package mcp.mobius.waila.gui;
import java.util.HashMap;
import mcp.mobius.waila.addons.ConfigHandler;
import mcp.mobius.waila.gui.widget_old.ButtonChangeScreen;
import mcp.mobius.waila.gui.widget_old.ContainerButtons;
import net.minecraft.client.gui.GuiScreen;
public class GuiModules extends BaseWailaScreen {
private HashMap<String, GuiScreen> screens = new HashMap<String, GuiScreen>();
public GuiModules(GuiScreen _parentGui) {
super(_parentGui);
for (String key : ConfigHandler.instance().getModuleNames())
screens.put(key, new GuiModuleOptions(this, key));
}
@Override
public void initGui()
{
buttonList.add(new ButtonChangeScreen(200, width / 2 - 100, height / 6 + 168, "Back", this.parentGui));
ContainerButtons container = new ContainerButtons(this, 5, 0, width - 10, height);
for (String key : ConfigHandler.instance().getModuleNames())
container.addButton(new ButtonChangeScreen(-1, key, screens.get(key)));
}
}
-29
View File
@@ -1,29 +0,0 @@
package mcp.mobius.waila.gui;
import mcp.mobius.waila.Constants;
import mcp.mobius.waila.gui.widget_old.ButtonChangeScreen;
import mcp.mobius.waila.gui.widget_old.ButtonConfigNEI;
import mcp.mobius.waila.gui.widget_old.ButtonConfigOption;
import mcp.mobius.waila.gui.widget_old.ContainerButtons;
import net.minecraft.client.gui.GuiScreen;
public class GuiWailaConfig extends BaseWailaScreen {
public GuiWailaConfig(GuiScreen _parentGui) {
super(_parentGui);
// TODO Auto-generated constructor stub
}
@Override
public void initGui()
{
buttonList.add(new ButtonChangeScreen(200, width / 2 - 100, height / 6 + 168, "Back", this.parentGui));
ContainerButtons container = new ContainerButtons(this, 5, 0, width - 10, height);
container.addButton(new ButtonConfigNEI(-1, "Hidden", "Shown", "Show/Hide Waila", Constants.CFG_NEI_SHOW ));
container.addButton(new ButtonConfigOption(-1, "Maintained", "Toggled", "Toggle/Maintained", "waila.showmode" ));
container.addButton(new ButtonConfigOption(-1, "Hidden", "Visible", "Show ID:Metadata", "waila.showmetadata", false ));
}
}
+101
View File
@@ -0,0 +1,101 @@
package mcp.mobius.waila.gui.events;
import net.minecraft.client.Minecraft;
import org.lwjgl.input.Mouse;
import mcp.mobius.waila.gui.interfaces.IWidget;
public class MouseEvent {
public enum EventType {NONE, MOVE, CLICK, RELEASED, DRAG, WHEEL, ENTER, LEAVE};
public long timestamp;
public Minecraft mc;
public IWidget srcwidget;
public IWidget trgwidget;
public double x,y;
public int z;
public static int buttonCount = Mouse.getButtonCount();
public boolean[] buttonState = new boolean[buttonCount];
public EventType type;
public int button = -1;
public MouseEvent(IWidget widget){
this.srcwidget = widget;
this.timestamp = System.nanoTime();
this.mc = Minecraft.getMinecraft();
this.x = (double)Mouse.getEventX() * (double)this.srcwidget.getSize().getX() / (double)this.mc.displayWidth;
this.y = (double)this.srcwidget.getSize().getY() - (double)Mouse.getEventY() * (double)this.srcwidget.getSize().getY() / (double)this.mc.displayHeight - 1.0;
//this.x = Mouse.getEventX();
//this.y = Mouse.getEventY();
//System.out.printf("%s %s\n", this.x, this.y);
//this.z = Mouse.getEventDWheel();
this.z = Mouse.getDWheel();
for (int i = 0; i < buttonCount; i++)
buttonState[i] = Mouse.isButtonDown(i);
this.trgwidget = this.srcwidget.getWidgetAtCoordinates(this.x, this.y);
}
public String toString(){
String retstring = String.format("MOUSE %s : [%s] [ %.2f %.2f %d ] [", this.type, this.timestamp, this.x, this.y, this.z);
if (this.buttonCount < 5)
for (int i = 0; i < this.buttonCount; i++)
retstring += String.format(" %s ", this.buttonState[i]);
else
for (int i = 0; i < 5; i++)
retstring += String.format(" %s ", this.buttonState[i]);
retstring += "]";
if (this.button != -1)
retstring += String.format(" Button %s", this.button);
return retstring;
}
// Returns the event type based on the previous mouse event.
public EventType getEventType(MouseEvent me){
this.type = EventType.NONE;
if (this.trgwidget != me.trgwidget){
this.type = EventType.ENTER;
return this.type;
}
if (this.z != 0){
this.type = EventType.WHEEL;
return this.type;
}
for (int i = 0; i < this.buttonCount; i++){
if (this.buttonState[i] != me.buttonState[i]){
if (this.buttonState[i] == true)
this.type = EventType.CLICK;
else
this.type = EventType.RELEASED;
this.button = i;
return this.type;
}
}
//MOVE & DRAG EVENTS (we moved the mouse and button 0 was clicked or not)
if ((this.x != me.x) || (this.y != me.y)){
if (this.buttonState[0] == true)
this.type = EventType.DRAG;
else
this.type = EventType.MOVE;
return this.type;
}
return this.type;
}
}
@@ -0,0 +1,37 @@
package mcp.mobius.waila.gui.helpers;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import com.google.common.collect.Lists;
public class ReverseIterator<T> implements Iterable<T> {
private ListIterator<T> listIterator;
public ReverseIterator(Collection<T> wrappedList) {
List list = Lists.newArrayList(wrappedList);
this.listIterator = list.listIterator(wrappedList.size());
}
public Iterator<T> iterator() {
return new Iterator<T>() {
public boolean hasNext() {
return listIterator.hasPrevious();
}
public T next() {
return listIterator.previous();
}
public void remove() {
listIterator.remove();
}
};
}
}
@@ -0,0 +1,7 @@
package mcp.mobius.waila.gui.helpers;
public class UIException extends RuntimeException {
public UIException(String message) {
super(message);
}
}
+161
View File
@@ -0,0 +1,161 @@
package mcp.mobius.waila.gui.helpers;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.Vec3;
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);
}
public static void drawBillboardText(String text, Vec3 pos, float offX, float offY, float offZ, double partialFrame){
UIHelper.drawBillboardText(text, (float)pos.xCoord, (float)pos.yCoord, (float)pos.zCoord, offX, offY, offZ, partialFrame);
}
public static void drawBillboardText(String text, float posX, float posY, float posZ, float offX, float offY, float offZ, double partialFrame){
EntityLivingBase player = Minecraft.getMinecraft().renderViewEntity;
float playerViewY = player.prevRotationYaw + (player.rotationYaw - player.prevRotationYaw) * (float)partialFrame;
float playerViewX = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * (float)partialFrame;
UIHelper.drawFloatingText(text, posX, posY, posZ, offX, offY, offZ, playerViewX, playerViewY * -1.0F, 0.0F);
}
public static void drawFloatingText(String text, Vec3 pos, float offX, float offY, float offZ, float rotX, float rotY, float rotZ){
UIHelper.drawFloatingText(text, (float)pos.xCoord, (float)pos.yCoord, (float)pos.zCoord, offX, offY, offZ, rotX, rotY, rotZ);
}
public static void drawFloatingText(String text, float posX, float posY, float posZ, float offX, float offY, float offZ, float rotX, float rotY, float rotZ){
if (text.isEmpty()) return;
FontRenderer fontrenderer = Minecraft.getMinecraft().fontRenderer;
float f = 1.6F;
float f1 = 0.016666668F * f;
GL11.glPushMatrix();
//GL11.glTranslatef((float)accessor.getPosition().blockX + 0.0F, (float)accessor.getPosition().blockY + 0.5F, (float)accessor.getPosition().blockZ);
GL11.glTranslatef(posX + offX, posY + offY, posZ + offZ);
//GL11.glTranslatef(posX, posY, posZ);
GL11.glNormal3f(0.0F, 1.0F, 0.0F);
GL11.glRotatef(rotY, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(rotX, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(rotZ, 0.0F, 0.0F, 1.0F);
//GL11.glTranslatef(offX, offY, offZ);
GL11.glScalef(-f1, -f1, f1);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDepthMask(false);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
byte b0 = 0;
Tessellator tessellator = Tessellator.instance;
GL11.glDisable(GL11.GL_TEXTURE_2D);
tessellator.startDrawingQuads();
int j = fontrenderer.getStringWidth(text) / 2;
tessellator.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F);
tessellator.addVertex((double)(-j - 1), (double)(-1 + b0), 0.0D);
tessellator.addVertex((double)(-j - 1), (double)(8 + b0), 0.0D);
tessellator.addVertex((double)(j + 1), (double)(8 + b0), 0.0D);
tessellator.addVertex((double)(j + 1), (double)(-1 + b0), 0.0D);
tessellator.draw();
GL11.glEnable(GL11.GL_TEXTURE_2D);
fontrenderer.drawString(text, -fontrenderer.getStringWidth(text) / 2, b0, 553648127);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glDepthMask(true);
fontrenderer.drawString(text, -fontrenderer.getStringWidth(text) / 2, b0, -1);
//GL11.glEnable(GL11.GL_LIGHTING);
//GL11.glDisable(GL11.GL_BLEND);
//GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glPopMatrix();
}
public static void drawRectangle(double x1, double y1, double z1, double x2, double y2, double z2, int r, int g, int b, int a){
Tessellator tessellator = Tessellator.instance;
tessellator.setColorRGBA(r, g, b, a);
tessellator.startDrawingQuads();
tessellator.addVertex(x1, y2, z1);
tessellator.addVertex(x1, y1, z2);
tessellator.addVertex(x2, y1, z2);
tessellator.addVertex(x2, y2, z1);
tessellator.draw();
}
public static void drawRectangleEW(double x1, double y1, double z1, double x2, double y2, double z2, int r, int g, int b, int a){
Tessellator tessellator = Tessellator.instance;
tessellator.setColorRGBA(r, g, b, a);
tessellator.startDrawingQuads();
tessellator.addVertex(x1, y1, z1);
tessellator.addVertex(x1, y1, z2);
tessellator.addVertex(x2, y2, z2);
tessellator.addVertex(x2, y2, z1);
tessellator.draw();
}
}
@@ -0,0 +1,8 @@
package mcp.mobius.waila.gui.interfaces;
public enum CType {
REL_X,
REL_Y,
RELXY,
ABSXY;
}
@@ -0,0 +1,64 @@
package mcp.mobius.waila.gui.interfaces;
import mcp.mobius.waila.gui.events.MouseEvent;
import mcp.mobius.waila.gui.widgets.WidgetGeometry;
import org.lwjgl.util.Point;
public interface IWidget {
// Should all the coordinates, sizes, etc be % or absolute values ?
// Should we allow 2 methods for an absolute referencing (screen pos) and relative one (parent pos) ?
IWidget getParent();
void setParent(IWidget parent);
IWidget setGeometry(WidgetGeometry geom);
WidgetGeometry getGeometry();
IWidget setPos(double x, double y);
IWidget setPos(double x, double y, boolean fracX, boolean fracY);
IWidget setSize(double sx, double sy);
IWidget setSize(double sx, double sy, boolean fracX, boolean fracY);
IWidget adjustSize();
Point getPos();
Point getSize();
int getRight();
int getLeft();
int getTop();
int getBottom();
void draw();
void draw(Point pos);
void show();
void hide();
void setAlpha(float alpha);
float getAlpha();
boolean shouldRender();
IWidget addWidget(String name, IWidget widget);
IWidget addWidget(String name, IWidget widget, RenderPriority priority);
IWidget getWidget(String name);
IWidget delWidget(String name);
IWidget getWidgetAtCoordinates(double posX, double posY);
boolean isWidgetAtCoordinates(double posx, double posy);
void handleMouseInput();
void onMouseClick(MouseEvent event);
void onMouseDrag(MouseEvent event);
void onMouseMove(MouseEvent event);
void onMouseRelease(MouseEvent event);
void onMouseWheel(MouseEvent event);
void onMouseEnter(MouseEvent event);
void onMouseLeave(MouseEvent event);
void emit(Signal signal, Object... params);
void onWidgetEvent(IWidget srcwidget, Signal signal, Object... params);
//boolean onMouseEnter();
//boolean onMouseMoved();
//boolean onMouseLeave();
}
@@ -0,0 +1,7 @@
package mcp.mobius.waila.gui.interfaces;
public enum RenderPriority {
LOW,
MEDIUM,
HIGH;
}
@@ -0,0 +1,8 @@
package mcp.mobius.waila.gui.interfaces;
public enum Signal {
DRAGGED,
CLICKED,
VALUE_CHANGED,
GEOM_CHANGED;
}
@@ -0,0 +1,5 @@
package mcp.mobius.waila.gui.interfaces;
public enum WAlign {
LEFT,CENTER,RIGHT,TOP,BOTTOM;
}
@@ -0,0 +1,90 @@
package mcp.mobius.waila.gui.screens;
import java.util.HashMap;
import org.lwjgl.input.Mouse;
import mcp.mobius.waila.gui.interfaces.IWidget;
import mcp.mobius.waila.gui.widgets.LayoutCanvas;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
public abstract class ScreenBase extends GuiScreen{
protected GuiScreen parent; // Return screen if available.
protected Minecraft mc; // Minecraft instance
protected HashMap<String, IWidget> widgets; // List of widgets on this ui
public ScreenBase(GuiScreen parent) {
this.parent = parent;
this.mc = Minecraft.getMinecraft();
this.widgets = new HashMap<String, IWidget>();
this.addWidget("canvas", new LayoutCanvas());
Mouse.getDWheel(); // We init the DWheel method (getDWheel returns the value since the last call, so we have to call it once on ui creation)
}
/////////////////////
// WIDGET HANDLING //
/////////////////////
public IWidget addWidget(String name, IWidget widget){
this.widgets.put(name, widget);
return this.getWidget(name);
}
public IWidget getWidget(String name){
return this.widgets.get(name);
}
public IWidget delWidget(String name){
IWidget widget = this.getWidget(name);
this.widgets.remove(widget);
return widget;
}
public IWidget getRoot(){
return this.getWidget("canvas");
}
/////////////////////
// DRAWING METHODS //
/////////////////////
@Override
public void drawScreen(int i, int j, float f) {
this.drawDefaultBackground(); //The dark background common to most of the UIs
super.drawScreen(i, j, f);
for (IWidget widget: this.widgets.values())
widget.draw();
}
// Used to easily display a UI without having to mess with mc handle.
public void display(){
this.mc.displayGuiScreen(this);
}
/////////////////////
// INPUT METHODS //
/////////////////////
//Keyboard handling. Basic one is just returning to the previous UI when Esc is pressed
@Override
public void keyTyped(char keyChar, int keyID)
{
if (keyID == 1)
if (this.parent == null){
this.mc.displayGuiScreen((GuiScreen)null);
this.mc.setIngameFocus();
} else
this.mc.displayGuiScreen(this.parent);
}
@Override
public void handleMouseInput()
{
this.getRoot().handleMouseInput();
}
}
@@ -0,0 +1,32 @@
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;
import mcp.mobius.waila.gui.widgets.LayoutBase;
import mcp.mobius.waila.gui.widgets.WidgetGeometry;
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 net.minecraft.client.gui.GuiScreen;
public class ScreenConfig extends ScreenBase {
public ScreenConfig(GuiScreen parent){
super(parent);
this.getRoot().addWidget("ButtonContainer", new ButtonContainer(this.getRoot(), 2, 100, 25.0));
this.getRoot().getWidget("ButtonContainer").setGeometry(new WidgetGeometry(50.0, 50.0, 50.0, 30.0, CType.RELXY, CType.REL_X, WAlign.CENTER, WAlign.CENTER));
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)));
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").getWidget("ButtonBack").setGeometry(new WidgetGeometry(50.0, 50.0, 100.0, 20.0, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
}
}
@@ -0,0 +1,254 @@
package mcp.mobius.waila.gui.screens.config;
import org.lwjgl.util.Point;
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;
import mcp.mobius.waila.gui.interfaces.RenderPriority;
import mcp.mobius.waila.gui.interfaces.Signal;
import mcp.mobius.waila.gui.interfaces.WAlign;
import mcp.mobius.waila.gui.screens.ScreenBase;
import mcp.mobius.waila.gui.widgets.LabelFixedFont;
import mcp.mobius.waila.gui.widgets.LayoutBase;
import mcp.mobius.waila.gui.widgets.LayoutMargin;
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 net.minecraft.client.gui.GuiScreen;
public class ScreenHUDConfig extends ScreenBase {
private class EventCanvas extends LayoutBase{
IWidget draggedWidget = null;
float scale;
public EventCanvas(IWidget parent, GuiScreen prevScreen){
super(parent);
this.setGeometry(new WidgetGeometry(0.0,0.0,100.0,100.0,CType.RELXY, CType.RELXY));
/*
IWidget layoutX = this.addWidget("LayoutX", new LayoutBase(this));
layoutX.setGeometry(new WidgetGeometry(40.0,50.0,20,60, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
layoutX.addWidget("ButtonXAdd", new ButtonLabel(null, "+")).setGeometry(new WidgetGeometry(0.0, 0.0,20,20, CType.RELXY, CType.ABSXY, WAlign.LEFT, WAlign.TOP));
layoutX.addWidget("ButtonXSub", new ButtonLabel(null, "-")).setGeometry(new WidgetGeometry(0.0,100.0,20,20, CType.RELXY, CType.ABSXY, WAlign.LEFT, WAlign.BOTTOM));
layoutX.addWidget("ValueDisplayX", new LabelFixedFont(null, "0")).setGeometry(new WidgetGeometry(50.0,50.0,20,20, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
*/
/*
IWidget layoutY = this.addWidget("LayoutY", new LayoutBase(this));
layoutY.setGeometry(new WidgetGeometry(50.0,50.0,20,60,CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
layoutY.addWidget("ButtonYAdd", new ButtonLabel(null, "+")).setGeometry(new WidgetGeometry(0.0, 0.0,20,20, CType.RELXY, CType.ABSXY, WAlign.LEFT, WAlign.TOP));
layoutY.addWidget("ButtonYSub", new ButtonLabel(null, "-")).setGeometry(new WidgetGeometry(0.0,100.0,20,20, CType.RELXY, CType.ABSXY, WAlign.LEFT, WAlign.BOTTOM));
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().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));;
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));
layoutX.addWidget("LabelX", new LabelFixedFont(null, "X")) .setGeometry(new WidgetGeometry(50.0, 0.0,20,20, CType.REL_X, CType.ABSXY, WAlign.CENTER, WAlign.TOP));
layoutX.addWidget("ButtonXAdd", new ButtonLabel(null, "+")) .setGeometry(new WidgetGeometry(0.0, 10.0,20,20, CType.REL_X, CType.ABSXY, WAlign.LEFT, WAlign.TOP));
layoutX.addWidget("ValueDisplayX", new LabelFixedFont(null, "0")) .setGeometry(new WidgetGeometry(50.0, 40.0,20,20, CType.REL_X, CType.ABSXY, WAlign.CENTER, WAlign.TOP));
layoutX.addWidget("ButtonXSub", new ButtonLabel(null, "-")) .setGeometry(new WidgetGeometry(0.0, 60.0,20,20, CType.REL_X, CType.ABSXY, WAlign.LEFT, WAlign.TOP));
IWidget layoutY = this.addWidget("LayoutY", new LayoutBase(this));
layoutY.setGeometry(new WidgetGeometry(45.0,50.0,20,80,CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
layoutY.addWidget("LabelY", new LabelFixedFont(null, "Y")) .setGeometry(new WidgetGeometry(50.0, 0.0,20,20, CType.REL_X, CType.ABSXY, WAlign.CENTER, WAlign.TOP));
layoutY.addWidget("ButtonYAdd", new ButtonLabel(null, "+")) .setGeometry(new WidgetGeometry(0.0, 10.0,20,20, CType.REL_X, CType.ABSXY, WAlign.LEFT, WAlign.TOP));
layoutY.addWidget("ValueDisplayY", new LabelFixedFont(null, "0")) .setGeometry(new WidgetGeometry(50.0, 40.0,20,20, CType.REL_X, CType.ABSXY, WAlign.CENTER, WAlign.TOP));
layoutY.addWidget("ButtonYSub", new ButtonLabel(null, "-")) .setGeometry(new WidgetGeometry(0.0, 60.0,20,20, CType.REL_X, CType.ABSXY, WAlign.LEFT, WAlign.TOP));
IWidget layoutAlpha = this.addWidget("LayoutAlpha", new LayoutBase(this));
layoutAlpha.setGeometry(new WidgetGeometry(55.0,50.0,20,80,CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
layoutAlpha.addWidget("LabelAlpha", new LabelFixedFont(null, "Alpha")).setGeometry(new WidgetGeometry(50.0, 0.0,20,20, CType.REL_X, CType.ABSXY, WAlign.CENTER, WAlign.TOP));
layoutAlpha.addWidget("ButtonAlphaAdd", new ButtonLabel(null, "+")) .setGeometry(new WidgetGeometry(0.0, 10.0,20,20, CType.REL_X, CType.ABSXY, WAlign.LEFT, WAlign.TOP));
layoutAlpha.addWidget("ValueDisplayAlpha", new LabelFixedFont(null, "0")) .setGeometry(new WidgetGeometry(50.0, 40.0,20,20, CType.REL_X, CType.ABSXY, WAlign.CENTER, WAlign.TOP));
layoutAlpha.addWidget("ButtonAlphaSub", new ButtonLabel(null, "-")) .setGeometry(new WidgetGeometry(0.0, 60.0,20,20, CType.REL_X, CType.ABSXY, WAlign.LEFT, WAlign.TOP));
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("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));
((LabelFixedFont)this.getWidget("LayoutX").getWidget("ValueDisplayX")).setText(String.format("%.2f", picX));
((LabelFixedFont)this.getWidget("LayoutY").getWidget("ValueDisplayY")).setText(String.format("%.2f", picY));
((LabelFixedFont)this.getWidget("LayoutAlpha").getWidget("ValueDisplayAlpha")).setText(String.format("%.2f", picAlpha));
((LabelFixedFont)this.getWidget("LayoutScale").getWidget("ValueDisplayScale")).setText(String.format("%.2f", scale));
this.getWidget("Layout").getWidget("Picture").setAlpha(picAlpha);
}
@Override
public IWidget getWidgetAtCoordinates(double posX, double posY){
if (this.getWidget("Layout").getWidget("Picture").isWidgetAtCoordinates(posX, posY))
return this.getWidget("Layout").getWidget("Picture");
else
return super.getWidgetAtCoordinates(posX, posY);
}
@Override
public void onMouseClick(MouseEvent event){
//System.out.println(this.getWidgetAtCoordinates(event.x, event.y));
if ((event.button == 0) && (this.getWidget("Layout").getWidget("Picture").isWidgetAtCoordinates(event.x, event.y))){
this.getWidget("Layout").getWidget("Picture").onMouseClick(event);
this.draggedWidget = this.getWidget("Layout").getWidget("Picture");
}
else
super.onMouseClick(event);
}
@Override
public void onMouseDrag(MouseEvent event){
//if ((this.getWidgetAtCoordinates(event.x, event.y) == this) && (this.draggedWidget != null)){
if (this.draggedWidget != null){
this.draggedWidget.onMouseDrag(event);
} else {
super.onMouseDrag(event);
}
}
@Override
public void onMouseRelease(MouseEvent event){
if (event.button == 0)
this.draggedWidget = null;
super.onMouseRelease(event);
}
private void updateData(){
((LabelFixedFont)this.getWidget("LayoutX").getWidget("ValueDisplayX")).setText(String.format("%.2f", this.getWidget("Layout").getWidget("Picture").getGeometry().getRawPos().getX()));
((LabelFixedFont)this.getWidget("LayoutY").getWidget("ValueDisplayY")).setText(String.format("%.2f", this.getWidget("Layout").getWidget("Picture").getGeometry().getRawPos().getY()));
((LabelFixedFont)this.getWidget("LayoutAlpha").getWidget("ValueDisplayAlpha")).setText(String.format("%.2f", this.getWidget("Layout").getWidget("Picture").getAlpha()));
((LabelFixedFont)this.getWidget("LayoutScale").getWidget("ValueDisplayScale")).setText(String.format("%.2f", scale));
}
@Override
public void onWidgetEvent(IWidget srcwidget, Signal signal, Object... params){
if (this.getWidget("Layout") == null) return;
if (srcwidget.equals(this.getWidget("Layout").getWidget("Picture")) && signal == Signal.DRAGGED){
this.draggedWidget = this.getWidget("Layout").getWidget("Picture");
this.updateData();
}
if (signal == Signal.CLICKED){
IWidget picture = this.getWidget("Layout").getWidget("Picture");
double pictureX = picture.getGeometry().getRawPos().getX();
double pictureY = picture.getGeometry().getRawPos().getY();
double pixelToPercentX = 100.0D / picture.getParent().getSize().getX();
double pixelToPercentY = 100.0D / picture.getParent().getSize().getY();
if (srcwidget.equals(this.getWidget("LayoutX").getWidget("ButtonXAdd"))){
double newPos = Math.min(pictureX + pixelToPercentX, 100.0);
picture.setPos(newPos, pictureY);
}
if (srcwidget.equals(this.getWidget("LayoutX").getWidget("ButtonXSub"))){
double newPos = Math.max(pictureX - pixelToPercentX, 0.0);
picture.setPos(newPos, pictureY);
}
if (srcwidget.equals(this.getWidget("LayoutY").getWidget("ButtonYAdd"))){
double newPos = Math.min(pictureY + pixelToPercentY, 100.0);
picture.setPos(pictureX, newPos);
}
if (srcwidget.equals(this.getWidget("LayoutY").getWidget("ButtonYSub"))){
double newPos = Math.max(pictureY - pixelToPercentY, 0.0);
picture.setPos(pictureX, newPos);
}
if (srcwidget.equals(this.getWidget("LayoutAlpha").getWidget("ButtonAlphaAdd")))
picture.setAlpha(Math.min(picture.getAlpha() + 0.05f, 1.0f));
if (srcwidget.equals(this.getWidget("LayoutAlpha").getWidget("ButtonAlphaSub")))
picture.setAlpha(Math.max(picture.getAlpha() - 0.05f, 0.0f));
if (srcwidget.equals(this.getWidget("LayoutScale").getWidget("ButtonScaleAdd"))){
scale += 0.05f;
scale = Math.max(0.10f, scale);
scale = Math.min(2.00f, scale);
int picSX = (int)(180 / this.rez.getScaleFactor() * scale), picSY = (int)(62 / this.rez.getScaleFactor() * scale);
picture.setSize(picSX, picSY);
((LayoutMargin)this.getWidget("Layout")).setMargins(picSX/2, picSX/2, picSY/2, picSY/2);
}
if (srcwidget.equals(this.getWidget("LayoutScale").getWidget("ButtonScaleSub"))){
scale -= 0.05f;
scale = Math.max(0.10f, scale);
scale = Math.min(2.00f, scale);
int picSX = (int)(180 / this.rez.getScaleFactor() * scale), picSY = (int)(62 / this.rez.getScaleFactor() * scale);
picture.setSize(picSX, picSY);
((LayoutMargin)this.getWidget("Layout")).setMargins(picSX/2, picSX/2, picSY/2, picSY/2);
}
//picture.emit(Signal.DRAGGED, picture.getPos());
this.updateData();
}
if (srcwidget.equals(this.getWidget("ButtonOk")) && signal == Signal.CLICKED){
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));
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;
mod_Waila.updateColors();
}
if (srcwidget.equals(this.getWidget("ButtonDefault")) && signal == Signal.CLICKED){
this.getWidget("Layout").getWidget("Picture").setPos(50.0, 1.0);
this.getWidget("Layout").getWidget("Picture").setAlpha(0.8f);
this.scale = 1.0f;
int picSX = (int)(180 / this.rez.getScaleFactor() * scale), picSY = (int)(62 / this.rez.getScaleFactor() * scale);
this.getWidget("Layout").getWidget("Picture").setSize(picSX, picSY);
((LayoutMargin)this.getWidget("Layout")).setMargins(picSX/2, picSX/2, picSY/2, picSY/2);
this.updateData();
}
}
}
public ScreenHUDConfig(GuiScreen parent){
super(parent);
this.getRoot().addWidget("EventCanvas", new EventCanvas(this.getRoot(), parent));
}
}
@@ -0,0 +1,32 @@
package mcp.mobius.waila.gui.screens.config;
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;
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 {
public ScreenModuleChoice(GuiScreen parent){
super(parent);
this.getRoot().addWidget("ButtonContainer", new ButtonContainer(this.getRoot(), 3, 100, 25.0));
this.getRoot().getWidget("ButtonContainer").setGeometry(new WidgetGeometry(50.0, 20.0, 400.0, 60.0, CType.RELXY, CType.REL_Y, WAlign.CENTER, WAlign.TOP));
ButtonContainer buttonContainer = ((ButtonContainer)this.getRoot().getWidget("ButtonContainer"));
for (String key : ConfigHandler.instance().getModuleNames())
buttonContainer.addButton( new ButtonScreenChange(this.getRoot(), key, new ScreenModuleConfig(this, key)));
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"), "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));
}
}
@@ -0,0 +1,49 @@
package mcp.mobius.waila.gui.screens.config;
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;
import mcp.mobius.waila.gui.widgets.LayoutBase;
import mcp.mobius.waila.gui.widgets.WidgetGeometry;
import mcp.mobius.waila.gui.widgets.buttons.ButtonBooleanConfig;
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.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 {
private String modName;
public ScreenModuleConfig(GuiScreen parent, String modname){
super(parent);
this.modName = modname;
this.getRoot().addWidget("ButtonContainer", new ButtonContainerLabel(this.getRoot(), 2, 100, 25.0));
this.getRoot().getWidget("ButtonContainer").setGeometry(new WidgetGeometry(0.0, 20.0, 100.0, 60.0, CType.RELXY, CType.RELXY, WAlign.LEFT, WAlign.TOP));
ButtonContainerLabel buttonContainer = ((ButtonContainerLabel)this.getRoot().getWidget("ButtonContainer"));
for (String key:ConfigHandler.instance().getConfigKeys(this.modName).keySet()){
if (ConfigHandler.instance().isServerRequired(key))
buttonContainer.addButton(new ButtonBooleanConfigRemote(this.getRoot(), key, "screen.button.no", "screen.button.yes"), ConfigHandler.instance().getConfigKeys(this.modName).get(key));
else
buttonContainer.addButton(new ButtonBooleanConfig(this.getRoot(), key, "screen.button.no", "screen.button.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 ));
}
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").getWidget("ButtonBack").setGeometry(new WidgetGeometry(50.0, 50.0, 100.0, 20.0, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
}
}
@@ -0,0 +1,40 @@
package mcp.mobius.waila.gui.screens.config;
import net.minecraft.client.gui.GuiScreen;
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;
import mcp.mobius.waila.gui.widgets.LayoutBase;
import mcp.mobius.waila.gui.widgets.WidgetGeometry;
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;
public class ScreenWailaConfig extends ScreenBase {
public ScreenWailaConfig(GuiScreen parent){
super(parent);
this.getRoot().addWidget("ButtonContainer", new ButtonContainerLabel(this.getRoot(), 2, 100, 25.0));
this.getRoot().getWidget("ButtonContainer").setGeometry(new WidgetGeometry(0.0, 10.0, 100.0, 50.0, CType.RELXY, CType.RELXY));
ButtonContainerLabel buttonContainer = ((ButtonContainerLabel)this.getRoot().getWidget("ButtonContainer"));
buttonContainer.addButton( new ButtonBooleanConfig(this.getRoot(), Constants.CFG_WAILA_SHOW, true, true, "screen.button.hidden", "screen.button.visible"), "choice.showhidewaila");
buttonContainer.addButton( new ButtonBooleanConfig(this.getRoot(), Constants.CFG_WAILA_MODE, true, true, "screen.button.maintained", "screen.button.toggled"), "choice.toggledmaintained");
buttonContainer.addButton( new ButtonBooleanConfig(this.getRoot(), Constants.CFG_WAILA_METADATA, true, false,"screen.button.hidden", "screen.button.visible"), "choice.showhideidmeta");
buttonContainer.addButton( new ButtonBooleanConfig(this.getRoot(), Constants.CFG_WAILA_LIQUID, true, false,"screen.button.hidden", "screen.button.visible"), "choice.showliquids");
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").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").getWidget("ButtonBack").setGeometry(new WidgetGeometry(50.0, 50.0, 100.0, 20.0, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
}
}
@@ -0,0 +1,79 @@
package mcp.mobius.waila.gui.screens.info;
import codechicken.lib.lang.LangUtil;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.item.ItemStack;
import mcp.mobius.waila.gui.interfaces.CType;
import mcp.mobius.waila.gui.interfaces.WAlign;
import mcp.mobius.waila.gui.screens.ScreenBase;
import mcp.mobius.waila.gui.widgets.ItemStackDisplay;
import mcp.mobius.waila.gui.widgets.LabelFixedFont;
import mcp.mobius.waila.gui.widgets.LayoutBase;
import mcp.mobius.waila.gui.widgets.ViewTable;
import mcp.mobius.waila.gui.widgets.WidgetGeometry;
public class ScreenEnchants extends ScreenBase {
public ScreenEnchants(GuiScreen parent) {
super(parent);
this.getRoot().addWidget("Layout_Title", new LayoutBase(null))
.setGeometry(new WidgetGeometry(50.0, 10.0, 50.0, 32.0, CType.REL_X, CType.REL_X, WAlign.CENTER, WAlign.TOP));
this.getRoot().getWidget("Layout_Title").addWidget("ItemStack", new ItemStackDisplay(null))
.setGeometry(new WidgetGeometry(0.0, 0.0, 32.0, 32.0, CType.ABSXY, CType.ABSXY, WAlign.LEFT, WAlign.TOP));
this.getRoot().getWidget("Layout_Title").addWidget("LabelName", new LabelFixedFont(null, "None"))
.setGeometry(new WidgetGeometry(40.0, 4.0, 16.0, 16.0, CType.ABSXY, CType.ABSXY, WAlign.LEFT, WAlign.TOP));
this.getRoot().getWidget("Layout_Title").addWidget("LabelEnchantability", new LabelFixedFont(null, "None"))
.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));
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")
.setColumnsWidth(35.0, 10.0, 10.0, 10.0, 35.0)
.setColumnsAlign(WAlign.LEFT, WAlign.CENTER, WAlign.CENTER, WAlign.CENTER, WAlign.LEFT);
}
public ViewTable getTable(){
return (ViewTable)this.getRoot().getWidget("Table");
}
public ScreenEnchants addRow(String...strings ){
this.getTable().addRow(strings);
return this;
}
public ScreenEnchants setStack(ItemStack stack){
((ItemStackDisplay)this.getRoot().getWidget("Layout_Title").getWidget("ItemStack")).setStack(stack);
this.getRoot().getWidget("Layout_Title").adjustSize();
return this;
}
public ScreenEnchants setName(String name){
((LabelFixedFont)this.getRoot().getWidget("Layout_Title").getWidget("LabelName")).setText(name);
this.getRoot().getWidget("Layout_Title").adjustSize();
return this;
}
public ScreenEnchants setEnchantability(String value){
((LabelFixedFont)this.getRoot().getWidget("Layout_Title").getWidget("LabelEnchantability")).setText(String.format("%s : %s", LangUtil.translateG("enchant.label.enchantability"), value));
this.getRoot().getWidget("Layout_Title").adjustSize();
return this;
}
/*
public ScreenEnchants setStack(ItemStack stack){
((ItemStackDisplay)this.getRoot().getWidget("ItemStack")).setStack(stack);
return this;
}
*/
}
@@ -0,0 +1,70 @@
package mcp.mobius.waila.gui.testing;
import org.lwjgl.util.Point;
import mcp.mobius.waila.gui.events.MouseEvent;
import mcp.mobius.waila.gui.helpers.UIException;
import mcp.mobius.waila.gui.interfaces.CType;
import mcp.mobius.waila.gui.interfaces.IWidget;
import mcp.mobius.waila.gui.interfaces.WAlign;
import mcp.mobius.waila.gui.screens.ScreenBase;
import mcp.mobius.waila.gui.widgets.ItemStackDisplay;
import mcp.mobius.waila.gui.widgets.LabelFixedFont;
import mcp.mobius.waila.gui.widgets.LayoutBase;
import mcp.mobius.waila.gui.widgets.LayoutCropping;
import mcp.mobius.waila.gui.widgets.PictureDisplay;
import mcp.mobius.waila.gui.widgets.PictureSwitch;
import mcp.mobius.waila.gui.widgets.ViewTable;
import mcp.mobius.waila.gui.widgets.ViewportScrollable;
import mcp.mobius.waila.gui.widgets.WidgetBase;
import mcp.mobius.waila.gui.widgets.WidgetGeometry;
import mcp.mobius.waila.gui.widgets.buttons.ButtonBoolean;
import mcp.mobius.waila.gui.widgets.buttons.ButtonContainerLabel;
import mcp.mobius.waila.gui.widgets.buttons.ButtonInteger;
import mcp.mobius.waila.gui.widgets.buttons.ButtonIntegerConfig;
import mcp.mobius.waila.gui.widgets.buttons.ButtonScreenChange;
import mcp.mobius.waila.gui.widgets.movable.PictureMovableRC;
import net.minecraft.block.Block;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.item.ItemStack;
public class ScreenTest extends ScreenBase {
public ScreenTest(GuiScreen parent) {
super(parent);
this.getRoot().addWidget("Test", new ViewTable(null))
.setGeometry(new WidgetGeometry(50.0, 50.0, 90.0, 90.0, CType.RELXY, CType.RELXY, WAlign.CENTER, WAlign.CENTER));
((ViewTable)this.getRoot().getWidget("Test"))
.setColumnsTitle("Column1","Column2","Column3")
.setColumnsWidth(30.0,30.0,30.0)
.setColumnsAlign(WAlign.CENTER, WAlign.CENTER, WAlign.CENTER)
.addRow("test1", "test2", "test3")
.addRow("test1", "test2", "test3")
.addRow("test1", "test2", "test3")
.addRow("test1", "test2", "test3")
.addRow("test1", "test2", "test3")
.addRow("test1", "test2", "test3")
.addRow("test1", "test2", "test3")
.addRow("test1", "test2", "test3")
.addRow("test1", "test2", "test3")
.addRow("test1", "test2", "test3");
/*
this.getRoot().addWidget("Test", new Row(null)).setGeometry(new WidgetGeometry(50.0, 50.0, 90.0, 20.0, CType.RELXY, CType.REL_X, WAlign.CENTER, WAlign.CENTER));
((Row)this.getRoot().getWidget("Test")).setColumnsText("aabbbbbbbbbbbbbbbbbbbbbbbbb","bb","cc");
((Row)this.getRoot().getWidget("Test")).setColumnsWidth(30.0,30.0,30.0);
((Row)this.getRoot().getWidget("Test")).setColumnsAlign(WAlign.LEFT, WAlign.CENTER, WAlign.CENTER);
*/
//this.getRoot().addWidget("TestLayout", new LayoutBase(null)).setGeometry(new WidgetGeometry(50.0, 50.0, 90.0, 90.0, CType.RELXY, CType.RELXY, WAlign.CENTER, WAlign.CENTER));
//((LayoutBase)this.getRoot().getWidget("TestLayout")).setBackgroundColors(0xff505050, 0xff505050);
//this.getRoot().addWidget("Layout", new ViewportScrollable(null)).setGeometry(new WidgetGeometry(50.0,50.0,75.0,75.0,CType.RELXY, CType.RELXY, WAlign.CENTER, WAlign.CENTER));
//((ViewportScrollable)this.getRoot().getWidget("Layout")).attachWidget(new PictureSwitch(this.getRoot(), "waila:textures/test.png", "waila:textures/test_solar.png")).setSize(900, 900);
}
}
@@ -0,0 +1,29 @@
package mcp.mobius.waila.gui.testing;
import net.minecraft.client.gui.GuiScreen;
import mcp.mobius.waila.gui.interfaces.CType;
import mcp.mobius.waila.gui.interfaces.WAlign;
import mcp.mobius.waila.gui.screens.ScreenBase;
import mcp.mobius.waila.gui.widgets.LabelFixedFont;
import mcp.mobius.waila.gui.widgets.WidgetGeometry;
import mcp.mobius.waila.gui.widgets.buttons.ButtonContainerLabel;
import mcp.mobius.waila.gui.widgets.buttons.ButtonIntegerConfig;
public class ScreenTest2 extends ScreenBase {
public ScreenTest2(GuiScreen parent) {
super(parent);
//this.getRoot().addWidget("Picture", new PictureSwitch(this.getRoot(), "waila:textures/test.png", "waila:textures/test_solar.png"));
//this.getRoot().addWidget("Button", new ButtonInteger(this.getRoot(), "Val0", "Val1", "Val2"));
//this.getRoot().getWidget("Button").setGeometry(new WidgetGeometry(50.0D, 50.0D, 100.0D, 20.0D, true, false, WidgetAlign.CENTER, WidgetAlign.CENTER));
this.getRoot().addWidget("Buttons", new ButtonContainerLabel(this.getRoot(), 2, 100, 30.0));
this.getRoot().getWidget("Buttons").setGeometry(new WidgetGeometry(0.0, 0.0, 100.0, 50.0, CType.RELXY, CType.RELXY));
//((ButtonContainer)this.getRoot().getWidget("Buttons")).addButton(new ButtonIntegerConfig(this.getRoot(), "testconfig", true, 0, "Val0", "Val1", "Val2"));
this.getRoot().addWidget("Text", new LabelFixedFont(this.getRoot(), "waila:textures/test.png"));
this.getRoot().getWidget("Text").setGeometry(new WidgetGeometry(50.0D, 10.0D, 50.0D, 50.0D, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.TOP));
}
}
@@ -0,0 +1,118 @@
package mcp.mobius.waila.gui.truetyper;
/**
* TrueTyper: Open Source TTF implementation for Minecraft.
* Copyright (C) 2013 - Mr_okushama
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import java.nio.FloatBuffer;
import org.lwjgl.BufferUtils;
import org.lwjgl.opengl.GL11;
import org.lwjgl.util.vector.Matrix4f;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraftforge.client.GuiIngameForge;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.common.MinecraftForge;
public class FontHelper {
private static String formatEscape = "\u00A7";
public static void drawString(String s, float x, float y, TrueTypeFont font, float scaleX, float scaleY, float... rgba){
drawString(s,x,y,font,scaleX,scaleY,0,rgba);
}
public static void drawString(String s, float x, float y, TrueTypeFont font, float scaleX, float scaleY, float rotationZ, float... rgba){
Minecraft mc = Minecraft.getMinecraft();
ScaledResolution sr = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
if(mc.gameSettings.hideGUI){
return;
}
int amt = 1;
if(sr.getScaleFactor() == 1){
amt = 2;
}
FloatBuffer matrixData = BufferUtils.createFloatBuffer(16);
GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, matrixData);
FontHelper.set2DMode(matrixData);
GL11.glPushMatrix();
y = mc.displayHeight-(y*sr.getScaleFactor())-(((font.getLineHeight()/amt)));
float tx = (x*sr.getScaleFactor())+(font.getWidth(s)/2);
float tranx = tx+2;
float trany = y+(font.getLineHeight()/2);
GL11.glTranslatef(tranx,trany,0);
GL11.glRotatef(rotationZ, 0f, 0f, 1f);
GL11.glTranslatef(-tranx,-trany,0);
GL11.glEnable(GL11.GL_BLEND);
if(s.contains(formatEscape)){
String[] pars = s.split(formatEscape);
float totalOffset = 0;
for(int i = 0; i < pars.length; i++){
String par = pars[i];
float[] c = rgba;
if(i > 0){
c = Formatter.getFormatted(par.charAt(0));
par = par.substring(1, par.length());
}
font.drawString((x*sr.getScaleFactor()+totalOffset), y, par, scaleX/amt, scaleY/amt, c);
totalOffset += font.getWidth(par);
}
}else{
font.drawString((x*sr.getScaleFactor()), y, s, scaleX/amt, scaleY/amt, rgba);
}
GL11.glPopMatrix();
GL11.glDisable(GL11.GL_BLEND);
FontHelper.set3DMode();
}
private static void set2DMode(FloatBuffer matrixData) {
Minecraft mc = Minecraft.getMinecraft();
ScaledResolution sr = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
mc.entityRenderer.setupOverlayRendering();
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glPushMatrix();
//GL11.glLoadMatrix(matrixData);
GL11.glLoadIdentity();
GL11.glOrtho(0, mc.displayWidth, 0, mc.displayHeight, -1, 1);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glPushMatrix();
GL11.glLoadIdentity();
Matrix4f matrix = new Matrix4f();
matrix.load(matrixData);
GL11.glTranslatef(matrix.m30*sr.getScaleFactor(),-matrix.m31*sr.getScaleFactor(), 0f);
}
private static void set3DMode() {
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glPopMatrix();
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glPopMatrix();
Minecraft mc = Minecraft.getMinecraft();
mc.entityRenderer.setupOverlayRendering();
}
}
Loaded 100 of 164 files, more files were not shown because too many files have changed in this diff. Show more