Compare commits

..

212 Commits

Author SHA1 Message Date
yueh 51c92d3dfb Merge pull request #1732 from yueh/fix-1718
Use the correct resolver for crystal seeds
2015-07-25 18:29:13 +02:00
yueh 37295745cf Merge pull request #1696 from yueh/feature-85
Adds a round robin and random mode to export buses.
2015-07-25 18:29:02 +02:00
yueh c3ce9d9542 Adds a round robin and random mode to export buses.
Resolves #85
2015-07-25 17:27:56 +02:00
yueh 15993eb3c7 Merge pull request #1695 from yueh/b-prevents-crafting-of-disabled-parts
Prevents crafting of disabled parts
2015-07-24 22:27:21 +02:00
yueh 48d1a5aa88 Merge pull request #1687 from yueh/fix-1686
Fixes #1686: Let PlayerRegistry handle nonexistent players
2015-07-24 22:26:00 +02:00
yueh 3826b3b51f Merge pull request #1730 from yueh/fix-1728
Fixes #1728 Mark the entity as dead before spawning overflow
2015-07-24 22:25:43 +02:00
yueh 7833ff5eab Merge pull request #1733 from yueh/fix-1710
Use the correct culling face for the meteor compass
2015-07-24 22:24:08 +02:00
yueh 6f5a2888c0 Fixes #1710 Use the correct culling face for the meteor compass 2015-07-22 16:58:50 +02:00
yueh 6d42032738 Fixes #1718 Use the correct resolver for crystal seeds 2015-07-22 16:00:18 +02:00
yueh 1a38e5ba94 Fixes #1728 Mark the entity as dead before spawning overflow 2015-07-22 15:07:08 +02:00
yueh ff3e51018f Fixes #1686: Let PlayerRegistry handle nonexistent players 2015-07-14 22:48:37 +02:00
yueh 65c47d4c4e Merge pull request #1633 from TheCricket/patch-2
Allows the automation of Vibration Chambers with lava buckets
2015-07-14 21:31:16 +02:00
yueh d7486fec3c Merge pull request #1647 from yueh/fix-1646
Fixes #1646 Save GridStorage properly
2015-07-14 21:30:50 +02:00
yueh 796b6dc7a2 Merge pull request #1709 from yueh/fix-1706
Fixes #1706 Adds a test to disable unsupported BetterStorage integration
2015-07-14 21:30:30 +02:00
yueh 67b261cc7c Merge pull request #1698 from yueh/fix-1648
Fixes #1648 Removes unecessary cast to BlockQuartzTorch
2015-07-14 21:30:19 +02:00
yueh 3fb3f70392 Merge pull request #1678 from yueh/fix-1673
Removed overly defensive code and ensure GL state to be restored.
2015-07-14 21:30:03 +02:00
yueh 49321d72c1 Merge pull request #1667 from yueh/fix-1666
Fixes #1666 Missing check for the memory card
2015-07-14 21:29:49 +02:00
yueh 62fb0dc7f7 Merge pull request #1665 from yueh/fix-1656
Fixes #1656 Reduces the amount of block updates a controller sends.
2015-07-14 21:29:39 +02:00
yueh e9e9535f2a Merge pull request #1635 from thatsIch/e-export-oredicts
Exports the ore-dicts out of the recipe files
2015-07-14 21:29:18 +02:00
yueh ab9f4e7fd7 Merge pull request #1604 from yueh/e-immutable-inscriber-recipes
Changed to immutable list to prevent direct modifcations
2015-07-14 21:28:41 +02:00
yueh 1080b65404 Fixes #1706 Adds a test to disable unsupported BetterStorage integration 2015-07-14 20:49:39 +02:00
yueh c823e1464b Ensure that disabled parts are actually disabled and removed. 2015-07-10 18:35:22 +02:00
yueh 4ba722cb51 Fixes #1648 Removes unecessary cast to BlockQuartzTorch 2015-07-10 18:16:27 +02:00
thatsIch 91b8d30a15 Fixes #1474: Prevents crafting of disabled recipes and deletes invalid parts 2015-07-09 13:35:31 +02:00
yueh 3e6231492e Merge pull request #1684 from yueh/fix-1611
Reset the lastUsedChannels on a gridstorage change
2015-07-06 09:58:43 +02:00
yueh 1c2df4f380 Reset the lastUsedChannels on a gridstorage change 2015-07-06 09:54:05 +02:00
yueh 3f013c8d1d Removed overly defensive code and ensure GL state to be restored.
Fixes #1673
2015-07-04 17:30:54 +02:00
yueh 4e46dc08af Fixes #1666 Missing check for the memory card 2015-07-01 22:01:46 +02:00
yueh f5e3ae8949 Fixes #1656 Reduces the amount of block updates a controller sends. 2015-07-01 20:26:04 +02:00
yueh b2c31e20b2 Fixes #1646 Save GridStorage properly 2015-06-26 00:35:59 +02:00
thatsIch cd0aec123d Exports the ore-dicts out of the recipe files
This will not alter the handler, because rewriting the parser for it being too static is not feasible at this point
2015-06-21 23:57:36 +02:00
yueh 3844f3af87 Merge pull request #1619 from yueh/fix-1618
Removed meta based rotation of CGA
2015-06-21 20:33:54 +02:00
Cricket 1cc118c927 Allows the automation of Vibration Chambers with lava buckets 2015-06-21 12:57:59 -04:00
thatsIch afd1d4e21e Merge pull request #1627 from bakaxyf/master
Update zh_CN.lang
2015-06-20 19:26:43 +02:00
bakaxyf 77597973e7 Update zh_CN.lang 2015-06-20 17:55:24 +08:00
yueh 4acec30a66 Removed meta based rotation of CGA
Fixes #1618
2015-06-17 21:42:35 +02:00
thatsIch ab32b2b357 Merge pull request #1600 from thatsIch/b-1599-precondition-failing-of-world-data
Fixes #1599: Removes preconditions for world data and children
2015-06-17 20:13:27 +02:00
thatsIch 8b7aea9f14 Merge pull request #1610 from thatsIch/e-update-dependencies
Update dependencies
2015-06-16 19:29:42 +02:00
thatsIch db4a6c6cc0 Fixes #1599: Removes preconditions for world data and children 2015-06-16 19:26:37 +02:00
yueh c6383f21c5 Merge pull request #1609 from yueh/fix-1510
Splitted channeldata into two ints
2015-06-16 18:04:49 +02:00
yueh 85de600d16 Splitted channeldata into two ints
Previously it did encode the current and previous used channels into the
same as well as mask it with 0xFF. Which lead to an overflow every 256
gridnodes requiring a channel. This will not happen at > 2^31

Also removes the need to bitshift them for every access.

Fixes #1510
2015-06-16 14:57:04 +02:00
thatsIch 944f434993 Update dependencies 2015-06-16 14:32:08 +02:00
yueh 6b47bf3ce8 Changed to immutable list to prevent direct modifcations 2015-06-16 00:18:01 +02:00
thatsIch 60aa74d19f Merge pull request #1593 from thatsIch/e-update-forge
Updates Forge to 1.7.10-10.13.4.1448-1.7.10
2015-06-14 14:51:36 +02:00
thatsIch e5f59e0a00 Updates Forge to 1.7.10-10.13.4.1448-1.7.10
the public field fluidID was removed and was replaced with the public getter
2015-06-14 09:46:44 +02:00
thatsIch 2ba4f312d4 Fixes wrong interface names for BuildCraft Transport 2015-06-13 23:42:40 +02:00
thatsIch 2274ca79e4 Merge pull request #1578 from thatsIch/b-1559-infinite-recursion-crash
Fixes #1559: Level Emitter with P:R alloy wire does not crash anymore
2015-06-13 22:45:28 +02:00
thatsIch a75dee0d08 Fixes #1559: Level Emitter with P:R alloy wire does not crash anymore
Required to implement a more advanced interface, if not done that way, the parts will update themselves recursively
2015-06-13 17:24:30 +02:00
thatsIch 349ac7e0a0 Merge pull request #1590 from thatsIch/b-1588-same-oredict-name-for-certus-ore-and-charged
Fixes #1588: Charged Certus Quartz Ore has its own oredictionary entry
2015-06-13 17:17:54 +02:00
thatsIch b5d0db493b Fixes #1588: Charged Certus Quartz Ore has its own oredictionary entry 2015-06-13 17:06:24 +02:00
yueh 256c0258bb Merge pull request #1522 from yueh/feature-12
Closes #12 Added visual lock state to monitors
2015-06-13 16:55:03 +02:00
yueh 73ffbb268a Merge pull request #1577 from yueh/fix-1567
Moved ETA to the title and also no longer display for empty jobs
2015-06-13 16:50:01 +02:00
thatsIch 69299a6b1d Merge pull request #1526 from thatsIch/e-error-message
Improves the message generated when generating the folder for the compass data
2015-06-13 16:46:29 +02:00
thatsIch d1e4ea6579 Improves the message generated when generating the folder for the compass data.
Outsources the encoding of the compass data into the file name
Written tests for the encoding
Did some internal cleaning of the class
2015-06-13 16:05:59 +02:00
yueh f0bf72bc34 Updated eclipse formatter and import order 2015-06-13 15:28:14 +02:00
thatsIch 7fc538fc99 Add IntelliJ Code-Style 2015-06-13 15:22:39 +02:00
thatsIch acc3bb6a29 Merge pull request #1561 from thatsIch/b-update-build-craft
Updates BuildCraft to 7.0.9
2015-06-13 14:37:41 +02:00
thatsIch 71ce42f26a Updates BuildCraft to 7.0.9
Split dependency logic on the BuildCraft modules.
Config needs to be reset, if BuildCraft was disabled actively,
because now there are 3 BC modules to be taken account of
2015-06-13 13:10:46 +02:00
yueh cb013cf55b Moved ETA to the title and also no longer display for empty jobs
Fixes #1567
2015-06-11 20:00:47 +02:00
yueh 57836848ae Merge pull request #1575 from yueh/fix-1574
Fixes #1574 Light detector no longer emitting light
2015-06-11 19:33:59 +02:00
yueh 53c4529d7a Fixes #1574 Light detector no longer emitting light 2015-06-11 11:51:15 +02:00
thatsIch e3a0b34767 Merge pull request #1555 from thatsIch/b-slow-craftguide-integration
Cleaned up CraftGuide Integration
2015-06-09 23:28:17 +02:00
yueh 5aaaeb6d42 Closes #12 Added visual lock state to monitors
Some general refactoring of every monitor including panels and terminals.
Disabled glPushAttrib and glPopAttrib for StorageMonitor as this can be a
performance issue.
2015-06-06 17:00:52 +02:00
Uristqwerty e1ff0fe5ef Cleaned up CraftGuide Integration
A NPE caused to open CraftGuide very slowly (several seconds)

Added Grinder recipes
Added Inscriber recipes
2015-06-06 13:36:00 +02:00
yueh 86e5d6f5da Merge pull request #1551 from yueh/fix-1036
No longer invalidate the cache on simulate.
2015-06-05 23:03:08 +02:00
yueh 05f90760f2 No longer invalidate the cache of MEMonitorIInventory on simulate.
Should fix #1036
2015-06-05 19:35:52 +02:00
thatsIch 17465e68e8 Merge pull request #1453 from thatsIch/f-1452-auto-gen-custom-recipes
Closes #1452: Implements auto-generation of custom recipes
2015-06-03 23:18:35 +02:00
thatsIch b0348fb888 Merge pull request #1543 from thatsIch/f-1541-td-attunements
Closes #1541: Implements Thermal Dynamics attunements
2015-06-03 23:18:17 +02:00
thatsIch 7a731ec658 Closes #1541: Implements Thermal Dynamics attunements
Adds itemduct to item P2P
Adds fluiducts to fluid P2P
Adds fluxduct to RF P2P
2015-06-02 22:21:37 +02:00
thatsIch 3a9296f453 Merge pull request #1537 from thatsIch/b-1536-bc-checking
Fixes #1536: Checking for all required BC classes
2015-06-01 20:45:15 +02:00
yueh 4ac8a0add0 Merge pull request #1519 from yueh/fix-1517
Fixes #1517 improved performance of TESRWrapper
2015-06-01 20:04:09 +02:00
yueh 6e76690835 Fixes #1517 improved performance of TESRWrapper 2015-06-01 19:57:14 +02:00
yueh 776d68bb03 Merge pull request #1486 from yueh/feature-1259
Closes #1259 ETA for crafting jobs
2015-06-01 19:51:47 +02:00
yueh e2b870f1f1 Merge pull request #1482 from yueh/feature-1344
Closes #1344 Added a silk touch annihilation plane
2015-06-01 19:51:28 +02:00
yueh 4befdecd25 Closes #1344 Added a silk touch annihilation plane 2015-06-01 19:50:38 +02:00
yueh 98fe4680c1 Merge pull request #1428 from yueh/feature-split-aebaseblock
Splits AEBaseBlock into AEBaseBlock + AEBaseTileBlock
2015-06-01 19:48:21 +02:00
yueh 2d7917de14 Splits AEBaseBlock into AEBaseBlock + AEBaseTileBlock 2015-06-01 19:38:46 +02:00
thatsIch 6e881fac2d Fixes #1536: Checking for all required BC classes 2015-06-01 19:14:45 +02:00
thatsIch 0076f2ea51 Closes #1452: Implements auto-generation of custom recipes 2015-06-01 17:37:25 +02:00
thatsIch 523548373d Merge pull request #1535 from LemonLake/master
Proper English localisation
2015-06-01 14:58:35 +02:00
Lemmmy 58bdeb134c Proper English localisation 2015-06-01 01:54:44 +01:00
thatsIch 2722057c81 Merge pull request #1527 from thatsIch/b-1521-wrong-stable-channel
Fixes #1521: Renames release to stable
2015-05-30 22:30:07 +02:00
thatsIch d6f29464c6 Fixes #1521: Renames release to stable 2015-05-30 19:52:06 +02:00
thatsIch 5105a2b1fb Merge pull request #1500 from plumpudding/master
Closes #1379: Implements decorative slabs
2015-05-25 15:27:10 +02:00
PetaByteBoy c00962b044 add slabs 2015-05-23 15:02:29 +02:00
thatsIch 858f73c439 Merge pull request #1498 from TheJulianJES/patch-6
Changed version from PartStack provider to rv2 (rv2)
2015-05-23 13:52:43 +02:00
TheJulianJES ade5e23458 Changed version from PartStack provider to rv2 (rv2)
because @thatsIch merged it also to rv2
2015-05-23 13:49:54 +02:00
yueh 61dfc05ae0 Added a simple ETA to crafting jobs 2015-05-21 21:31:13 +02:00
thatsIch 25fd03cb88 Revert cast to match Java 6 2015-05-21 21:00:45 +02:00
thatsIch e7fe8b60de Merge pull request #1487 from thatsIch/f-source-jar
Adds source jar artifact to gradle
2015-05-20 21:02:46 +02:00
thatsIch f16ae9c80b Merge pull request #1490 from bakaxyf/master
Update zh_CN.lang
2015-05-20 10:43:31 +02:00
bakaxyf ed1f327c57 Update zh_CN.lang 2015-05-20 16:10:04 +08:00
thatsIch 4a19ea4c68 Merge pull request #1447 from jeremiahwinsley/master
Fix for #1384 - Infinite Power
2015-05-19 21:06:48 +02:00
thatsIch 0ec1d728e5 Adds source jar artifact to gradle 2015-05-19 20:55:31 +02:00
thatsIch 57eb4c0a71 Lower case playerID 2015-05-19 16:24:08 +02:00
yueh ecf2f3fdaf Merge pull request #1478 from yueh/fix-1465
Fixes #1465 faulty item comparison
2015-05-19 00:53:53 +02:00
yueh f3db010303 Merge pull request #1461 from yueh/fix-1389
Fixes #1389 Enabled repeatable keyboard events
2015-05-19 00:53:22 +02:00
Jeremiah Winsley 1a1316072a Test with V6e of RotaryCraft 2015-05-18 14:38:38 -04:00
Jeremiah Winsley 020740bf43 Fixes #1384 - implement AdvancedShaftPowerReceiver for RotaryCraft powersink 2015-05-18 14:38:38 -04:00
thatsIch 682c674696 Merge pull request #1467 from TheJulianJES/wailaStackPart
Fix #1362 - Parts display in WAILA
2015-05-18 19:35:14 +02:00
yueh 7fa7502770 Fixes #1465 faulty item comparison 2015-05-18 19:31:18 +02:00
thatsIch 962c7c0a92 Merge pull request #1468 from TheJulianJES/noRFtooltip
Removes default RF tooltip on WAILA 1.5.9+
2015-05-18 19:28:31 +02:00
thatsIch 12e0efa3e1 Merge pull request #1466 from thatsIch/e-instance-factory
Uses an instance factory access for AE2
2015-05-18 19:26:46 +02:00
thatsIch a349e1a277 Usage of CONSTANTS 2015-05-18 08:59:27 +02:00
thatsIch b72c766c16 Split raytrace 2015-05-18 00:37:06 +02:00
thatsIch 72eab029ab Static imports 2015-05-18 00:34:50 +02:00
thatsIch 3613c235be Unused imports 2015-05-18 00:34:37 +02:00
thatsIch 880ea762e5 missing javadoc 2015-05-18 00:34:14 +02:00
thatsIch 83c9c0efcb Better hyphing 2015-05-18 00:33:39 +02:00
thatsIch 733a53ec6d Typo in 'fward' 2015-05-18 00:33:04 +02:00
thatsIch 8c500c4016 Typo in 'fward' 2015-05-18 00:32:46 +02:00
thatsIch abdd6e1915 Typo in 'constructor' 2015-05-18 00:31:41 +02:00
thatsIch 209333989e Typ in chisldQuartz 2015-05-18 00:31:16 +02:00
thatsIch 2803a671d1 Redundant type casts 2015-05-18 00:30:08 +02:00
thatsIch 1cf2e8d43e Instance field access not qualified with 'this' 2015-05-18 00:12:45 +02:00
thatsIch e7746dc037 Static imports 2015-05-18 00:12:13 +02:00
thatsIch 72195ea784 Unused imports 2015-05-18 00:12:01 +02:00
thatsIch f102c3b468 apply constant naming convention 2015-05-18 00:11:18 +02:00
thatsIch f0215ca56a apply method parameter naming convetion 2015-05-18 00:09:09 +02:00
thatsIch 0f9ca7885a Lower case methods 2015-05-18 00:08:05 +02:00
thatsIch 124d14d3c3 Lower case Swap 2015-05-18 00:02:28 +02:00
thatsIch f9e25b5a33 Lower case method name 2015-05-17 23:52:15 +02:00
thatsIch 72d85aecc9 Use interface for collections 2015-05-17 23:51:57 +02:00
TheJulianJES 0bfb7b7ed3 Removes default RF tooltip
Removed tab

Did something
2015-05-17 20:22:01 +02:00
TheJulianJES e82e8a039b Parts display correctly in WAILA
Register an method that can be overidden

Register the same method in the interface

New class that picks the item and displays it to WAILA

Register the new class and call the other class method

Import in PartWailaDataProvider

Fixed errors

Renamed all Display -> Stack

Stuff
2015-05-17 20:03:32 +02:00
thatsIch e626355aef Merge pull request #1464 from thatsIch/e-update-rtc-api
Update RotaryCraft API to V6f
2015-05-16 21:22:59 +02:00
thatsIch 192848e383 Uses an instance factory access for AE2
Removes the improper way to set itself into a public static non-final variable.
Removes the direct access to the IntegrationRegistry from AppEng. Will be added at some later point somewhere else for non-singleton access.
Constructor is set to package private to enable possible construction from unit tests. Are current not runnable sind it is currently tied to the FML Loader instance.
2015-05-16 20:48:32 +02:00
thatsIch 6339be5a06 Update RotaryCraft API to V6f 2015-05-16 15:16:16 +02:00
thatsIch 4b5fd35056 Merge pull request #1462 from thatsIch/e-improved-test-coverage
Adds tests to improve the test coverage
2015-05-16 14:21:58 +02:00
thatsIch 1137b11550 Merge pull request #1463 from thatsIch/e-update-gradle-2-4
Update Gradle to 2.4
2015-05-16 14:21:53 +02:00
thatsIch 6636718ef7 Update Gradle to 2.4 2015-05-16 13:20:11 +02:00
thatsIch e40f68d3fa Adds tests to improve the test coverage 2015-05-16 12:25:10 +02:00
yueh 96e79e9d9c Fixes #1389 Enabled repeatable keyboard events 2015-05-16 11:34:18 +02:00
thatsIch 3f5ed8ed7f Merge pull request #1443 from TheJulianJES/doublePlayerInvInscriber
Fixes #1442 - Don't add the player inventory two times (Inscriber)
2015-05-14 10:42:43 +02:00
thatsIch fdd44f4633 Add missing License and contributing to gitignore 2015-05-13 22:21:48 +02:00
TheJulianJES 0085909914 Don't add the player inventory two times (Inscriber) 2015-05-10 17:55:10 +02:00
thatsIch 5c301238cd Merge pull request #1438 from TheJulianJES/stainedClayMeteorite
Meteorites can now spawn in stained clay biomes
2015-05-10 13:45:17 +02:00
thatsIch 30ba43e672 Merge pull request #1433 from plumpudding/readme-links
fix licensing links in readme
2015-05-10 12:12:39 +02:00
TheJulianJES afb9bb4379 Meteorites can now spawn in stained clay biomes 2015-05-10 11:37:42 +02:00
PetaByteBoy 3863e2c900 fix licensing links in readme 2015-05-09 23:24:05 +02:00
thatsIch b0249244cc Merge pull request #1431 from TheJulianJES/GermanLang
Changed things in de_DE.lang
2015-05-09 23:23:26 +02:00
TheJulianJES 77873e135f Changed things in de_DE.lang
Fixed a derp

Changed it, again!

Fixed it (all)

Added line 450
2015-05-09 23:20:53 +02:00
thatsIch 35997d58bb Merge pull request #1432 from TheJulianJES/errorEclipse
Fix warnings in eclipse
2015-05-09 23:13:38 +02:00
TheJulianJES 82efa151cc Fix warnings in eclipse
Close scanner instead of doing it with a warning

Make the scanner final..
2015-05-09 23:10:23 +02:00
thatsIch 71569cadb5 Merge pull request #1424 from thatsIch/e-simplified-bitwise-operations
Simplified bitwise operation
2015-05-09 15:58:04 +02:00
thatsIch 1d737c3167 Merge pull request #1425 from thatsIch/e-weaker-collection-type
Use weaker collection types
2015-05-09 15:57:57 +02:00
thatsIch 168038c595 Merge pull request #1426 from thatsIch/e-overly-strong-cast
reduces overly strong type cast
2015-05-09 15:57:47 +02:00
thatsIch e99680d59b Merge pull request #1410 from fnuecke/master
Added P2P tunnel part for OpenComputers.
2015-05-09 15:57:21 +02:00
Florian Nücke 18503ac526 Added P2P tunnel part for OpenComputers.
Includes cleanup provided by thatsIch.
2015-05-09 14:53:54 +02:00
yueh 22f7345147 Merge pull request #1429 from yueh/organize-imports
Organize imports
2015-05-09 13:16:07 +02:00
yueh b6b76d145b Organize imports 2015-05-09 13:06:09 +02:00
thatsIch 7c9b734948 reduces overly strong type cast 2015-05-09 12:45:46 +02:00
thatsIch 16c0fbe3c1 Use weaker collection types 2015-05-09 12:33:16 +02:00
thatsIch b8f22202d4 Merge pull request #1421 from thatsIch/e-local-variable-naming-conventions
Replaces all local variables regarding their naming conventions
2015-05-08 23:50:51 +02:00
thatsIch 513292cd08 Replaces all local variables regarding their naming conventions 2015-05-08 23:50:36 +02:00
thatsIch d8ac614a17 Merge pull request #1423 from thatsIch/e-import-issues
Replaces * and static imports with more readable ones
2015-05-08 23:45:51 +02:00
thatsIch 8dd0991a7d Merge pull request #1422 from thatsIch/e-constant-naming-convention
Replaces all constants regarding their naming conventions
2015-05-08 23:45:44 +02:00
thatsIch 5832e2d828 Merge pull request #1420 from thatsIch/e-method-parameter-naming-conventions
Replaces all method parameter regarding their naming conventions
2015-05-08 23:45:28 +02:00
thatsIch c451a25c7f Merge pull request #1419 from thatsIch/e-non-constant-field-with-upper-case-name
Replaces all non constant fields with upper case name
2015-05-08 23:45:15 +02:00
thatsIch 9d4fd64c58 Merge pull request #1417 from thatsIch/e-reflection-stuff
Removes the unneeded information about the current class in all blocks
2015-05-08 23:45:02 +02:00
thatsIch 42c7cca64f Simplified bitwise operation 2015-05-08 23:44:07 +02:00
thatsIch 7f61ebebc8 Replaces * and static imports with more readable ones 2015-05-08 23:40:31 +02:00
thatsIch 7f14faeaa3 Replaces all constants regarding their naming conventions 2015-05-08 23:37:09 +02:00
thatsIch f193c2adc4 Replaces all method parameter regarding their naming conventions 2015-05-08 23:25:19 +02:00
thatsIch b748a1982f Replaces all non constant fields with upper case name 2015-05-08 22:53:50 +02:00
thatsIch a44369a272 More efficient iteration 2015-05-08 22:42:08 +02:00
thatsIch 25a3573a76 Fix typos 2015-05-08 22:38:04 +02:00
thatsIch 9845e2a463 Merge pull request #1414 from thatsIch/e-1413-removal-of-rb
Closes #1413: Removes RB integration since lacking 1.7.10+ support
2015-05-08 19:44:09 +02:00
thatsIch 3d5fd2c5e8 Merge pull request #1408 from thatsIch/e-logo
Closes #1404: Added logo to AE2
2015-05-08 19:44:02 +02:00
thatsIch dbacb566bb Removes the unneeded information about the current class in all blocks
Every Block had a call to its super, passing its own class.
This can easily be simulated by calling `this.getClass()` in the super class.
Also this was basically only used as using a name.
In the future it might be advisable to not use such methods,
since they are prone to refactoring.
2015-05-08 19:03:03 +02:00
thatsIch 96576a7fc5 Closes #1413: Removes RB integration since lacking 1.7.10+ support 2015-05-08 18:58:37 +02:00
thatsIch 81464d7de1 Closes #1404: Added logo to AE2 2015-05-08 18:47:18 +02:00
thatsIch dd8e1d1faf Merge pull request #1416 from thatsIch/b-1411-missing-recipes-for-stairs
Fixes #1411: Adds recipes for stairs
2015-05-08 18:33:47 +02:00
thatsIch 00248f574a Fixes #1411: Adds recipes for stairs 2015-05-08 18:32:44 +02:00
thatsIch e6e1771349 Merge pull request #1400 from LorenzoDCC/patch-1
Update pt_BR.lang
2015-05-08 17:25:24 +02:00
thatsIch 0a0a788c1c Merge pull request #1406 from thatsIch/b-1405-missing-mcmod
Fixes #1405: Adds mcmod.info and pack.mcmeta to resources
2015-05-07 20:03:44 +02:00
thatsIch 74c0fd92ae Fixes #1405: Adds mcmod.info and pack.mcmeta to resources 2015-05-07 18:14:29 +02:00
Lorenzo Dalla Costa Cervelin 34665d94df Update pt_BR.lang 2015-05-06 14:38:21 -03:00
thatsIch 7e681dc1d9 Merge pull request #1395 from thatsIch/e-more-shields
Adds tag and release shield
2015-05-06 07:16:34 +02:00
thatsIch c158519f37 Adds tag and release shield 2015-05-05 23:36:17 +02:00
thatsIch de069980ce Closes #1287: Set release channel to stable 2015-05-03 22:10:13 +02:00
thatsIch 1710894edc Use self compiled InvTweaks API 2015-05-03 21:23:54 +02:00
thatsIch 65d0ae9290 Merge pull request #1323 from thatsIch/e-installable-mods
Makes maven dependencies de- and installable
2015-05-03 16:24:34 +02:00
thatsIch 1baed48b0a Merge pull request #1372 from thatsIch/b-1368-vibration-chamber-comparator
Fixes #1368: Vibration Chamber notifies neighbors on inventory change and state change
2015-05-03 16:24:26 +02:00
yueh da6b31cdb1 Merge pull request #1352 from yueh/fix-1336
Fixes part interface inventory model
2015-05-02 20:39:42 +02:00
thatsIch 013c8d882c Makes maven dependencies de- and installable
Provides a new configuration `mods` which can be used on Maven Artifacts. That way, we can install them without affecting them on runtime (less load time)

Put the optional tasks into `optional.gradle` where a install task is just a copy task and the deinstall task a delete task

Added maven local to the repositories, if for some reason somebody uses a local maven
2015-05-02 19:35:34 +02:00
thatsIch 503d325021 Merge pull request #1381 from thatsIch/e-overriden-annotions
Adds annotations by contract of the interface
2015-05-02 19:22:19 +02:00
thatsIch 875214c166 Adds annotations by contract of the interface 2015-05-02 15:39:59 +02:00
thatsIch 2eec5309ac Merge pull request #1371 from thatsIch/e-latest-bleeding-edge-badge
Adds several badges
2015-05-02 07:24:52 +02:00
thatsIch a9ec31d72f Merge pull request #1332 from thatsIch/b-1331-crash-on-disabled-material
Fixes #1331: Happened on deactivating features for intermediate crafting components
2015-05-02 07:24:36 +02:00
thatsIch e392ecd08d Fixes #1368: Vibration Chamber notifies neighbors on inventory change and state change 2015-05-01 17:58:59 +02:00
thatsIch 03f9436ef9 Fixes #1331: Happened on deactivating features for intermediate crafting components
If a feature dependency of ItemMultiMaterial was disabled, the returned value was never assigned with the constructed. Pulling out the construction and setting it before checking it, prevents the NPE and also matches the behaviour in ItemMultiPart, where parts are constructed, but never registered.
2015-05-01 17:52:23 +02:00
yueh 8917a331eb Merge pull request #1373 from yueh/fix-1360
Added missing check to detect missing cell workbenches
2015-05-01 17:39:39 +02:00
thatsIch 8fbb317f6e Adds several badges 2015-05-01 17:34:06 +02:00
yueh f15561c4dc Added missing check to detect missing cell workbenches
Fixes #1360
2015-05-01 12:48:08 +02:00
thatsIch ee431b3269 Merge pull request #1359 from thatsIch/e-use-gradle-properties
Do not use the slurper anymore
2015-04-30 18:52:49 +02:00
thatsIch ba97dacfdd Merge pull request #1356 from thatsIch/e-brackets-everywhere
Puts everywhere brackets
2015-04-30 18:52:34 +02:00
thatsIch ce6a2e8487 Do not use the slurper anymore
The proper way to use gradle is to actually use the gradle.properties. It will be automatically read without using a self defined config slurper.

The gradle.properties adds additional convenient options e.g. regarding the VM options and parallel calculation or daemons
2015-04-29 21:03:49 +02:00
thatsIch 64ed05a1b4 Puts everywhere brackets 2015-04-29 18:38:24 +02:00
thatsIch 23aa8fd72d Merge pull request #1337 from thatsIch/e-1333-recipe-sorter
Fixes #1333: Updated old code parts related to recipes
2015-04-28 19:44:55 +02:00
yueh 332ea089e3 Fixes part interface inventory model
Fixes #1336
2015-04-28 19:13:51 +02:00
yueh 106003ebf9 Merge pull request #1349 from yueh/fix-1348
Removed MJ as icon
2015-04-28 19:11:21 +02:00
thatsIch 8271597394 Merge pull request #1341 from thatsIch/b-1339-server-crash
Fixes #1339: Was not able to retrieve the name of an unregistered part
2015-04-28 18:42:42 +02:00
thatsIch 9210069d9b Fixes #1333: Updated old code parts related to recipes
Fixed an additional bug, where the disassembling recipes were not working properly. The fail logic was flawed, so that it would never match the recipe
2015-04-28 18:37:46 +02:00
yueh f364359905 Removed MJ as icon
Fixes #1348
2015-04-28 18:28:54 +02:00
thatsIch fb618b939f Merge pull request #1342 from Mazdallier/patch-1
Update fr_FR.lang
2015-04-27 15:48:33 +02:00
Yves 43a47f8971 Update fr_FR.lang
Minor correction and group organisation
2015-04-27 13:23:28 +02:00
thatsIch e85acf2bee Fixes #1339: Was not able to retrieve the name of an unregistered part
Added an additional map to store all parts and be able to access them if needed.
Added public preconditions
Added private asserts
Excluded public overridden methods, since behaviour can be unexpected
2015-04-27 09:51:40 +02:00
thatsIch bbde2443e1 Merge pull request #1335 from TheVikingWarrior/patch-3
Update it_IT.lang
2015-04-26 16:54:21 +02:00
thatsIch ad2f63ba0d Merge pull request #1328 from thatsIch/b-1327-wrong-container
Fixes #1327: Prevents crash when configuring a GUI
2015-04-26 16:46:06 +02:00
TheVikingWarrior ee977720ca Update it_IT.lang 2015-04-26 15:48:53 +02:00
thatsIch ca953f4596 Fixes #1327: Prevents crash when configuring a GUI 2015-04-25 20:09:53 +02:00
686 changed files with 17476 additions and 5717 deletions
+3 -2
View File
@@ -7,11 +7,12 @@
!gradlew
!gradlew.bat
!build.gradle
!build.properties
!gradle.properties
# include markdowns
!README.md
!License.md
!LICENSE
!CONTRIBUTING.md
# include sourcecode
!src/
+16 -11
View File
@@ -1,3 +1,7 @@
[![Latest Build](https://img.shields.io/teamcity/http/ci.tsr.me/s/AppliedEnergistics_AutoHeadBuild.svg?label=Latest Build)](http://ci.tsr.me/viewType.html?buildTypeId=AppliedEnergistics_AutoHeadBuild&tab=buildTypeStatusDiv)
[![Latest Tag](https://img.shields.io/github/tag/AppliedEnergistics/Applied-Energistics-2.svg?label=Latest Tag)](https://github.com/AppliedEnergistics/Applied-Energistics-2/tags)
[![Latest Release](https://img.shields.io/github/release/AppliedEnergistics/Applied-Energistics-2.svg?label=Latest Release)](https://github.com/AppliedEnergistics/Applied-Energistics-2/releases)
# Applied Energistics 2
## Table of Contents
@@ -26,12 +30,17 @@ A Mod about Matter, Energy and using them to conquer the world..
## License
Applied Energistics 2 API is (c) 2013 - 2014 AlgorithmX2 and licensed under MIT.
Applied Energistics 2 is (c) 2013 - 2014 AlgorithmX2 and licensed under LGPL v3.
See the LICENSE.txt for details or go to http://www.gnu.org/licenses/lgpl-3.0.txt for more information.
Textures and Models are licensed under [Creative Commons, Attribution-NonCommercial-ShareAlike 3.0]( https://creativecommons.org/licenses/by-nc-sa/3.0/).
* Applied Energistics 2 API
- (c) 2013 - 2015 AlgorithmX2 et al
- [![License](https://img.shields.io/badge/License-MIT-red.svg?style=flat)](http://opensource.org/licenses/MIT)
* Applied Energistics 2
- (c) 2013 - 2015 AlgorithmX2 et al
- [![License](https://img.shields.io/badge/License-LGPLv3-blue.svg?style=flat)](https://raw.githubusercontent.com/AppliedEnergistics/Applied-Energistics-2/rv2/LICENSE)
* Textures and Models
- (c) 2013 - 2015 AlgorithmX2 et al
- [![License](https://img.shields.io/badge/License-CC%20BY--NC--SA%203.0-yellow.svg?style=flat)](https://creativecommons.org/licenses/by-nc-sa/3.0/)
* Text and Translations
- [![License](https://img.shields.io/badge/License-No%20Restriction-green.svg?style=flat)](https://creativecommons.org/publicdomain/zero/1.0/)
## Downloads
@@ -103,7 +112,7 @@ Getting Started
6. Push to your fork `git push`
7. Create a Pull-Request on GitHub
8. Wait for review
9. Suqash commits for cleaner history
9. Squash commits for cleaner history
If you are only doing single file pull requests, GitHub supports using a quick way without the need of cloning your fork. Also read up about [synching](https://help.github.com/articles/syncing-a-fork) if you plan to contribute on regular basis.
@@ -137,10 +146,6 @@ An example string would be `appeng:appliedenergistics2:rv2-alpha-30:dev`
Files must be encoded as UTF-8.
### License
All Text and Translations submitted here can be used for any purpose, and may be re-distributed or used without any limitations.
### New Translations
You can provide any additional languages by creating a new file with the [appropriate language code](http://download1.parallels.com/SiteBuilder/Windows/docs/3.2/en_US/sitebulder-3.2-win-sdk-localization-pack-creation-guide/30801.htm).
+14 -9
View File
@@ -18,14 +18,15 @@
apply plugin: 'forge'
apply from: 'gradle/scripts/propertyloader.gradle'
apply from: 'gradle/scripts/dependencies.gradle'
apply from: 'gradle/scripts/artifacts.gradle'
apply from: 'gradle/scripts/autoinstallruntime.gradle'
apply from: 'gradle/scripts/integration.gradle'
apply from: 'gradle/scripts/optional.gradle'
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven {
@@ -51,9 +52,9 @@ configurations.all {
sourceCompatibility = JavaVersion.VERSION_1_6
targetCompatibility = JavaVersion.VERSION_1_6
version = config.version + "-" + config.aechannel + "-" + config.build
group = config.group
archivesBaseName = config.archivesBaseName
version = aeversion + "-" + aechannel + "-" + aebuild
group = aegroup
archivesBaseName = aebasename
// If TeamCity is running this build, lets set the version info
if (hasProperty("teamcity")) {
@@ -78,11 +79,11 @@ jar {
}
minecraft {
version = config.minecraft_version + "-" + config.forge_version
version = minecraft_version + "-" + forge_version
replaceIn "AEConfig.java"
replace "@version@", project.version
replace "@aechannel@", config.aechannel
replace "@aechannel@", aechannel
// used when launching minecraft in dev env
runDir = "run"
@@ -98,11 +99,16 @@ sourceSets {
resources {
srcDir "src/main/resources/"
include "assets/appliedenergistics2/recipes/*.recipe",
"assets/appliedenergistics2/recipes/README.html",
"assets/appliedenergistics2/oredict/*.oredict",
"assets/appliedenergistics2/lang/*.lang",
"assets/appliedenergistics2/textures/blocks/*",
"assets/appliedenergistics2/textures/guis/*",
"assets/appliedenergistics2/textures/models/*",
"assets/appliedenergistics2/textures/items/*"
"assets/appliedenergistics2/textures/items/*",
"assets/appliedenergistics2/meta/*",
"mcmod.info",
"pack.mcmeta"
}
}
}
@@ -111,7 +117,6 @@ processResources {
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand 'version': project.version, 'mcversion': config.minecraft_version
include 'pack.mcmeta'
expand 'version': project.version, 'mcversion': minecraft_version
}
}
-41
View File
@@ -1,41 +0,0 @@
version=rv2
aechannel=beta
build=0
group=appeng
archivesBaseName=appliedenergistics2
#########################################################
# Versions #
#########################################################
minecraft_version=1.7.10
forge_version=10.13.2.1291
#########################################################
# APIs used for development #
#########################################################
cb_minecraft_version=1.7.10
fmp_version=1.1.1.324
code_chicken_lib_version=1.1.3.127
code_chicken_core_version=1.0.4.35
nei_version=1.0.4.90
bc_version=6.4.6
#########################################################
# API Stubs #
# Note: Do not edit these version numbers as they are #
# not the version of the mod, but stub code for AE2 to #
# compile #
#########################################################
api_betterstorage_version=1
api_coloredlightscore_version=1
api_craftguide_version=1
api_ic2_version=1
api_immibis_version=1
api_invtweaks_version=1
api_mekansim_version=1.7.10-8.0.1.198
api_mfr_version=1
api_railcraft_version=1
api_rblocks_version=1
api_rf_version=2
api_rotarycraft_version=V5c
api_waila_version=1.5.10_1.7.10
Binary file not shown.
-10
View File
@@ -1,10 +0,0 @@
#Organize Import Order
#Thu Oct 09 12:52:21 CEST 2014
6=
5=cpw
4=net
3=io
2=org
1=com
0=java
7=appeng
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="12">
<profile kind="CodeFormatterProfile" name="Algo" version="12">
<profile kind="CodeFormatterProfile" name="AE2" version="12">
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="do not insert"/>
@@ -22,7 +22,7 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
@@ -37,13 +37,13 @@
<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
@@ -72,14 +72,14 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
@@ -96,7 +96,7 @@
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="0"/>
@@ -106,7 +106,7 @@
<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
@@ -122,13 +122,13 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="insert"/>
@@ -138,7 +138,7 @@
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="next_line"/>
@@ -147,7 +147,7 @@
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="do not insert"/>
<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
@@ -182,7 +182,7 @@
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.8"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="next_line"/>
@@ -215,7 +215,7 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="insert"/>
@@ -231,7 +231,7 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="insert"/>
@@ -267,8 +267,8 @@
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="insert"/>
@@ -283,13 +283,13 @@
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="tab"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="160"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="do not insert"/>
</profile>
</profiles>
+11
View File
@@ -0,0 +1,11 @@
#Organize Import Order
#Sat Jun 13 15:22:41 CEST 2015
8=appeng
7=
6=cpw
5=net
4=io
3=org
2=com
1=javax
0=java
+57
View File
@@ -0,0 +1,57 @@
aeversion=rv3
aechannel=alpha
aebuild=0
aegroup=appeng
aebasename=appliedenergistics2
#########################################################
# Versions #
#########################################################
minecraft_version=1.7.10
forge_version=10.13.4.1448-1.7.10
#########################################################
# Installable #
#########################################################
waila_version=1.5.10
jabba_version=1.2.1a
enderstorage_version=1.4.7.36
translocator_version=1.1.2.15
ic2_version=2.2.717
enderio_version=2.3.0.375_beta
#cofhlib_version=1.0.1-157
#cofhcore_version=3.0.2-270
#texpansion_version=4.0.0-176
#tfoundation_version=1.0.0-82
betterstorage_version=0.11.3.123.20
invtweaks_version=1.58
#########################################################
# Provided APIs #
#########################################################
fmp_version=1.2.0.345
code_chicken_lib_version=1.1.3.138
code_chicken_core_version=1.0.7.46
nei_version=1.0.5.111
bc_version=7.0.9
opencomputers_version=1.5.12.26
#########################################################
# Self Compiled APIs #
#########################################################
mekansim_version=8.0.1.198
rotarycraft_version=V6e
#########################################################
# Self Compiled API Stubs #
# Note: Do not edit these version numbers as they are #
# not the version of the mod, but stub code for AE2 to #
# compile #
#########################################################
api_coloredlightscore_version=1
api_craftguide_version=1
api_immibis_version=1
api_mfr_version=1
api_railcraft_version=1
api_rf_version=2
+6
View File
@@ -10,6 +10,11 @@ task javadocJar(type: Jar, dependsOn: myJavadocs) {
from 'build/docs/javadoc/'
}
task sourceJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task devJar(type: Jar) {
manifest {
@@ -40,4 +45,5 @@ artifacts {
archives devJar
archives apiJar
archives javadocJar
archives sourceJar
}
+90 -21
View File
@@ -1,3 +1,4 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
@@ -19,14 +20,14 @@
repositories {
mavenLocal()
maven {
name 'CB Maven FS'
name "ChickenBones"
url "http://chickenbones.net/maven/"
}
maven {
name "Waila Mobius Repo"
name "Mobius"
url "http://mobiusstrip.eu/maven"
}
@@ -34,31 +35,99 @@ repositories {
name "FireBall API Depot"
url "http://dl.tsr.me/artifactory/libs-release-local"
}
maven {
name = "Player"
url = "http://maven.ic2.player.to/"
}
maven {
name = "Tterrag"
url = "http://maven.tterrag.com/"
}
maven {
name = "RX14 Proxy"
url = "http://mvn.rx14.co.uk/repo/"
}
maven {
name "OpenComputers Repo"
url = "http://maven.cil.li/"
}
ivy {
name "BuildCraft"
artifactPattern "http://www.mod-buildcraft.com/releases/BuildCraft/[revision]/[module]-[revision]-[classifier].[ext]"
}
// CurseForge DNS for TE is not available or I am just being unlucky, code part can stay since this is applicable to any other curseforge mod though
// ivy {
// name = "CoFHLib"
// artifactPattern "http://addons.cursecdn.com/files/2212/893/[module]-[revision].[ext]"
// }
//
// ivy {
// name = "CoFHCore"
// artifactPattern "http://addons.cursecdn.com/files/2212/895/[module]-[revision].[ext]"
// }
// ivy {
// name = "ThermalExpansion"
// artifactPattern "http://addons.curse.cursecdn.com/files/2212/446/[module]-[revision].[ext]"
// }
// ivy {
// name = "ThermalFoundation"
// artifactPattern "http://addons.curse.cursecdn.com/files/2212/444/[module]-[revision].[ext]"
// }
}
configurations {
mods
}
dependencies {
// installable
mods "mcp.mobius.waila:Waila:${waila_version}_${minecraft_version}:dev"
mods "mcp.mobius.jabba:Jabba:${jabba_version}_${minecraft_version}:dev"
mods "codechicken:EnderStorage:${minecraft_version}-${enderstorage_version}:dev"
mods "codechicken:Translocator:${minecraft_version}-${translocator_version}:dev"
mods "net.industrial-craft:industrialcraft-2:${ic2_version}-experimental:dev"
mods "com.enderio:EnderIO:${minecraft_version}-${enderio_version}:dev"
mods "net.mcft.copy.betterstorage:BetterStorage:${minecraft_version}-${betterstorage_version}:deobf"
mods "inventorytweaks:InventoryTweaks:${invtweaks_version}:deobf"
mods "li.cil.oc:OpenComputers:MC${minecraft_version}-${opencomputers_version}:dev"
compile "codechicken:ForgeMultipart:${config.cb_minecraft_version}-${config.fmp_version}:dev"
compile "codechicken:CodeChickenLib:${config.cb_minecraft_version}-${config.code_chicken_lib_version}:dev"
compile "codechicken:CodeChickenCore:${config.cb_minecraft_version}-${config.code_chicken_core_version}:dev"
compile "codechicken:NotEnoughItems:${config.cb_minecraft_version}-${config.nei_version}:dev"
// mods name: 'CoFHLib', version: "[${minecraft_version}]${cofhlib_version}-dev", ext: 'jar'
// mods name: 'CoFHCore', version: "[${minecraft_version}]${cofhcore_version}-dev", ext: 'jar'
// mods name: 'ThermalExpansion', version: "[${minecraft_version}]${texpansion_version}-dev", ext: 'jar'
// mods name: 'ThermalFoundation', version: "[${minecraft_version}]${tfoundation_version}-dev", ext: 'jar'
compile "com.mod-buildcraft:buildcraft:${config.bc_version}:dev"
compile "codechicken:ForgeMultipart:${minecraft_version}-${fmp_version}:dev"
compile "codechicken:CodeChickenLib:${minecraft_version}-${code_chicken_lib_version}:dev"
compile "codechicken:CodeChickenCore:${minecraft_version}-${code_chicken_core_version}:dev"
compile "codechicken:NotEnoughItems:${minecraft_version}-${nei_version}:dev"
compile "com.mod-buildcraft:buildcraft:${bc_version}:dev"
// provided APIs
compile "li.cil.oc:OpenComputers:MC${minecraft_version}-${opencomputers_version}:api"
compile "net.industrial-craft:industrialcraft-2:${ic2_version}-experimental:api"
compile "net.mcft.copy.betterstorage:BetterStorage:${minecraft_version}-${betterstorage_version}:api"
// self compiled APIs
compile(group: 'api', name: 'betterstorage', version: "${config.api_betterstorage_version}")
compile(group: 'api', name: 'coloredlightscore', version: "${config.api_coloredlightscore_version}")
compile(group: 'api', name: 'craftguide', version: "${config.api_craftguide_version}")
compile(group: 'api', name: 'ic2', version: "${config.api_ic2_version}")
compile(group: 'api', name: 'immibis', version: "${config.api_immibis_version}")
compile(group: 'api', name: 'invtweaks', version: "${config.api_invtweaks_version}")
compile(group: 'api', name: 'mfr', version: "${config.api_mfr_version}")
compile(group: 'api', name: 'railcraft', version: "${config.api_railcraft_version}")
compile(group: 'api', name: 'rblocks', version: "${config.api_rblocks_version}")
compile(group: 'api', name: 'rf', version: "${config.api_rf_version}")
compile "appeng:Waila:${config.api_waila_version}:api"
compile "appeng:RotaryCraft:${config.api_rotarycraft_version}:api"
compile "appeng:mekanism:${config.api_mekansim_version}:api"
compile "appeng:Waila:${waila_version}_${minecraft_version}:api"
compile "appeng:RotaryCraft:${rotarycraft_version}:api"
compile "appeng:mekanism:${minecraft_version}-${mekansim_version}:api"
compile "appeng:InventoryTweaks:${invtweaks_version}:api"
// self compiled stubs
compile(group: 'api', name: 'coloredlightscore', version: "${api_coloredlightscore_version}")
compile(group: 'api', name: 'craftguide', version: "${api_craftguide_version}")
compile(group: 'api', name: 'immibis', version: "${api_immibis_version}")
compile(group: 'api', name: 'mfr', version: "${api_mfr_version}")
compile(group: 'api', name: 'railcraft', version: "${api_railcraft_version}")
compile(group: 'api', name: 'rf', version: "${api_rf_version}")
testCompile "junit:junit:4.11"
}
+116
View File
@@ -0,0 +1,116 @@
task wrapper(type: Wrapper) {
gradleVersion = "2.4"
}
// WAILA
task installWaila(type: Copy, dependsOn: "deinstallWaila") {
from { configurations.mods }
include "**/*Waila*dev.jar"
into file(minecraft.runDir + "/mods")
}
task deinstallWaila(type: Delete) {
delete fileTree(dir: minecraft.runDir + "/mods", include: "*Waila*.jar")
}
// JABBA
task installJabba(type: Copy, dependsOn: "deinstallJabba") {
from { configurations.mods }
include "**/*Jabba*dev.jar"
into file(minecraft.runDir + "/mods")
}
task deinstallJabba(type: Delete) {
delete fileTree(dir: minecraft.runDir + "/mods", include: "*Jabba*.jar")
}
// ENDER STORAGE
task installEnderStorage(type: Copy, dependsOn: "deinstallEnderStorage") {
from { configurations.mods }
include "**/*EnderStorage*dev.jar"
into file(minecraft.runDir + "/mods")
}
task deinstallEnderStorage(type: Delete) {
delete fileTree(dir: minecraft.runDir + "/mods", include: "*EnderStorage*.jar")
}
// TRANSLOCATOR
task installTranslocator(type: Copy, dependsOn: "deinstallTranslocator") {
from { configurations.mods }
include "**/*Translocator*dev.jar"
into file(minecraft.runDir + "/mods")
}
task deinstallTranslocator(type: Delete) {
delete fileTree(dir: minecraft.runDir + "/mods", include: "*Translocator*.jar")
}
// INDUSTRIALCRAFT
task installIC2(type: Copy, dependsOn: "deinstallIC2") {
from { configurations.mods }
include "**/*industrialcraft*dev.jar"
into file(minecraft.runDir + "/mods")
}
task deinstallIC2(type: Delete) {
delete fileTree(dir: minecraft.runDir + "/mods", include: "*industrialcraft*.jar")
}
// ENDER IO
task installEnderIO(type: Copy, dependsOn: "deinstallEnderIO") {
from { configurations.mods }
include "**/*EnderIO*dev.jar"
into file(minecraft.runDir + "/mods")
}
task deinstallEnderIO(type: Delete) {
delete fileTree(dir: minecraft.runDir + "/mods", include: "*EnderIO*.jar")
}
// TE
//task installTE(type: Copy, dependsOn: "deinstallTE") {
// from { configurations.mods }
// include "**/*CoFHLib*.jar"
// include "**/*CoFHCore*.jar"
// include "**/*ThermalFoundation*.jar"
// include "**/*ThermalExpansion*.jar"
//
// into file(minecraft.runDir + "/mods")
//}
//
//task deinstallTE(type: Delete) {
// delete fileTree(dir: minecraft.runDir + "/mods", includes: ["*CoFHLib*.jar", "*CoFHCore*.jar", "*ThermalFoundation*.jar", "*ThermalExpansion*.jar"])
//}
// INV TWEAKS
task installInvTweaks(type: Copy, dependsOn: "deinstallInvTweaks") {
from { configurations.mods }
include "**/*InventoryTweaks*dev*.jar"
into file(minecraft.runDir + "/mods")
}
task deinstallInvTweaks(type: Delete) {
delete fileTree(dir: minecraft.runDir + "/mods", include: "*InventoryTweaks*.jar")
}
// BETTER STORAGE
task installBetterStorage(type: Copy, dependsOn: "deinstallBetterStorage") {
from { configurations.mods }
include "**/*BetterStorage*deobf*.jar"
into file(minecraft.runDir + "/mods")
}
task deinstallBetterStorage(type: Delete) {
delete fileTree(dir: minecraft.runDir + "/mods", include: "*BetterStorage*.jar")
}
task installOpenComputers(type: Copy, dependsOn: "deinstallOpenComputers") {
from { configurations.mods }
include "**/*OpenComputer*dev*.jar"
into file(minecraft.runDir + "/mods")
}
task deinstallOpenComputers(type: Delete) {
delete fileTree(dir: minecraft.runDir + "/mods", include: "*OpenComputers*.jar")
}
-9
View File
@@ -1,9 +0,0 @@
// define the properties file
ext.configFile = file "build.properties"
configFile.withReader {
// read config. it shall from now on be referenced as simply config or as project.config
def prop = new Properties()
prop.load(it)
project.ext.config = new ConfigSlurper().parse prop
}
Binary file not shown.
+2 -2
View File
@@ -1,6 +1,6 @@
#Sat Sep 13 21:58:22 CEST 2014
#Sat May 16 13:19:14 CEST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-bin.zip
@@ -0,0 +1,30 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2013 AlgorithmX2
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package appeng.api.config;
public enum SchedulingMode
{
DEFAULT, ROUNDROBIN, RANDOM
}
+4 -2
View File
@@ -54,13 +54,15 @@ public enum Settings
INTERFACE_TERMINAL( EnumSet.of( YesNo.YES, YesNo.NO ) ), CRAFT_VIA_REDSTONE( EnumSet.of( YesNo.YES, YesNo.NO ) ),
STORAGE_FILTER( EnumSet.allOf( StorageFilter.class ) ), PLACE_BLOCK( EnumSet.of( YesNo.YES, YesNo.NO ) );
STORAGE_FILTER( EnumSet.allOf( StorageFilter.class ) ), PLACE_BLOCK( EnumSet.of( YesNo.YES, YesNo.NO ) ),
SCHEDULING_MODE( EnumSet.allOf( SchedulingMode.class ) );
private final EnumSet<? extends Enum<?>> values;
Settings( @Nonnull EnumSet<? extends Enum<?>> possibleOptions )
{
if ( possibleOptions.isEmpty() )
if( possibleOptions.isEmpty() )
{
throw new IllegalArgumentException( "Tried to instantiate an empty setting." );
}
@@ -3,6 +3,7 @@ package appeng.api.definitions;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import net.minecraft.world.IBlockAccess;
import com.google.common.base.Optional;
@@ -18,4 +19,16 @@ public interface IBlockDefinition extends IItemDefinition
* @return the {@link ItemBlock} implementation if applicable
*/
Optional<ItemBlock> maybeItemBlock();
/**
* Compare Block with world.
*
* @param world world of block
* @param x x pos of block
* @param y y pos of block
* @param z z pos of block
*
* @return if the block is placed in the world at the specific location.
*/
boolean isSameAs( IBlockAccess world, int x, int y, int z );
}
@@ -77,6 +77,22 @@ public interface IBlocks
IBlockDefinition quartzPillarStair();
IBlockDefinition skyStoneSlab();
IBlockDefinition skyStoneBlockSlab();
IBlockDefinition skyStoneBrickSlab();
IBlockDefinition skyStoneSmallBrickSlab();
IBlockDefinition fluixSlab();
IBlockDefinition quartzSlab();
IBlockDefinition chiseledQuartzSlab();
IBlockDefinition quartzPillarSlab();
/*
* misc
*/
@@ -90,7 +106,7 @@ public interface IBlocks
ITileDefinition charger();
ITileDefinition tinyTNT();
IBlockDefinition tinyTNT();
ITileDefinition security();
@@ -7,6 +7,10 @@ import net.minecraft.world.IBlockAccess;
/**
* Interface to compare a definition with an itemstack or a block
*
* @author thatsIch
* @version rv2
* @since rv2
*/
public interface IComparableDefinition
{
@@ -28,6 +32,9 @@ public interface IComparableDefinition
* @param z z pos of block
*
* @return if the block is placed in the world at the specific location.
*
* @deprecated moved to {@link IBlockDefinition}. Is removed in the next major release rv3
*/
@Deprecated
boolean isSameAs( IBlockAccess world, int x, int y, int z );
}
@@ -1,11 +1,34 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2013 - 2015 AlgorithmX2
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package appeng.api.definitions;
import com.google.common.base.Optional;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import com.google.common.base.Optional;
public interface IItemDefinition extends IComparableDefinition
{
@@ -18,4 +41,9 @@ public interface IItemDefinition extends IComparableDefinition
* @return an {@link ItemStack} with specified quantity of this item.
*/
Optional<ItemStack> maybeStack( int stackSize );
/**
* @return <tt>true</tt> if definition is enabled
*/
boolean isEnabled();
}
@@ -66,6 +66,8 @@ public interface IParts
IItemDefinition annihilationPlane();
IItemDefinition identityAnnihilationPlane();
IItemDefinition formationPlane();
IItemDefinition p2PTunnelME();
@@ -82,6 +84,8 @@ public interface IParts
IItemDefinition p2PTunnelLight();
IItemDefinition p2PTunnelOpenComputers();
IItemDefinition cableAnchor();
IItemDefinition monitor();
@@ -1,10 +1,15 @@
package appeng.api.features;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import javax.annotation.Nonnull;
import com.google.common.base.Optional;
import net.minecraft.item.ItemStack;
@@ -12,22 +17,26 @@ import net.minecraft.item.ItemStack;
* Lets you manipulate Inscriber Recipes, by adding or editing existing ones.
*
* @author thatsIch
* @version rv2
* @version rv3
* @since rv2
*/
public interface IInscriberRegistry
{
/**
* Current list of registered recipes, you can modify this if you want too.
* Will never contain a null recipe
* An immutable copy of currently registered recipes.
*
* Use the provided methods to actually modify the inscriber recipes.
*
* @see IInscriberRegistry#addRecipe(IInscriberRecipe)
* @see IInscriberRegistry#removeRecipe(IInscriberRecipe)
*
* @return currentlyRegisteredRecipes
*/
@Nonnull
List<IInscriberRecipe> getRecipes();
Collection<IInscriberRecipe> getRecipes();
/**
* Optional items which are used in the top or bottom slot
* Optional items which are used in the top or bottom slot.
*
* @return set of all optional items
*/
@@ -35,7 +44,7 @@ public interface IInscriberRegistry
Set<ItemStack> getOptionals();
/**
* Get all registered items which are valid inputs
* Get all registered items which are valid inputs.
*
* @return set of all input items
*/
@@ -43,7 +52,7 @@ public interface IInscriberRegistry
Set<ItemStack> getInputs();
/**
* Extensible way to create an inscriber recipe
* Extensible way to create an inscriber recipe.
*
* @return builder for inscriber recipes
*/
@@ -61,9 +70,10 @@ public interface IInscriberRegistry
void addRecipe( IInscriberRecipe recipe );
/**
* Removes a recipe from the registry
* Removes all equal recipes from the registry.
*
* @param toBeRemovedRecipe to be removed recipe, can be null, makes just no sense
* @param toBeRemovedRecipe to be removed recipe, can be null, makes just no sense.
*/
void removeRecipe( IInscriberRecipe toBeRemovedRecipe );
}
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2013 AlgorithmX2
* Copyright (c) 2013 - 2015 AlgorithmX2
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
@@ -24,6 +24,8 @@
package appeng.api.features;
import javax.annotation.Nullable;
import net.minecraft.item.ItemStack;
import appeng.api.config.TunnelType;
@@ -39,10 +41,10 @@ public interface IP2PTunnelRegistry
* Allows third parties to register items from their mod as potential
* attunements for AE's P2P Tunnels
*
* @param trigger - the item which triggers attunement
* @param type - the type of tunnel
* @param trigger - the item which triggers attunement. Nullable, but then ignored
* @param type - the type of tunnel. Nullable, but then ignored
*/
void addNewAttunement( ItemStack trigger, TunnelType type );
void addNewAttunement( @Nullable ItemStack trigger, @Nullable TunnelType type );
/**
* returns null if no attunement can be found.
@@ -51,5 +53,6 @@ public interface IP2PTunnelRegistry
*
* @return null if no attunement can be found or attunement
*/
@Nullable
TunnelType getTunnelTypeByItem( ItemStack trigger );
}
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2013 AlgorithmX2
* Copyright (c) 2013 - 2015 AlgorithmX2
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
@@ -24,10 +24,12 @@
package appeng.api.features;
import net.minecraft.entity.player.EntityPlayer;
import javax.annotation.Nullable;
import com.mojang.authlib.GameProfile;
import net.minecraft.entity.player.EntityPlayer;
/**
* Maintains a save specific list of userids and username combinations this greatly simplifies storage internally and
@@ -55,5 +57,6 @@ public interface IPlayerRegistry
*
* @return PlayerEntity, or null if the player could not be found.
*/
@Nullable
EntityPlayer findPlayer( int playerID );
}
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2013 AlgorithmX2
* Copyright (c) 2013 - 2015 AlgorithmX2
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
@@ -38,8 +38,8 @@ public interface ISecurityRegistry
/**
* Submit Permissions into the register.
*
* @param PlayerID player id
* @param playerID player id
* @param permissions permissions of player
*/
void addPlayer( int PlayerID, EnumSet<SecurityPermissions> permissions );
void addPlayer( int playerID, EnumSet<SecurityPermissions> permissions );
}
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2013 AlgorithmX2
* Copyright (c) 2013 - 2015 AlgorithmX2
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
@@ -94,7 +94,7 @@ public interface IFacadePart
int getItemDamage();
boolean isBC();
boolean notAEFacade();
void setThinFacades( boolean useThinFacades );
+4 -1
View File
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2013 AlgorithmX2
* Copyright (c) 2013 - 2015 AlgorithmX2
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
@@ -24,6 +24,8 @@
package appeng.api.parts;
import javax.annotation.Nullable;
import net.minecraft.item.ItemStack;
//@formatter:off
@@ -63,5 +65,6 @@ public interface IPartItem
*
* @return part from item
*/
@Nullable
IPart createPartFromItemStack( ItemStack is );
}
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2013 AlgorithmX2
* Copyright (c) 2013 - 2015 AlgorithmX2
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
@@ -25,10 +25,17 @@ package appeng.api.recipes;
import java.io.BufferedReader;
import javax.annotation.Nonnull;
public interface IRecipeLoader
{
BufferedReader getFile( String s ) throws Exception;
/**
* @param filePath the path to the to be loaded file
*
* @return reader handler of the file
*
* @throws Exception if reading goes wrong
*/
BufferedReader getFile( @Nonnull String filePath ) throws Exception;
}
@@ -80,7 +80,9 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
public StackType injectItems( StackType input, Actionable mode, BaseActionSource src )
{
if( mode == Actionable.SIMULATE )
{
return this.getHandler().injectItems( input, mode, src );
}
return this.monitorDifference( input.copy(), this.getHandler().injectItems( input, mode, src ), false, src );
}
@@ -94,12 +96,18 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
StackType diff = (StackType) original.copy();
if( extraction )
{
diff.setStackSize( leftOvers == null ? 0 : -leftOvers.getStackSize() );
}
else if( leftOvers != null )
{
diff.decStackSize( leftOvers.getStackSize() );
}
if( diff.getStackSize() != 0 )
{
this.postChangesToListeners( ImmutableList.of( diff ), src );
}
return leftOvers;
}
@@ -118,9 +126,13 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
Entry<IMEMonitorHandlerReceiver<StackType>, Object> o = i.next();
IMEMonitorHandlerReceiver<StackType> receiver = o.getKey();
if( receiver.isValid( o.getValue() ) )
{
receiver.postChange( this, diff, src );
}
else
{
i.remove();
}
}
}
@@ -133,7 +145,9 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
public StackType extractItems( StackType request, Actionable mode, BaseActionSource src )
{
if( mode == Actionable.SIMULATE )
{
return this.getHandler().extractItems( request, mode, src );
}
return this.monitorDifference( request.copy(), this.getHandler().extractItems( request, mode, src ), true, src );
}
@@ -53,8 +53,12 @@ public enum StorageChannel
public IItemList createList()
{
if( this == ITEMS )
{
return AEApi.instance().storage().createItemList();
}
else
{
return AEApi.instance().storage().createFluidList();
}
}
}
@@ -24,7 +24,7 @@
package appeng.api.util;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
@@ -43,5 +43,5 @@ public interface ICommonTile
* @param z z pos of tile entity
* @param drops drops of tile entity
*/
void getDrops( World world, int x, int y, int z, ArrayList<ItemStack> drops );
void getDrops( World world, int x, int y, int z, List<ItemStack> drops );
}
@@ -105,22 +105,34 @@ public class WorldCoord
int zlen = Math.abs( oz );
if( loc.isEqual( this.copy().add( ForgeDirection.EAST, xlen ) ) )
{
return ForgeDirection.EAST;
}
if( loc.isEqual( this.copy().add( ForgeDirection.WEST, xlen ) ) )
{
return ForgeDirection.WEST;
}
if( loc.isEqual( this.copy().add( ForgeDirection.NORTH, zlen ) ) )
{
return ForgeDirection.NORTH;
}
if( loc.isEqual( this.copy().add( ForgeDirection.SOUTH, zlen ) ) )
{
return ForgeDirection.SOUTH;
}
if( loc.isEqual( this.copy().add( ForgeDirection.UP, ylen ) ) )
{
return ForgeDirection.UP;
}
if( loc.isEqual( this.copy().add( ForgeDirection.DOWN, ylen ) ) )
{
return ForgeDirection.DOWN;
}
return null;
}
+120 -342
View File
@@ -1,6 +1,6 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -22,24 +22,19 @@ package appeng.block;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import javax.annotation.Nullable;
import com.google.common.base.Optional;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.client.resources.IResource;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
import net.minecraft.util.MovingObjectPosition;
@@ -49,21 +44,11 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.ReflectionHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import com.google.common.base.Optional;
import com.google.common.collect.Lists;
import appeng.api.implementations.items.IMemoryCard;
import appeng.api.implementations.items.MemoryCardMessages;
import appeng.api.implementations.tiles.IColorableTile;
import appeng.api.util.AEColor;
import appeng.api.util.IOrientable;
import appeng.api.util.IOrientableBlock;
import appeng.block.networking.BlockCableBus;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.BlockRenderInfo;
import appeng.client.render.WorldRender;
@@ -71,70 +56,62 @@ import appeng.client.texture.FlippableIcon;
import appeng.client.texture.MissingIcon;
import appeng.core.features.AEBlockFeatureHandler;
import appeng.core.features.AEFeature;
import appeng.core.features.ActivityState;
import appeng.core.features.FeatureNameExtractor;
import appeng.core.features.IAEFeature;
import appeng.core.features.IFeatureHandler;
import appeng.core.features.ItemStackSrc;
import appeng.helpers.AEGlassMaterial;
import appeng.helpers.ICustomCollision;
import appeng.tile.AEBaseTile;
import appeng.tile.networking.TileCableBus;
import appeng.tile.storage.TileSkyChest;
import appeng.util.LookDirection;
import appeng.util.Platform;
import appeng.util.SettingsFrom;
public class AEBaseBlock extends BlockContainer implements IAEFeature
public abstract class AEBaseBlock extends Block implements IAEFeature
{
private final String featureFullName;
private final Optional<String> featureSubName;
@SideOnly( Side.CLIENT )
public IIcon renderIcon;
protected final Optional<String> featureSubName;
protected boolean isOpaque = true;
protected boolean isFullSize = true;
protected boolean hasSubtypes = false;
protected boolean isInventory = false;
private IFeatureHandler handler;
@SideOnly( Side.CLIENT )
BlockRenderInfo renderInfo;
private IFeatureHandler handler;
@Nullable
private Class<? extends TileEntity> tileEntityType = null;
protected AEBaseBlock( Class<? extends AEBaseBlock> c, Material mat )
protected AEBaseBlock( Material mat )
{
this( c, mat, Optional.<String>absent() );
this( mat, Optional.<String>absent() );
this.setLightOpacity( 255 );
this.setLightLevel( 0 );
this.setHardness( 2.2F );
this.setTileProvider( false );
this.setHarvestLevel( "pickaxe", 0 );
}
protected AEBaseBlock( Class<?> c, Material mat, Optional<String> subName )
protected AEBaseBlock( Material mat, Optional<String> subName )
{
super( mat );
if( mat == AEGlassMaterial.INSTANCE || mat == Material.glass )
{
this.setStepSound( Block.soundTypeGlass );
}
else if( mat == Material.rock )
{
this.setStepSound( Block.soundTypeStone );
}
else if( mat == Material.wood )
{
this.setStepSound( Block.soundTypeWood );
}
else
{
this.setStepSound( Block.soundTypeMetal );
}
this.featureFullName = new FeatureNameExtractor( c, subName ).get();
this.featureFullName = new FeatureNameExtractor( this.getClass(), subName ).get();
this.featureSubName = subName;
}
// update Block value.
private void setTileProvider( boolean b )
{
ReflectionHelper.setPrivateValue( Block.class, this, b, "isTileProvider" );
}
@Override
public String toString()
{
@@ -143,8 +120,8 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
public void registerNoIcons()
{
BlockRenderInfo info = this.getRendererInstance();
FlippableIcon i = new FlippableIcon( new MissingIcon( this ) );
final BlockRenderInfo info = this.getRendererInstance();
final FlippableIcon i = new FlippableIcon( new MissingIcon( this ) );
info.updateIcons( i, i, i, i, i, i );
}
@@ -152,7 +129,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
public BlockRenderInfo getRendererInstance()
{
if( this.renderInfo != null )
{
return this.renderInfo;
}
try
{
@@ -161,7 +140,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
return this.renderInfo;
}
catch ( InstantiationException e )
catch( InstantiationException e )
{
throw new IllegalStateException( "Failed to create a new instance of an illegal class " + this.getRenderer(), e );
}
@@ -182,24 +161,10 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
return super.getIcon( w, x, y, z, s );
}
protected void setTileEntity( Class<? extends TileEntity> c )
{
this.tileEntityType = c;
AEBaseTile.registerTileItem( c, new ItemStackSrc( this, 0 ) );
GameRegistry.registerTileEntity( this.tileEntityType, this.featureFullName );
this.isInventory = IInventory.class.isAssignableFrom( c );
this.setTileProvider( this.hasBlockTileEntity() );
}
public boolean hasBlockTileEntity()
{
return this.tileEntityType != null;
}
protected void setFeature( EnumSet<AEFeature> f )
{
this.handler = new AEBlockFeatureHandler( f, this, this.featureSubName );
final AEBlockFeatureHandler featureHandler = new AEBlockFeatureHandler( f, this, this.featureSubName );
this.setHandler( featureHandler );
}
@Override
@@ -208,6 +173,11 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
return this.handler;
}
protected final void setHandler( IFeatureHandler handler )
{
this.handler = handler;
}
@Override
public void postInit()
{
@@ -242,27 +212,24 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
@SideOnly( Side.CLIENT )
public IIcon getIcon( int direction, int metadata )
{
if( this.renderIcon != null )
return this.renderIcon;
return this.getRendererInstance().getTexture( ForgeDirection.getOrientation( direction ) );
}
protected ICustomCollision getCustomCollision( World w, int x, int y, int z )
{
if( this instanceof ICustomCollision )
{
return (ICustomCollision) this;
}
return null;
}
@Override
@SuppressWarnings( "unchecked" )
// NOTE: WAS FINAL, changed for Immibis
public void addCollisionBoxesToList( World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e )
{
ICustomCollision collisionHandler = null;
if( this instanceof ICustomCollision )
collisionHandler = (ICustomCollision) this;
else
{
AEBaseTile te = this.getTileEntity( w, x, y, z );
if( te instanceof ICustomCollision )
collisionHandler = (ICustomCollision) te;
}
final ICustomCollision collisionHandler = this.getCustomCollision( w, x, y, z );
if( collisionHandler != null && bb != null )
{
@@ -277,37 +244,31 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
b.maxY += y;
b.maxZ += z;
if( bb.intersectsWith( b ) )
{
out.add( b );
}
}
}
else
{
super.addCollisionBoxesToList( w, x, y, z, bb, out, e );
}
}
@Override
@SideOnly( Side.CLIENT )
public final AxisAlignedBB getSelectedBoundingBoxFromPool( World w, int x, int y, int z )
{
ICustomCollision collisionHandler = null;
AxisAlignedBB b = null;
if( this instanceof ICustomCollision )
collisionHandler = (ICustomCollision) this;
else
{
AEBaseTile te = this.getTileEntity( w, x, y, z );
if( te instanceof ICustomCollision )
collisionHandler = (ICustomCollision) te;
}
final ICustomCollision collisionHandler = this.getCustomCollision( w, x, y, z );
if( collisionHandler != null )
{
if( Platform.isClient() )
{
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
LookDirection ld = Platform.getPlayerRay( player, Platform.getEyeOffset( player ) );
final EntityPlayer player = Minecraft.getMinecraft().thePlayer;
final LookDirection ld = Platform.getPlayerRay( player, Platform.getEyeOffset( player ) );
Iterable<AxisAlignedBB> bbs = collisionHandler.getSelectedBoundingBoxesFromPool( w, x, y, z, Minecraft.getMinecraft().thePlayer, true );
final Iterable<AxisAlignedBB> bbs = collisionHandler.getSelectedBoundingBoxesFromPool( w, x, y, z, Minecraft.getMinecraft().thePlayer, true );
AxisAlignedBB br = null;
double lastDist = 0;
@@ -322,11 +283,12 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
if( r != null )
{
double xLen = ( ld.a.xCoord - r.hitVec.xCoord );
double yLen = ( ld.a.yCoord - r.hitVec.yCoord );
double zLen = ( ld.a.zCoord - r.hitVec.zCoord );
final double xLen = ( ld.a.xCoord - r.hitVec.xCoord );
final double yLen = ( ld.a.yCoord - r.hitVec.yCoord );
final double zLen = ( ld.a.zCoord - r.hitVec.zCoord );
final double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
if( br == null || lastDist > thisDist )
{
lastDist = thisDist;
@@ -342,28 +304,26 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
}
}
final AxisAlignedBB b = AxisAlignedBB.getBoundingBox( 16d, 16d, 16d, 0d, 0d, 0d );
for( AxisAlignedBB bx : collisionHandler.getSelectedBoundingBoxesFromPool( w, x, y, z, null, false ) )
{
if( b == null )
b = bx;
else
{
double minX = Math.min( b.minX, bx.minX );
double minY = Math.min( b.minY, bx.minY );
double minZ = Math.min( b.minZ, bx.minZ );
double maxX = Math.max( b.maxX, bx.maxX );
double maxY = Math.max( b.maxY, bx.maxY );
double maxZ = Math.max( b.maxZ, bx.maxZ );
b.setBounds( minX, minY, minZ, maxX, maxY, maxZ );
}
final double minX = Math.min( b.minX, bx.minX );
final double minY = Math.min( b.minY, bx.minY );
final double minZ = Math.min( b.minZ, bx.minZ );
final double maxX = Math.max( b.maxX, bx.maxX );
final double maxY = Math.max( b.maxY, bx.maxY );
final double maxZ = Math.max( b.maxZ, bx.maxZ );
b.setBounds( minX, minY, minZ, maxX, maxY, maxZ );
}
b.setBounds( b.minX + x, b.minY + y, b.minZ + z, b.maxX + x, b.maxY + y, b.maxZ + z );
}
else
b = super.getSelectedBoundingBoxFromPool( w, x, y, z );
return b;
return b;
}
return super.getSelectedBoundingBoxFromPool( w, x, y, z );
}
@Override
@@ -375,20 +335,11 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
@Override
public MovingObjectPosition collisionRayTrace( World w, int x, int y, int z, Vec3 a, Vec3 b )
{
ICustomCollision collisionHandler = null;
if( this instanceof ICustomCollision )
collisionHandler = (ICustomCollision) this;
else
{
AEBaseTile te = this.getTileEntity( w, x, y, z );
if( te instanceof ICustomCollision )
collisionHandler = (ICustomCollision) te;
}
final ICustomCollision collisionHandler = this.getCustomCollision( w, x, y, z );
if( collisionHandler != null )
{
Iterable<AxisAlignedBB> bbs = collisionHandler.getSelectedBoundingBoxesFromPool( w, x, y, z, null, true );
final Iterable<AxisAlignedBB> bbs = collisionHandler.getSelectedBoundingBoxesFromPool( w, x, y, z, null, true );
MovingObjectPosition br = null;
double lastDist = 0;
@@ -420,6 +371,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
{
return br;
}
return null;
}
@@ -427,104 +379,11 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
return super.collisionRayTrace( w, x, y, z, a, b );
}
@Override
public final boolean onBlockActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
{
if( player != null )
{
ItemStack is = player.inventory.getCurrentItem();
if( is != null )
{
if( Platform.isWrench( player, is, x, y, z ) && player.isSneaking() )
{
Block id = w.getBlock( x, y, z );
if( id != null )
{
AEBaseTile tile = this.getTileEntity( w, x, y, z );
ItemStack[] drops = Platform.getBlockDrops( w, x, y, z );
if( tile == null )
return false;
if( tile instanceof TileCableBus || tile instanceof TileSkyChest )
return false;
ItemStack op = new ItemStack( this );
for( ItemStack ol : drops )
{
if( Platform.isSameItemType( ol, op ) )
{
NBTTagCompound tag = tile.downloadSettings( SettingsFrom.DISMANTLE_ITEM );
if( tag != null )
ol.setTagCompound( tag );
}
}
if( id.removedByPlayer( w, player, x, y, z, false ) )
{
List<ItemStack> l = Lists.newArrayList( drops );
Platform.spawnDrops( w, x, y, z, l );
w.setBlockToAir( x, y, z );
}
}
return false;
}
if( is.getItem() instanceof IMemoryCard && !( this instanceof BlockCableBus ) )
{
IMemoryCard memoryCard = (IMemoryCard) is.getItem();
if( player.isSneaking() )
{
AEBaseTile t = this.getTileEntity( w, x, y, z );
if( t != null )
{
String name = this.getUnlocalizedName();
NBTTagCompound data = t.downloadSettings( SettingsFrom.MEMORY_CARD );
if( data != null )
{
memoryCard.setMemoryCardContents( is, name, data );
memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_SAVED );
return true;
}
}
}
else
{
String name = memoryCard.getSettingsName( is );
NBTTagCompound data = memoryCard.getData( is );
if( this.getUnlocalizedName().equals( name ) )
{
AEBaseTile t = this.getTileEntity( w, x, y, z );
t.uploadSettings( SettingsFrom.MEMORY_CARD, data );
memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_LOADED );
}
else
memoryCard.notifyUser( player, MemoryCardMessages.INVALID_MACHINE );
return false;
}
}
}
}
return this.onActivated( w, x, y, z, player, side, hitX, hitY, hitZ );
}
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
{
return false;
}
@Override
public void onBlockPlacedBy( World w, int x, int y, int z, EntityLivingBase player, ItemStack is )
{
if( is.hasDisplayName() )
{
TileEntity te = this.getTileEntity( w, x, y, z );
if( te instanceof AEBaseTile )
( (AEBaseTile) w.getTileEntity( x, y, z ) ).setName( is.getDisplayName() );
}
}
@Override
@SideOnly( Side.CLIENT )
@SuppressWarnings( "unchecked" )
@@ -542,9 +401,6 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
@Override
public int getComparatorInputOverride( World w, int x, int y, int z, int s )
{
TileEntity te = this.getTileEntity( w, x, y, z );
if( te instanceof IInventory )
return Container.calcRedstoneFromInventory( (IInventory) te );
return 0;
}
@@ -552,14 +408,14 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
@SideOnly( Side.CLIENT )
public void registerBlockIcons( IIconRegister iconRegistry )
{
BlockRenderInfo info = this.getRendererInstance();
FlippableIcon topIcon;
FlippableIcon bottomIcon;
FlippableIcon sideIcon;
FlippableIcon eastIcon;
FlippableIcon westIcon;
FlippableIcon southIcon;
FlippableIcon northIcon;
final BlockRenderInfo info = this.getRendererInstance();
final FlippableIcon topIcon;
final FlippableIcon bottomIcon;
final FlippableIcon sideIcon;
final FlippableIcon eastIcon;
final FlippableIcon westIcon;
final FlippableIcon southIcon;
final FlippableIcon northIcon;
this.blockIcon = topIcon = this.optionalIcon( iconRegistry, this.getTextureName(), null );
bottomIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Bottom", topIcon );
@@ -578,19 +434,19 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
return this.isFullSize;
}
public IOrientable getOrientable( IBlockAccess w, int x, int y, int z )
{
if( this instanceof IOrientableBlock )
{
return ( (IOrientableBlock) this ).getOrientable( w, x, y, z );
}
return null;
}
@Override
public final boolean rotateBlock( World w, int x, int y, int z, ForgeDirection axis )
{
IOrientable rotatable = null;
if( this.hasBlockTileEntity() )
{
rotatable = (AEBaseTile) this.getTileEntity( w, x, y, z );
}
else if( this instanceof IOrientableBlock )
{
rotatable = ( (IOrientableBlock) this ).getOrientable( w, x, y, z );
}
final IOrientable rotatable = this.getOrientable( w, x, y, z );
if( rotatable != null && rotatable.canBeRotated() )
{
@@ -637,59 +493,32 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
}
@Override
public final ForgeDirection[] getValidRotations( World w, int x, int y, int z )
public ForgeDirection[] getValidRotations( World w, int x, int y, int z )
{
if( this.hasBlockTileEntity() )
{
AEBaseTile obj = this.getTileEntity( w, x, y, z );
if( obj != null && obj.canBeRotated() )
{
return ForgeDirection.VALID_DIRECTIONS;
}
}
return new ForgeDirection[0];
}
@Override
public boolean recolourBlock( World world, int x, int y, int z, ForgeDirection side, int colour )
{
TileEntity te = this.getTileEntity( world, x, y, z );
if( te instanceof IColorableTile )
{
IColorableTile ct = (IColorableTile) te;
AEColor c = ct.getColor();
AEColor newColor = AEColor.values()[colour];
if( c != newColor )
{
ct.recolourBlock( side, newColor, null );
return true;
}
return false;
}
return super.recolourBlock( world, x, y, z, side, colour );
}
@SideOnly( Side.CLIENT )
private FlippableIcon optionalIcon( IIconRegister ir, String Name, IIcon substitute )
private FlippableIcon optionalIcon( IIconRegister ir, String name, IIcon substitute )
{
// if the input is an flippable IIcon find the original.
while( substitute instanceof FlippableIcon )
{
substitute = ( (FlippableIcon) substitute ).getOriginal();
}
if( substitute != null )
{
try
{
ResourceLocation resLoc = new ResourceLocation( Name );
ResourceLocation resLoc = new ResourceLocation( name );
resLoc = new ResourceLocation( resLoc.getResourceDomain(), String.format( "%s/%s%s", "textures/blocks", resLoc.getResourcePath(), ".png" ) );
IResource res = Minecraft.getMinecraft().getResourceManager().getResource( resLoc );
if( res != null )
return new FlippableIcon( ir.registerIcon( Name ) );
{
return new FlippableIcon( ir.registerIcon( name ) );
}
}
catch( Throwable e )
{
@@ -697,7 +526,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
}
}
return new FlippableIcon( ir.registerIcon( Name ) );
return new FlippableIcon( ir.registerIcon( name ) );
}
@SideOnly( Side.CLIENT )
@@ -708,16 +537,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
int mapRotation( IBlockAccess w, int x, int y, int z, int s )
{
IOrientable ori = null;
if( this.hasBlockTileEntity() )
{
ori = (AEBaseTile) this.getTileEntity( w, x, y, z );
}
else if( this instanceof IOrientableBlock )
{
ori = ( (IOrientableBlock) this ).getOrientable( w, x, y, z );
}
final IOrientable ori = this.getOrientable( w, x, y, z );
if( ori != null && ori.canBeRotated() )
{
@@ -727,19 +547,6 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
return s;
}
@Nullable
public <T extends TileEntity> T getTileEntity( IBlockAccess w, int x, int y, int z )
{
if( !this.hasBlockTileEntity() )
return null;
TileEntity te = w.getTileEntity( x, y, z );
if( this.tileEntityType.isInstance( te ) )
return (T) te;
return null;
}
public ForgeDirection mapRotation( IOrientable ori, ForgeDirection dir )
{
// case DOWN: return bottomIcon;
@@ -749,93 +556,63 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
// case WEST: return sideIcon;
// case EAST: return sideIcon;
ForgeDirection forward = ori.getForward();
ForgeDirection up = ori.getUp();
final ForgeDirection forward = ori.getForward();
final ForgeDirection up = ori.getUp();
ForgeDirection west = ForgeDirection.UNKNOWN;
if( forward == null || up == null )
{
return dir;
}
int west_x = forward.offsetY * up.offsetZ - forward.offsetZ * up.offsetY;
int west_y = forward.offsetZ * up.offsetX - forward.offsetX * up.offsetZ;
int west_z = forward.offsetX * up.offsetY - forward.offsetY * up.offsetX;
for( ForgeDirection dx : ForgeDirection.VALID_DIRECTIONS )
{
if( dx.offsetX == west_x && dx.offsetY == west_y && dx.offsetZ == west_z )
{
west = dx;
}
}
if( dir == forward )
{
return ForgeDirection.SOUTH;
}
if( dir == forward.getOpposite() )
{
return ForgeDirection.NORTH;
}
if( dir == up )
{
return ForgeDirection.UP;
}
if( dir == up.getOpposite() )
{
return ForgeDirection.DOWN;
}
if( dir == west )
{
return ForgeDirection.WEST;
}
if( dir == west.getOpposite() )
{
return ForgeDirection.EAST;
}
return ForgeDirection.UNKNOWN;
}
public Class<? extends TileEntity> getTileEntityClass()
{
return this.tileEntityType;
}
@SideOnly( Side.CLIENT )
public void setRenderStateByMeta( int itemDamage )
{
}
@Override
public final TileEntity createNewTileEntity( World var1, int var2 )
{
if( this.hasBlockTileEntity() )
{
try
{
return this.tileEntityType.newInstance();
}
catch( InstantiationException e )
{
throw new IllegalStateException( "Failed to create a new instance of an illegal class " + this.tileEntityType , e );
}
catch( IllegalAccessException e )
{
throw new IllegalStateException( "Failed to create a new instance of " + this.tileEntityType + ", because lack of permissions", e );
}
}
return null;
}
@Override
public void breakBlock( World w, int x, int y, int z, Block a, int b )
{
AEBaseTile te = this.getTileEntity( w, x, y, z );
if( te != null )
{
ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
if( te.dropItems() )
te.getDrops( w, x, y, z, drops );
else
te.getNoDrops( w, x, y, z, drops );
// Cry ;_; ...
Platform.spawnDrops( w, x, y, z, drops );
}
super.breakBlock( w, x, y, z, a, b );
if( te != null )
w.setTileEntity( x, y, z, null );
}
public String getUnlocalizedName( ItemStack is )
{
return this.getUnlocalizedName();
@@ -855,4 +632,5 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
{
return this.hasSubtypes;
}
}
@@ -47,7 +47,7 @@ import appeng.util.Platform;
public class AEBaseItemBlock extends ItemBlock
{
final AEBaseBlock blockType;
private final AEBaseBlock blockType;
public AEBaseItemBlock( Block id )
{
@@ -56,14 +56,18 @@ public class AEBaseItemBlock extends ItemBlock
this.hasSubtypes = this.blockType.hasSubtypes;
if( Platform.isClient() )
{
MinecraftForgeClient.registerItemRenderer( this, ItemRenderer.INSTANCE );
}
}
@Override
public int getMetadata( int dmg )
{
if( this.hasSubtypes )
{
return dmg;
}
return 0;
}
@@ -101,23 +105,31 @@ public class AEBaseItemBlock extends ItemBlock
IOrientable ori = null;
if( this.blockType.hasBlockTileEntity() )
if( this.blockType instanceof AEBaseTileBlock )
{
if( this.blockType instanceof BlockLightDetector )
{
up = ForgeDirection.getOrientation( side );
if( up == ForgeDirection.UP || up == ForgeDirection.DOWN )
{
forward = ForgeDirection.SOUTH;
}
else
{
forward = ForgeDirection.UP;
}
}
else if( this.blockType instanceof BlockWireless || this.blockType instanceof BlockSkyCompass )
{
forward = ForgeDirection.getOrientation( side );
if( forward == ForgeDirection.UP || forward == ForgeDirection.DOWN )
{
up = ForgeDirection.SOUTH;
}
else
{
up = ForgeDirection.UP;
}
}
else
{
@@ -161,27 +173,35 @@ public class AEBaseItemBlock extends ItemBlock
up = ForgeDirection.getOrientation( side );
forward = ForgeDirection.SOUTH;
if( up.offsetY == 0 )
{
forward = ForgeDirection.UP;
}
}
if( !this.blockType.isValidOrientation( w, x, y, z, forward, up ) )
{
return false;
}
if( super.placeBlockAt( stack, player, w, x, y, z, side, hitX, hitY, hitZ, metadata ) )
{
if( this.blockType.hasBlockTileEntity() && !( this.blockType instanceof BlockLightDetector ) )
if( this.blockType instanceof AEBaseTileBlock && !( this.blockType instanceof BlockLightDetector ) )
{
AEBaseTile tile = this.blockType.getTileEntity( w, x, y, z );
AEBaseTile tile = ( (AEBaseTileBlock) this.blockType ).getTileEntity( w, x, y, z );
ori = tile;
if( tile == null )
{
return true;
}
if( ori.canBeRotated() && !this.blockType.hasCustomRotation() )
{
if( ori.getForward() == null || ori.getUp() == null || // null
tile.getForward() == ForgeDirection.UNKNOWN || ori.getUp() == ForgeDirection.UNKNOWN )
tile.getForward() == ForgeDirection.UNKNOWN || ori.getUp() == ForgeDirection.UNKNOWN )
{
ori.setOrientation( forward, up );
}
}
if( tile instanceof IGridProxyable )
@@ -51,7 +51,7 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
@SideOnly( Side.CLIENT )
public void addCheckedInformation( ItemStack itemStack, EntityPlayer player, List<String> toolTip, boolean advancedTooltips )
{
NBTTagCompound tag = itemStack.getTagCompound();
final NBTTagCompound tag = itemStack.getTagCompound();
double internalCurrentPower = 0;
double internalMaxPower = this.getMaxEnergyCapacity();
@@ -60,14 +60,14 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
internalCurrentPower = tag.getDouble( "internalCurrentPower" );
}
double percent = internalCurrentPower / internalMaxPower;
final double percent = internalCurrentPower / internalMaxPower;
toolTip.add( GuiText.StoredEnergy.getLocal() + ':' + MessageFormat.format( " {0,number,#} ", internalCurrentPower ) + Platform.gui_localize( PowerUnits.AE.unlocalizedName ) + " - " + MessageFormat.format( " {0,number,#.##%} ", percent ) );
}
private double getMaxEnergyCapacity()
{
Block blockID = Block.getBlockFromItem( this );
final Block blockID = Block.getBlockFromItem( this );
final IBlockDefinition energyCell = Api.INSTANCE.definitions().blocks().energyCell();
for( Block block : energyCell.maybeBlock().asSet() )
{
@@ -104,13 +104,13 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
private double getInternal( ItemStack is )
{
NBTTagCompound nbt = Platform.openNbtData( is );
final NBTTagCompound nbt = Platform.openNbtData( is );
return nbt.getDouble( "internalCurrentPower" );
}
private void setInternal( ItemStack is, double amt )
{
NBTTagCompound nbt = Platform.openNbtData( is );
final NBTTagCompound nbt = Platform.openNbtData( is );
nbt.setDouble( "internalCurrentPower", amt );
}
@@ -0,0 +1,12 @@
package appeng.block;
import net.minecraft.block.Block;
import net.minecraft.item.ItemSlab;
public class AEBaseItemBlockSlab extends ItemSlab {
public AEBaseItemBlockSlab(Block block, AEBaseSlabBlock singleSlab, AEBaseSlabBlock doubleSlab, Boolean isDoubleSlab)
{
super( block, singleSlab, doubleSlab, isDoubleSlab );
}
}
@@ -0,0 +1,129 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.block;
import java.util.EnumSet;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSlab;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import appeng.core.features.AEFeature;
import appeng.core.features.IAEFeature;
import appeng.core.features.IFeatureHandler;
import appeng.core.features.SlabBlockFeatureHandler;
public class AEBaseSlabBlock extends BlockSlab implements IAEFeature
{
private final IFeatureHandler features;
private final AEBaseBlock block;
private final int meta;
private AEBaseSlabBlock slabs;
private AEBaseSlabBlock doubleSlabs;
private final String name;
public AEBaseSlabBlock( AEBaseBlock block, int meta, EnumSet<AEFeature> features, boolean isDoubleSlab, String name )
{
super( isDoubleSlab, block.getMaterial() );
this.block = block;
this.meta = meta;
this.name = name;
this.setBlockName( "appliedenergistics2." + name );
this.setHardness( block.getBlockHardness( null, 0, 0, 0 ) );
this.setResistance( block.getExplosionResistance( null ) * 5.0F / 3.0F );
this.setStepSound( block.stepSound );
this.useNeighborBrightness = true;
if (!field_150004_a) this.doubleSlabs = new AEBaseSlabBlock( block, meta, features, true, name + ".double" ).setSlabs(this);
this.features = !field_150004_a ? new SlabBlockFeatureHandler( features, this ) : null;
}
public AEBaseSlabBlock setSlabs(AEBaseSlabBlock slabs)
{
this.slabs = slabs;
return this;
}
public AEBaseSlabBlock slabs()
{
return slabs;
}
public AEBaseSlabBlock doubleSlabs()
{
return doubleSlabs;
}
@Override
public IFeatureHandler handler()
{
return this.features;
}
@Override
public void postInit()
{
// Override to do stuff
}
@Override
public IIcon getIcon(int dir, int meta)
{
return block.getIcon( dir, this.meta );
}
@Override
public String func_150002_b(int p_150002_1_)
{
return this.getUnlocalizedName();
}
@Override
public void registerBlockIcons(IIconRegister reg) { }
@Override
public Item getItemDropped(int meta, Random rand, int fortune)
{
return this.field_150004_a ? Item.getItemFromBlock(this.slabs) : Item.getItemFromBlock(this);
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
{
AEBaseSlabBlock block = (AEBaseSlabBlock) world.getBlock(x, y, z);
if (block == null) return null;
if (block.field_150004_a) block = this.slabs;
int meta = world.getBlockMetadata(x, y, z) & 7;
return new ItemStack(block, 1, meta);
}
public String name()
{
return name;
}
}
@@ -21,11 +21,11 @@ package appeng.block;
import java.util.EnumSet;
import com.google.common.base.Optional;
import net.minecraft.block.Block;
import net.minecraft.block.BlockStairs;
import com.google.common.base.Optional;
import appeng.core.features.AEFeature;
import appeng.core.features.IAEFeature;
import appeng.core.features.IFeatureHandler;
@@ -0,0 +1,350 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.block;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import com.google.common.base.Optional;
import com.google.common.collect.Lists;
import net.minecraft.block.Block;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.ReflectionHelper;
import appeng.api.implementations.items.IMemoryCard;
import appeng.api.implementations.items.MemoryCardMessages;
import appeng.api.implementations.tiles.IColorableTile;
import appeng.api.util.AEColor;
import appeng.api.util.IOrientable;
import appeng.block.networking.BlockCableBus;
import appeng.core.features.AEFeature;
import appeng.core.features.AETileBlockFeatureHandler;
import appeng.core.features.ActivityState;
import appeng.core.features.IAEFeature;
import appeng.core.features.ItemStackSrc;
import appeng.helpers.ICustomCollision;
import appeng.tile.AEBaseTile;
import appeng.tile.networking.TileCableBus;
import appeng.tile.storage.TileSkyChest;
import appeng.util.Platform;
import appeng.util.SettingsFrom;
public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, ITileEntityProvider
{
@Nonnull
private Class<? extends TileEntity> tileEntityType;
public AEBaseTileBlock( Material mat )
{
super( mat );
}
protected AEBaseTileBlock( Material mat, Optional<String> subName )
{
super( mat, subName );
}
@Override
protected void setFeature( EnumSet<AEFeature> f )
{
final AETileBlockFeatureHandler featureHandler = new AETileBlockFeatureHandler( f, this, this.featureSubName );
this.setHandler( featureHandler );
}
protected void setTileEntity( Class<? extends TileEntity> c )
{
this.tileEntityType = c;
this.isInventory = IInventory.class.isAssignableFrom( c );
this.setTileProvider( this.hasBlockTileEntity() );
}
// update Block value.
private void setTileProvider( boolean b )
{
ReflectionHelper.setPrivateValue( Block.class, this, b, "isTileProvider" );
}
public boolean hasBlockTileEntity()
{
return this.tileEntityType != null;
}
public Class<? extends TileEntity> getTileEntityClass()
{
return this.tileEntityType;
}
@Nullable
public <T extends AEBaseTile> T getTileEntity( IBlockAccess w, int x, int y, int z )
{
if( !this.hasBlockTileEntity() )
{
return null;
}
final TileEntity te = w.getTileEntity( x, y, z );
if( this.tileEntityType.isInstance( te ) )
{
return (T) te;
}
return null;
}
@Override
public final TileEntity createNewTileEntity( World var1, int var2 )
{
if( this.hasBlockTileEntity() )
{
try
{
return this.tileEntityType.newInstance();
}
catch( InstantiationException e )
{
throw new IllegalStateException( "Failed to create a new instance of an illegal class " + this.tileEntityType, e );
}
catch( IllegalAccessException e )
{
throw new IllegalStateException( "Failed to create a new instance of " + this.tileEntityType + ", because lack of permissions", e );
}
}
return null;
}
@Override
public void breakBlock( World w, int x, int y, int z, Block a, int b )
{
final AEBaseTile te = this.getTileEntity( w, x, y, z );
if( te != null )
{
final ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
if( te.dropItems() )
{
te.getDrops( w, x, y, z, drops );
}
else
{
te.getNoDrops( w, x, y, z, drops );
}
// Cry ;_; ...
Platform.spawnDrops( w, x, y, z, drops );
}
// super will remove the TE, as it is not an instance of BlockContainer
super.breakBlock( w, x, y, z, a, b );
}
@Override
public final ForgeDirection[] getValidRotations( World w, int x, int y, int z )
{
final AEBaseTile obj = this.getTileEntity( w, x, y, z );
if( obj != null && obj.canBeRotated() )
{
return ForgeDirection.VALID_DIRECTIONS;
}
return super.getValidRotations( w, x, y, z );
}
@Override
public boolean recolourBlock( World world, int x, int y, int z, ForgeDirection side, int colour )
{
final TileEntity te = this.getTileEntity( world, x, y, z );
if( te instanceof IColorableTile )
{
final IColorableTile ct = (IColorableTile) te;
final AEColor c = ct.getColor();
final AEColor newColor = AEColor.values()[colour];
if( c != newColor )
{
ct.recolourBlock( side, newColor, null );
return true;
}
return false;
}
return super.recolourBlock( world, x, y, z, side, colour );
}
@Override
public int getComparatorInputOverride( World w, int x, int y, int z, int s )
{
final TileEntity te = this.getTileEntity( w, x, y, z );
if( te instanceof IInventory )
{
return Container.calcRedstoneFromInventory( (IInventory) te );
}
return 0;
}
@Override
public boolean onBlockEventReceived( World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, int p_149696_5_, int p_149696_6_ )
{
super.onBlockEventReceived( p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, p_149696_5_, p_149696_6_ );
final TileEntity tileentity = p_149696_1_.getTileEntity( p_149696_2_, p_149696_3_, p_149696_4_ );
return tileentity != null ? tileentity.receiveClientEvent( p_149696_5_, p_149696_6_ ) : false;
}
@Override
public void onBlockPlacedBy( World w, int x, int y, int z, EntityLivingBase player, ItemStack is )
{
if( is.hasDisplayName() )
{
final TileEntity te = this.getTileEntity( w, x, y, z );
if( te instanceof AEBaseTile )
{
( (AEBaseTile) w.getTileEntity( x, y, z ) ).setName( is.getDisplayName() );
}
}
}
@Override
public final boolean onBlockActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
{
if( player != null )
{
final ItemStack is = player.inventory.getCurrentItem();
if( is != null )
{
if( Platform.isWrench( player, is, x, y, z ) && player.isSneaking() )
{
final Block id = w.getBlock( x, y, z );
if( id != null )
{
final AEBaseTile tile = this.getTileEntity( w, x, y, z );
final ItemStack[] drops = Platform.getBlockDrops( w, x, y, z );
if( tile == null )
{
return false;
}
if( tile instanceof TileCableBus || tile instanceof TileSkyChest )
{
return false;
}
final ItemStack op = new ItemStack( this );
for( ItemStack ol : drops )
{
if( Platform.isSameItemType( ol, op ) )
{
final NBTTagCompound tag = tile.downloadSettings( SettingsFrom.DISMANTLE_ITEM );
if( tag != null )
{
ol.setTagCompound( tag );
}
}
}
if( id.removedByPlayer( w, player, x, y, z, false ) )
{
final List<ItemStack> l = Lists.newArrayList( drops );
Platform.spawnDrops( w, x, y, z, l );
w.setBlockToAir( x, y, z );
}
}
return false;
}
if( is.getItem() instanceof IMemoryCard && !( this instanceof BlockCableBus ) )
{
final IMemoryCard memoryCard = (IMemoryCard) is.getItem();
if( player.isSneaking() )
{
final AEBaseTile t = this.getTileEntity( w, x, y, z );
if( t != null )
{
final String name = this.getUnlocalizedName();
final NBTTagCompound data = t.downloadSettings( SettingsFrom.MEMORY_CARD );
if( data != null )
{
memoryCard.setMemoryCardContents( is, name, data );
memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_SAVED );
return true;
}
}
}
else
{
final String name = memoryCard.getSettingsName( is );
final NBTTagCompound data = memoryCard.getData( is );
if( this.getUnlocalizedName().equals( name ) )
{
final AEBaseTile t = this.getTileEntity( w, x, y, z );
t.uploadSettings( SettingsFrom.MEMORY_CARD, data );
memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_LOADED );
}
else
{
memoryCard.notifyUser( player, MemoryCardMessages.INVALID_MACHINE );
}
return false;
}
}
}
}
return this.onActivated( w, x, y, z, player, side, hitX, hitY, hitZ );
}
@Override
public IOrientable getOrientable( IBlockAccess w, int x, int y, int z )
{
return this.getTileEntity( w, x, y, z );
}
@Override
public ICustomCollision getCustomCollision( World w, int x, int y, int z )
{
final AEBaseTile te = this.getTileEntity( w, x, y, z );
if( te instanceof ICustomCollision )
{
return (ICustomCollision) te;
}
return super.getCustomCollision( w, x, y, z );
}
}
@@ -26,9 +26,9 @@ import net.minecraft.world.IBlockAccess;
public class AEDecorativeBlock extends AEBaseBlock
{
public AEDecorativeBlock( Class<? extends AEBaseBlock> c, Material mat )
public AEDecorativeBlock( Material mat )
{
super( c, mat );
super( mat );
}
@Override
@@ -40,11 +40,8 @@ import appeng.tile.crafting.TileCraftingMonitorTile;
public class BlockCraftingMonitor extends BlockCraftingUnit
{
public BlockCraftingMonitor()
{
super( BlockCraftingMonitor.class );
this.setTileEntity( TileCraftingMonitorTile.class );
}
@@ -37,8 +37,6 @@ public class BlockCraftingStorage extends BlockCraftingUnit
{
public BlockCraftingStorage()
{
super( BlockCraftingStorage.class );
this.setTileEntity( TileCraftingStorageTile.class );
}
@@ -89,13 +87,19 @@ public class BlockCraftingStorage extends BlockCraftingUnit
public String getUnlocalizedName( ItemStack is )
{
if( is.getItemDamage() == 1 )
{
return "tile.appliedenergistics2.BlockCraftingStorage4k";
}
if( is.getItemDamage() == 2 )
{
return "tile.appliedenergistics2.BlockCraftingStorage16k";
}
if( is.getItemDamage() == 3 )
{
return "tile.appliedenergistics2.BlockCraftingStorage64k";
}
return this.getItemUnlocalizedName( is );
}
@@ -35,7 +35,7 @@ import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockCraftingCPU;
import appeng.client.texture.ExtraBlockTextures;
@@ -45,22 +45,16 @@ import appeng.tile.crafting.TileCraftingTile;
import appeng.util.Platform;
public class BlockCraftingUnit extends AEBaseBlock
public class BlockCraftingUnit extends AEBaseTileBlock
{
public static final int FLAG_FORMED = 8;
public BlockCraftingUnit()
{
this( BlockCraftingUnit.class );
this.setTileEntity( TileCraftingTile.class );
}
public BlockCraftingUnit( Class<? extends BlockCraftingUnit> childClass )
{
super( childClass, Material.iron );
super( Material.iron );
this.hasSubtypes = true;
this.setTileEntity( TileCraftingTile.class );
this.setFeature( EnumSet.of( AEFeature.CraftingCPU ) );
}
@@ -94,7 +88,9 @@ public class BlockCraftingUnit extends AEBaseBlock
if( tg != null && !p.isSneaking() && tg.isFormed() && tg.isActive() )
{
if( Platform.isClient() )
{
return true;
}
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_CRAFTING_CPU );
return true;
@@ -124,7 +120,9 @@ public class BlockCraftingUnit extends AEBaseBlock
{
TileCraftingTile cp = this.getTileEntity( w, x, y, z );
if( cp != null )
{
cp.breakCluster();
}
super.breakBlock( w, x, y, z, a, b );
}
@@ -133,7 +131,9 @@ public class BlockCraftingUnit extends AEBaseBlock
public String getUnlocalizedName( ItemStack is )
{
if( is.getItemDamage() == 1 )
{
return "tile.appliedenergistics2.BlockCraftingAccelerator";
}
return this.getItemUnlocalizedName( is );
}
@@ -148,7 +148,9 @@ public class BlockCraftingUnit extends AEBaseBlock
{
TileCraftingTile cp = this.getTileEntity( w, x, y, z );
if( cp != null )
{
cp.updateMultiBlock();
}
}
@Override
@@ -29,7 +29,7 @@ import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockAssembler;
import appeng.core.features.AEFeature;
@@ -38,14 +38,15 @@ import appeng.tile.crafting.TileMolecularAssembler;
import appeng.util.Platform;
public class BlockMolecularAssembler extends AEBaseBlock
public class BlockMolecularAssembler extends AEBaseTileBlock
{
public static boolean booleanAlphaPass = false;
public BlockMolecularAssembler()
{
super( BlockMolecularAssembler.class, Material.iron );
super( Material.iron );
this.setTileEntity( TileMolecularAssembler.class );
this.isOpaque = false;
this.lightOpacity = 1;
@@ -32,7 +32,7 @@ import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.implementations.tiles.ICrankable;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockCrank;
import appeng.core.features.AEFeature;
@@ -41,12 +41,13 @@ import appeng.tile.AEBaseTile;
import appeng.tile.grindstone.TileCrank;
public class BlockCrank extends AEBaseBlock
public class BlockCrank extends AEBaseTileBlock
{
public BlockCrank()
{
super( BlockCrank.class, Material.wood );
super( Material.wood );
this.setTileEntity( TileCrank.class );
this.setLightOpacity( 0 );
this.setHarvestLevel( "axe", 0 );
@@ -117,10 +118,12 @@ public class BlockCrank extends AEBaseBlock
private ForgeDirection findCrankable( World world, int x, int y, int z )
{
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
{
if( this.isCrankable( world, x, y, z, dir ) )
{
return dir;
}
}
return ForgeDirection.UNKNOWN;
}
@@ -26,19 +26,20 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseTileBlock;
import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge;
import appeng.tile.grindstone.TileGrinder;
import appeng.util.Platform;
public class BlockGrinder extends AEBaseBlock
public class BlockGrinder extends AEBaseTileBlock
{
public BlockGrinder()
{
super( BlockGrinder.class, Material.rock );
super( Material.rock );
this.setTileEntity( TileGrinder.class );
this.setHardness( 3.2F );
this.setFeature( EnumSet.of( AEFeature.GrindStone ) );
@@ -26,19 +26,20 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseTileBlock;
import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge;
import appeng.tile.misc.TileCellWorkbench;
import appeng.util.Platform;
public class BlockCellWorkbench extends AEBaseBlock
public class BlockCellWorkbench extends AEBaseTileBlock
{
public BlockCellWorkbench()
{
super( BlockCellWorkbench.class, Material.iron );
super( Material.iron );
this.setTileEntity( TileCellWorkbench.class );
this.setFeature( EnumSet.of( AEFeature.StorageCells ) );
}
@@ -47,13 +48,17 @@ public class BlockCellWorkbench extends AEBaseBlock
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileCellWorkbench tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
{
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_CELL_WORKBENCH );
}
return true;
}
return false;
@@ -36,7 +36,7 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.api.AEApi;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockCharger;
import appeng.client.render.effects.LightningFX;
@@ -49,12 +49,13 @@ import appeng.tile.misc.TileCharger;
import appeng.util.Platform;
public class BlockCharger extends AEBaseBlock implements ICustomCollision
public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
{
public BlockCharger()
{
super( BlockCharger.class, Material.iron );
super( Material.iron );
this.setTileEntity( TileCharger.class );
this.setLightOpacity( 2 );
this.isFullSize = this.isOpaque = false;
@@ -71,7 +72,9 @@ public class BlockCharger extends AEBaseBlock implements ICustomCollision
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
{
if( player.isSneaking() )
{
return false;
}
if( Platform.isServer() )
{
@@ -90,10 +93,14 @@ public class BlockCharger extends AEBaseBlock implements ICustomCollision
public void randomDisplayTick( World w, int x, int y, int z, Random r )
{
if( !AEConfig.instance.enableEffects )
{
return;
}
if( r.nextFloat() < 0.98 )
{
return;
}
AEBaseTile tile = this.getTileEntity( w, x, y, z );
if( tile instanceof TileCharger )
@@ -26,19 +26,20 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseTileBlock;
import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge;
import appeng.tile.misc.TileCondenser;
import appeng.util.Platform;
public class BlockCondenser extends AEBaseBlock
public class BlockCondenser extends AEBaseTileBlock
{
public BlockCondenser()
{
super( BlockCondenser.class, Material.iron );
super( Material.iron );
this.setTileEntity( TileCondenser.class );
this.setFeature( EnumSet.of( AEFeature.Core ) );
}
@@ -47,7 +48,9 @@ public class BlockCondenser extends AEBaseBlock
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
{
if( player.isSneaking() )
{
return false;
}
if( Platform.isServer() )
{
@@ -26,7 +26,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockInscriber;
import appeng.core.features.AEFeature;
@@ -35,12 +35,13 @@ import appeng.tile.misc.TileInscriber;
import appeng.util.Platform;
public class BlockInscriber extends AEBaseBlock
public class BlockInscriber extends AEBaseTileBlock
{
public BlockInscriber()
{
super( BlockInscriber.class, Material.iron );
super( Material.iron );
this.setTileEntity( TileInscriber.class );
this.setLightOpacity( 2 );
this.isFullSize = this.isOpaque = false;
@@ -57,13 +58,17 @@ public class BlockInscriber extends AEBaseBlock
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileInscriber tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
{
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_INSCRIBER );
}
return true;
}
return false;
@@ -27,7 +27,7 @@ import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.util.IOrientable;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockInterface;
import appeng.core.features.AEFeature;
@@ -36,12 +36,13 @@ import appeng.tile.misc.TileInterface;
import appeng.util.Platform;
public class BlockInterface extends AEBaseBlock
public class BlockInterface extends AEBaseTileBlock
{
public BlockInterface()
{
super( BlockInterface.class, Material.iron );
super( Material.iron );
this.setTileEntity( TileInterface.class );
this.setFeature( EnumSet.of( AEFeature.Core ) );
}
@@ -56,13 +57,17 @@ public class BlockInterface extends AEBaseBlock
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileInterface tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
{
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_INTERFACE );
}
return true;
}
return false;
@@ -19,25 +19,43 @@
package appeng.block.misc;
import java.util.Collections;
import java.util.EnumSet;
import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.api.util.IOrientable;
import appeng.api.util.IOrientableBlock;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.blocks.RenderQuartzTorch;
import appeng.core.features.AEFeature;
import appeng.helpers.ICustomCollision;
import appeng.helpers.MetaRotation;
import appeng.tile.misc.TileLightDetector;
public class BlockLightDetector extends BlockQuartzTorch
public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBlock, ICustomCollision
{
public BlockLightDetector()
{
super( BlockLightDetector.class );
super( Material.circuits );
this.setLightOpacity( 0 );
this.isFullSize = false;
this.isOpaque = false;
this.setTileEntity( TileLightDetector.class );
this.setFeature( EnumSet.of( AEFeature.LightDetector ) );
}
@@ -46,7 +64,9 @@ public class BlockLightDetector extends BlockQuartzTorch
public int isProvidingWeakPower( IBlockAccess w, int x, int y, int z, int side )
{
if( w instanceof World && ( (TileLightDetector) this.getTileEntity( w, x, y, z ) ).isReady() )
{
return ( (World) w ).getBlockLightValue( x, y, z ) - 6;
}
return 0;
}
@@ -58,7 +78,9 @@ public class BlockLightDetector extends BlockQuartzTorch
TileLightDetector tld = this.getTileEntity( world, x, y, z );
if( tld != null )
{
tld.updateLight();
}
}
@Override
@@ -67,4 +89,82 @@ public class BlockLightDetector extends BlockQuartzTorch
{
// cancel out lightning
}
@Override
protected Class<? extends RenderQuartzTorch> getRenderer()
{
return RenderQuartzTorch.class;
}
@Override
public boolean isValidOrientation( World w, int x, int y, int z, ForgeDirection forward, ForgeDirection up )
{
return this.canPlaceAt( w, x, y, z, up.getOpposite() );
}
private boolean canPlaceAt( World w, int x, int y, int z, ForgeDirection dir )
{
return w.isSideSolid( x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, dir.getOpposite(), false );
}
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
{
ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
double xOff = -0.3 * up.offsetX;
double yOff = -0.3 * up.offsetY;
double zOff = -0.3 * up.offsetZ;
return Collections.singletonList( AxisAlignedBB.getBoundingBox( xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7 ) );
}
@Override
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e )
{/*
* double xOff = -0.15 * getUp().offsetX; double yOff = -0.15 * getUp().offsetY; double zOff = -0.15 *
* getUp().offsetZ; out.add( AxisAlignedBB.getBoundingBox( xOff + (double) x + 0.15, yOff + (double) y + 0.15, zOff
* + (double) z + 0.15,// ahh xOff + (double) x + 0.85, yOff + (double) y + 0.85, zOff + (double) z + 0.85 ) );
*/
}
@Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block id )
{
ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
if( !this.canPlaceAt( w, x, y, z, up.getOpposite() ) )
{
this.dropTorch( w, x, y, z );
}
}
private void dropTorch( World w, int x, int y, int z )
{
w.func_147480_a( x, y, z, true );
// w.destroyBlock( x, y, z, true );
w.markBlockForUpdate( x, y, z );
}
@Override
public boolean canPlaceBlockAt( World w, int x, int y, int z )
{
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
{
if( this.canPlaceAt( w, x, y, z, dir ) )
{
return true;
}
}
return false;
}
@Override
public boolean usesMetadata()
{
return true;
}
@Override
public IOrientable getOrientable( final IBlockAccess w, final int x, final int y, final int z )
{
return new MetaRotation( w, x, y, z );
}
}
@@ -36,7 +36,7 @@ import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockPaint;
import appeng.core.features.AEFeature;
@@ -44,12 +44,13 @@ import appeng.tile.misc.TilePaint;
import appeng.util.Platform;
public class BlockPaint extends AEBaseBlock
public class BlockPaint extends AEBaseTileBlock
{
public BlockPaint()
{
super( BlockPaint.class, new MaterialLiquid( MapColor.airColor ) );
super( new MaterialLiquid( MapColor.airColor ) );
this.setTileEntity( TilePaint.class );
this.setLightOpacity( 0 );
this.isFullSize = false;
@@ -71,13 +72,13 @@ public class BlockPaint extends AEBaseBlock
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool( World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_ )
public AxisAlignedBB getCollisionBoundingBoxFromPool( World world, int x, int y, int z )
{
return null;
}
@Override
public boolean canCollideCheck( int p_149678_1_, boolean p_149678_2_ )
public boolean canCollideCheck( int metadata, boolean isHoldingRightClick )
{
return false;
}
@@ -88,17 +89,19 @@ public class BlockPaint extends AEBaseBlock
TilePaint tp = this.getTileEntity( w, x, y, z );
if( tp != null )
{
tp.onNeighborBlockChange();
}
}
@Override
public Item getItemDropped( int p_149650_1_, Random p_149650_2_, int p_149650_3_ )
public Item getItemDropped( int meta, Random random, int fortune )
{
return null;
}
@Override
public void dropBlockAsItemWithChance( World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_ )
public void dropBlockAsItemWithChance( World world, int x, int y, int z, int meta, float chance, int fortune )
{
}
@@ -107,7 +110,9 @@ public class BlockPaint extends AEBaseBlock
public void fillWithRain( World w, int x, int y, int z )
{
if( Platform.isServer() )
w.setBlock( x, y, z, Platform.AIR, 0, 3 );
{
w.setBlock( x, y, z, Platform.AIR_BLOCK, 0, 3 );
}
}
@Override
@@ -25,33 +25,30 @@ import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.api.util.IOrientable;
import appeng.api.util.IOrientableBlock;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockQuartzAccelerator;
import appeng.client.render.effects.LightningFX;
import appeng.core.AEConfig;
import appeng.core.CommonHelper;
import appeng.core.features.AEFeature;
import appeng.helpers.MetaRotation;
import appeng.tile.misc.TileQuartzGrowthAccelerator;
import appeng.util.Platform;
public class BlockQuartzGrowthAccelerator extends AEBaseBlock implements IOrientableBlock
public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOrientableBlock
{
public BlockQuartzGrowthAccelerator()
{
super( BlockQuartzGrowthAccelerator.class, Material.rock );
super( Material.rock );
this.setStepSound( Block.soundTypeMetal );
this.setTileEntity( TileQuartzGrowthAccelerator.class );
this.setFeature( EnumSet.of( AEFeature.Core ) );
@@ -68,17 +65,19 @@ public class BlockQuartzGrowthAccelerator extends AEBaseBlock implements IOrient
public void randomDisplayTick( World w, int x, int y, int z, Random r )
{
if( !AEConfig.instance.enableEffects )
{
return;
}
TileQuartzGrowthAccelerator tileQuartzGrowthAccelerator = this.getTileEntity( w, x, y, z );
TileQuartzGrowthAccelerator cga = this.getTileEntity( w, x, y, z );
if( tileQuartzGrowthAccelerator != null && tileQuartzGrowthAccelerator.hasPower && CommonHelper.proxy.shouldAddParticles( r ) )
if( cga != null && cga.hasPower && CommonHelper.proxy.shouldAddParticles( r ) )
{
double d0 = r.nextFloat() - 0.5F;
double d1 = r.nextFloat() - 0.5F;
ForgeDirection up = tileQuartzGrowthAccelerator.getUp();
ForgeDirection forward = tileQuartzGrowthAccelerator.getForward();
ForgeDirection up = cga.getUp();
ForgeDirection forward = cga.getForward();
ForgeDirection west = Platform.crossProduct( forward, up );
double rx = 0.5 + x;
@@ -98,25 +97,33 @@ public class BlockQuartzGrowthAccelerator extends AEBaseBlock implements IOrient
dx = 0.6;
dz = d1;
if( !w.getBlock( x + west.offsetX, y + west.offsetY, z + west.offsetZ ).isAir( w, x + west.offsetX, y + west.offsetY, z + west.offsetZ ) )
{
return;
}
break;
case 1:
dx = d1;
dz += 0.6;
if( !w.getBlock( x + forward.offsetX, y + forward.offsetY, z + forward.offsetZ ).isAir( w, x + forward.offsetX, y + forward.offsetY, z + forward.offsetZ ) )
{
return;
}
break;
case 2:
dx = d1;
dz = -0.6;
if( !w.getBlock( x - forward.offsetX, y - forward.offsetY, z - forward.offsetZ ).isAir( w, x - forward.offsetX, y - forward.offsetY, z - forward.offsetZ ) )
{
return;
}
break;
case 3:
dx = -0.6;
dz = d1;
if( !w.getBlock( x - west.offsetX, y - west.offsetY, z - west.offsetZ ).isAir( w, x - west.offsetX, y - west.offsetY, z - west.offsetZ ) )
{
return;
}
break;
}
@@ -134,14 +141,14 @@ public class BlockQuartzGrowthAccelerator extends AEBaseBlock implements IOrient
}
@Override
/**
* TODO: remove with 1.8 or later
*
* @Deprecated no longer true, only kept to prevent missing blocks.
*/
@Deprecated
public boolean usesMetadata()
{
return true;
}
@Override
public IOrientable getOrientable( final IBlockAccess w, final int x, final int y, final int z )
{
return new MetaRotation( w, x, y, z );
}
}
@@ -51,19 +51,15 @@ import appeng.helpers.MetaRotation;
public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, ICustomCollision
{
public BlockQuartzTorch()
{
this( BlockQuartzTorch.class );
this.setLightLevel( 0.9375F );
this.setFeature( EnumSet.of( AEFeature.DecorativeLights ) );
}
super( Material.circuits );
protected BlockQuartzTorch( Class which )
{
super( which, Material.circuits );
this.setFeature( EnumSet.of( AEFeature.DecorativeLights ) );
this.setLightLevel( 0.9375F );
this.setLightOpacity( 0 );
this.isFullSize = this.isOpaque = false;
this.isFullSize = false;
this.isOpaque = false;
}
@Override
@@ -107,10 +103,14 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
public void randomDisplayTick( World w, int x, int y, int z, Random r )
{
if( !AEConfig.instance.enableEffects )
{
return;
}
if( r.nextFloat() < 0.98 )
{
return;
}
ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
double xOff = -0.3 * up.offsetX;
@@ -132,7 +132,9 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
{
ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
if( !this.canPlaceAt( w, x, y, z, up.getOpposite() ) )
{
this.dropTorch( w, x, y, z );
}
}
private void dropTorch( World w, int x, int y, int z )
@@ -146,8 +148,12 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
public boolean canPlaceBlockAt( World w, int x, int y, int z )
{
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
{
if( this.canPlaceAt( w, x, y, z, dir ) )
{
return true;
}
}
return false;
}
@@ -26,7 +26,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RendererSecurity;
import appeng.core.features.AEFeature;
@@ -35,12 +35,13 @@ import appeng.tile.misc.TileSecurity;
import appeng.util.Platform;
public class BlockSecurity extends AEBaseBlock
public class BlockSecurity extends AEBaseTileBlock
{
public BlockSecurity()
{
super( BlockSecurity.class, Material.iron );
super( Material.iron );
this.setTileEntity( TileSecurity.class );
this.setFeature( EnumSet.of( AEFeature.Security ) );
}
@@ -55,13 +56,17 @@ public class BlockSecurity extends AEBaseBlock
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileSecurity tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isClient() )
{
return true;
}
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_SECURITY );
return true;
@@ -36,7 +36,7 @@ import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockSkyCompass;
import appeng.core.features.AEFeature;
@@ -44,12 +44,12 @@ import appeng.helpers.ICustomCollision;
import appeng.tile.misc.TileSkyCompass;
public class BlockSkyCompass extends AEBaseBlock implements ICustomCollision
public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
{
public BlockSkyCompass()
{
super( BlockSkyCompass.class, Material.iron );
super( Material.iron );
this.setTileEntity( TileSkyCompass.class );
this.isOpaque = this.isFullSize = false;
this.lightOpacity = 0;
@@ -80,7 +80,9 @@ public class BlockSkyCompass extends AEBaseBlock implements ICustomCollision
{
TileSkyCompass sc = this.getTileEntity( w, x, y, z );
if( sc != null )
{
return false;
}
return this.canPlaceAt( w, x, y, z, forward.getOpposite() );
}
@@ -95,7 +97,9 @@ public class BlockSkyCompass extends AEBaseBlock implements ICustomCollision
TileSkyCompass sc = this.getTileEntity( w, x, y, z );
ForgeDirection up = sc.getForward();
if( !this.canPlaceAt( w, x, y, z, up.getOpposite() ) )
{
this.dropTorch( w, x, y, z );
}
}
private void dropTorch( World w, int x, int y, int z )
@@ -109,8 +113,12 @@ public class BlockSkyCompass extends AEBaseBlock implements ICustomCollision
public boolean canPlaceBlockAt( World w, int x, int y, int z )
{
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
{
if( this.canPlaceAt( w, x, y, z, dir ) )
{
return true;
}
}
return false;
}
@@ -1,6 +1,6 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -58,7 +58,7 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
public BlockTinyTNT()
{
super( BlockTinyTNT.class, Material.tnt );
super( Material.tnt );
this.setLightOpacity( 1 );
this.setBlockBounds( 0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f );
this.isFullSize = this.isOpaque = false;
@@ -66,7 +66,7 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
this.setHardness( 0F );
this.setFeature( EnumSet.of( AEFeature.TinyTNT ) );
EntityRegistry.registerModEntity( EntityTinyTNTPrimed.class, "EntityTinyTNTPrimed", EntityIds.TINY_TNT, AppEng.instance, 16, 4, true );
EntityRegistry.registerModEntity( EntityTinyTNTPrimed.class, "EntityTinyTNTPrimed", EntityIds.TINY_TNT, AppEng.instance(), 16, 4, true );
}
@Override
@@ -29,7 +29,7 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseTileBlock;
import appeng.client.texture.ExtraBlockTextures;
import appeng.core.AEConfig;
import appeng.core.features.AEFeature;
@@ -39,12 +39,12 @@ import appeng.tile.misc.TileVibrationChamber;
import appeng.util.Platform;
public class BlockVibrationChamber extends AEBaseBlock
public final class BlockVibrationChamber extends AEBaseTileBlock
{
public BlockVibrationChamber()
{
super( BlockVibrationChamber.class, Material.iron );
super( Material.iron );
this.setTileEntity( TileVibrationChamber.class );
this.setHardness( 4.2F );
this.setFeature( EnumSet.of( AEFeature.PowerGen ) );
@@ -68,7 +68,9 @@ public class BlockVibrationChamber extends AEBaseBlock
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
{
if( player.isSneaking() )
{
return false;
}
if( Platform.isServer() )
{
@@ -87,7 +89,9 @@ public class BlockVibrationChamber extends AEBaseBlock
public void randomDisplayTick( World w, int x, int y, int z, Random r )
{
if( !AEConfig.instance.enableEffects )
{
return;
}
AEBaseTile tile = this.getTileEntity( w, x, y, z );
if( tile instanceof TileVibrationChamber )
@@ -1,6 +1,6 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -53,17 +53,18 @@ import appeng.api.parts.IPartHost;
import appeng.api.parts.PartItemStack;
import appeng.api.parts.SelectedPart;
import appeng.api.util.AEColor;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.BusRenderHelper;
import appeng.client.render.blocks.RendererCableBus;
import appeng.client.texture.ExtraBlockTextures;
import appeng.core.AEConfig;
import appeng.core.Api;
import appeng.core.AppEng;
import appeng.core.CommonHelper;
import appeng.core.features.AECableBusFeatureHandler;
import appeng.core.features.AEFeature;
import appeng.helpers.AEGlassMaterial;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IFMP;
import appeng.parts.ICableBusContainer;
@@ -77,7 +78,7 @@ import appeng.util.Platform;
@Interface( iface = "powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection", iname = "MFR" )
public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
{
private static final ICableBusContainer NULL_CABLE_BUS = new NullCableBusContainer();
@@ -91,9 +92,12 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
public BlockCableBus()
{
super( BlockCableBus.class, AEGlassMaterial.INSTANCE );
super( AEGlassMaterial.INSTANCE );
this.setLightOpacity( 0 );
this.isFullSize = this.isOpaque = false;
// this will actually be overwritten later through setupTile and the combined layers
this.setTileEntity( TileCableBus.class );
this.setFeature( EnumSet.of( AEFeature.Core ) );
}
@@ -119,12 +123,14 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
public int getRenderBlockPass()
{
if( AEConfig.instance.isFeatureEnabled( AEFeature.AlphaPass ) )
{
return 1;
}
return 0;
}
@Override
public int colorMultiplier( IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_ )
public int colorMultiplier( IBlockAccess world, int x, int y, int z )
{
return this.myColorMultiplier;
}
@@ -162,7 +168,9 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
return block.getLightValue( world, x, y, z );
}
if( block == null )
{
return 0;
}
return this.cb( world, x, y, z ).getLightValue();
}
@@ -192,7 +200,9 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
{
AEBaseTile tile = this.getTileEntity( world, x, y, z );
if( tile != null )
{
tile.disableDrops();
}
// maybe ray trace?
}
return super.removedByPlayer( world, player, x, y, z );
@@ -224,7 +234,9 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
BusRenderHelper.INSTANCE.setPass( pass );
if( AEConfig.instance.isFeatureEnabled( AEFeature.AlphaPass ) )
{
return true;
}
return pass == 0;
}
@@ -236,9 +248,13 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
SelectedPart sp = this.cb( world, x, y, z ).selectPart( v3 );
if( sp.part != null )
{
return sp.part.getItemStack( PartItemStack.Pick );
}
else if( sp.facade != null )
{
return sp.facade.getItemStack();
}
return null;
}
@@ -258,7 +274,9 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
IIcon ico = this.getIcon( p );
if( ico == null )
{
continue;
}
byte b0 = (byte) ( Platform.getRandomInt() % 2 == 0 ? 1 : 0 );
@@ -304,7 +322,9 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
IIcon ico = this.getIcon( p );
if( ico == null )
{
continue;
}
byte b0 = 3;
@@ -335,19 +355,25 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
public void onNeighborChange( IBlockAccess w, int x, int y, int z, int tileX, int tileY, int tileZ )
{
if( Platform.isServer() )
{
this.cb( w, x, y, z ).onNeighborChanged();
}
}
private IIcon getIcon( IPart p )
{
if( p == null )
{
return null;
}
try
{
IIcon ico = p.getBreakingTexture();
if( ico != null )
{
return ico;
}
}
catch( Throwable t )
{
@@ -356,7 +382,9 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
ItemStack is = p.getItemStack( PartItemStack.Network );
if( is == null || is.getItem() == null )
{
return null;
}
return is.getItem().getIcon( is, 0 );
}
@@ -367,10 +395,13 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
ICableBusContainer out = null;
if( te instanceof TileCableBus )
{
out = ( (TileCableBus) te ).cb;
else if( AppEng.instance.isIntegrationEnabled( IntegrationType.FMP ) )
out = ( (IFMP) AppEng.instance.getIntegration( IntegrationType.FMP ) ).getCableContainer( te );
}
else if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FMP ) )
{
out = ( (IFMP) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FMP ) ).getCableContainer( te );
}
return out == null ? NULL_CABLE_BUS : out;
}
@@ -392,7 +423,9 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
{
IIcon i = super.getIcon( direction, metadata );
if( i != null )
{
return i;
}
return ExtraBlockTextures.BlockQuartzGlassB.getIcon();
}
@@ -422,8 +455,7 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
return this.cb( world, x, y, z ).recolourBlock( side, AEColor.values()[colour], who );
}
catch( Throwable ignored )
{
}
{}
return false;
}
@@ -435,22 +467,35 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
}
@Override
public <T extends TileEntity> T getTileEntity( IBlockAccess w, int x, int y, int z )
public <T extends AEBaseTile> T getTileEntity( IBlockAccess w, int x, int y, int z )
{
TileEntity te = w.getTileEntity( x, y, z );
if( noTesrTile.isInstance( te ) )
{
return (T) te;
}
if( tesrTile != null && tesrTile.isInstance( te ) )
{
return (T) te;
}
return null;
}
@Override
protected void setFeature( EnumSet<AEFeature> f )
{
final AECableBusFeatureHandler featureHandler = new AECableBusFeatureHandler( f, this, this.featureSubName );
this.setHandler( featureHandler );
}
public void setupTile()
{
this.setTileEntity( noTesrTile = Api.INSTANCE.partHelper().getCombinedInstance( TileCableBus.class.getName() ) );
noTesrTile = Api.INSTANCE.partHelper().getCombinedInstance( TileCableBus.class.getName() );
this.setTileEntity( noTesrTile );
GameRegistry.registerTileEntity( noTesrTile, "BlockCableBus" );
if( Platform.isClient() )
{
tesrTile = Api.INSTANCE.partHelper().getCombinedInstance( TileCableBusTESR.class.getName() );
@@ -25,30 +25,32 @@ import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.world.World;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockController;
import appeng.core.features.AEFeature;
import appeng.tile.networking.TileController;
public class BlockController extends AEBaseBlock
public class BlockController extends AEBaseTileBlock
{
public BlockController()
{
super( BlockController.class, Material.iron );
super( Material.iron );
this.setTileEntity( TileController.class );
this.setHardness( 6 );
this.setFeature( EnumSet.of( AEFeature.Channels ) );
}
@Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block id_junk )
public void onNeighborBlockChange( World w, int x, int y, int z, Block neighborBlock )
{
TileController tc = this.getTileEntity( w, x, y, z );
if( tc != null )
{
tc.onNeighborChange( false );
}
}
@Override
@@ -21,18 +21,18 @@ package appeng.block.networking;
import java.util.EnumSet;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseTileBlock;
import appeng.core.features.AEFeature;
import appeng.helpers.AEGlassMaterial;
import appeng.tile.networking.TileCreativeEnergyCell;
public class BlockCreativeEnergyCell extends AEBaseBlock
public class BlockCreativeEnergyCell extends AEBaseTileBlock
{
public BlockCreativeEnergyCell()
{
super( BlockCreativeEnergyCell.class, AEGlassMaterial.INSTANCE );
super( AEGlassMaterial.INSTANCE );
this.setTileEntity( TileCreativeEnergyCell.class );
this.setFeature( EnumSet.of( AEFeature.Creative ) );
}
@@ -33,7 +33,6 @@ public class BlockDenseEnergyCell extends BlockEnergyCell
public BlockDenseEnergyCell()
{
super( BlockDenseEnergyCell.class );
this.setTileEntity( TileDenseEnergyCell.class );
this.setFeature( EnumSet.of( AEFeature.DenseEnergyCells ) );
}
@@ -23,17 +23,17 @@ import java.util.EnumSet;
import net.minecraft.block.material.Material;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseTileBlock;
import appeng.core.features.AEFeature;
import appeng.tile.networking.TileEnergyAcceptor;
public class BlockEnergyAcceptor extends AEBaseBlock
public class BlockEnergyAcceptor extends AEBaseTileBlock
{
public BlockEnergyAcceptor()
{
super( BlockEnergyAcceptor.class, Material.iron );
super( Material.iron );
this.setTileEntity( TileEnergyAcceptor.class );
this.setFeature( EnumSet.of( AEFeature.Core ) );
}
@@ -31,9 +31,9 @@ import net.minecraft.util.IIcon;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseItemBlock;
import appeng.block.AEBaseItemBlockChargeable;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockEnergyCube;
import appeng.client.texture.ExtraBlockTextures;
@@ -43,21 +43,17 @@ import appeng.tile.networking.TileEnergyCell;
import appeng.util.Platform;
public class BlockEnergyCell extends AEBaseBlock
public class BlockEnergyCell extends AEBaseTileBlock
{
public BlockEnergyCell()
{
this( BlockEnergyCell.class );
super( AEGlassMaterial.INSTANCE );
this.setTileEntity( TileEnergyCell.class );
this.setFeature( EnumSet.of( AEFeature.Core ) );
}
public BlockEnergyCell( Class c )
{
super( c, AEGlassMaterial.INSTANCE );
}
@Override
protected Class<? extends BaseBlockRender> getRenderer()
{
@@ -29,7 +29,7 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockWireless;
import appeng.core.features.AEFeature;
@@ -40,12 +40,12 @@ import appeng.tile.networking.TileWireless;
import appeng.util.Platform;
public class BlockWireless extends AEBaseBlock implements ICustomCollision
public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
{
public BlockWireless()
{
super( BlockWireless.class, AEGlassMaterial.INSTANCE );
super( AEGlassMaterial.INSTANCE );
this.setTileEntity( TileWireless.class );
this.setLightOpacity( 0 );
this.isFullSize = false;
@@ -63,13 +63,17 @@ public class BlockWireless extends AEBaseBlock implements ICustomCollision
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileWireless tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
{
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_WIRELESS );
}
return true;
}
return false;
@@ -197,6 +201,8 @@ public class BlockWireless extends AEBaseBlock implements ICustomCollision
out.add( AxisAlignedBB.getBoundingBox( minX, minY, minZ, maxX, maxY, maxZ ) );
}
else
{
out.add( AxisAlignedBB.getBoundingBox( 0.0, 0.0, 0.0, 1.0, 1.0, 1.0 ) );
}
}
}
@@ -0,0 +1,78 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.block.qnb;
import java.util.EnumSet;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.world.World;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderQNB;
import appeng.core.features.AEFeature;
import appeng.helpers.ICustomCollision;
import appeng.tile.qnb.TileQuantumBridge;
public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICustomCollision
{
public BlockQuantumBase( Material mat )
{
super( mat );
this.setTileEntity( TileQuantumBridge.class );
float shave = 2.0f / 16.0f;
this.setBlockBounds( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave );
this.setLightOpacity( 0 );
this.isFullSize = this.isOpaque = false;
this.setFeature( EnumSet.of( AEFeature.QuantumNetworkBridge ) );
}
@Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block pointlessNumber )
{
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
if( bridge != null )
{
bridge.neighborUpdate();
}
}
@Override
public void breakBlock( World w, int x, int y, int z, Block a, int b )
{
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
if( bridge != null )
{
bridge.breakCluster();
}
super.breakBlock( w, x, y, z, a, b );
}
@Override
protected Class<? extends RenderQNB> getRenderer()
{
return RenderQNB.class;
}
}
@@ -20,11 +20,9 @@ package appeng.block.qnb;
import java.util.Collections;
import java.util.EnumSet;
import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.AxisAlignedBB;
@@ -34,31 +32,20 @@ import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseBlock;
import appeng.client.EffectType;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderQNB;
import appeng.core.CommonHelper;
import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge;
import appeng.helpers.AEGlassMaterial;
import appeng.helpers.ICustomCollision;
import appeng.tile.qnb.TileQuantumBridge;
import appeng.util.Platform;
public class BlockQuantumLinkChamber extends AEBaseBlock implements ICustomCollision
public class BlockQuantumLinkChamber extends BlockQuantumBase
{
public BlockQuantumLinkChamber()
{
super( BlockQuantumLinkChamber.class, AEGlassMaterial.INSTANCE );
this.setTileEntity( TileQuantumBridge.class );
float shave = 2.0f / 16.0f;
this.setBlockBounds( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave );
this.setLightOpacity( 0 );
this.isFullSize = this.isOpaque = false;
this.setFeature( EnumSet.of( AEFeature.QuantumNetworkBridge ) );
super( AEGlassMaterial.INSTANCE );
}
@Override
@@ -71,62 +58,44 @@ public class BlockQuantumLinkChamber extends AEBaseBlock implements ICustomColli
if( bridge.hasQES() )
{
if( CommonHelper.proxy.shouldAddParticles( r ) )
{
CommonHelper.proxy.spawnEffect( EffectType.Energy, w, bx + 0.5, by + 0.5, bz + 0.5, null );
}
}
}
}
@Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block pointlessNumber )
{
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
if( bridge != null )
bridge.neighborUpdate();
}
@Override
protected Class<? extends BaseBlockRender> getRenderer()
{
return RenderQNB.class;
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileQuantumBridge tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
{
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_QNB );
}
return true;
}
return false;
}
@Override
public void breakBlock( World w, int x, int y, int z, Block a, int b )
{
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
if( bridge != null )
bridge.breakCluster();
super.breakBlock( w, x, y, z, a, b );
}
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
{
double OnePx = 2.0 / 16.0;
return Collections.singletonList( AxisAlignedBB.getBoundingBox( OnePx, OnePx, OnePx, 1.0 - OnePx, 1.0 - OnePx, 1.0 - OnePx ) );
double onePixel = 2.0 / 16.0;
return Collections.singletonList( AxisAlignedBB.getBoundingBox( onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel ) );
}
@Override
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e )
{
double OnePx = 2.0 / 16.0;
out.add( AxisAlignedBB.getBoundingBox( OnePx, OnePx, OnePx, 1.0 - OnePx, 1.0 - OnePx, 1.0 - OnePx ) );
double onePixel = 2.0 / 16.0;
out.add( AxisAlignedBB.getBoundingBox( onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel ) );
}
}
@@ -23,87 +23,52 @@ import java.util.Collections;
import java.util.EnumSet;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderQNB;
import appeng.core.features.AEFeature;
import appeng.helpers.ICustomCollision;
import appeng.tile.qnb.TileQuantumBridge;
public class BlockQuantumRing extends AEBaseBlock implements ICustomCollision
public class BlockQuantumRing extends BlockQuantumBase
{
public BlockQuantumRing()
{
super( BlockQuantumRing.class, Material.iron );
this.setTileEntity( TileQuantumBridge.class );
float shave = 2.0f / 16.0f;
this.setBlockBounds( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave );
this.setLightOpacity( 1 );
this.isFullSize = this.isOpaque = false;
this.setFeature( EnumSet.of( AEFeature.QuantumNetworkBridge ) );
}
@Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block pointlessNumber )
{
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
if( bridge != null )
bridge.neighborUpdate();
}
@Override
protected Class<? extends BaseBlockRender> getRenderer()
{
return RenderQNB.class;
}
@Override
public void breakBlock( World w, int x, int y, int z, Block a, int b )
{
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
if( bridge != null )
bridge.breakCluster();
super.breakBlock( w, x, y, z, a, b );
super( Material.iron );
}
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
{
double OnePx = 2.0 / 16.0;
double onePixel = 2.0 / 16.0;
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
if( bridge != null && bridge.isCorner() )
{
OnePx = 4.0 / 16.0;
onePixel = 4.0 / 16.0;
}
else if( bridge != null && bridge.isFormed() )
{
OnePx = 1.0 / 16.0;
onePixel = 1.0 / 16.0;
}
return Collections.singletonList( AxisAlignedBB.getBoundingBox( OnePx, OnePx, OnePx, 1.0 - OnePx, 1.0 - OnePx, 1.0 - OnePx ) );
return Collections.singletonList( AxisAlignedBB.getBoundingBox( onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel ) );
}
@Override
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e )
{
double OnePx = 2.0 / 16.0;
double onePixel = 2.0 / 16.0;
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
if( bridge != null && bridge.isCorner() )
{
OnePx = 4.0 / 16.0;
onePixel = 4.0 / 16.0;
}
else if( bridge != null && bridge.isFormed() )
{
OnePx = 1.0 / 16.0;
onePixel = 1.0 / 16.0;
}
out.add( AxisAlignedBB.getBoundingBox( OnePx, OnePx, OnePx, 1.0 - OnePx, 1.0 - OnePx, 1.0 - OnePx ) );
out.add( AxisAlignedBB.getBoundingBox( onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel ) );
}
}
@@ -31,7 +31,7 @@ public class BlockFluix extends AEDecorativeBlock
{
public BlockFluix()
{
super( BlockFluix.class, Material.rock );
super( Material.rock );
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
}
}
@@ -32,7 +32,7 @@ public class BlockQuartz extends AEDecorativeBlock
public BlockQuartz()
{
super( BlockQuartz.class, Material.rock );
super( Material.rock );
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
}
}
@@ -32,7 +32,7 @@ public class BlockQuartzChiseled extends AEDecorativeBlock
public BlockQuartzChiseled()
{
super( BlockQuartzChiseled.class, Material.rock );
super( Material.rock );
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
}
}
@@ -36,15 +36,9 @@ import appeng.helpers.AEGlassMaterial;
public class BlockQuartzGlass extends AEBaseBlock
{
public BlockQuartzGlass()
{
this( BlockQuartzGlass.class );
}
public BlockQuartzGlass( Class c )
{
super( c, Material.glass );
super( Material.glass );
this.setLightOpacity( 0 );
this.isOpaque = false;
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
@@ -64,7 +58,9 @@ public class BlockQuartzGlass extends AEBaseBlock
if( mat == Material.glass || mat == AEGlassMaterial.INSTANCE )
{
if( w.getBlock( x, y, z ).getRenderType() == this.getRenderType() )
{
return false;
}
}
return super.shouldSideBeRendered( w, x, y, z, side );
}
@@ -39,7 +39,6 @@ public class BlockQuartzLamp extends BlockQuartzGlass
public BlockQuartzLamp()
{
super( BlockQuartzLamp.class );
this.setLightLevel( 1.0f );
this.setBlockTextureName( "BlockQuartzGlass" );
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks, AEFeature.DecorativeLights ) );
@@ -50,7 +49,9 @@ public class BlockQuartzLamp extends BlockQuartzGlass
public void randomDisplayTick( World w, int x, int y, int z, Random r )
{
if( !AEConfig.instance.enableEffects )
{
return;
}
if( CommonHelper.proxy.shouldAddParticles( r ) )
{
@@ -36,7 +36,7 @@ public class BlockQuartzPillar extends AEBaseBlock implements IOrientableBlock
public BlockQuartzPillar()
{
super( BlockQuartzPillar.class, Material.rock );
super( Material.rock );
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
}
@@ -1,6 +1,6 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -29,7 +29,6 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.IBlockAccess;
@@ -41,40 +40,37 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import rblocks.api.RotatableBlockEnable;
import appeng.api.util.IOrientable;
import appeng.api.util.IOrientableBlock;
import appeng.block.AEBaseBlock;
import appeng.core.AppEng;
import appeng.core.WorldSettings;
import appeng.core.features.AEFeature;
import appeng.core.worlddata.WorldData;
import appeng.helpers.LocationRotation;
import appeng.helpers.NullRotation;
import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IRB;
import appeng.util.Platform;
@RotatableBlockEnable
public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
{
private static final float BLOCK_RESISTANCE = 150.0f;
private static final double BREAK_SPEAK_SCALAR = 0.1;
private static final double BREAK_SPEAK_THRESHOLD = 7.0;
@SideOnly( Side.CLIENT )
IIcon Block;
private IIcon block;
@SideOnly( Side.CLIENT )
IIcon Brick;
private IIcon brick;
@SideOnly( Side.CLIENT )
IIcon SmallBrick;
private IIcon smallBrick;
public BlockSkyStone()
{
super( BlockSkyStone.class, Material.rock );
super( Material.rock );
this.setHardness( 50 );
this.hasSubtypes = true;
this.blockResistance = 150.0f;
this.blockResistance = BLOCK_RESISTANCE;
this.setHarvestLevel( "pickaxe", 3, 0 );
this.setFeature( EnumSet.of( AEFeature.Core ) );
@@ -82,18 +78,22 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
}
@SubscribeEvent
public void breakFaster( PlayerEvent.BreakSpeed Ev )
public void breakFaster( PlayerEvent.BreakSpeed event )
{
if( Ev.block == this && Ev.entityPlayer != null )
if( event.block == this && event.entityPlayer != null )
{
ItemStack is = Ev.entityPlayer.inventory.getCurrentItem();
ItemStack is = event.entityPlayer.inventory.getCurrentItem();
int level = -1;
if( is != null )
if( is != null && is.getItem() != null )
{
level = is.getItem().getHarvestLevel( is, "pickaxe" );
}
if( Ev.metadata > 0 || level >= 3 || Ev.originalSpeed > 7.0 )
Ev.newSpeed /= 0.1;
if( event.metadata > 0 || level >= 3 || event.originalSpeed > BREAK_SPEAK_THRESHOLD )
{
event.newSpeed /= BREAK_SPEAK_SCALAR;
}
}
}
@@ -117,13 +117,9 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
{
super.onBlockAdded( w, x, y, z );
if( Platform.isServer() )
WorldSettings.getInstance().getCompass().updateArea( w, x, y, z );
}
// use AE2's renderer, no rotatable blocks.
int getRealRenderType()
{
return this.getRenderType();
{
WorldData.instance().compassData().service().updateArea( w, x, y, z );
}
}
@Override
@@ -135,19 +131,10 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
@Override
public IOrientable getOrientable( final IBlockAccess w, final int x, final int y, final int z )
{
if( AppEng.instance.isIntegrationEnabled( IntegrationType.RB ) )
{
TileEntity te = w.getTileEntity( x, y, z );
if( te != null )
{
IOrientable out = ( (IRB) AppEng.instance.getIntegration( IntegrationType.RB ) ).getOrientable( te );
if( out != null )
return out;
}
}
if( w.getBlockMetadata( x, y, z ) == 0 )
{
return new LocationRotation( w, x, y, z );
}
return new NullRotation();
}
@@ -156,13 +143,19 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
public String getUnlocalizedName( ItemStack is )
{
if( is.getItemDamage() == 1 )
{
return this.getUnlocalizedName() + ".Block";
}
if( is.getItemDamage() == 2 )
{
return this.getUnlocalizedName() + ".Brick";
}
if( is.getItemDamage() == 3 )
{
return this.getUnlocalizedName() + ".SmallBrick";
}
return this.getUnlocalizedName();
}
@@ -172,9 +165,9 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
public void registerBlockIcons( IIconRegister ir )
{
super.registerBlockIcons( ir );
this.Block = ir.registerIcon( this.getTextureName() + ".Block" );
this.Brick = ir.registerIcon( this.getTextureName() + ".Brick" );
this.SmallBrick = ir.registerIcon( this.getTextureName() + ".SmallBrick" );
this.block = ir.registerIcon( this.getTextureName() + ".Block" );
this.brick = ir.registerIcon( this.getTextureName() + ".Brick" );
this.smallBrick = ir.registerIcon( this.getTextureName() + ".SmallBrick" );
}
@Override
@@ -182,11 +175,17 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
public IIcon getIcon( int direction, int metadata )
{
if( metadata == 1 )
return this.Block;
{
return this.block;
}
if( metadata == 2 )
return this.Brick;
{
return this.brick;
}
if( metadata == 3 )
return this.SmallBrick;
{
return this.smallBrick;
}
return super.getIcon( direction, metadata );
}
@@ -208,10 +207,12 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
}
@Override
public void breakBlock( World w, int x, int y, int z, Block b, int WTF )
public void breakBlock( World w, int x, int y, int z, Block b, int metadata )
{
super.breakBlock( w, x, y, z, b, WTF );
super.breakBlock( w, x, y, z, b, metadata );
if( Platform.isServer() )
WorldSettings.getInstance().getCompass().updateArea( w, x, y, z );
{
WorldData.instance().compassData().service().updateArea( w, x, y, z );
}
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -29,7 +29,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import appeng.api.AEApi;
import appeng.api.exceptions.MissingDefinition;
@@ -47,12 +46,7 @@ public class OreQuartz extends AEBaseBlock
public OreQuartz()
{
this( OreQuartz.class );
}
public OreQuartz( Class<? extends OreQuartz> self )
{
super( self, Material.rock );
super( Material.rock );
this.setHardness( 3.0F );
this.setResistance( 5.0F );
this.boostBrightnessLow = 0;
@@ -67,12 +61,6 @@ public class OreQuartz extends AEBaseBlock
return RenderQuartzOre.class;
}
@Override
public void postInit()
{
OreDictionary.registerOre( "oreCertusQuartz", new ItemStack( this ) );
}
@Override
public int getMixedBrightnessForBlock( IBlockAccess par1iBlockAccess, int par2, int par3, int par4 )
{
@@ -91,7 +79,9 @@ public class OreQuartz extends AEBaseBlock
}
if( j1 > 15 )
{
j1 = 15;
}
return j1 << 20 | j1 << 4;
}
return j1;
@@ -43,7 +43,6 @@ public class OreQuartzCharged extends OreQuartz
public OreQuartzCharged()
{
super( OreQuartzCharged.class );
this.setBoostBrightnessLow( 2 );
this.setBoostBrightnessHigh( 5 );
}
@@ -76,7 +75,9 @@ public class OreQuartzCharged extends OreQuartz
public void randomDisplayTick( World w, int x, int y, int z, Random r )
{
if ( !AEConfig.instance.enableEffects )
{
return;
}
double xOff = ( r.nextFloat() );
double yOff = ( r.nextFloat() );
@@ -49,7 +49,7 @@ public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision
public BlockMatrixFrame()
{
super( BlockMatrixFrame.class, Material.anvil );
super( Material.anvil );
this.setResistance( 6000000.0F );
this.setBlockUnbreakable();
this.setLightOpacity( 0 );
@@ -27,19 +27,19 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseTileBlock;
import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge;
import appeng.tile.spatial.TileSpatialIOPort;
import appeng.util.Platform;
public class BlockSpatialIOPort extends AEBaseBlock
public class BlockSpatialIOPort extends AEBaseTileBlock
{
public BlockSpatialIOPort()
{
super( BlockSpatialIOPort.class, Material.iron );
super( Material.iron );
this.setTileEntity( TileSpatialIOPort.class );
this.setFeature( EnumSet.of( AEFeature.SpatialIO ) );
}
@@ -49,20 +49,26 @@ public class BlockSpatialIOPort extends AEBaseBlock
{
TileSpatialIOPort te = this.getTileEntity( w, x, y, z );
if( te != null )
{
te.updateRedstoneState();
}
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileSpatialIOPort tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
{
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_SPATIAL_IO_PORT );
}
return true;
}
return false;
@@ -25,7 +25,7 @@ import net.minecraft.block.Block;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderSpatialPylon;
import appeng.core.features.AEFeature;
@@ -33,12 +33,12 @@ import appeng.helpers.AEGlassMaterial;
import appeng.tile.spatial.TileSpatialPylon;
public class BlockSpatialPylon extends AEBaseBlock
public class BlockSpatialPylon extends AEBaseTileBlock
{
public BlockSpatialPylon()
{
super( BlockSpatialPylon.class, AEGlassMaterial.INSTANCE );
super( AEGlassMaterial.INSTANCE );
this.setTileEntity( TileSpatialPylon.class );
this.setFeature( EnumSet.of( AEFeature.SpatialIO ) );
}
@@ -48,7 +48,9 @@ public class BlockSpatialPylon extends AEBaseBlock
{
TileSpatialPylon tsp = this.getTileEntity( w, x, y, z );
if( tsp != null )
{
tsp.onNeighborBlockChange();
}
}
@Override
@@ -56,7 +58,9 @@ public class BlockSpatialPylon extends AEBaseBlock
{
TileSpatialPylon tsp = this.getTileEntity( w, x, y, z );
if( tsp != null )
{
return tsp.getLightValue();
}
return super.getLightValue( w, x, y, z );
}
@@ -29,7 +29,7 @@ import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.AEApi;
import appeng.api.storage.ICellHandler;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderMEChest;
import appeng.core.features.AEFeature;
@@ -39,12 +39,12 @@ import appeng.tile.storage.TileChest;
import appeng.util.Platform;
public class BlockChest extends AEBaseBlock
public class BlockChest extends AEBaseTileBlock
{
public BlockChest()
{
super( BlockChest.class, Material.iron );
super( Material.iron );
this.setTileEntity( TileChest.class );
this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.MEChest ) );
}
@@ -62,7 +62,9 @@ public class BlockChest extends AEBaseBlock
if( tg != null && !p.isSneaking() )
{
if( Platform.isClient() )
{
return true;
}
if( side != tg.getUp().ordinal() )
{
@@ -78,7 +80,9 @@ public class BlockChest extends AEBaseBlock
tg.openGui( p, ch, cell, side );
}
else
{
p.addChatMessage( PlayerMessages.ChestCannotReadStorageCell.get() );
}
}
return true;
@@ -26,7 +26,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderDrive;
import appeng.core.features.AEFeature;
@@ -35,12 +35,12 @@ import appeng.tile.storage.TileDrive;
import appeng.util.Platform;
public class BlockDrive extends AEBaseBlock
public class BlockDrive extends AEBaseTileBlock
{
public BlockDrive()
{
super( BlockDrive.class, Material.iron );
super( Material.iron );
this.setTileEntity( TileDrive.class );
this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.MEDrive ) );
}
@@ -55,13 +55,17 @@ public class BlockDrive extends AEBaseBlock
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileDrive tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
{
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_DRIVE );
}
return true;
}
return false;
@@ -27,19 +27,19 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseTileBlock;
import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge;
import appeng.tile.storage.TileIOPort;
import appeng.util.Platform;
public class BlockIOPort extends AEBaseBlock
public class BlockIOPort extends AEBaseTileBlock
{
public BlockIOPort()
{
super( BlockIOPort.class, Material.iron );
super( Material.iron );
this.setTileEntity( TileIOPort.class );
this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.IOPort ) );
}
@@ -49,20 +49,26 @@ public class BlockIOPort extends AEBaseBlock
{
TileIOPort te = this.getTileEntity( w, x, y, z );
if( te != null )
{
te.updateRedstoneState();
}
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileIOPort tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
{
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_IOPORT );
}
return true;
}
return false;
@@ -42,7 +42,7 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.api.AEApi;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockSkyChest;
import appeng.core.features.AEFeature;
@@ -52,12 +52,12 @@ import appeng.tile.storage.TileSkyChest;
import appeng.util.Platform;
public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
{
public BlockSkyChest()
{
super( BlockSkyChest.class, Material.rock );
super( Material.rock );
this.setTileEntity( TileSkyChest.class );
this.isOpaque = this.isFullSize = false;
this.lightOpacity = 0;
@@ -104,7 +104,9 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
{
if( Platform.isServer() )
{
Platform.openGUI( player, this.getTileEntity( w, x, y, z ), ForgeDirection.getOrientation( side ), GuiBridge.GUI_SKYCHEST );
}
return true;
}
@@ -127,7 +129,9 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
public String getUnlocalizedName( ItemStack is )
{
if( is.getItemDamage() == 1 )
{
return this.getUnlocalizedName() + ".Block";
}
return this.getUnlocalizedName();
}
@@ -140,13 +144,15 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
ForgeDirection o = ForgeDirection.UNKNOWN;
if( sk != null )
{
o = sk.getUp();
}
double X = o.offsetX == 0 ? 0.06 : 0.0;
double Y = o.offsetY == 0 ? 0.06 : 0.0;
double Z = o.offsetZ == 0 ? 0.06 : 0.0;
double offsetX = o.offsetX == 0 ? 0.06 : 0.0;
double offsetY = o.offsetY == 0 ? 0.06 : 0.0;
double offsetZ = o.offsetZ == 0 ? 0.06 : 0.0;
return Collections.singletonList( AxisAlignedBB.getBoundingBox( Math.max( 0.0, X - o.offsetX * sc ), Math.max( 0.0, Y - o.offsetY * sc ), Math.max( 0.0, Z - o.offsetZ * sc ), Math.min( 1.0, ( 1.0 - X ) - o.offsetX * sc ), Math.min( 1.0, ( 1.0 - Y ) - o.offsetY * sc ), Math.min( 1.0, ( 1.0 - Z ) - o.offsetZ * sc ) ) );
return Collections.singletonList( AxisAlignedBB.getBoundingBox( Math.max( 0.0, offsetX - o.offsetX * sc ), Math.max( 0.0, offsetY - o.offsetY * sc ), Math.max( 0.0, offsetZ - o.offsetZ * sc ), Math.min( 1.0, ( 1.0 - offsetX ) - o.offsetX * sc ), Math.min( 1.0, ( 1.0 - offsetY ) - o.offsetY * sc ), Math.min( 1.0, ( 1.0 - offsetZ ) - o.offsetZ * sc ) ) );
}
@Override
+27 -6
View File
@@ -1,6 +1,6 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -84,9 +84,6 @@ import appeng.server.ServerHelper;
import appeng.transformer.MissingCoreMod;
import appeng.util.Platform;
import static net.minecraftforge.client.IItemRenderer.ItemRenderType.ENTITY;
import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D;
public class ClientHelper extends ServerHelper
{
@@ -119,9 +116,13 @@ public class ClientHelper extends ServerHelper
public World getWorld()
{
if( Platform.isClient() )
{
return Minecraft.getMinecraft().theWorld;
}
else
{
return super.getWorld();
}
}
@Override
@@ -129,7 +130,9 @@ public class ClientHelper extends ServerHelper
{
BaseBlockRender bbr = blk.getRendererInstance().rendererInstance;
if( bbr.hasTESR() && tile != null )
{
ClientRegistry.bindTileEntitySpecialRenderer( tile, new TESRWrapper( bbr ) );
}
}
@Override
@@ -142,7 +145,9 @@ public class ClientHelper extends ServerHelper
return o;
}
else
{
return super.getPlayers();
}
}
@Override
@@ -243,9 +248,13 @@ public class ClientHelper extends ServerHelper
{
int setting = Minecraft.getMinecraft().gameSettings.particleSetting;
if( setting == 2 )
{
return false;
}
if( setting == 0 )
{
return true;
}
return r.nextInt( 2 * ( setting + 1 ) ) == 0;
}
@@ -289,10 +298,10 @@ public class ClientHelper extends ServerHelper
GL11.glRotatef( 30.0f, 0.0f, 1.0f, 0.0f );
}
IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer( itemstack, ENTITY );
IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer( itemstack, IItemRenderer.ItemRenderType.ENTITY );
if( customRenderer != null && !( itemstack.getItem() instanceof ItemBlock ) )
{
if( customRenderer.shouldUseRenderHelper( ENTITY, itemstack, BLOCK_3D ) )
if( customRenderer.shouldUseRenderHelper( IItemRenderer.ItemRenderType.ENTITY, itemstack, IItemRenderer.ItemRendererHelper.BLOCK_3D ) )
{
GL11.glTranslatef( 0, -0.04F, 0 );
GL11.glScalef( 0.7f, 0.7f, 0.7f );
@@ -347,7 +356,9 @@ public class ClientHelper extends ServerHelper
public CableRenderMode getRenderMode()
{
if( Platform.isServer() )
{
return super.getRenderMode();
}
Minecraft mc = Minecraft.getMinecraft();
EntityPlayer player = mc.thePlayer;
@@ -360,7 +371,9 @@ public class ClientHelper extends ServerHelper
{
Minecraft mc = Minecraft.getMinecraft();
if( mc == null || mc.thePlayer == null || mc.theWorld == null )
{
return;
}
EntityPlayer player = mc.thePlayer;
@@ -383,7 +396,9 @@ public class ClientHelper extends ServerHelper
public void wheelEvent( MouseEvent me )
{
if( me.isCanceled() || me.dwheel == 0 )
{
return;
}
Minecraft mc = Minecraft.getMinecraft();
EntityPlayer player = mc.thePlayer;
@@ -409,16 +424,22 @@ public class ClientHelper extends ServerHelper
if( ev.map.getTextureType() == 1 )
{
for( ExtraItemTextures et : ExtraItemTextures.values() )
{
et.registerIcon( ev.map );
}
}
if( ev.map.getTextureType() == 0 )
{
for( ExtraBlockTextures et : ExtraBlockTextures.values() )
{
et.registerIcon( ev.map );
}
for( CableBusTextures cb : CableBusTextures.values() )
{
cb.registerIcon( ev.map );
}
}
}
}
+62 -17
View File
@@ -1,6 +1,6 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -30,6 +30,9 @@ import java.util.List;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import com.google.common.base.Joiner;
import com.google.common.base.Stopwatch;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
@@ -49,9 +52,6 @@ import net.minecraft.util.ResourceLocation;
import cpw.mods.fml.common.ObfuscationReflectionHelper;
import com.google.common.base.Joiner;
import com.google.common.base.Stopwatch;
import appeng.api.storage.data.IAEItemStack;
import appeng.client.gui.widgets.GuiScrollbar;
import appeng.client.gui.widgets.ITooltip;
@@ -72,11 +72,11 @@ import appeng.container.slot.SlotOutput;
import appeng.container.slot.SlotPatternTerm;
import appeng.container.slot.SlotRestrictedInput;
import appeng.core.AELog;
import appeng.core.AppEng;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketInventoryAction;
import appeng.core.sync.packets.PacketSwapSlots;
import appeng.helpers.InventoryAction;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType;
import appeng.integration.abstraction.INEI;
@@ -136,11 +136,17 @@ public abstract class AEBaseGui extends GuiContainer
final List<Slot> slots = this.getInventorySlots();
Iterator<Slot> i = slots.iterator();
while( i.hasNext() )
{
if( i.next() instanceof SlotME )
{
i.remove();
}
}
for( InternalSlotME me : this.meSlots )
{
slots.add( new SlotME( me ) );
}
}
@SuppressWarnings( "unchecked" )
@@ -150,13 +156,15 @@ public abstract class AEBaseGui extends GuiContainer
}
@Override
public void drawScreen( int mouse_x, int mouse_y, float btn )
public void drawScreen( int mouseX, int mouseY, float btn )
{
super.drawScreen( mouse_x, mouse_y, btn );
super.drawScreen( mouseX, mouseY, btn );
boolean hasClicked = Mouse.isButtonDown( 0 );
if( hasClicked && this.myScrollBar != null )
this.myScrollBar.click( this, mouse_x - this.guiLeft, mouse_y - this.guiTop );
{
this.myScrollBar.click( this, mouseX - this.guiLeft, mouseY - this.guiTop );
}
for( Object c : this.buttonList )
{
@@ -166,30 +174,34 @@ public abstract class AEBaseGui extends GuiContainer
int x = tooltip.xPos(); // ((GuiImgButton) c).xPosition;
int y = tooltip.yPos(); // ((GuiImgButton) c).yPosition;
if( x < mouse_x && x + tooltip.getWidth() > mouse_x && tooltip.isVisible() )
if( x < mouseX && x + tooltip.getWidth() > mouseX && tooltip.isVisible() )
{
if( y < mouse_y && y + tooltip.getHeight() > mouse_y )
if( y < mouseY && y + tooltip.getHeight() > mouseY )
{
if( y < 15 )
{
y = 15;
}
String msg = tooltip.getMessage();
if( msg != null )
{
this.drawTooltip( x + 11, y + 4, 0, msg );
}
}
}
}
}
}
public void drawTooltip( int par2, int par3, int forceWidth, String Msg )
public void drawTooltip( int par2, int par3, int forceWidth, String message )
{
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
GL11.glDisable( GL12.GL_RESCALE_NORMAL );
RenderHelper.disableStandardItemLighting();
GL11.glDisable( GL11.GL_LIGHTING );
GL11.glDisable( GL11.GL_DEPTH_TEST );
String[] var4 = Msg.split( "\n" );
String[] var4 = message.split( "\n" );
if( var4.length > 0 )
{
@@ -222,7 +234,9 @@ public abstract class AEBaseGui extends GuiContainer
}
if( forceWidth > 0 )
{
var5 = forceWidth;
}
this.zLevel = 300.0F;
itemRender.zLevel = 300.0F;
@@ -276,7 +290,9 @@ public abstract class AEBaseGui extends GuiContainer
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
if( this.myScrollBar != null )
{
this.myScrollBar.draw( this );
}
this.drawFG( ox, oy, x, y );
}
@@ -357,7 +373,9 @@ public abstract class AEBaseGui extends GuiContainer
}
}
else
{
super.mouseClickMove( x, y, c, d );
}
}
@Override
@@ -370,7 +388,9 @@ public abstract class AEBaseGui extends GuiContainer
final InventoryAction action = ctrlDown == 1 ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN;
if( this.drag_click.size() > 1 )
{
return;
}
PacketInventoryAction p = new PacketInventoryAction( action, slotIdx, 0 );
NetworkHandler.instance.sendToServer( p );
@@ -381,7 +401,9 @@ public abstract class AEBaseGui extends GuiContainer
if( slot instanceof SlotPatternTerm )
{
if( key == 6 )
{
return; // prevent weird double clicks..
}
try
{
@@ -395,13 +417,19 @@ public abstract class AEBaseGui extends GuiContainer
else if( slot instanceof SlotCraftingTerm )
{
if( key == 6 )
{
return; // prevent weird double clicks..
}
InventoryAction action = null;
if( key == 1 )
{
action = InventoryAction.CRAFT_SHIFT;
}
else
{
action = ctrlDown == 1 ? InventoryAction.CRAFT_STACK : InventoryAction.CRAFT_ITEM;
}
PacketInventoryAction p = new PacketInventoryAction( action, slotIdx, 0 );
NetworkHandler.instance.sendToServer( p );
@@ -415,12 +443,16 @@ public abstract class AEBaseGui extends GuiContainer
{
IAEItemStack stack = null;
if( slot instanceof SlotME )
{
stack = ( (SlotME) slot ).getAEStack();
}
int slotNum = this.getInventorySlots().size();
if( !( slot instanceof SlotME ) && slot != null )
{
slotNum = slot.slotNumber;
}
( (AEBaseContainer) this.inventorySlots ).setTargetStack( stack );
PacketInventoryAction p = new PacketInventoryAction( InventoryAction.MOVE_REGION, slotNum, 0 );
@@ -477,7 +509,9 @@ public abstract class AEBaseGui extends GuiContainer
stack = ( (SlotME) slot ).getAEStack();
if( stack != null && action == InventoryAction.PICKUP_OR_SET_DOWN && stack.getStackSize() == 0 && player.inventory.getItemStack() == null )
{
action = InventoryAction.AUTO_CRAFT;
}
break;
case 1:
@@ -489,8 +523,9 @@ public abstract class AEBaseGui extends GuiContainer
stack = ( (SlotME) slot ).getAEStack();
if( stack != null && stack.isCraftable() )
{
action = InventoryAction.AUTO_CRAFT;
}
else if( player.capabilities.isCreativeMode )
{
IAEItemStack slotItem = ( (SlotME) slot ).getAEStack();
@@ -526,9 +561,13 @@ public abstract class AEBaseGui extends GuiContainer
this.bl_clicked = slot;
this.dbl_clickTimer = Stopwatch.createStarted();
if( slot != null )
{
this.dbl_whichItem = slot.getHasStack() ? slot.getStack().copy() : null;
}
else
{
this.dbl_whichItem = null;
}
}
else if( this.dbl_whichItem != null )
{
@@ -551,7 +590,7 @@ public abstract class AEBaseGui extends GuiContainer
}
@Override
protected boolean checkHotbarKeys( int p_146983_1_ )
protected boolean checkHotbarKeys( int keyCode )
{
Slot theSlot;
@@ -568,7 +607,7 @@ public abstract class AEBaseGui extends GuiContainer
{
for( int j = 0; j < 9; ++j )
{
if( p_146983_1_ == this.mc.gameSettings.keyBindsHotbar[j].getKeyCode() )
if( keyCode == this.mc.gameSettings.keyBindsHotbar[j].getKeyCode() )
{
final List<Slot> slots = this.getInventorySlots();
for( Slot s : slots )
@@ -642,7 +681,9 @@ public abstract class AEBaseGui extends GuiContainer
this.mouseWheelEvent( x, y, i / Math.abs( i ) );
}
else if( i != 0 && this.myScrollBar != null )
{
this.myScrollBar.wheel( i );
}
}
protected void mouseWheelEvent( int x, int y, int wheel )
@@ -702,7 +743,9 @@ public abstract class AEBaseGui extends GuiContainer
private boolean hasCustomInventoryName()
{
if( this.inventorySlots instanceof AEBaseContainer )
{
return ( (AEBaseContainer) this.inventorySlots ).customName != null;
}
return false;
}
@@ -835,7 +878,9 @@ public abstract class AEBaseGui extends GuiContainer
this.safeDrawSlot( s );
}
else
{
this.safeDrawSlot( s );
}
return;
}
@@ -850,9 +895,9 @@ public abstract class AEBaseGui extends GuiContainer
private RenderItem setItemRender( RenderItem item )
{
if( AppEng.instance.isIntegrationEnabled( IntegrationType.NEI ) )
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.NEI ) )
{
return ( (INEI) AppEng.instance.getIntegration( IntegrationType.NEI ) ).setItemRender( item );
return ( (INEI) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.NEI ) ).setItemRender( item );
}
else
{
@@ -121,10 +121,14 @@ public abstract class AEBaseMEGui extends AEBaseGui
List<String> currentToolTip = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips );
if( myStack.getStackSize() > BigNumber || ( myStack.getStackSize() > 1 && stack.isItemDamaged() ) )
{
currentToolTip.add( "Items Stored: " + NumberFormat.getNumberInstance( Locale.US ).format( myStack.getStackSize() ) );
}
if( myStack.getCountRequestable() > 0 )
{
currentToolTip.add( "Items Requestable: " + NumberFormat.getNumberInstance( Locale.US ).format( myStack.getCountRequestable() ) );
}
this.drawTooltip( x, y, 0, join( currentToolTip, "\n" ) );
}
@@ -48,15 +48,21 @@ public class AEConfigGui extends GuiConfig
for( String cat : AEConfig.instance.getCategoryNames() )
{
if( cat.equals( "versionchecker" ) )
{
continue;
}
if( cat.equals( "settings" ) )
{
continue;
}
ConfigCategory cc = AEConfig.instance.getCategory( cat );
if( cc.isChild() )
{
continue;
}
ConfigElement ce = new ConfigElement( cc );
list.add( ce );
@@ -98,9 +98,13 @@ public class GuiCellWorkbench extends GuiUpgradeable
int dx = this.workbench.availableUpgrades() - 8;
this.drawTexturedModalRect( offsetX + 177 + 27, offsetY, 186, 0, 35 - 8, 7 + dx * 18 );
if( dx == 8 )
{
this.drawTexturedModalRect( offsetX + 177 + 27, offsetY + ( 7 + ( dx ) * 18 ), 186, 151, 35 - 8, 7 );
}
else
{
this.drawTexturedModalRect( offsetX + 177 + 27 + 4, offsetY + ( 7 + ( dx ) * 18 ), 186 + 4, 151, 35 - 8, 7 );
}
}
else
{
@@ -113,13 +117,19 @@ public class GuiCellWorkbench extends GuiUpgradeable
int dx = this.workbench.availableUpgrades() - 16;
this.drawTexturedModalRect( offsetX + 177 + 27 + 18, offsetY, 186, 0, 35 - 8, 7 + dx * 18 );
if( dx == 8 )
{
this.drawTexturedModalRect( offsetX + 177 + 27 + 18, offsetY + ( 7 + ( dx ) * 18 ), 186, 151, 35 - 8, 7 );
}
else
{
this.drawTexturedModalRect( offsetX + 177 + 27 + 18 + 4, offsetY + ( 7 + ( dx ) * 18 ), 186 + 4, 151, 35 - 8, 7 );
}
}
}
if( this.hasToolbox() )
{
this.drawTexturedModalRect( offsetX + 178, offsetY + this.ySize - 90, 178, 161, 68, 68 );
}
}
@Override
@@ -135,7 +145,9 @@ public class GuiCellWorkbench extends GuiUpgradeable
if( is != null && is.getItem() instanceof IUpgradeModule )
{
if( ( (IUpgradeModule) is.getItem() ).getType( is ) == Upgrades.FUZZY )
{
hasFuzzy = true;
}
}
}
this.fuzzyMode.setVisibility( hasFuzzy );
@@ -186,7 +198,9 @@ public class GuiCellWorkbench extends GuiUpgradeable
NetworkHandler.instance.sendToServer( new PacketValueConfig( "CellWorkbench.Fuzzy", fz.name() ) );
}
else
{
super.actionPerformed( btn );
}
}
catch( IOException ignored )
{
@@ -197,10 +197,14 @@ public class GuiCraftAmount extends AEBaseGui
}
if( fixed )
{
this.amountToCraft.setText( out );
}
if( out.length() == 0 )
{
out = "0";
}
long result = Long.parseLong( out );
if( result < 0 )
@@ -248,7 +252,9 @@ public class GuiCraftAmount extends AEBaseGui
boolean isMinus = btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000;
if( isPlus || isMinus )
{
this.addQty( this.getQty( btn ) );
}
}
private void addQty( int i )
@@ -265,19 +271,27 @@ public class GuiCraftAmount extends AEBaseGui
}
if( fixed )
{
this.amountToCraft.setText( out );
}
if( out.length() == 0 )
{
out = "0";
}
long result = Integer.parseInt( out );
if( result == 1 && i > 1 )
{
result = 0;
}
result += i;
if( result < 1 )
{
result = 1;
}
out = Long.toString( result );
Integer.parseInt( out );
@@ -26,6 +26,8 @@ import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import com.google.common.base.Joiner;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
@@ -33,8 +35,6 @@ import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import com.google.common.base.Joiner;
import appeng.api.AEApi;
import appeng.api.storage.ITerminalHost;
import appeng.api.storage.data.IAEItemStack;
@@ -84,16 +84,24 @@ public class GuiCraftConfirm extends AEBaseGui
this.ccc = (ContainerCraftConfirm) this.inventorySlots;
if( te instanceof WirelessTerminalGuiObject )
{
this.OriginalGui = GuiBridge.GUI_WIRELESS_TERM;
}
if( te instanceof PartTerminal )
{
this.OriginalGui = GuiBridge.GUI_ME;
}
if( te instanceof PartCraftingTerminal )
{
this.OriginalGui = GuiBridge.GUI_CRAFTING_TERMINAL;
}
if( te instanceof PartPatternTerminal )
{
this.OriginalGui = GuiBridge.GUI_PATTERN_TERMINAL;
}
}
boolean isAutoStart()
@@ -115,13 +123,15 @@ public class GuiCraftConfirm extends AEBaseGui
this.buttonList.add( this.selectCPU );
if( this.OriginalGui != null )
{
this.cancel = new GuiButton( 0, this.guiLeft + 6, this.guiTop + this.ySize - 25, 50, 20, GuiText.Cancel.getLocal() );
}
this.buttonList.add( this.cancel );
}
@Override
public void drawScreen( int mouse_x, int mouse_y, float btn )
public void drawScreen( int mouseX, int mouseY, float btn )
{
this.updateCPUButtonText();
@@ -142,9 +152,9 @@ public class GuiCraftConfirm extends AEBaseGui
int minX = gx + 9 + x * 67;
int minY = gy + 22 + y * offY;
if( minX < mouse_x && minX + 67 > mouse_x )
if( minX < mouseX && minX + 67 > mouseX )
{
if( minY < mouse_y && minY + offY - 2 > mouse_y )
if( minY < mouseY && minY + offY - 2 > mouseY )
{
this.tooltip = z;
break;
@@ -160,7 +170,7 @@ public class GuiCraftConfirm extends AEBaseGui
}
}
super.drawScreen( mouse_x, mouse_y, btn );
super.drawScreen( mouseX, mouseY, btn );
}
private void updateCPUButtonText()
@@ -174,11 +184,15 @@ public class GuiCraftConfirm extends AEBaseGui
btnTextText = GuiText.CraftingCPU.getLocal() + ": " + name;
}
else
{
btnTextText = GuiText.CraftingCPU.getLocal() + ": #" + this.ccc.selectedCpu;
}
}
if( this.ccc.noCPU )
{
btnTextText = GuiText.NoCraftingCPUs.getLocal();
}
this.selectCPU.displayString = btnTextText;
}
@@ -199,9 +213,13 @@ public class GuiCraftConfirm extends AEBaseGui
String dsp = null;
if( this.isSimulation() )
{
dsp = GuiText.Simulation.getLocal();
}
else
{
dsp = this.ccc.cpuBytesAvail > 0 ? ( GuiText.Bytes.getLocal() + ": " + this.ccc.cpuBytesAvail + " : " + GuiText.CoProcessors.getLocal() + ": " + this.ccc.cpuCoProcessors ) : GuiText.Bytes.getLocal() + ": N/A : " + GuiText.CoProcessors.getLocal() + ": N/A";
}
int offset = ( 219 - this.fontRendererObj.getStringWidth( dsp ) ) / 2;
this.fontRendererObj.drawString( dsp, offset, 165, 4210752 );
@@ -237,11 +255,17 @@ public class GuiCraftConfirm extends AEBaseGui
int lines = 0;
if( stored != null && stored.getStackSize() > 0 )
{
lines++;
}
if( pendingStack != null && pendingStack.getStackSize() > 0 )
{
lines++;
}
if( pendingStack != null && pendingStack.getStackSize() > 0 )
{
lines++;
}
int negY = ( ( lines - 1 ) * 5 ) / 2;
int downY = 0;
@@ -251,16 +275,22 @@ public class GuiCraftConfirm extends AEBaseGui
{
String str = Long.toString( stored.getStackSize() );
if( stored.getStackSize() >= 10000 )
{
str = Long.toString( stored.getStackSize() / 1000 ) + 'k';
}
if( stored.getStackSize() >= 10000000 )
{
str = Long.toString( stored.getStackSize() / 1000000 ) + 'm';
}
str = GuiText.FromStorage.getLocal() + ": " + str;
int w = 4 + this.fontRendererObj.getStringWidth( str );
this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + yo + 6 - negY + downY ) * 2, 4210752 );
if( this.tooltip == z - viewStart )
{
lineList.add( GuiText.FromStorage.getLocal() + ": " + Long.toString( stored.getStackSize() ) );
}
downY += 5;
}
@@ -269,16 +299,22 @@ public class GuiCraftConfirm extends AEBaseGui
{
String str = Long.toString( missingStack.getStackSize() );
if( missingStack.getStackSize() >= 10000 )
{
str = Long.toString( missingStack.getStackSize() / 1000 ) + 'k';
}
if( missingStack.getStackSize() >= 10000000 )
{
str = Long.toString( missingStack.getStackSize() / 1000000 ) + 'm';
}
str = GuiText.Missing.getLocal() + ": " + str;
int w = 4 + this.fontRendererObj.getStringWidth( str );
this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + yo + 6 - negY + downY ) * 2, 4210752 );
if( this.tooltip == z - viewStart )
{
lineList.add( GuiText.Missing.getLocal() + ": " + Long.toString( missingStack.getStackSize() ) );
}
red = true;
downY += 5;
@@ -288,16 +324,22 @@ public class GuiCraftConfirm extends AEBaseGui
{
String str = Long.toString( pendingStack.getStackSize() );
if( pendingStack.getStackSize() >= 10000 )
{
str = Long.toString( pendingStack.getStackSize() / 1000 ) + 'k';
}
if( pendingStack.getStackSize() >= 10000000 )
{
str = Long.toString( pendingStack.getStackSize() / 1000000 ) + 'm';
}
str = GuiText.ToCraft.getLocal() + ": " + str;
int w = 4 + this.fontRendererObj.getStringWidth( str );
this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + yo + 6 - negY + downY ) * 2, 4210752 );
if( this.tooltip == z - viewStart )
{
lineList.add( GuiText.ToCraft.getLocal() + ": " + Long.toString( pendingStack.getStackSize() ) );
}
}
GL11.glPopMatrix();
@@ -311,7 +353,9 @@ public class GuiCraftConfirm extends AEBaseGui
dspToolTip = Platform.getItemDisplayName( is );
if( lineList.size() > 0 )
{
dspToolTip = dspToolTip + '\n' + Joiner.on( "\n" ).join( lineList );
}
toolPosX = x * ( 1 + sectionLength ) + xo + sectionLength - 8;
toolPosY = y * offY + yo;
@@ -366,17 +410,23 @@ public class GuiCraftConfirm extends AEBaseGui
{
case 0:
for( IAEItemStack l : list )
{
this.handleInput( this.storage, l );
}
break;
case 1:
for( IAEItemStack l : list )
{
this.handleInput( this.pending, l );
}
break;
case 2:
for( IAEItemStack l : list )
{
this.handleInput( this.missing, l );
}
break;
}
@@ -385,7 +435,9 @@ public class GuiCraftConfirm extends AEBaseGui
long amt = this.getTotal( l );
if( amt <= 0 )
{
this.deleteVisualStack( l );
}
else
{
IAEItemStack is = this.findVisualStack( l );
@@ -403,7 +455,9 @@ public class GuiCraftConfirm extends AEBaseGui
if( l.getStackSize() <= 0 )
{
if( a != null )
{
a.reset();
}
}
else
{
@@ -414,7 +468,9 @@ public class GuiCraftConfirm extends AEBaseGui
}
if( a != null )
{
a.setStackSize( l.getStackSize() );
}
}
}
@@ -427,13 +483,19 @@ public class GuiCraftConfirm extends AEBaseGui
long total = 0;
if( a != null )
{
total += a.getStackSize();
}
if( c != null )
{
total += c.getStackSize();
}
if( m != null )
{
total += m.getStackSize();
}
return total;
}
@@ -24,15 +24,17 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import com.google.common.base.Joiner;
import org.apache.commons.lang3.time.DurationFormatUtils;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import com.google.common.base.Joiner;
import appeng.api.AEApi;
import appeng.api.config.SortDir;
import appeng.api.config.SortOrder;
@@ -50,20 +52,45 @@ import appeng.core.localization.GuiText;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketValueConfig;
import appeng.util.Platform;
import appeng.util.ReadableNumberConverter;
public class GuiCraftingCPU extends AEBaseGui implements ISortSource
{
private final static int GUI_HEIGHT = 184;
private final static int GUI_WIDTH = 238;
final int rows = 6;
private final static int DISPLAYED_ROWS = 6;
IItemList<IAEItemStack> storage = AEApi.instance().storage().createItemList();
IItemList<IAEItemStack> active = AEApi.instance().storage().createItemList();
IItemList<IAEItemStack> pending = AEApi.instance().storage().createItemList();
private final static int TEXT_COLOR = 0x404040;
private final static int BACKGROUND_ALPHA = 0x5A000000;
List<IAEItemStack> visual = new ArrayList<IAEItemStack>();
GuiButton cancel;
int tooltip = -1;
private final static int SECTION_LENGTH = 67;
private final static int SCROLLBAR_TOP = 19;
private final static int SCROLLBAR_LEFT = 218;
private final static int SCROLLBAR_HEIGHT = 137;
private final static int CANCEL_LEFT_OFFSET = 163;
private final static int CANCEL_TOP_OFFSET = 25;
private final static int CANCEL_HEIGHT = 20;
private final static int CANCEL_WIDTH = 50;
private final static int TITLE_TOP_OFFSET = 7;
private final static int TITLE_LEFT_OFFSET = 8;
private final static int ITEMSTACK_LEFT_OFFSET = 9;
private final static int ITEMSTACK_TOP_OFFSET = 22;
private final ContainerCraftingCPU craftingCpu;
private IItemList<IAEItemStack> storage = AEApi.instance().storage().createItemList();
private IItemList<IAEItemStack> active = AEApi.instance().storage().createItemList();
private IItemList<IAEItemStack> pending = AEApi.instance().storage().createItemList();
private List<IAEItemStack> visual = new ArrayList<IAEItemStack>();
private GuiButton cancel;
private int tooltip = -1;
public GuiCraftingCPU( InventoryPlayer inventoryPlayer, Object te )
{
@@ -73,8 +100,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
protected GuiCraftingCPU( ContainerCraftingCPU container )
{
super( container );
this.ySize = 184;
this.xSize = 238;
this.craftingCpu = container;
this.ySize = GUI_HEIGHT;
this.xSize = GUI_WIDTH;
this.myScrollBar = new GuiScrollbar();
}
@@ -109,7 +137,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
{
super.initGui();
this.setScrollBar();
this.cancel = new GuiButton( 0, this.guiLeft + 163, this.guiTop + this.ySize - 25, 50, 20, GuiText.Cancel.getLocal() );
this.cancel = new GuiButton( 0, this.guiLeft + CANCEL_LEFT_OFFSET, this.guiTop + this.ySize - CANCEL_TOP_OFFSET, CANCEL_WIDTH, CANCEL_HEIGHT, GuiText.Cancel.getLocal() );
this.buttonList.add( this.cancel );
}
@@ -117,21 +145,21 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
{
int size = this.visual.size();
this.myScrollBar.setTop( 19 ).setLeft( 218 ).setHeight( 137 );
this.myScrollBar.setRange( 0, ( size + 2 ) / 3 - this.rows, 1 );
this.myScrollBar.setTop( SCROLLBAR_TOP ).setLeft( SCROLLBAR_LEFT ).setHeight( SCROLLBAR_HEIGHT );
this.myScrollBar.setRange( 0, ( size + 2 ) / 3 - DISPLAYED_ROWS, 1 );
}
@Override
public void drawScreen( int mouse_x, int mouse_y, float btn )
public void drawScreen( int mouseX, int mouseY, float btn )
{
this.cancel.enabled = !this.visual.isEmpty();
int x = 0;
int y = 0;
int gx = ( this.width - this.xSize ) / 2;
int gy = ( this.height - this.ySize ) / 2;
int offY = 23;
final int gx = ( this.width - this.xSize ) / 2;
final int gy = ( this.height - this.ySize ) / 2;
final int offY = 23;
this.tooltip = -1;
@@ -140,9 +168,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
int minX = gx + 9 + x * 67;
int minY = gy + 22 + y * offY;
if( minX < mouse_x && minX + 67 > mouse_x )
if( minX < mouseX && minX + 67 > mouseX )
{
if( minY < mouse_y && minY + offY - 2 > mouse_y )
if( minY < mouseY && minY + offY - 2 > mouseY )
{
this.tooltip = z;
break;
@@ -158,22 +186,28 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
}
}
super.drawScreen( mouse_x, mouse_y, btn );
super.drawScreen( mouseX, mouseY, btn );
}
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
{
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.CraftingStatus.getLocal() ), 8, 7, 4210752 );
final ReadableNumberConverter converter = ReadableNumberConverter.INSTANCE;
String title = this.getGuiDisplayName( GuiText.CraftingStatus.getLocal() );
int sectionLength = 67;
if( this.craftingCpu.eta > 0 && !this.visual.isEmpty() )
{
final long etaInMilliseconds = TimeUnit.MILLISECONDS.convert( this.craftingCpu.eta, TimeUnit.NANOSECONDS );
final String etaTimeText = DurationFormatUtils.formatDuration( etaInMilliseconds, GuiText.ETAFormat.getLocal() );
title += " - " + etaTimeText;
}
this.fontRendererObj.drawString( title, TITLE_LEFT_OFFSET, TITLE_TOP_OFFSET, TEXT_COLOR );
int x = 0;
int y = 0;
int xo = 9;
int yo = 22;
int viewStart = this.myScrollBar.getCurrentScroll() * 3;
int viewEnd = viewStart + 3 * 6;
final int viewStart = this.myScrollBar.getCurrentScroll() * 3;
final int viewEnd = viewStart + 3 * 6;
String dspToolTip = "";
List<String> lineList = new LinkedList<String>();
@@ -190,9 +224,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
GL11.glPushMatrix();
GL11.glScaled( 0.5, 0.5, 0.5 );
IAEItemStack stored = this.storage.findPrecise( refStack );
IAEItemStack activeStack = this.active.findPrecise( refStack );
IAEItemStack pendingStack = this.pending.findPrecise( refStack );
final IAEItemStack stored = this.storage.findPrecise( refStack );
final IAEItemStack activeStack = this.active.findPrecise( refStack );
final IAEItemStack pendingStack = this.pending.findPrecise( refStack );
int lines = 0;
boolean active = false;
@@ -215,10 +249,10 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
if( AEConfig.instance.useColoredCraftingStatus && ( active || scheduled ) )
{
int bgColor = ( active ? AEColor.Green.blackVariant : AEColor.Yellow.blackVariant ) | 0x5A000000;
int startX = ( x * ( 1 + sectionLength ) + xo ) * 2;
int startY = ( ( y * offY + yo ) - 3 ) * 2;
drawRect( startX, startY, startX + ( sectionLength * 2 ), startY + ( offY * 2 ) - 2, bgColor );
int bgColor = ( active ? AEColor.Green.blackVariant : AEColor.Yellow.blackVariant ) | BACKGROUND_ALPHA;
int startX = ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET ) * 2;
int startY = ( ( y * offY + ITEMSTACK_TOP_OFFSET ) - 3 ) * 2;
drawRect( startX, startY, startX + ( SECTION_LENGTH * 2 ), startY + ( offY * 2 ) - 2, bgColor );
}
int negY = ( ( lines - 1 ) * 5 ) / 2;
@@ -226,59 +260,49 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
if( stored != null && stored.getStackSize() > 0 )
{
String str = Long.toString( stored.getStackSize() );
if( stored.getStackSize() >= 10000 )
str = Long.toString( stored.getStackSize() / 1000 ) + 'k';
if( stored.getStackSize() >= 10000000 )
str = Long.toString( stored.getStackSize() / 1000000 ) + 'm';
str = GuiText.Stored.getLocal() + ": " + str;
final String str = GuiText.Stored.getLocal() + ": " + converter.toWideReadableForm( stored.getStackSize() );
int w = 4 + this.fontRendererObj.getStringWidth( str );
this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + yo + 6 - negY + downY ) * 2, 4210752 );
this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + ITEMSTACK_TOP_OFFSET + 6 - negY + downY ) * 2, TEXT_COLOR );
if( this.tooltip == z - viewStart )
{
lineList.add( GuiText.Stored.getLocal() + ": " + Long.toString( stored.getStackSize() ) );
}
downY += 5;
}
if( activeStack != null && activeStack.getStackSize() > 0 )
{
String str = Long.toString( activeStack.getStackSize() );
if( activeStack.getStackSize() >= 10000 )
str = Long.toString( activeStack.getStackSize() / 1000 ) + 'k';
if( activeStack.getStackSize() >= 10000000 )
str = Long.toString( activeStack.getStackSize() / 1000000 ) + 'm';
final String str = GuiText.Crafting.getLocal() + ": " + converter.toWideReadableForm( activeStack.getStackSize() );
final int w = 4 + this.fontRendererObj.getStringWidth( str );
str = GuiText.Crafting.getLocal() + ": " + str;
int w = 4 + this.fontRendererObj.getStringWidth( str );
this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + yo + 6 - negY + downY ) * 2, 4210752 );
this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + ITEMSTACK_TOP_OFFSET + 6 - negY + downY ) * 2, TEXT_COLOR );
if( this.tooltip == z - viewStart )
{
lineList.add( GuiText.Crafting.getLocal() + ": " + Long.toString( activeStack.getStackSize() ) );
}
downY += 5;
}
if( pendingStack != null && pendingStack.getStackSize() > 0 )
{
String str = Long.toString( pendingStack.getStackSize() );
if( pendingStack.getStackSize() >= 10000 )
str = Long.toString( pendingStack.getStackSize() / 1000 ) + 'k';
if( pendingStack.getStackSize() >= 10000000 )
str = Long.toString( pendingStack.getStackSize() / 1000000 ) + 'm';
final String str = GuiText.Scheduled.getLocal() + ": " + converter.toWideReadableForm( pendingStack.getStackSize() );
final int w = 4 + this.fontRendererObj.getStringWidth( str );
str = GuiText.Scheduled.getLocal() + ": " + str;
int w = 4 + this.fontRendererObj.getStringWidth( str );
this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + yo + 6 - negY + downY ) * 2, 4210752 );
this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + ITEMSTACK_TOP_OFFSET + 6 - negY + downY ) * 2, TEXT_COLOR );
if( this.tooltip == z - viewStart )
{
lineList.add( GuiText.Scheduled.getLocal() + ": " + Long.toString( pendingStack.getStackSize() ) );
}
}
GL11.glPopMatrix();
int posX = x * ( 1 + sectionLength ) + xo + sectionLength - 19;
int posY = y * offY + yo;
int posX = x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19;
int posY = y * offY + ITEMSTACK_TOP_OFFSET;
ItemStack is = refStack.copy().getItemStack();
@@ -287,10 +311,12 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
dspToolTip = Platform.getItemDisplayName( is );
if( lineList.size() > 0 )
{
dspToolTip = dspToolTip + '\n' + Joiner.on( "\n" ).join( lineList );
}
toolPosX = x * ( 1 + sectionLength ) + xo + sectionLength - 8;
toolPosY = y * offY + yo;
toolPosX = x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 8;
toolPosY = y * offY + ITEMSTACK_TOP_OFFSET;
}
this.drawItem( posX, posY, is );
@@ -326,17 +352,23 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
{
case 0:
for( IAEItemStack l : list )
{
this.handleInput( this.storage, l );
}
break;
case 1:
for( IAEItemStack l : list )
{
this.handleInput( this.active, l );
}
break;
case 2:
for( IAEItemStack l : list )
{
this.handleInput( this.pending, l );
}
break;
}
@@ -345,7 +377,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
long amt = this.getTotal( l );
if( amt <= 0 )
{
this.deleteVisualStack( l );
}
else
{
IAEItemStack is = this.findVisualStack( l );
@@ -363,7 +397,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
if( l.getStackSize() <= 0 )
{
if( a != null )
{
a.reset();
}
}
else
{
@@ -374,33 +410,42 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
}
if( a != null )
{
a.setStackSize( l.getStackSize() );
}
}
}
private long getTotal( IAEItemStack is )
{
IAEItemStack a = this.storage.findPrecise( is );
IAEItemStack b = this.active.findPrecise( is );
IAEItemStack c = this.pending.findPrecise( is );
final IAEItemStack a = this.storage.findPrecise( is );
final IAEItemStack b = this.active.findPrecise( is );
final IAEItemStack c = this.pending.findPrecise( is );
long total = 0;
if( a != null )
{
total += a.getStackSize();
}
if( b != null )
{
total += b.getStackSize();
}
if( c != null )
{
total += c.getStackSize();
}
return total;
}
private void deleteVisualStack( IAEItemStack l )
{
Iterator<IAEItemStack> i = this.visual.iterator();
final Iterator<IAEItemStack> i = this.visual.iterator();
while( i.hasNext() )
{
IAEItemStack o = i.next();
@@ -422,8 +467,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
}
}
IAEItemStack stack = l.copy();
final IAEItemStack stack = l.copy();
this.visual.add( stack );
return stack;
}
@@ -166,11 +166,15 @@ public class GuiCraftingStatus extends GuiCraftingCPU
btnTextText = GuiText.CPUs.getLocal() + ": " + name;
}
else
{
btnTextText = GuiText.CPUs.getLocal() + ": #" + this.status.selectedCpu;
}
}
if( this.status.noCPU )
{
btnTextText = GuiText.NoCraftingJobs.getLocal();
}
this.selectCPU.displayString = btnTextText;
}
@@ -59,7 +59,9 @@ public class GuiCraftingTerm extends GuiMEMonitorable
for( Object j : c.inventorySlots )
{
if( j instanceof SlotCraftingMatrix )
{
s = (Slot) j;
}
}
if( s != null )
@@ -69,10 +69,14 @@ public class GuiFormationPlane extends GuiUpgradeable
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
if( this.fuzzyMode != null )
{
this.fuzzyMode.set( this.cvb.fzMode );
}
if( this.placeMode != null )
{
this.placeMode.set( ( (ContainerFormationPlane) this.cvb ).placeMode );
}
}
@Override
@@ -70,13 +70,19 @@ public class GuiIOPort extends GuiUpgradeable
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
if( this.redstoneMode != null )
{
this.redstoneMode.set( this.cvb.rsMode );
}
if( this.operationMode != null )
{
this.operationMode.set( ( (ContainerIOPort) this.cvb ).opMode );
}
if( this.fullMode != null )
{
this.fullMode.set( ( (ContainerIOPort) this.cvb ).fMode );
}
}
@Override
@@ -111,9 +117,13 @@ public class GuiIOPort extends GuiUpgradeable
boolean backwards = Mouse.isButtonDown( 1 );
if( btn == this.fullMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.fullMode.getSetting(), backwards ) );
}
if( btn == this.operationMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.operationMode.getSetting(), backwards ) );
}
}
}
@@ -77,9 +77,13 @@ public class GuiInscriber extends AEBaseGui
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, 211 - 34, this.ySize );
if( this.drawUpgrades() )
{
this.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 14 + this.cvc.availableUpgrades() * 18 );
}
if( this.hasToolbox() )
{
this.drawTexturedModalRect( offsetX + 178, offsetY + this.ySize - 90, 178, this.ySize - 90, 68, 68 );
}
}
protected boolean drawUpgrades()
@@ -68,10 +68,14 @@ public class GuiInterface extends GuiUpgradeable
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
{
if( this.BlockMode != null )
{
this.BlockMode.set( ( (ContainerInterface) this.cvb ).bMode );
}
if( this.interfaceMode != null )
{
this.interfaceMode.setState( ( (ContainerInterface) this.cvb ).iTermMode == YesNo.YES );
}
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Interface.getLocal() ), 8, 6, 4210752 );
@@ -101,9 +105,13 @@ public class GuiInterface extends GuiUpgradeable
}
if( btn == this.interfaceMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( Settings.INTERFACE_TERMINAL, backwards ) );
}
if( btn == this.BlockMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.BlockMode.getSetting(), backwards ) );
}
}
}

Some files were not shown because too many files have changed in this diff Show More