Compare commits

...

217 Commits

Author SHA1 Message Date
yueh f558e64ef9 Updated Readme (#2374)
Added some additional details about the translation process.
2016-09-16 16:50:53 +02:00
yueh f870583c0f Added Travis CI as additional service (#2373) 2016-09-16 15:41:18 +02:00
thatsIch ed54f03e70 Merge pull request #2232 from Kasama/master
Updated pt_BR.lang to match latest en_US
2016-04-27 13:04:12 +02:00
Kasama a2e647014d Updated pt_BR.lang to match latest en_US 2016-04-05 23:46:52 -03:00
yueh ac45095cb4 Merge pull request #2100 from yueh/fix-2099
Fixes #2099: No neighbor update of Pressure P2P before IAirHandler is validated.
2016-01-13 14:57:59 +01:00
yueh 68d3025fac Fixes #2099: No neighbor update of Pressure P2P before IAirHandler is validated. 2016-01-10 21:01:02 +01:00
yueh a62e157e7c Merge pull request #2091 from Adaptivity/master
Ore Dictionary support for recipes
2016-01-08 21:00:34 +01:00
yueh 106b823827 Merge pull request #2088 from fnuecke/master
Reworked computer P2P tunnel for #2087
2016-01-08 20:48:27 +01:00
yueh 8406c00e22 Merge pull request #2092 from GWYOG/master_patch_1
Update zh_CN.lang, fix #2090
2016-01-08 20:36:29 +01:00
JJN 22f05428be fixed #2090
fixed #2090
2016-01-07 09:29:49 +08:00
Adaptivity bd0bf26f30 Ore Dictionary support for recipes
Added missing changes to oredict.recipe
2016-01-06 20:29:33 +03:00
Florian Nücke 2ea05bce5f Reworked computer P2P tunnel to use events, and cleaned up reconnection, fixes #2087.
Just `onTunnelNetworkChange` with tickable is apparently less exhaustive, and less stable. This now avoids issues with network splits and reconnects not being handled in some cases. Also simplified reconnection; there was some duplicate logic in there, with a missing validity check which potentially led to invalid connections.
2016-01-05 19:05:25 +01:00
yueh f47fd1957a Merge pull request #2075 from yueh/fix-2043
Fixes #2043: Storage buses updates should happen in the correct order.
2016-01-05 13:53:01 +01:00
yueh a890e57e44 Merge pull request #2085 from yueh/fix-wrong-api-version
Changed outdated API version to rv3
2016-01-04 08:09:58 +01:00
thatsIch 6e61627d7c Merge pull request #2006 from Mazdallier/patch-1
Update fr_FR.lang
2016-01-03 14:42:59 +01:00
thatsIch 580a17987b Merge pull request #2079 from Honon/patch-1
Japanese translation files
2016-01-03 14:42:07 +01:00
yueh bfe2e6ecb3 API version will be replaced during build with the correct rv. 2016-01-03 14:28:37 +01:00
yueh 38e7e579fa Fixes #2043: Storage buses updates should happen in the correct order.
This is loosely based on #2032 and should prevent any duplicated event,
but still does a refresh the whole cache due to potentially issues with
some inventories.

It also ensures that storage buses will not announce a CellArrayUpdate
before they are fully initialized, thus no longer causing them to return
null during an update.

Fixes #2403
2016-01-03 13:23:51 +01:00
Tier 6aa91c3f65 Japanese translation files
Hello!!
As we have created a Japanese translation files , and you sure you want to got to add when it is good?
2015-12-29 17:46:20 +09:00
yueh 17bdd085b1 Merge pull request #2010 from yueh/feature-logger-refactoring
Refactored the logging
2015-12-27 12:53:01 +01:00
yueh 684cda58c2 Merge pull request #2074 from yueh/backport-1.8-cleanup
Backport some 1.8 cleanups
2015-12-27 12:50:11 +01:00
yueh 740324913e Merge pull request #2073 from yueh/fix-1905-followup
Interfaces now slow down with failed crafting attempts.
2015-12-27 12:50:01 +01:00
yueh dae5e888e9 Merge pull request #2059 from wlhlm/update-german-translation
Update and extend German translation
2015-12-27 12:49:49 +01:00
yueh a3abc7a1f0 Backport some 1.8 cleanups 2015-12-27 12:33:50 +01:00
yueh dd1ae4a9b5 Interfaces now slow down with failed crafting attempts.
Cleanup of unneeded tracking of failed attempts of MultiCraftingTracker.
Followup of #1905
2015-12-27 00:00:12 +01:00
yueh c9ef1beea1 Refactored the logging
Using LogManager instead of FMLRelaunchLog to access the logger instance.
Added logging of the name of failed exports instead of exception.
Improved crafting log to include issuer including their location and the
requested item.
Removed superfluous FMLRelaunchLog instance.
Removed superfluous parameters for PlayerData constructor.

Closes #2009
Refs #2069
2015-12-26 23:14:29 +01:00
Wilhelm Schuster 276480519e Update and extend German translation
Add translated achievements.
2015-12-20 14:23:42 +01:00
yueh 04b1ca3485 Merge pull request #2050 from XFRGod/patch-7
Update hu_HU.lang
2015-12-11 22:39:14 +01:00
yueh c14f688100 Merge pull request #1997 from thatsIch/b-1995-versionchecker-config
Fixes #1995: Allows creation of version checker config file after start up
2015-12-11 22:38:54 +01:00
yueh 8bf98919e2 Merge pull request #2053 from AppliedEnergistics/revert-2032-feature-cached-networkmonitor
Revert "Changed NetworkMonitor to update its cache."
2015-12-11 22:31:46 +01:00
yueh 1862ab3562 Revert "Changed NetworkMonitor to update its cache." 2015-12-11 22:26:21 +01:00
XFRGod df6070ecbd Update hu_HU.lang
This is a language "correction"(?) and typo fixing update for the lang file and now it's 110% localized:D
2015-12-11 16:04:16 +01:00
yueh 12cf76a62f Merge pull request #1880 from yueh/feature-rendering-cleanup
Rendering cleanup
2015-12-10 16:36:01 +01:00
yueh 919faefb15 Merge pull request #2032 from yueh/feature-cached-networkmonitor
Changed NetworkMonitor to update its cache.
2015-12-10 16:34:24 +01:00
yueh 71a9687b01 Merge pull request #2045 from yueh/fix-2044
Fixes #2044: No longer uses internal exceptions
2015-12-10 16:33:25 +01:00
yueh e877eac7bb Fixes #2044: No longer uses internal exceptions
Added 3 new exception as subclass to FailedConnection to allow a more
precise handling and/or logging.
2015-12-10 16:24:40 +01:00
yueh 0696662254 Changed NetworkMonitor to update its cache.
No longer invalidates and refresh it with every single change.
This should now also ensure that updates are send exactly once per network
instead of multiple times scaling up with the amount of chained networks.
2015-12-10 16:11:30 +01:00
yueh 1aa84945eb Merge pull request #2037 from XFRGod/patch-5
Update hu_HU.lang
2015-12-07 20:40:53 +01:00
XFRGod 88f9c8ba40 Update hu_HU.lang
Okay now it's absolutely 100% done and I'm officially dead.
Onto EnderIO and Botania then!
2015-12-06 21:36:53 +01:00
yueh 0ed1054aad Merge pull request #2035 from XFRGod/patch-3
Update hu_HU.lang
2015-12-06 16:55:53 +01:00
XFRGod 11f92f6888 Update hu_HU.lang 2015-12-06 16:49:45 +01:00
yueh b0d3a6c743 Merge pull request #2022 from yueh/feature-revert-itemlist-changes
Reverts some of the changes to ItemList.
2015-12-06 14:36:45 +01:00
yueh b252d1f269 Merge pull request #2028 from yueh/fix-2027
Fixes 2027: TinyTNT not triggered by flint&steel.
2015-12-06 14:36:09 +01:00
yueh d4692128a5 Merge pull request #2031 from yueh/e-gridconnection-better-logging
Exception during GridConnection now reports the machine and side.
2015-12-06 14:35:54 +01:00
yueh 599e6f3e64 Exception during GridConnection now reports the machine and side. 2015-11-30 12:55:47 +01:00
yueh 478d400627 Fixes 2027: TinyTNT not triggered by flint&steel. 2015-11-29 18:21:05 +01:00
yueh fbfd13d163 Reverts some of the changes to ItemList.
Removes the split collection as in some rare corner cases the insertion
order is important to maintain the correct data in terms of self cleaning.

Keeps the general cleanups and split of Fluid/ItemList.

Fixes #1964
2015-11-28 11:12:31 +01:00
Mazdallier 5bb0ac7833 Update fr_FR.lang
thanks Pyeroh
2015-11-17 10:27:12 +01:00
yueh 8b4a39085e Fixes #1998: Using the correct culling mode and rotation
Blocks are now rendered with the correct culling mode and rotated similar
to the icon itself, but slightly shifted to the left that the front
texture appears larger (This applies to items following the normal
minecraft rotation like furnaces)

Items are also now rotated a bit differently and more in line with their
item rendering as well as longer being mirror inverted.
2015-11-16 11:31:02 +01:00
yueh d5dfc31210 Rendering cleanup
Replaces the reflexive instantiation of the Renderes with a factory
method.

Some optimizations to the renderers to no longer push the whole OpenGL state to the stack.

General cleanup of duplicate code, etc
2015-11-16 10:52:20 +01:00
yueh 824ec1eccb Merge pull request #1986 from yueh/fix-1983
Fixes #1983: WorldData cleared too early when still needed.
2015-11-16 10:51:05 +01:00
yueh 87eb5498f9 Merge pull request #1996 from thatsIch/b-1970-inscriber-lighting
Fixes #1970: Lighting was not re-enabled when looking at an inscriber
2015-11-16 10:50:56 +01:00
Mazdallier 55c0e6aa56 Update fr_FR.lang 2015-11-16 09:47:36 +01:00
thatsIch 8c62e1e7a6 Fixes #1995: Allows creation of version checker config file after start up 2015-11-11 21:39:29 +01:00
thatsIch 97c099c2ae Fixes #1970: Lighting was not re-enabled when looking at an inscriber 2015-11-11 21:36:53 +01:00
yueh 3c19350b9b Fixes #1983: WorldData cleared too early when still needed. 2015-11-02 12:13:09 +01:00
yueh c83946420e Merge pull request #1936 from yueh/feature-hide-fields
Make all fields private and creates necessary getters/setters
2015-10-30 19:02:00 +01:00
yueh 500fc47490 Reduces visibility of internal fields/methods
Reduces the visibility of all fields to private and create setters/getters
when necessary. Exceptions are fields with GuiSync as these need to be
public.

Reduces the visibility of internal methods to private/protected/default when possible.
2015-10-30 18:52:20 +01:00
thatsIch cb44af5e49 Merge pull request #1974 from thatsIch/b-1973-ignored-required-work
Fixes #1973: 9th slot of ME Interface ignored work
2015-10-29 09:24:43 +01:00
thatsIch c1b966eea1 Fixes #1973: 9th slot of ME Interface ignored work 2015-10-28 11:19:05 +01:00
yueh 8f1d22b863 Merge pull request #1934 from yueh/fix-1932
Fixes #1932: Better VersionChecker exception handling
2015-10-21 14:06:54 +02:00
yueh 15bcf6fbd1 Merge pull request #1957 from bakaxyf/master
Update zh_CN.lang
2015-10-17 19:21:25 +02:00
bakaxyf 1ea48fb389 Update zh_CN.lang
1728f683c3 d893e52eb0 24224a450b
2015-10-18 00:37:39 +08:00
yueh 47592bcbcb Fixes #1932: Better VersionChecker exception handling
ModVersionFetcher will now return a MissingVersion in case of an exception
instead of letting it propagate upwards.

Also added a generic try/catch to the VersionChecker itself, just in case
any unchecked exception might be triggered inside the thread and at least
not logged correctly.
2015-10-12 14:07:36 +02:00
yueh 56435199b7 Merge pull request #1891 from yueh/feature-1156
Added an option to toggle oredict substitutions for patterns.
2015-10-10 22:28:40 +02:00
yueh d615fa2dcd Merge pull request #1940 from yueh/fix-1938
Fixes #1938: UnsortedList not respecting meaningful entries.
2015-10-10 18:31:21 +02:00
yueh 614da977f9 Fixes #1938: UnsortedList not respecting meaningful entries. 2015-10-09 12:27:00 +02:00
yueh 24224a450b Added an option to toggle oredict subsitutions for patterns.
It adds a backward compatibility to convert current patterns to use
oredict by default, which should be removed with rv4 stable.

Closes #1156
2015-10-06 11:33:27 +02:00
thatsIch c14bc82a01 Merge pull request #1900 from thatsIch/export-names-to-csv
Closes #1899, Fixed #1898: Adds an easy way to export item names
2015-10-06 09:00:53 +02:00
yueh 64e4dc08d9 Merge pull request #1908 from yueh/feature-1906
Closes #1906: Using a constant time collection for cells
2015-10-05 20:38:50 +02:00
yueh 2e00a483a0 Closes #1906: Using a constant time collection for cells
Cells are only ever using precise for storing their items, thus there is
no need for a sorted collection with in general logarithmic time.
Storing them inside a HashMap for constant time is a way better solution.

Also adds an UnsortedItemList without fuzzy handling.
If anyone tries to use it, it will currently throw an
UnsupportedOperationException, Should the need arise guava Collections2
could provide a filter for it, but it is no alternative with heavy usage
of fuzzy access.

Also some code cleanup, reducing the visibility when not needed as
protected/default as well as removing actually unused methods.
2015-10-03 15:22:12 +02:00
thatsIch d52efa8f78 Merge pull request #1919 from thatsIch/e-javadoc-issues
Javadoc issues
2015-09-27 14:07:28 +02:00
thatsIch 55e373bb31 Javadoc issues 2015-09-27 11:20:01 +02:00
thatsIch db76915b7e sort modifier 2015-09-27 00:00:50 +02:00
thatsIch d5b352abda Add this qualifier 2015-09-27 00:00:34 +02:00
thatsIch 90af295750 Constant array init 2015-09-27 00:00:11 +02:00
thatsIch b004e6eb27 Javastyle array 2015-09-26 23:59:47 +02:00
thatsIch 37ae2131fe Closes #1899, Fixed #1898: Adds an easy way to export interesting information into CSV format
Mostly used for the recipe system, but can also be used for debugging purposes. Debug options needs to be ticked to use the full information gain. Recipes only require the normal localization and the specific name plus metadata.

Shifted the recipes into a recipes folder where the CSV will also reside. This will also elevate the copying of the readme to the user directory since it can reside in the recipes folder.

Fixed a bug where the copier would copy the would also copy empty folders
2015-09-26 23:15:25 +02:00
thatsIch b560382e80 Merge pull request #1913 from thatsIch/e-final-stuff
final variables and parameters
2015-09-26 23:06:46 +02:00
thatsIch 410d2f1e0d final variables and parameters
seeing some methods it does actually help to enforce the parameters
2015-09-26 21:08:18 +02:00
thatsIch e52400bf26 Merge pull request #1911 from thatsIch/e-scope-too-broad
Reduce scope of variables
2015-09-26 20:23:57 +02:00
thatsIch 0387d30d1c Reduce scope of variables 2015-09-26 20:07:51 +02:00
yueh f4ff28d2a6 Merge pull request #1877 from yueh/feature-itemlist-refactoring
ItemList refactoring
2015-09-26 19:51:47 +02:00
yueh 1bec11f616 ItemList refactoring
Splitted the ItemList and MeaningfulIterator into an item and fluid
version.
Added an IdentityHashMap as additional item layer to the ItemList for a
faster access.
Refactored FluidList, findFuzzy will now return the same fluid instead of
an empty collection.
2015-09-26 19:00:59 +02:00
yueh 9b685d5b73 Merge pull request #1915 from thatsIch/e-remove-base-module
Remove base module
2015-09-26 11:57:04 +02:00
yueh 4b984452ad Merge pull request #1914 from thatsIch/e-prefer-is-empty
prefer isEmpty over length() == 0
2015-09-26 11:56:50 +02:00
yueh b3e33b1c3b Merge pull request #1912 from thatsIch/e-replace-with-array-initializer
Replace with array initializer
2015-09-26 11:56:44 +02:00
yueh 572c2bb403 Merge pull request #1910 from thatsIch/e-redundant-type-casts
Remove redundant type casts
2015-09-26 11:56:28 +02:00
yueh 645c2b0e1c Merge pull request #1907 from yueh/fix-1905
Fixes #1905: Export bus now considers failed crafting requests
2015-09-26 11:40:38 +02:00
thatsIch 6952a2f958 Remove base module 2015-09-25 23:28:57 +02:00
thatsIch dbf84428a5 Remove unnecessary semicolon 2015-09-25 23:19:34 +02:00
thatsIch 734d50d086 prefer isEmpty over length() == 0 2015-09-25 23:18:27 +02:00
thatsIch 4b3d7c7d03 Replace with array initializer
this can be done through http://docs.oracle.com/javase/specs/jls/se6/html/arrays.html#10.6
2015-09-25 23:04:36 +02:00
thatsIch 7a220e253d Remove unused imports 2015-09-25 22:33:03 +02:00
thatsIch 80e1a2863b Remove redundant type casts 2015-09-25 22:30:38 +02:00
yueh 92331b4d2e Fixes #1905: Export bus now considers failed crafting requests
The export bus will now no longer speed up, if more than 1 of the last
crafting requests failed and slow down, if more then 5 failed.

Some code cleanup and moved the custom iterator into the helper package
as it is clearly related to the craftingtracker and not the export bus.
2015-09-25 19:58:07 +02:00
yueh bcba2329b7 Merge pull request #1902 from yueh/fix-1896
Fixes 1896: Only update a monitor if the text would change
2015-09-23 23:46:43 +02:00
yueh 597e17b52b Fixes 1896: Only update a monitor if the text would change 2015-09-23 22:28:50 +02:00
yueh 4b055a7f21 Merge pull request #1894 from yueh/update-readme
Updated README.md and CONTRIBIBUTING.md
2015-09-23 15:28:23 +02:00
yueh 759b6daa59 Merge pull request #1893 from yueh/fix-1892
Fixes incorrect handling of prioritized inventories
2015-09-23 15:28:13 +02:00
yueh e1f03db7b3 Updated README.md and CONTRIBIBUTING.md 2015-09-23 14:27:11 +02:00
yueh 72518ad977 Merge pull request #1772 from yueh/feature-1569
Feature 1569 Typesafe Integration Modules
2015-09-23 00:20:00 +02:00
yueh 21fa2718f8 Merge pull request #1879 from yueh/fix-1878
Fixes #1878: Now saves the dimensionlist correctly
2015-09-23 00:15:36 +02:00
yueh 777bec184a Fixes 1878: Now saves worlddata more reliable. 2015-09-23 00:12:53 +02:00
yueh b9d615c4ba Fixes incorrect handling of prioritized inventories
Prioritized inventories are not longer used twice for storing leftover
items and thus finally reporting twice the amount of storable items when
they are the only possible option to store something.

Also fixes import buses now respecting the amount of storable items inside
the network instead of trying to place the exported items back and failing
on any restricted inventory, potentially voiding the overflow.

Fixes #1892
2015-09-23 00:09:27 +02:00
yueh 40d339e173 Merge pull request #1888 from asd0210a/patch-3
zh_tw.lang Updated
2015-09-22 19:39:56 +02:00
asd0210a 20c1c4529a zh_tw.lang Updated 2015-09-21 10:15:20 +08:00
yueh 72399e5789 Merge pull request #1866 from yueh/fix-1865
Fixes #1865: Spawn overflow items into the world
2015-09-16 20:41:57 +02:00
yueh f303c17ae0 First iteration of making integrations typesafe 2015-09-16 15:59:33 +02:00
yueh 26f13d4109 Fixes #1865: Spawn overflow items into the world 2015-09-11 20:05:17 +02:00
yueh 0df445c6a8 Merge pull request #1862 from yueh/feature-interface-9-slots
Changed the interface to 9 slots to be consistent with every other machine
2015-09-11 20:04:29 +02:00
thatsIch 8c817b2f85 Merge pull request #1851 from thatsIch/b-1850-add-second-optional-to-grindstone
Fixes #1850: Fixed support for second optional output of the AE2 Grindstone
2015-09-10 19:15:29 +02:00
yueh 7bd8cf3f59 Changed the interface to 9 slots to be consistent with every other machine 2015-09-08 00:19:05 +02:00
yueh 3ab6758e6c Merge pull request #1839 from yueh/fix-1833
Fixed the order craftinglinks are notified for the last item.
2015-09-05 18:00:41 +02:00
yueh 3dd948e4a4 Merge pull request #1854 from yueh/feature-recipes-refactoring
Added a missing whitespace and removed duplicate ones.
2015-09-05 18:00:22 +02:00
thatsIch 3bb9e4df97 Merge pull request #1634 from thatsIch/b-1588-wrong-oredict-name
Fixes #1588: Charged Certus Quartz Ore was given a wrong name
2015-09-03 23:50:53 +02:00
thatsIch d17f045339 Merge pull request #1852 from Mazdallier/patch-1
Update fr_FR.lang
2015-09-02 17:03:16 +02:00
yueh 5817cde56b Added a missing whitespace and removed duplicate ones. 2015-09-02 16:51:37 +02:00
Mazdallier 45d94d4c2c Update fr_FR.lang 2015-09-02 10:00:16 +02:00
thatsIch d893e52eb0 Fixes #1850: Fixed support for second optional output of the AE2 Grindstone 2015-09-01 23:58:40 +02:00
thatsIch 464a56ffc5 Fixes #1588: Charged Certus Quartz Ore was given a wrong name 2015-08-31 16:54:29 +02:00
yueh 40dcf711f6 Fixed the order craftinglinks are notified for the last item.
Fixes #1833
2015-08-28 13:29:24 +02:00
yueh 5dfca5eb93 Merge pull request #1776 from yueh/feature-1283
Closes #1283: Add custom Callable to prevent memory leaks
2015-08-22 23:22:17 +02:00
yueh 26daaf2232 Merge pull request #1805 from yueh/feature-recipes-refactoring
Reorganizes the recipes in a more reasonable way.
2015-08-22 23:21:14 +02:00
yueh c2022a7208 Reorganizes the recipes in a more reasonable way.
The recipes are now structured into multipe subfolder and split into more
distinct files, so the names are more appropriate and are better at
hinting which items the actually contain.

It also extends the RecipeResourceCopier to now handle the folder
recursively and extract all subdirectories and their files.

"import=" is currently requiring a relative path to the root directory
of the recipes. This would require a larger rewrite/refactoring, thus it
is kept for now until a potentially later changer.

This reverts splitting the oredict entries into their own directory and
moves them back into the recipes folder, as it currently is causing a
couple of issues like not being able to resolve the aliases or is not
working indev. But to keep it seperate it is now its own recipe file.

Fixes #1791
Reverts #1635
2015-08-21 12:23:20 +02:00
yueh 74c2e1fab9 Merge pull request #1823 from yueh/fix-1810
Fixes #1810: Removes a CompassReader once the world is unloaded.
2015-08-20 23:05:58 +02:00
yueh 0de7a2d83a Closes #1283: Add custom Callable to prevent memory leaks 2015-08-20 21:04:06 +02:00
yueh 517a832ac1 Fixes #1810: Removes a CompassReader once the world is unloaded.
This should no longer keep a reference to a World around and potentially
keep them loaded.
Also added a finalize() to CompassRegion to ensure the file is closed on a
GC.

Some cleanup regarding member order, final, etc
2015-08-20 19:04:33 +02:00
yueh 1ecc811559 Merge pull request #1813 from yueh/fix-1481
Fixes #1481: Not using the right itemcount in a few cases
2015-08-16 15:39:33 +02:00
yueh 7dd283cf9f Fixes 1481: Not using the right itemcount in a few cases 2015-08-16 15:32:58 +02:00
yueh a12ef1e534 Merge pull request #1807 from yueh/fix-1806
Wrong culling direction when rendering inscriber
2015-08-15 21:25:29 +02:00
yueh a567dcc026 Wrong culling direction when rendering inscriber
Fixes #1806
2015-08-15 19:48:12 +02:00
yueh 7f72ba97f0 Merge pull request #1769 from yueh/feature-1726
Closes #1726: Added Pressure P2P tunnel (PneumaticCraft)
2015-08-15 18:12:37 +02:00
yueh c3db5ef9e4 Merge pull request #1787 from thatsIch/b-1786-turkish-locale
Fixes #1786: Locale critical code now uses the english local. Fixes Turkish Problem.
2015-08-15 18:11:48 +02:00
yueh f955febb5d Merge pull request #1782 from yueh/fix-1781
Fixes #1781: Do not crash after the tileentity was removed
2015-08-15 18:10:44 +02:00
yueh 3115147edf Merge pull request #1774 from yueh/fix-1481
Fixes #1481: Updated cell itemcount when empty
2015-08-15 18:10:30 +02:00
yueh 1cec5922a0 Merge pull request #1773 from yueh/fix-1601
Fixes #1601: Do not allow 0 as stacksize for recipes
2015-08-15 18:10:21 +02:00
thatsIch 322b296639 Fixes #1786: Locale critical code now uses the english local for transmission. Fixes Turkish Problem.
Applied English Locale where localization is not expected as in internal recipe handling and IMC handling, basically which interacts with public API where we either require to enforce the incoming text with regex ([a-z0-9]) or just expect proper usage of the API, but with just using upper cases in recipe files it would break in Turkish Locale like

ALIAS

another option would have been to use `equalsIgnoreCase` in some cases, but not all applicable
2015-08-10 13:34:31 +02:00
yueh d1244f59ed Fixes #1781 Do not crash after the tileentity was removed 2015-08-08 14:14:38 +02:00
yueh 6a18102ea0 Fixes #1481: Updated cell itemcount when empty 2015-08-06 23:04:57 +02:00
yueh 300a9618b6 Fixes #1601: Do not allow 0 as stacksize for recipes 2015-08-06 22:47:24 +02:00
yueh dfb435ae7d Removed unused imports 2015-08-06 19:49:56 +02:00
yueh 1728f683c3 Closes #1726: Added Pressure P2P tunnel (PneumaticCraft) 2015-08-06 19:37:19 +02:00
yueh c0b62fd519 Added missing annotations 2015-08-06 19:08:33 +02:00
yueh 67c901966e Non static access of static members 2015-08-06 19:08:32 +02:00
yueh a5287f6779 Qualified field and method access 2015-08-06 19:08:04 +02:00
yueh 8234c6dbb5 Added missing blocks for control statements 2015-08-06 19:08:03 +02:00
yueh 9c8deac9de Code format 2015-08-06 19:08:02 +02:00
yueh c21a44d8c0 Organize imports 2015-08-06 19:06:49 +02:00
yueh 3c62734c87 Merge pull request #1770 from bakaxyf/master
Update zh_CN.lang
2015-08-06 13:25:45 +02:00
bakaxyf 5b6b14cde7 Update zh_CN.lang 2015-08-06 15:32:15 +08:00
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
1025 changed files with 28625 additions and 19793 deletions
+1
View File
@@ -8,6 +8,7 @@
!gradlew.bat
!build.gradle
!gradle.properties
!.travis.yml
# include markdowns
!README.md
+16
View File
@@ -0,0 +1,16 @@
language: java
jdk:
- oraclejdk8
- oraclejdk7
- openjdk7
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
install: "./gradlew setupCIWorkspace"
script: "./gradlew build test"
+29 -16
View File
@@ -11,20 +11,32 @@ top of things.
Applied Energistics 2 crashing, have a suggestion, found a bug? Create an issue now!
1. Make sure your issue hasn't already been answered or fixed. Also think about whether your issue is a valid one before submitting it.
2. Go to [the issues page](https://github.com/AppliedEnergistics/Applied-Energistics-2/issues)
3. Click new issue
4. Enter your Issue's title (something that summarizes your issue), and then create a detailed description of the issue.
* To help in resolving your issues please try to include the follow if applicable:
* The problem that is happening?
* What was expected?
* How to reproduce the problem?
* Server or Single Player?
* Mod Pack using and version?
* Crash log (Please make sure to use [pastebin](http://pastebin.com/) for the log file)
* Screen shots or Pictures of the problem
1. Make sure your issue has not already been answered or fixed and you are using the latest version. Also think about whether your issue is a valid one before submitting it.
2. Go to [the issues page](https://github.com/AppliedEnergistics/Applied-Energistics-2/issues) and click [new issue](https://github.com/AppliedEnergistics/Applied-Energistics-2/issues/new)
3. Enter your a title of your issue (something that summarizes your issue), and then create a detailed description of the issue.
* Do not tag it with something like `[Feature]` or `[Bug]`. When it is applicable, we will take care of it.
* The following details are required. Not including them can cause the issue to be closed.
* Forge version
* AE2 version
* Crash log, when reporting a crash (Please make sure to use [pastebin](http://pastebin.com/))
* Do not post an excerpt of what you consider important, instead:
* Post the full log
* Other mods and their version, when reporting an issue between AE and another mod
* Also consider updating these before submitting a new issue, it might be already fixed
* A detailed description of the bug or feature
* To further help in resolving your issues please try to include the follow if applicable:
* What was expected?
* How to reproduce the problem?
* This is usually a great detail and allows us to fix it way faster
* Server or Single Player?
* Screen shots or Pictures of the problem
* Mod Pack using and version?
* Keep in mind that some mods might use an outdated version of AE2
* If so you should report it to your modpack
5. Click `Submit New Issue`, and wait for feedback!
Providing as many details as possible does help us to find and resolve the issue faster and also you getting a fixed version as fast as possible.
### Submitting Changes
* Submit an issue to the github project, assuming one does not already exist.
@@ -55,10 +67,8 @@ Applied Energistics 2 crashing, have a suggestion, found a bug? Create an issue
from our issue tracker. The body describes the behavior without the patch,
why this is a problem, and how the patch fixes the problem when applied.
````
* Always fully test your changes. If they are large engouh in scope, then fully
test AE2.
* Describing the process you used to test your changes in detail will help speed
up this process.
* Always fully test your changes. If they are large engouh in scope, then fully test AE2.
* Describing the process you used to test your changes in detail will help speed up this process.
## Making Trivial Changes
@@ -97,6 +107,9 @@ the styling guidelines used by AE.
PRs that do not conform to these standards will be rejected.
You can find presets for Eclipse and IntelliJ IDEA in the `codeformat` folder.
We try to keep them up to date, but in case you find them not formatting it correctly, then please report it
### Whitespace
#### Tabs or spaces
+44 -22
View File
@@ -1,6 +1,6 @@
[![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)
[![Latest Build](https://img.shields.io/teamcity/http/ci.tsr.me/s/AppliedEnergistics_AutoHeadBuild.svg?label=Latest Build&style=flat-square)](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&style=flat-square)](https://github.com/AppliedEnergistics/Applied-Energistics-2/tags)
[![Latest Release](https://img.shields.io/github/release/AppliedEnergistics/Applied-Energistics-2.svg?label=Latest Release&style=flat-square)](https://github.com/AppliedEnergistics/Applied-Energistics-2/releases)
# Applied Energistics 2
@@ -32,15 +32,15 @@ A Mod about Matter, Energy and using them to conquer the world..
* 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)
- [![License](https://img.shields.io/badge/License-MIT-red.svg?style=flat-square)](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)
- [![License](https://img.shields.io/badge/License-LGPLv3-blue.svg?style=flat-square)](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/)
- [![License](https://img.shields.io/badge/License-CC%20BY--NC--SA%203.0-yellow.svg?style=flat-square)](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/)
- [![License](https://img.shields.io/badge/License-No%20Restriction-green.svg?style=flat-square)](https://creativecommons.org/publicdomain/zero/1.0/)
## Downloads
@@ -54,20 +54,32 @@ You install this mod by putting it into the `minecraft/mods/` folder. It has no
Applied Energistics 2 crashing, have a suggestion, found a bug? Create an issue now!
1. Make sure your issue hasn't already been answered or fixed. Also think about whether your issue is a valid one before submitting it.
2. Go to [the issues page](https://github.com/AppliedEnergistics/Applied-Energistics-2/issues)
3. Click new issue
4. Enter your Issue's title (something that summarizes your issue), and then create a detailed description of the issue.
* To help in resolving your issues please try to include the follow if applicable:
* The problem that is happening?
* What was expected?
* How to reproduce the problem?
* Server or Single Player?
* Mod Pack using and version?
* Crash log (Please make sure to use [pastebin](http://pastebin.com/) for the log file)
* Screen shots or Pictures of the problem
1. Make sure your issue has not already been answered or fixed and you are using the latest version. Also think about whether your issue is a valid one before submitting it.
2. Go to [the issues page](https://github.com/AppliedEnergistics/Applied-Energistics-2/issues) and click [new issue](https://github.com/AppliedEnergistics/Applied-Energistics-2/issues/new)
3. Enter your a title of your issue (something that summarizes your issue), and then create a detailed description of the issue.
* Do not tag it with something like `[Feature]` or `[Bug]`. When it is applicable, we will take care of it.
* The following details are required. Not including them can cause the issue to be closed.
* Forge version
* AE2 version
* Crash log, when reporting a crash (Please make sure to use [pastebin](http://pastebin.com/))
* Do not post an excerpt of what you consider important, instead:
* Post the full log
* Other mods and their version, when reporting an issue between AE and another mod
* Also consider updating these before submitting a new issue, it might be already fixed
* A detailed description of the bug or feature
* To further help in resolving your issues please try to include the follow if applicable:
* What was expected?
* How to reproduce the problem?
* This is usually a great detail and allows us to fix it way faster
* Server or Single Player?
* Screen shots or Pictures of the problem
* Mod Pack using and version?
* Keep in mind that some mods might use an outdated version of AE2
* If so you should report it to your modpack
5. Click `Submit New Issue`, and wait for feedback!
Providing as many details as possible does help us to find and resolve the issue faster and also you getting a fixed version as fast as possible.
## Building
1. Clone this repository via
@@ -90,6 +102,8 @@ Applied Energistics 2 crashing, have a suggestion, found a bug? Create an issue
Before you want to add major changes, you might want to discuss them with us first, before wasting your time.
If you are still willing to contribute to this project, you can contribute via [Pull-Request](https://help.github.com/articles/creating-a-pull-request).
The [guidelines for contributing](https://github.com/AppliedEnergistics/Applied-Energistics-2/blob/master/CONTRIBUTING.md) contain more detailed information about topics like the used code style and should also be considered.
Here are a few things to keep in mind that will help get your PR approved.
* A PR should be focused on content. Any PRs where the changes are only syntax will be rejected.
@@ -127,7 +141,7 @@ Development and standard builds can be obtained [Here](http://ae2.ae-mod.info/Do
When compiling against the AE2 API you can use gradle dependencies, just add
dependencies {
compile "appeng:appliedenergistics2:rv_-_____-__:dev"
compile "appeng:appliedenergistics2:rv_-_____-__:dev"
}
or add the compile line to your existing dependencies task to your build.gradle
@@ -146,9 +160,17 @@ An example string would be `appeng:appliedenergistics2:rv2-alpha-30:dev`
Files must be encoded as UTF-8.
### New Translations
### New or updated 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).
The language files are located in `/src/main/resources/assets/appliedenergistics2/lang/` and use the [appropriate locale code](http://minecraft.gamepedia.com/Language) as name and `.lang` as extension.
To update an translation edit the corresponding file and improve/correct the existing entry. Or copy any entries from `en_US.lang` for missing translation.
To create a new translation, copy the contents of `en_US.lang`, create a new file with appropriate filename, and translate it to your language.
Please keep in mind that we use [String format](https://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html) to pass additional data to the text for displaying.
Therefore you should preserve parts like `%s` or `%1$d%%`, which allows us to replace them with the correct values while you still have the option to change their order for match the rules of grammar.
This might not be possible for some languages. Should this be the case, please contact us.
### Final Note
+5 -5
View File
@@ -45,10 +45,6 @@ buildscript {
}
}
configurations.all {
resolutionStrategy.cacheDynamicVersionsFor 7200, 'hours'
}
sourceCompatibility = JavaVersion.VERSION_1_6
targetCompatibility = JavaVersion.VERSION_1_6
@@ -82,8 +78,12 @@ minecraft {
version = minecraft_version + "-" + forge_version
replaceIn "AEConfig.java"
replaceIn "package-info.java"
replace "@version@", project.version
replace "@aeversion@", aeversion
replace "@aechannel@", aechannel
replace "@aebuild@", aebuild
// used when launching minecraft in dev env
runDir = "run"
@@ -98,7 +98,7 @@ sourceSets {
resources {
srcDir "src/main/resources/"
include "assets/appliedenergistics2/recipes/*.recipe",
include "assets/appliedenergistics2/recipes/**/*.recipe",
"assets/appliedenergistics2/recipes/README.html",
"assets/appliedenergistics2/lang/*.lang",
"assets/appliedenergistics2/textures/blocks/*",
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
+12 -11
View File
@@ -1,5 +1,5 @@
aeversion=rv2
aechannel=stable
aeversion=rv3
aechannel=alpha
aebuild=0
aegroup=appeng
aebasename=appliedenergistics2
@@ -8,15 +8,15 @@ aebasename=appliedenergistics2
# Versions #
#########################################################
minecraft_version=1.7.10
forge_version=10.13.2.1291
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.33
translocator_version=1.1.1.14
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
@@ -29,12 +29,13 @@ invtweaks_version=1.58
#########################################################
# Provided APIs #
#########################################################
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
opencomputers_version=1.5.9.21
fmp_version=1.2.0.345
code_chicken_lib_version=1.1.3.138
code_chicken_core_version=1.0.7.47
nei_version=1.0.5.111
bc_version=7.0.9
opencomputers_version=1.5.12.26
pneumaticcraft_version=1.9.15-105
#########################################################
# Self Compiled APIs #
+13 -1
View File
@@ -1,3 +1,4 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
@@ -55,6 +56,16 @@ repositories {
url = "http://maven.cil.li/"
}
maven {
name = "MM repo"
url = "http://maven.k-4u.nl/"
}
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"
@@ -103,6 +114,7 @@ dependencies {
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"
compile "pneumaticCraft:PneumaticCraft-${minecraft_version}:${pneumaticcraft_version}:api"
// provided APIs
compile "li.cil.oc:OpenComputers:MC${minecraft_version}-${opencomputers_version}:api"
@@ -123,5 +135,5 @@ dependencies {
compile(group: 'api', name: 'railcraft', version: "${api_railcraft_version}")
compile(group: 'api', name: 'rf', version: "${api_rf_version}")
testCompile "junit:junit:4.11"
testCompile "junit:junit:4.12"
}
+2 -2
View File
@@ -1,6 +1,6 @@
#Sat May 16 13:19:14 CEST 2015
#Tue Sep 01 22:00:39 CEST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
+3 -3
View File
@@ -51,15 +51,15 @@ public enum AEApi
HELD_API = (IAppEngApi) apiField.get( apiClass );
}
catch( ClassNotFoundException e )
catch( final ClassNotFoundException e )
{
throw new CoreInaccessibleException( "AE2 API tried to access the " + CORE_API_FQN + " class, without it being declared." );
}
catch( NoSuchFieldException e )
catch( final NoSuchFieldException e )
{
throw new CoreInaccessibleException( "AE2 API tried to access the " + CORE_API_FIELD + " field in " + CORE_API_FQN + " without it being declared." );
}
catch( IllegalAccessException e )
catch( final IllegalAccessException e )
{
throw new CoreInaccessibleException( "AE2 API tried to access the " + CORE_API_FIELD + " field in " + CORE_API_FQN + " without enough access permissions." );
}
@@ -30,22 +30,22 @@ public enum AccessRestriction
private final int permissionBit;
AccessRestriction( int v )
AccessRestriction( final int v )
{
this.permissionBit = v;
}
public boolean hasPermission( AccessRestriction ar )
public boolean hasPermission( final AccessRestriction ar )
{
return ( this.permissionBit & ar.permissionBit ) == ar.permissionBit;
}
public AccessRestriction restrictPermissions( AccessRestriction ar )
public AccessRestriction restrictPermissions( final AccessRestriction ar )
{
return this.getPermByBit( this.permissionBit & ar.permissionBit );
}
private AccessRestriction getPermByBit( int bit )
private AccessRestriction getPermByBit( final int bit )
{
switch( bit )
{
@@ -61,12 +61,12 @@ public enum AccessRestriction
}
}
public AccessRestriction addPermissions( AccessRestriction ar )
public AccessRestriction addPermissions( final AccessRestriction ar )
{
return this.getPermByBit( this.permissionBit | ar.permissionBit );
}
public AccessRestriction removePermissions( AccessRestriction ar )
public AccessRestriction removePermissions( final AccessRestriction ar )
{
return this.getPermByBit( this.permissionBit & ( ~ar.permissionBit ) );
}
@@ -32,13 +32,13 @@ public enum FuzzyMode
public final float breakPoint;
public final float percentage;
FuzzyMode( float p )
FuzzyMode( final float p )
{
this.percentage = p;
this.breakPoint = p / 100.0f;
}
public int calculateBreakPoint( int maxDamage )
public int calculateBreakPoint( final int maxDamage )
{
return (int) ( ( this.percentage * maxDamage ) / 100.0f );
}
@@ -0,0 +1,30 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 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.config;
public enum ItemSubstitution
{
ENABLED, DISABLED;
}
@@ -33,12 +33,12 @@ public enum PowerMultiplier
*/
public double multiplier = 1.0;
public double multiply( double in )
public double multiply( final double in )
{
return in * this.multiplier;
}
public double divide( double in )
public double divide( final double in )
{
return in / this.multiplier;
}
@@ -41,7 +41,7 @@ public enum PowerUnits
*/
public double conversionRatio = 1.0;
PowerUnits( String un )
PowerUnits( final String un )
{
this.unlocalizedName = un;
}
@@ -58,7 +58,7 @@ public enum PowerUnits
*
* @return value converted to target units, from this units.
*/
public double convertTo( PowerUnits target, double value )
public double convertTo( final PowerUnits target, final double value )
{
return ( value * this.conversionRatio ) / target.conversionRatio;
}
@@ -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
}
+5 -3
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 )
Settings( @Nonnull final EnumSet<? extends Enum<?>> possibleOptions )
{
if ( possibleOptions.isEmpty() )
if( possibleOptions.isEmpty() )
{
throw new IllegalArgumentException( "Tried to instantiate an empty setting." );
}
@@ -34,5 +34,6 @@ public enum TunnelType
ITEM, // Item Tunnel
LIGHT, // Light Tunnel
BUNDLED_REDSTONE, // Bundled Redstone Tunnel
COMPUTER_MESSAGE // Computer Message Tunnel
COMPUTER_MESSAGE, // Computer Message Tunnel
PRESSURE // PneumaticCraft Tunnel
}
+5 -5
View File
@@ -59,7 +59,7 @@ public enum Upgrades
@Deprecated
private final Map<ItemStack, Integer> supportedMax = new HashMap<ItemStack, Integer>();
Upgrades( int tier )
Upgrades( final int tier )
{
this.tier = tier;
}
@@ -78,10 +78,10 @@ public enum Upgrades
* @param item machine in which this upgrade can be installed
* @param maxSupported amount how many upgrades can be installed
*/
public void registerItem( IItemDefinition item, int maxSupported )
public void registerItem( final IItemDefinition item, final int maxSupported )
{
final Optional<ItemStack> maybeStack = item.maybeStack( 1 );
for( ItemStack stack : maybeStack.asSet() )
for( final ItemStack stack : maybeStack.asSet() )
{
this.registerItem( stack, maxSupported );
}
@@ -93,7 +93,7 @@ public enum Upgrades
* @param stack machine in which this upgrade can be installed
* @param maxSupported amount how many upgrades can be installed
*/
public void registerItem( ItemStack stack, int maxSupported )
public void registerItem( final ItemStack stack, final int maxSupported )
{
if( stack != null )
{
@@ -110,7 +110,7 @@ public enum Upgrades
* @deprecated use {@link Upgrades#registerItem(IItemDefinition, int)}
*/
@Deprecated
public void registerItem( AEItemDefinition item, int maxSupported )
public void registerItem( final AEItemDefinition item, final int maxSupported )
{
if( item != null )
{
@@ -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();
}
@@ -86,6 +86,8 @@ public interface IParts
IItemDefinition p2PTunnelOpenComputers();
IItemDefinition p2PTunnelPneumaticCraft();
IItemDefinition cableAnchor();
IItemDefinition monitor();
@@ -40,7 +40,7 @@ public class LocatableEventAnnounce extends Event
public final ILocatable target;
public final LocatableEvent change;
public LocatableEventAnnounce( ILocatable o, LocatableEvent ev )
public LocatableEventAnnounce( final ILocatable o, final LocatableEvent ev )
{
this.target = o;
this.change = ev;
@@ -29,7 +29,7 @@ public class AppEngException extends Exception
private static final long serialVersionUID = -9051434206368465494L;
public AppEngException( String t )
public AppEngException( final String t )
{
super( t );
}
@@ -3,7 +3,7 @@ package appeng.api.exceptions;
public class CoreInaccessibleException extends RuntimeException
{
public CoreInaccessibleException( String message )
public CoreInaccessibleException( final String message )
{
super( message );
}
@@ -0,0 +1,56 @@
/*
* 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.exceptions;
import appeng.api.networking.IGridNode;
/**
* Exception occurred because of an already existing connection between the two {@link IGridNode}s
*
* Intended to signal an internal exception and not intended to be thrown by
* any 3rd party module.
*
* @author yueh
* @version rv3
* @since rv3
*/
public class ExistingConnectionException extends FailedConnection
{
private static final long serialVersionUID = 2975450379720353182L;
private static final String DEFAULT_MESSAGE = "Connection between both nodes already exists.";
public ExistingConnectionException()
{
super( DEFAULT_MESSAGE );
}
public ExistingConnectionException( String message )
{
super( message );
}
}
@@ -24,6 +24,22 @@
package appeng.api.exceptions;
import appeng.api.networking.IGridNode;
/**
* Exception indicating a failed connection between two {@link IGridNode}s.
*
* Intended to signal an internal exception and not intended to be thrown by
* any 3rd party module.
*
* See any subclass for a more specific reason.
*
* @author AlgorithmX2
* @author yueh
* @version rv3
* @since rv0
*/
public class FailedConnection extends Exception
{
@@ -32,4 +48,9 @@ public class FailedConnection extends Exception
public FailedConnection()
{
}
public FailedConnection( String message )
{
super( message );
}
}
@@ -3,7 +3,7 @@ package appeng.api.exceptions;
public class MissingDefinition extends RuntimeException
{
public MissingDefinition( String message )
public MissingDefinition( final String message )
{
super( message );
}
@@ -29,7 +29,7 @@ public class MissingIngredientError extends Exception
private static final long serialVersionUID = -998858343831371697L;
public MissingIngredientError( String n )
public MissingIngredientError( final String n )
{
super( n );
}
@@ -29,7 +29,7 @@ public class ModNotInstalled extends Exception
private static final long serialVersionUID = -9052435206368425494L;
public ModNotInstalled( String t )
public ModNotInstalled( final String t )
{
super( t );
}
@@ -0,0 +1,53 @@
/*
* 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.exceptions;
/**
* Exception due to trying to connect one or more null values.
*
* Intended to signal an internal exception and not intended to be thrown by
* any 3rd party module.
*
* @author yueh
* @version rv3
* @since rv3
*/
public class NullNodeConnectionException extends FailedConnection
{
private static final long serialVersionUID = -2143719383495321764L;
private static final String DEFAULT_MESSAGE = "Connection forged between null entities.";
public NullNodeConnectionException()
{
super( DEFAULT_MESSAGE );
}
public NullNodeConnectionException( String message )
{
super( message );
}
}
@@ -29,7 +29,7 @@ public class RecipeError extends Exception
private static final long serialVersionUID = -6602870588617670262L;
public RecipeError( String n )
public RecipeError( final String n )
{
super( n );
}
@@ -29,7 +29,7 @@ public class RegistrationError extends Exception
private static final long serialVersionUID = -6602870588617670263L;
public RegistrationError( String n )
public RegistrationError( final String n )
{
super( n );
}
@@ -0,0 +1,52 @@
/*
* 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.exceptions;
/**
* Exception due to trying to connect different security realms.
*
* Intended to signal an internal exception and not intended to be thrown by
* any 3rd party module.
*
* @author yueh
* @version rv3
* @since rv3
*/
public class SecurityConnectionException extends FailedConnection
{
private static final long serialVersionUID = 5048714900434215426L;
private static final String DEFAULT_MESSAGE = "Connection failed due to different security realms.";
public SecurityConnectionException()
{
super( DEFAULT_MESSAGE );
}
public SecurityConnectionException( String message )
{
super( message );
}
}
@@ -1,8 +1,10 @@
package appeng.api.features;
import java.util.List;
import java.util.Collection;
import java.util.Set;
import javax.annotation.Nonnull;
import net.minecraft.item.ItemStack;
@@ -12,22 +14,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 +41,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 +49,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 +67,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,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
@@ -24,11 +24,19 @@
package appeng.api.features;
import javax.annotation.Nullable;
import appeng.api.recipes.ICraftHandler;
import appeng.api.recipes.IRecipeHandler;
import appeng.api.recipes.ISubItemResolver;
/**
* @author AlgorithmX2
* @author thatsIch
* @version rv3 - 10.08.2015
* @since rv0
*/
public interface IRecipeHandlerRegistry
{
@@ -37,7 +45,7 @@ public interface IRecipeHandlerRegistry
*
* MUST BE CALLED IN PRE-INIT
*
* @param name name of crafthandler
* @param name name of crafthandler
* @param handler class of crafthandler
*/
void addNewCraftHandler( String name, Class<? extends ICraftHandler> handler );
@@ -56,6 +64,7 @@ public interface IRecipeHandlerRegistry
*
* @return A recipe handler by name, returns null on failure.
*/
@Nullable
ICraftHandler getCraftHandlerFor( String name );
/**
@@ -67,9 +76,10 @@ public interface IRecipeHandlerRegistry
* resolve sub items by name.
*
* @param nameSpace namespace of item
* @param itemName full name of item
* @param itemName full name of item
*
* @return ResolverResult or ResolverResultSet
* @return ResolverResult or ResolverResultSet or null if could not resolve
*/
@Nullable
Object resolveItem( String nameSpace, String itemName );
}
@@ -33,7 +33,7 @@ public class TransitionResult
public final boolean success;
public final double energyUsage;
public TransitionResult( boolean _success, double power )
public TransitionResult( final boolean _success, final double power )
{
this.success = _success;
this.energyUsage = power;
@@ -36,7 +36,7 @@ public class MENetworkChannelChanged extends MENetworkEvent
public final IGridNode node;
public MENetworkChannelChanged( IGridNode n )
public MENetworkChannelChanged( final IGridNode n )
{
this.node = n;
}
@@ -32,7 +32,7 @@ public class MENetworkCraftingCpuChange extends MENetworkEvent
public final IGridNode node;
public MENetworkCraftingCpuChange( IGridNode n )
public MENetworkCraftingCpuChange( final IGridNode n )
{
this.node = n;
}
@@ -34,7 +34,7 @@ public class MENetworkCraftingPatternChange extends MENetworkEvent
public final ICraftingProvider provider;
public final IGridNode node;
public MENetworkCraftingPatternChange( ICraftingProvider p, IGridNode n )
public MENetworkCraftingPatternChange( final ICraftingProvider p, final IGridNode n )
{
this.provider = p;
this.node = n;
@@ -71,7 +71,7 @@ public class MENetworkEvent
*
* @param v current number of visitors
*/
public void setVisitedObjects( int v )
public void setVisitedObjects( final int v )
{
this.visited = v;
}
@@ -39,7 +39,7 @@ public class MENetworkPowerIdleChange extends MENetworkEvent
public final IGridNode node;
public MENetworkPowerIdleChange( IGridNode nodeThatChanged )
public MENetworkPowerIdleChange( final IGridNode nodeThatChanged )
{
this.node = nodeThatChanged;
}
@@ -42,7 +42,7 @@ public class MENetworkPowerStorage extends MENetworkEvent
public final IAEPowerStorage storage;
public final PowerEventType type;
public MENetworkPowerStorage( IAEPowerStorage t, PowerEventType y )
public MENetworkPowerStorage( final IAEPowerStorage t, final PowerEventType y )
{
this.storage = t;
this.type = y;
@@ -39,7 +39,7 @@ public class MENetworkSpatialEvent extends MENetworkEvent
* @param SpatialIO ( INSTANCE of the SpatialIO block )
* @param EnergyUsage ( the amount of energy that the SpatialIO uses)
*/
public MENetworkSpatialEvent( IGridHost SpatialIO, double EnergyUsage )
public MENetworkSpatialEvent( final IGridHost SpatialIO, final double EnergyUsage )
{
this.host = SpatialIO;
this.spatialEnergyUsage = EnergyUsage;
@@ -42,7 +42,7 @@ public class MENetworkStorageEvent extends MENetworkEvent
public final IMEMonitor monitor;
public final StorageChannel channel;
public MENetworkStorageEvent( IMEMonitor o, StorageChannel chan )
public MENetworkStorageEvent( final IMEMonitor o, final StorageChannel chan )
{
this.monitor = o;
this.channel = chan;
@@ -29,7 +29,7 @@ public class MachineSource extends BaseActionSource
public final IActionHost via;
public MachineSource( IActionHost v )
public MachineSource( final IActionHost v )
{
this.via = v;
}
@@ -33,7 +33,7 @@ public class PlayerSource extends BaseActionSource
public final EntityPlayer player;
public final IActionHost via;
public PlayerSource( EntityPlayer p, IActionHost v )
public PlayerSource( final EntityPlayer p, final IActionHost v )
{
this.player = p;
this.via = v;
@@ -60,7 +60,7 @@ public class TickingRequest
*/
public final boolean canBeAlerted;
public TickingRequest( int min, int max, boolean sleep, boolean alertable )
public TickingRequest( final int min, final int max, final boolean sleep, final boolean alertable )
{
this.minTickRate = min;
this.maxTickRate = max;
+1 -1
View File
@@ -21,7 +21,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
@API( apiVersion = "rv2", owner = "appliedenergistics2", provides = "appliedenergistics2|API" ) package appeng.api;
@API( apiVersion = "@aeversion@", owner = "appliedenergistics2", provides = "appliedenergistics2|API" ) package appeng.api;
import cpw.mods.fml.common.API;
@@ -33,7 +33,7 @@ public enum CableRenderMode
public final boolean transparentFacades;
public final boolean opaqueFacades;
CableRenderMode( boolean hideFacades )
CableRenderMode( final boolean hideFacades )
{
this.transparentFacades = hideFacades;
this.opaqueFacades = !hideFacades;
@@ -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 -1
View File
@@ -46,7 +46,7 @@ public abstract class LayerBase extends TileEntity // implements IPartHost
*
* @return the part for the requested side.
*/
public IPart getPart( ForgeDirection side )
public IPart getPart( final ForgeDirection side )
{
return null; // place holder.
}
@@ -55,14 +55,14 @@ public class SelectedPart
this.side = ForgeDirection.UNKNOWN;
}
public SelectedPart( IPart part, ForgeDirection side )
public SelectedPart( final IPart part, final ForgeDirection side )
{
this.part = part;
this.facade = null;
this.side = side;
}
public SelectedPart( IFacadePart facade, ForgeDirection side )
public SelectedPart( final IFacadePart facade, final ForgeDirection side )
{
this.part = null;
this.facade = facade;
@@ -34,14 +34,14 @@ public class ResolverResult
public final int damageValue;
public final NBTTagCompound compound;
public ResolverResult( String name, int damage )
public ResolverResult( final String name, final int damage )
{
this.itemName = name;
this.damageValue = damage;
this.compound = null;
}
public ResolverResult( String name, int damage, NBTTagCompound data )
public ResolverResult( final String name, final int damage, final NBTTagCompound data )
{
this.itemName = name;
this.damageValue = damage;
@@ -36,7 +36,7 @@ public class ResolverResultSet
public final String name;
public final List<ItemStack> results;
public ResolverResultSet( String myName, ItemStack... set )
public ResolverResultSet( final String myName, final ItemStack... set )
{
this.results = Arrays.asList( set );
this.name = myName;
@@ -52,32 +52,32 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
protected boolean hasChanged = true;
public MEMonitorHandler( IMEInventoryHandler<StackType> t )
public MEMonitorHandler( final IMEInventoryHandler<StackType> t )
{
this.internalHandler = t;
this.cachedList = (IItemList<StackType>) t.getChannel().createList();
}
public MEMonitorHandler( IMEInventoryHandler<StackType> t, StorageChannel chan )
public MEMonitorHandler( final IMEInventoryHandler<StackType> t, final StorageChannel chan )
{
this.internalHandler = t;
this.cachedList = (IItemList<StackType>) chan.createList();
}
@Override
public void addListener( IMEMonitorHandlerReceiver<StackType> l, Object verificationToken )
public void addListener( final IMEMonitorHandlerReceiver<StackType> l, final Object verificationToken )
{
this.listeners.put( l, verificationToken );
}
@Override
public void removeListener( IMEMonitorHandlerReceiver<StackType> l )
public void removeListener( final IMEMonitorHandlerReceiver<StackType> l )
{
this.listeners.remove( l );
}
@Override
public StackType injectItems( StackType input, Actionable mode, BaseActionSource src )
public StackType injectItems( final StackType input, final Actionable mode, final BaseActionSource src )
{
if( mode == Actionable.SIMULATE )
{
@@ -91,9 +91,9 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
return this.internalHandler;
}
private StackType monitorDifference( IAEStack original, StackType leftOvers, boolean extraction, BaseActionSource src )
private StackType monitorDifference( final IAEStack original, final StackType leftOvers, final boolean extraction, final BaseActionSource src )
{
StackType diff = (StackType) original.copy();
final StackType diff = (StackType) original.copy();
if( extraction )
{
@@ -112,19 +112,19 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
return leftOvers;
}
protected void postChangesToListeners( Iterable<StackType> changes, BaseActionSource src )
protected void postChangesToListeners( final Iterable<StackType> changes, final BaseActionSource src )
{
this.notifyListenersOfChange( changes, src );
}
protected void notifyListenersOfChange( Iterable<StackType> diff, BaseActionSource src )
protected void notifyListenersOfChange( final Iterable<StackType> diff, final BaseActionSource src )
{
this.hasChanged = true;// need to update the cache.
Iterator<Entry<IMEMonitorHandlerReceiver<StackType>, Object>> i = this.getListeners();
final Iterator<Entry<IMEMonitorHandlerReceiver<StackType>, Object>> i = this.getListeners();
while( i.hasNext() )
{
Entry<IMEMonitorHandlerReceiver<StackType>, Object> o = i.next();
IMEMonitorHandlerReceiver<StackType> receiver = o.getKey();
final Entry<IMEMonitorHandlerReceiver<StackType>, Object> o = i.next();
final IMEMonitorHandlerReceiver<StackType> receiver = o.getKey();
if( receiver.isValid( o.getValue() ) )
{
receiver.postChange( this, diff, src );
@@ -142,7 +142,7 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
}
@Override
public StackType extractItems( StackType request, Actionable mode, BaseActionSource src )
public StackType extractItems( final StackType request, final Actionable mode, final BaseActionSource src )
{
if( mode == Actionable.SIMULATE )
{
@@ -175,17 +175,17 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
}
@Override
public boolean isPrioritized( StackType input )
public boolean isPrioritized( final StackType input )
{
return this.getHandler().isPrioritized( input );
}
@Override
public boolean canAccept( StackType input )
public boolean canAccept( final StackType input )
{
return this.getHandler().canAccept( input );
} @Override
public IItemList<StackType> getAvailableItems( IItemList out )
public IItemList<StackType> getAvailableItems( final IItemList out )
{
return this.getHandler().getAvailableItems( out );
}
@@ -203,7 +203,7 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
}
@Override
public boolean validForPass( int i )
public boolean validForPass( final int i )
{
return this.getHandler().validForPass( i );
}
@@ -45,7 +45,7 @@ public enum StorageChannel
public final Class<? extends IAEStack> type;
StorageChannel( Class<? extends IAEStack> t )
StorageChannel( final Class<? extends IAEStack> t )
{
this.type = t;
}
+2 -2
View File
@@ -94,7 +94,7 @@ public enum AEColor
*/
public final int whiteVariant;
AEColor( String unlocalizedName, int blackHex, int medHex, int whiteHex )
AEColor( final String unlocalizedName, final int blackHex, final int medHex, final int whiteHex )
{
this.unlocalizedName = unlocalizedName;
this.blackVariant = blackHex;
@@ -105,7 +105,7 @@ public enum AEColor
/**
* Logic to see which colors match each other.. special handle for Transparent
*/
public boolean matches( AEColor color )
public boolean matches( final AEColor color )
{
return this == Transparent || color == Transparent || this == color;
}
@@ -37,21 +37,21 @@ public class DimensionalCoord extends WorldCoord
private final World w;
private final int dimId;
public DimensionalCoord( DimensionalCoord s )
public DimensionalCoord( final DimensionalCoord s )
{
super( s.x, s.y, s.z );
this.w = s.w;
this.dimId = s.dimId;
}
public DimensionalCoord( TileEntity s )
public DimensionalCoord( final TileEntity s )
{
super( s );
this.w = s.getWorldObj();
this.dimId = this.w.provider.dimensionId;
}
public DimensionalCoord( World _w, int _x, int _y, int _z )
public DimensionalCoord( final World _w, final int _x, final int _y, final int _z )
{
super( _x, _y, _z );
this.w = _w;
@@ -71,12 +71,12 @@ public class DimensionalCoord extends WorldCoord
}
@Override
public boolean equals( Object obj )
public boolean equals( final Object obj )
{
return obj instanceof DimensionalCoord && this.isEqual( (DimensionalCoord) obj );
}
public boolean isEqual( DimensionalCoord c )
public boolean isEqual( final DimensionalCoord c )
{
return this.x == c.x && this.y == c.y && this.z == c.z && c.w == this.w;
}
@@ -87,7 +87,7 @@ public class DimensionalCoord extends WorldCoord
return "dimension=" + this.dimId + ", " + super.toString();
}
public boolean isInWorld( World world )
public boolean isInWorld( final World world )
{
return this.w == world;
}
+17 -17
View File
@@ -39,19 +39,19 @@ public class WorldCoord
public int y;
public int z;
public WorldCoord( TileEntity s )
public WorldCoord( final TileEntity s )
{
this( s.xCoord, s.yCoord, s.zCoord );
}
public WorldCoord( int _x, int _y, int _z )
public WorldCoord( final int _x, final int _y, final int _z )
{
this.x = _x;
this.y = _y;
this.z = _z;
}
public WorldCoord subtract( ForgeDirection direction, int length )
public WorldCoord subtract( final ForgeDirection direction, final int length )
{
this.x -= direction.offsetX * length;
this.y -= direction.offsetY * length;
@@ -59,7 +59,7 @@ public class WorldCoord
return this;
}
public WorldCoord add( int _x, int _y, int _z )
public WorldCoord add( final int _x, final int _y, final int _z )
{
this.x += _x;
this.y += _y;
@@ -67,7 +67,7 @@ public class WorldCoord
return this;
}
public WorldCoord subtract( int _x, int _y, int _z )
public WorldCoord subtract( final int _x, final int _y, final int _z )
{
this.x -= _x;
this.y -= _y;
@@ -75,7 +75,7 @@ public class WorldCoord
return this;
}
public WorldCoord multiple( int _x, int _y, int _z )
public WorldCoord multiple( final int _x, final int _y, final int _z )
{
this.x *= _x;
this.y *= _y;
@@ -83,7 +83,7 @@ public class WorldCoord
return this;
}
public WorldCoord divide( int _x, int _y, int _z )
public WorldCoord divide( final int _x, final int _y, final int _z )
{
this.x /= _x;
this.y /= _y;
@@ -94,15 +94,15 @@ public class WorldCoord
/**
* Will Return NULL if it's at some diagonal!
*/
public ForgeDirection directionTo( WorldCoord loc )
public ForgeDirection directionTo( final WorldCoord loc )
{
int ox = this.x - loc.x;
int oy = this.y - loc.y;
int oz = this.z - loc.z;
final int ox = this.x - loc.x;
final int oy = this.y - loc.y;
final int oz = this.z - loc.z;
int xlen = Math.abs( ox );
int ylen = Math.abs( oy );
int zlen = Math.abs( oz );
final int xlen = Math.abs( ox );
final int ylen = Math.abs( oy );
final int zlen = Math.abs( oz );
if( loc.isEqual( this.copy().add( ForgeDirection.EAST, xlen ) ) )
{
@@ -137,12 +137,12 @@ public class WorldCoord
return null;
}
public boolean isEqual( WorldCoord c )
public boolean isEqual( final WorldCoord c )
{
return this.x == c.x && this.y == c.y && this.z == c.z;
}
public WorldCoord add( ForgeDirection direction, int length )
public WorldCoord add( final ForgeDirection direction, final int length )
{
this.x += direction.offsetX * length;
this.y += direction.offsetY * length;
@@ -162,7 +162,7 @@ public class WorldCoord
}
@Override
public boolean equals( Object obj )
public boolean equals( final Object obj )
{
return obj instanceof WorldCoord && this.isEqual( (WorldCoord) obj );
}
+69 -80
View File
@@ -61,6 +61,7 @@ import appeng.core.features.IAEFeature;
import appeng.core.features.IFeatureHandler;
import appeng.helpers.AEGlassMaterial;
import appeng.helpers.ICustomCollision;
import appeng.tile.AEBaseTile;
import appeng.util.LookDirection;
import appeng.util.Platform;
@@ -75,9 +76,9 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
protected boolean isInventory = false;
private IFeatureHandler handler;
@SideOnly( Side.CLIENT )
BlockRenderInfo renderInfo;
private BlockRenderInfo renderInfo;
protected AEBaseBlock( Material mat )
protected AEBaseBlock( final Material mat )
{
this( mat, Optional.<String>absent() );
this.setLightOpacity( 255 );
@@ -86,7 +87,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
this.setHarvestLevel( "pickaxe", 0 );
}
protected AEBaseBlock( Material mat, Optional<String> subName )
protected AEBaseBlock( final Material mat, final Optional<String> subName )
{
super( mat );
@@ -132,35 +133,29 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
return this.renderInfo;
}
try
{
final BaseBlockRender renderer = this.getRenderer().newInstance();
this.renderInfo = new BlockRenderInfo( renderer );
final BaseBlockRender<? extends AEBaseBlock, ? extends AEBaseTile> renderer = this.getRenderer();
this.renderInfo = new BlockRenderInfo( renderer );
return this.renderInfo;
}
catch( InstantiationException e )
{
throw new IllegalStateException( "Failed to create a new instance of an illegal class " + this.getRenderer(), e );
}
catch( IllegalAccessException e )
{
throw new IllegalStateException( "Failed to create a new instance of " + this.getRenderer() + " because of permissions.", e );
}
return this.renderInfo;
}
/**
* Factory method to create a new render instance.
*
* @return the newly created instance.
*/
@SideOnly( Side.CLIENT )
protected Class<? extends BaseBlockRender> getRenderer()
protected BaseBlockRender<? extends AEBaseBlock, ? extends AEBaseTile> getRenderer()
{
return BaseBlockRender.class;
return new BaseBlockRender<AEBaseBlock, AEBaseTile>();
}
public IIcon unmappedGetIcon( IBlockAccess w, int x, int y, int z, int s )
IIcon unmappedGetIcon( final IBlockAccess w, final int x, final int y, final int z, final int s )
{
return super.getIcon( w, x, y, z, s );
}
protected void setFeature( EnumSet<AEFeature> f )
protected void setFeature( final EnumSet<AEFeature> f )
{
final AEBlockFeatureHandler featureHandler = new AEBlockFeatureHandler( f, this, this.featureSubName );
this.setHandler( featureHandler );
@@ -172,7 +167,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
return this.handler;
}
protected final void setHandler( IFeatureHandler handler )
protected final void setHandler( final IFeatureHandler handler )
{
this.handler = handler;
}
@@ -202,19 +197,19 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
}
@Override
public IIcon getIcon( IBlockAccess w, int x, int y, int z, int s )
public IIcon getIcon( final IBlockAccess w, final int x, final int y, final int z, final int s )
{
return this.getIcon( this.mapRotation( w, x, y, z, s ), w.getBlockMetadata( x, y, z ) );
}
@Override
@SideOnly( Side.CLIENT )
public IIcon getIcon( int direction, int metadata )
public IIcon getIcon( final int direction, final int metadata )
{
return this.getRendererInstance().getTexture( ForgeDirection.getOrientation( direction ) );
}
protected ICustomCollision getCustomCollision( World w, int x, int y, int z )
protected ICustomCollision getCustomCollision( final World w, final int x, final int y, final int z )
{
if( this instanceof ICustomCollision )
{
@@ -226,15 +221,15 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
@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 )
public void addCollisionBoxesToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List out, final Entity e )
{
final ICustomCollision collisionHandler = this.getCustomCollision( w, x, y, z );
if( collisionHandler != null && bb != null )
{
List<AxisAlignedBB> tmp = new ArrayList<AxisAlignedBB>();
final List<AxisAlignedBB> tmp = new ArrayList<AxisAlignedBB>();
collisionHandler.addCollidingBlockToList( w, x, y, z, bb, tmp, e );
for( AxisAlignedBB b : tmp )
for( final AxisAlignedBB b : tmp )
{
b.minX += x;
b.minY += y;
@@ -256,7 +251,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
@Override
@SideOnly( Side.CLIENT )
public final AxisAlignedBB getSelectedBoundingBoxFromPool( World w, int x, int y, int z )
public final AxisAlignedBB getSelectedBoundingBoxFromPool( final World w, final int x, final int y, final int z )
{
final ICustomCollision collisionHandler = this.getCustomCollision( w, x, y, z );
@@ -272,19 +267,19 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
double lastDist = 0;
for( AxisAlignedBB bb : bbs )
for( final AxisAlignedBB bb : bbs )
{
this.setBlockBounds( (float) bb.minX, (float) bb.minY, (float) bb.minZ, (float) bb.maxX, (float) bb.maxY, (float) bb.maxZ );
MovingObjectPosition r = super.collisionRayTrace( w, x, y, z, ld.a, ld.b );
final MovingObjectPosition r = super.collisionRayTrace( w, x, y, z, ld.getA(), ld.getB() );
this.setBlockBounds( 0, 0, 0, 1, 1, 1 );
if( r != null )
{
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 xLen = ( ld.getA().xCoord - r.hitVec.xCoord );
final double yLen = ( ld.getA().yCoord - r.hitVec.yCoord );
final double zLen = ( ld.getA().zCoord - r.hitVec.zCoord );
final double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
@@ -305,7 +300,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
final AxisAlignedBB b = AxisAlignedBB.getBoundingBox( 16d, 16d, 16d, 0d, 0d, 0d );
for( AxisAlignedBB bx : collisionHandler.getSelectedBoundingBoxesFromPool( w, x, y, z, null, false ) )
for( final AxisAlignedBB bx : collisionHandler.getSelectedBoundingBoxesFromPool( w, x, y, z, null, false ) )
{
final double minX = Math.min( b.minX, bx.minX );
final double minY = Math.min( b.minY, bx.minY );
@@ -332,7 +327,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
}
@Override
public MovingObjectPosition collisionRayTrace( World w, int x, int y, int z, Vec3 a, Vec3 b )
public MovingObjectPosition collisionRayTrace( final World w, final int x, final int y, final int z, final Vec3 a, final Vec3 b )
{
final ICustomCollision collisionHandler = this.getCustomCollision( w, x, y, z );
@@ -343,21 +338,21 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
double lastDist = 0;
for( AxisAlignedBB bb : bbs )
for( final AxisAlignedBB bb : bbs )
{
this.setBlockBounds( (float) bb.minX, (float) bb.minY, (float) bb.minZ, (float) bb.maxX, (float) bb.maxY, (float) bb.maxZ );
MovingObjectPosition r = super.collisionRayTrace( w, x, y, z, a, b );
final MovingObjectPosition r = super.collisionRayTrace( w, x, y, z, a, b );
this.setBlockBounds( 0, 0, 0, 1, 1, 1 );
if( r != null )
{
double xLen = ( a.xCoord - r.hitVec.xCoord );
double yLen = ( a.yCoord - r.hitVec.yCoord );
double zLen = ( a.zCoord - r.hitVec.zCoord );
final double xLen = ( a.xCoord - r.hitVec.xCoord );
final double yLen = ( a.yCoord - r.hitVec.yCoord );
final double zLen = ( a.zCoord - r.hitVec.zCoord );
double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
final double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
if( br == null || lastDist > thisDist )
{
lastDist = thisDist;
@@ -378,7 +373,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
return super.collisionRayTrace( w, x, y, z, a, b );
}
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ )
{
return false;
}
@@ -386,7 +381,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
@Override
@SideOnly( Side.CLIENT )
@SuppressWarnings( "unchecked" )
public final void getSubBlocks( Item item, CreativeTabs tabs, List itemStacks )
public final void getSubBlocks( final Item item, final CreativeTabs tabs, final List itemStacks )
{
this.getCheckedSubBlocks( item, tabs, itemStacks );
}
@@ -398,42 +393,36 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
}
@Override
public int getComparatorInputOverride( World w, int x, int y, int z, int s )
public int getComparatorInputOverride( final World w, final int x, final int y, final int z, final int s )
{
return 0;
}
@Override
@SideOnly( Side.CLIENT )
public void registerBlockIcons( IIconRegister iconRegistry )
public void registerBlockIcons( final IIconRegister iconRegistry )
{
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;
final FlippableIcon topIcon = this.optionalIcon( iconRegistry, this.getTextureName(), null );
final FlippableIcon bottomIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Bottom", topIcon );
final FlippableIcon sideIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Side", topIcon );
final FlippableIcon eastIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "East", sideIcon );
final FlippableIcon westIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "West", sideIcon );
final FlippableIcon southIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Front", sideIcon );
final FlippableIcon northIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Back", sideIcon );
this.blockIcon = topIcon = this.optionalIcon( iconRegistry, this.getTextureName(), null );
bottomIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Bottom", topIcon );
sideIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Side", topIcon );
eastIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "East", sideIcon );
westIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "West", sideIcon );
southIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Front", sideIcon );
northIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Back", sideIcon );
this.blockIcon = topIcon;
info.updateIcons( bottomIcon, topIcon, northIcon, southIcon, eastIcon, westIcon );
}
@Override
public final boolean isNormalCube( IBlockAccess world, int x, int y, int z )
public final boolean isNormalCube( final IBlockAccess world, final int x, final int y, final int z )
{
return this.isFullSize;
}
public IOrientable getOrientable( IBlockAccess w, int x, int y, int z )
public IOrientable getOrientable( final IBlockAccess w, final int x, final int y, final int z )
{
if( this instanceof IOrientableBlock )
{
@@ -443,7 +432,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
}
@Override
public final boolean rotateBlock( World w, int x, int y, int z, ForgeDirection axis )
public final boolean rotateBlock( final World w, final int x, final int y, final int z, final ForgeDirection axis )
{
final IOrientable rotatable = this.getOrientable( w, x, y, z );
@@ -481,24 +470,24 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
return false;
}
protected void customRotateBlock( IOrientable rotatable, ForgeDirection axis )
protected void customRotateBlock( final IOrientable rotatable, final ForgeDirection axis )
{
}
public boolean isValidOrientation( World w, int x, int y, int z, ForgeDirection forward, ForgeDirection up )
public boolean isValidOrientation( final World w, final int x, final int y, final int z, final ForgeDirection forward, final ForgeDirection up )
{
return true;
}
@Override
public ForgeDirection[] getValidRotations( World w, int x, int y, int z )
public ForgeDirection[] getValidRotations( final World w, final int x, final int y, final int z )
{
return new ForgeDirection[0];
}
@SideOnly( Side.CLIENT )
private FlippableIcon optionalIcon( IIconRegister ir, String name, IIcon substitute )
private FlippableIcon optionalIcon( final IIconRegister ir, final String name, IIcon substitute )
{
// if the input is an flippable IIcon find the original.
while( substitute instanceof FlippableIcon )
@@ -513,13 +502,13 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
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 );
final IResource res = Minecraft.getMinecraft().getResourceManager().getResource( resLoc );
if( res != null )
{
return new FlippableIcon( ir.registerIcon( name ) );
}
}
catch( Throwable e )
catch( final Throwable e )
{
return new FlippableIcon( substitute );
}
@@ -529,12 +518,12 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
}
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
super.getSubBlocks( item, tabs, itemStacks );
}
int mapRotation( IBlockAccess w, int x, int y, int z, int s )
private int mapRotation( final IBlockAccess w, final int x, final int y, final int z, final int s )
{
final IOrientable ori = this.getOrientable( w, x, y, z );
@@ -546,7 +535,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
return s;
}
public ForgeDirection mapRotation( IOrientable ori, ForgeDirection dir )
public ForgeDirection mapRotation( final IOrientable ori, final ForgeDirection dir )
{
// case DOWN: return bottomIcon;
// case UP: return blockIcon;
@@ -557,18 +546,18 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
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;
final int west_x = forward.offsetY * up.offsetZ - forward.offsetZ * up.offsetY;
final int west_y = forward.offsetZ * up.offsetX - forward.offsetX * up.offsetZ;
final int west_z = forward.offsetX * up.offsetY - forward.offsetY * up.offsetX;
for( ForgeDirection dx : ForgeDirection.VALID_DIRECTIONS )
ForgeDirection west = ForgeDirection.UNKNOWN;
for( final ForgeDirection dx : ForgeDirection.VALID_DIRECTIONS )
{
if( dx.offsetX == west_x && dx.offsetY == west_y && dx.offsetZ == west_z )
{
@@ -607,17 +596,17 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
}
@SideOnly( Side.CLIENT )
public void setRenderStateByMeta( int itemDamage )
public void setRenderStateByMeta( final int itemDamage )
{
}
public String getUnlocalizedName( ItemStack is )
public String getUnlocalizedName( final ItemStack is )
{
return this.getUnlocalizedName();
}
public void addInformation( ItemStack is, EntityPlayer player, List<String> lines, boolean advancedItemTooltips )
void addInformation( final ItemStack is, final EntityPlayer player, final List<String> lines, final boolean advancedItemTooltips )
{
}
+10 -11
View File
@@ -49,7 +49,7 @@ public class AEBaseItemBlock extends ItemBlock
private final AEBaseBlock blockType;
public AEBaseItemBlock( Block id )
public AEBaseItemBlock( final Block id )
{
super( id );
this.blockType = (AEBaseBlock) id;
@@ -62,7 +62,7 @@ public class AEBaseItemBlock extends ItemBlock
}
@Override
public int getMetadata( int dmg )
public int getMetadata( final int dmg )
{
if( this.hasSubtypes )
{
@@ -74,37 +74,35 @@ public class AEBaseItemBlock extends ItemBlock
@Override
@SideOnly( Side.CLIENT )
@SuppressWarnings( "unchecked" )
public final void addInformation( ItemStack itemStack, EntityPlayer player, List toolTip, boolean advancedTooltips )
public final void addInformation( final ItemStack itemStack, final EntityPlayer player, final List toolTip, final boolean advancedTooltips )
{
this.addCheckedInformation( itemStack, player, toolTip, advancedTooltips );
}
@SideOnly( Side.CLIENT )
public void addCheckedInformation( ItemStack itemStack, EntityPlayer player, List<String> toolTip, boolean advancedToolTips )
public void addCheckedInformation( final ItemStack itemStack, final EntityPlayer player, final List<String> toolTip, final boolean advancedToolTips )
{
this.blockType.addInformation( itemStack, player, toolTip, advancedToolTips );
}
@Override
public boolean isBookEnchantable( ItemStack itemstack1, ItemStack itemstack2 )
public boolean isBookEnchantable( final ItemStack itemstack1, final ItemStack itemstack2 )
{
return false;
}
@Override
public String getUnlocalizedName( ItemStack is )
public String getUnlocalizedName( final ItemStack is )
{
return this.blockType.getUnlocalizedName( is );
}
@Override
public boolean placeBlockAt( ItemStack stack, EntityPlayer player, World w, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata )
public boolean placeBlockAt( final ItemStack stack, final EntityPlayer player, final World w, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ, final int metadata )
{
ForgeDirection up = ForgeDirection.UNKNOWN;
ForgeDirection forward = ForgeDirection.UNKNOWN;
IOrientable ori = null;
if( this.blockType instanceof AEBaseTileBlock )
{
if( this.blockType instanceof BlockLightDetector )
@@ -135,7 +133,7 @@ public class AEBaseItemBlock extends ItemBlock
{
up = ForgeDirection.UP;
byte rotation = (byte) ( MathHelper.floor_double( ( player.rotationYaw * 4F ) / 360F + 2.5D ) & 3 );
final byte rotation = (byte) ( MathHelper.floor_double( ( player.rotationYaw * 4F ) / 360F + 2.5D ) & 3 );
switch( rotation )
{
@@ -167,6 +165,7 @@ public class AEBaseItemBlock extends ItemBlock
}
}
IOrientable ori = null;
if( this.blockType instanceof IOrientableBlock )
{
ori = ( (IOrientableBlock) this.blockType ).getOrientable( w, x, y, z );
@@ -187,7 +186,7 @@ public class AEBaseItemBlock extends ItemBlock
{
if( this.blockType instanceof AEBaseTileBlock && !( this.blockType instanceof BlockLightDetector ) )
{
AEBaseTile tile = ( (AEBaseTileBlock) this.blockType ).getTileEntity( w, x, y, z );
final AEBaseTile tile = ( (AEBaseTileBlock) this.blockType ).getTileEntity( w, x, y, z );
ori = tile;
if( tile == null )
@@ -42,18 +42,18 @@ import appeng.util.Platform;
public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEItemPowerStorage
{
public AEBaseItemBlockChargeable( Block id )
public AEBaseItemBlockChargeable( final Block id )
{
super( id );
}
@Override
@SideOnly( Side.CLIENT )
public void addCheckedInformation( ItemStack itemStack, EntityPlayer player, List<String> toolTip, boolean advancedTooltips )
public void addCheckedInformation( final ItemStack itemStack, final EntityPlayer player, final List<String> toolTip, final boolean advancedTooltips )
{
final NBTTagCompound tag = itemStack.getTagCompound();
double internalCurrentPower = 0;
double internalMaxPower = this.getMaxEnergyCapacity();
final double internalMaxPower = this.getMaxEnergyCapacity();
if( tag != null )
{
@@ -69,7 +69,7 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
{
final Block blockID = Block.getBlockFromItem( this );
final IBlockDefinition energyCell = Api.INSTANCE.definitions().blocks().energyCell();
for( Block block : energyCell.maybeBlock().asSet() )
for( final Block block : energyCell.maybeBlock().asSet() )
{
if( blockID == block )
{
@@ -85,10 +85,10 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
}
@Override
public double injectAEPower( ItemStack is, double amt )
public double injectAEPower( final ItemStack is, double amt )
{
double internalCurrentPower = this.getInternal( is );
double internalMaxPower = this.getMaxEnergyCapacity();
final double internalMaxPower = this.getMaxEnergyCapacity();
internalCurrentPower += amt;
if( internalCurrentPower > internalMaxPower )
{
@@ -102,20 +102,20 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
return 0;
}
private double getInternal( ItemStack is )
private double getInternal( final ItemStack is )
{
final NBTTagCompound nbt = Platform.openNbtData( is );
return nbt.getDouble( "internalCurrentPower" );
}
private void setInternal( ItemStack is, double amt )
private void setInternal( final ItemStack is, final double amt )
{
final NBTTagCompound nbt = Platform.openNbtData( is );
nbt.setDouble( "internalCurrentPower", amt );
}
@Override
public double extractAEPower( ItemStack is, double amt )
public double extractAEPower( final ItemStack is, double amt )
{
double internalCurrentPower = this.getInternal( is );
if( internalCurrentPower > amt )
@@ -131,19 +131,19 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
}
@Override
public double getAEMaxPower( ItemStack is )
public double getAEMaxPower( final ItemStack is )
{
return this.getMaxEnergyCapacity();
}
@Override
public double getAECurrentPower( ItemStack is )
public double getAECurrentPower( final ItemStack is )
{
return this.getInternal( is );
}
@Override
public AccessRestriction getPowerFlow( ItemStack is )
public AccessRestriction getPowerFlow( final ItemStack is )
{
return AccessRestriction.WRITE;
}
@@ -1,11 +1,15 @@
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)
public class AEBaseItemBlockSlab extends ItemSlab
{
public AEBaseItemBlockSlab( final Block block, final AEBaseSlabBlock singleSlab, final AEBaseSlabBlock doubleSlab, final Boolean isDoubleSlab )
{
super( block, singleSlab, doubleSlab, isDoubleSlab );
}
+35 -25
View File
@@ -22,15 +22,14 @@ 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;
@@ -46,7 +45,7 @@ public class AEBaseSlabBlock extends BlockSlab implements IAEFeature
private AEBaseSlabBlock doubleSlabs;
private final String name;
public AEBaseSlabBlock( AEBaseBlock block, int meta, EnumSet<AEFeature> features, boolean isDoubleSlab, String name )
public AEBaseSlabBlock( final AEBaseBlock block, final int meta, final EnumSet<AEFeature> features, final boolean isDoubleSlab, final String name )
{
super( isDoubleSlab, block.getMaterial() );
this.block = block;
@@ -57,24 +56,27 @@ public class AEBaseSlabBlock extends BlockSlab implements IAEFeature
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;
if( !this.field_150004_a )
{
this.doubleSlabs = new AEBaseSlabBlock( block, meta, features, true, name + ".double" ).setSlabs( this );
}
this.features = !this.field_150004_a ? new SlabBlockFeatureHandler( features, this ) : null;
}
public AEBaseSlabBlock setSlabs(AEBaseSlabBlock slabs)
private AEBaseSlabBlock setSlabs( final AEBaseSlabBlock slabs )
{
this.slabs = slabs;
return this;
}
public AEBaseSlabBlock slabs()
{
return slabs;
return this.slabs;
}
public AEBaseSlabBlock doubleSlabs()
{
return doubleSlabs;
return this.doubleSlabs;
}
@Override
@@ -90,40 +92,48 @@ public class AEBaseSlabBlock extends BlockSlab implements IAEFeature
}
@Override
public IIcon getIcon(int dir, int meta)
public IIcon getIcon( final int dir, final int meta )
{
return block.getIcon( dir, this.meta );
return this.block.getIcon( dir, this.meta );
}
@Override
public String func_150002_b(int p_150002_1_)
public String func_150002_b( final int p_150002_1_ )
{
return this.getUnlocalizedName();
}
@Override
public void registerBlockIcons(IIconRegister reg) { }
@Override
public Item getItemDropped(int meta, Random rand, int fortune)
public void registerBlockIcons( final IIconRegister reg )
{
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)
public Item getItemDropped( final int meta, final Random rand, final int fortune )
{
AEBaseSlabBlock block = (AEBaseSlabBlock) world.getBlock(x, y, z);
return this.field_150004_a ? Item.getItemFromBlock( this.slabs ) : Item.getItemFromBlock( this );
}
if (block == null) return null;
if (block.field_150004_a) block = this.slabs;
@Override
public ItemStack getPickBlock( final MovingObjectPosition target, final World world, final int x, final int y, final int z )
{
AEBaseSlabBlock block = (AEBaseSlabBlock) world.getBlock( x, y, z );
int meta = world.getBlockMetadata(x, y, z) & 7;
return new ItemStack(block, 1, meta);
if( block == null )
{
return null;
}
if( block.field_150004_a )
{
block = this.slabs;
}
final int meta = world.getBlockMetadata( x, y, z ) & 7;
return new ItemStack( block, 1, meta );
}
public String name()
{
return name;
return this.name;
}
}
@@ -36,7 +36,7 @@ public abstract class AEBaseStairBlock extends BlockStairs implements IAEFeature
{
private final IFeatureHandler features;
protected AEBaseStairBlock( Block block, int meta, EnumSet<AEFeature> features )
protected AEBaseStairBlock( final Block block, final int meta, final EnumSet<AEFeature> features )
{
super( block, meta );
+22 -24
View File
@@ -50,10 +50,10 @@ 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.IAEFeature;
import appeng.core.features.ItemStackSrc;
import appeng.helpers.ICustomCollision;
import appeng.tile.AEBaseTile;
import appeng.tile.networking.TileCableBus;
@@ -68,39 +68,37 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
@Nonnull
private Class<? extends TileEntity> tileEntityType;
public AEBaseTileBlock( Material mat )
public AEBaseTileBlock( final Material mat )
{
super( mat );
}
protected AEBaseTileBlock( Material mat, Optional<String> subName )
protected AEBaseTileBlock( final Material mat, final Optional<String> subName )
{
super( mat, subName );
}
@Override
protected void setFeature( EnumSet<AEFeature> f )
protected void setFeature( final EnumSet<AEFeature> f )
{
final AETileBlockFeatureHandler featureHandler = new AETileBlockFeatureHandler( f, this, this.featureSubName );
this.setHandler( featureHandler );
}
protected void setTileEntity( Class<? extends TileEntity> c )
protected void setTileEntity( final Class<? extends TileEntity> c )
{
this.tileEntityType = c;
AEBaseTile.registerTileItem( c, new ItemStackSrc( this, 0 ) );
this.isInventory = IInventory.class.isAssignableFrom( c );
this.setTileProvider( this.hasBlockTileEntity() );
}
// update Block value.
private void setTileProvider( boolean b )
private void setTileProvider( final boolean b )
{
ReflectionHelper.setPrivateValue( Block.class, this, b, "isTileProvider" );
}
public boolean hasBlockTileEntity()
private boolean hasBlockTileEntity()
{
return this.tileEntityType != null;
}
@@ -111,7 +109,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
}
@Nullable
public <T extends AEBaseTile> T getTileEntity( IBlockAccess w, int x, int y, int z )
public <T extends AEBaseTile> T getTileEntity( final IBlockAccess w, final int x, final int y, final int z )
{
if( !this.hasBlockTileEntity() )
{
@@ -128,7 +126,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
}
@Override
public final TileEntity createNewTileEntity( World var1, int var2 )
public final TileEntity createNewTileEntity( final World var1, final int var2 )
{
if( this.hasBlockTileEntity() )
{
@@ -136,11 +134,11 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
{
return this.tileEntityType.newInstance();
}
catch( InstantiationException e )
catch( final InstantiationException e )
{
throw new IllegalStateException( "Failed to create a new instance of an illegal class " + this.tileEntityType, e );
}
catch( IllegalAccessException e )
catch( final IllegalAccessException e )
{
throw new IllegalStateException( "Failed to create a new instance of " + this.tileEntityType + ", because lack of permissions", e );
}
@@ -150,7 +148,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
}
@Override
public void breakBlock( World w, int x, int y, int z, Block a, int b )
public void breakBlock( final World w, final int x, final int y, final int z, final Block a, final int b )
{
final AEBaseTile te = this.getTileEntity( w, x, y, z );
if( te != null )
@@ -174,7 +172,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
}
@Override
public final ForgeDirection[] getValidRotations( World w, int x, int y, int z )
public final ForgeDirection[] getValidRotations( final World w, final int x, final int y, final int z )
{
final AEBaseTile obj = this.getTileEntity( w, x, y, z );
if( obj != null && obj.canBeRotated() )
@@ -186,7 +184,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
}
@Override
public boolean recolourBlock( World world, int x, int y, int z, ForgeDirection side, int colour )
public boolean recolourBlock( final World world, final int x, final int y, final int z, final ForgeDirection side, final int colour )
{
final TileEntity te = this.getTileEntity( world, x, y, z );
@@ -208,7 +206,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
}
@Override
public int getComparatorInputOverride( World w, int x, int y, int z, int s )
public int getComparatorInputOverride( final World w, final int x, final int y, final int z, final int s )
{
final TileEntity te = this.getTileEntity( w, x, y, z );
if( te instanceof IInventory )
@@ -219,7 +217,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
}
@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_ )
public boolean onBlockEventReceived( final World p_149696_1_, final int p_149696_2_, final int p_149696_3_, final int p_149696_4_, final int p_149696_5_, final 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_ );
@@ -227,7 +225,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
}
@Override
public void onBlockPlacedBy( World w, int x, int y, int z, EntityLivingBase player, ItemStack is )
public void onBlockPlacedBy( final World w, final int x, final int y, final int z, final EntityLivingBase player, final ItemStack is )
{
if( is.hasDisplayName() )
{
@@ -240,7 +238,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
}
@Override
public final boolean onBlockActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
public final boolean onBlockActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ )
{
if( player != null )
{
@@ -266,7 +264,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
}
final ItemStack op = new ItemStack( this );
for( ItemStack ol : drops )
for( final ItemStack ol : drops )
{
if( Platform.isSameItemType( ol, op ) )
{
@@ -288,7 +286,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
return false;
}
if( is.getItem() instanceof IMemoryCard )
if( is.getItem() instanceof IMemoryCard && !( this instanceof BlockCableBus ) )
{
final IMemoryCard memoryCard = (IMemoryCard) is.getItem();
if( player.isSneaking() )
@@ -330,13 +328,13 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
}
@Override
public IOrientable getOrientable( IBlockAccess w, int x, int y, int z )
public IOrientable getOrientable( final IBlockAccess w, final int x, final int y, final int z )
{
return this.getTileEntity( w, x, y, z );
}
@Override
public ICustomCollision getCustomCollision( World w, int x, int y, int z )
public ICustomCollision getCustomCollision( final World w, final int x, final int y, final int z )
{
final AEBaseTile te = this.getTileEntity( w, x, y, z );
if( te instanceof ICustomCollision )
@@ -26,7 +26,7 @@ import net.minecraft.world.IBlockAccess;
public class AEDecorativeBlock extends AEBaseBlock
{
public AEDecorativeBlock( Material mat )
public AEDecorativeBlock( final Material mat )
{
super( mat );
}
@@ -38,7 +38,7 @@ public class AEDecorativeBlock extends AEBaseBlock
}
@Override
public IIcon getIcon( IBlockAccess w, int x, int y, int z, int s )
public IIcon getIcon( final IBlockAccess w, final int x, final int y, final int z, final int s )
{
return super.unmappedGetIcon( w, x, y, z, s );
}
@@ -32,7 +32,6 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.api.AEApi;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockCraftingCPUMonitor;
import appeng.client.texture.ExtraBlockTextures;
import appeng.tile.crafting.TileCraftingMonitorTile;
@@ -46,17 +45,18 @@ public class BlockCraftingMonitor extends BlockCraftingUnit
}
@Override
protected Class<? extends BaseBlockRender> getRenderer()
@SideOnly( Side.CLIENT )
protected RenderBlockCraftingCPUMonitor getRenderer()
{
return RenderBlockCraftingCPUMonitor.class;
return new RenderBlockCraftingCPUMonitor();
}
@Override
public IIcon getIcon( int direction, int metadata )
public IIcon getIcon( final int direction, final int metadata )
{
if( direction != ForgeDirection.SOUTH.ordinal() )
{
for( Block craftingUnitBlock : AEApi.instance().definitions().blocks().craftingUnit().maybeBlock().asSet() )
for( final Block craftingUnitBlock : AEApi.instance().definitions().blocks().craftingUnit().maybeBlock().asSet() )
{
return craftingUnitBlock.getIcon( direction, metadata );
}
@@ -74,7 +74,7 @@ public class BlockCraftingMonitor extends BlockCraftingUnit
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
itemStacks.add( new ItemStack( this, 1, 0 ) );
}
@@ -47,7 +47,7 @@ public class BlockCraftingStorage extends BlockCraftingUnit
}
@Override
public IIcon getIcon( int direction, int metadata )
public IIcon getIcon( final int direction, final int metadata )
{
switch( metadata & ( ~4 ) )
{
@@ -75,7 +75,7 @@ public class BlockCraftingStorage extends BlockCraftingUnit
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
itemStacks.add( new ItemStack( this, 1, 0 ) );
itemStacks.add( new ItemStack( this, 1, 1 ) );
@@ -84,7 +84,7 @@ public class BlockCraftingStorage extends BlockCraftingUnit
}
@Override
public String getUnlocalizedName( ItemStack is )
public String getUnlocalizedName( final ItemStack is )
{
if( is.getItemDamage() == 1 )
{
@@ -36,7 +36,6 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockCraftingCPU;
import appeng.client.texture.ExtraBlockTextures;
import appeng.core.features.AEFeature;
@@ -47,7 +46,7 @@ import appeng.util.Platform;
public class BlockCraftingUnit extends AEBaseTileBlock
{
public static final int FLAG_FORMED = 8;
static final int FLAG_FORMED = 8;
public BlockCraftingUnit()
{
@@ -59,13 +58,14 @@ public class BlockCraftingUnit extends AEBaseTileBlock
}
@Override
protected Class<? extends BaseBlockRender> getRenderer()
@SideOnly( Side.CLIENT )
protected RenderBlockCraftingCPU<? extends BlockCraftingUnit, ? extends TileCraftingTile> getRenderer()
{
return RenderBlockCraftingCPU.class;
return new RenderBlockCraftingCPU<BlockCraftingUnit, TileCraftingTile>();
}
@Override
public IIcon getIcon( int direction, int metadata )
public IIcon getIcon( final int direction, final int metadata )
{
switch( metadata )
{
@@ -82,9 +82,9 @@ public class BlockCraftingUnit extends AEBaseTileBlock
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
{
TileCraftingTile tg = this.getTileEntity( w, x, y, z );
final TileCraftingTile tg = this.getTileEntity( w, x, y, z );
if( tg != null && !p.isSneaking() && tg.isFormed() && tg.isActive() )
{
if( Platform.isClient() )
@@ -101,24 +101,24 @@ public class BlockCraftingUnit extends AEBaseTileBlock
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
itemStacks.add( new ItemStack( this, 1, 0 ) );
itemStacks.add( new ItemStack( this, 1, 1 ) );
}
@Override
public void setRenderStateByMeta( int itemDamage )
public void setRenderStateByMeta( final int itemDamage )
{
IIcon front = this.getIcon( ForgeDirection.SOUTH.ordinal(), itemDamage );
IIcon other = this.getIcon( ForgeDirection.NORTH.ordinal(), itemDamage );
final IIcon front = this.getIcon( ForgeDirection.SOUTH.ordinal(), itemDamage );
final IIcon other = this.getIcon( ForgeDirection.NORTH.ordinal(), itemDamage );
this.getRendererInstance().setTemporaryRenderIcons( other, other, front, other, other, other );
}
@Override
public void breakBlock( World w, int x, int y, int z, Block a, int b )
public void breakBlock( final World w, final int x, final int y, final int z, final Block a, final int b )
{
TileCraftingTile cp = this.getTileEntity( w, x, y, z );
final TileCraftingTile cp = this.getTileEntity( w, x, y, z );
if( cp != null )
{
cp.breakCluster();
@@ -128,7 +128,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock
}
@Override
public String getUnlocalizedName( ItemStack is )
public String getUnlocalizedName( final ItemStack is )
{
if( is.getItemDamage() == 1 )
{
@@ -138,15 +138,15 @@ public class BlockCraftingUnit extends AEBaseTileBlock
return this.getItemUnlocalizedName( is );
}
protected String getItemUnlocalizedName( ItemStack is )
protected String getItemUnlocalizedName( final ItemStack is )
{
return super.getUnlocalizedName( is );
}
@Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block junk )
public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block junk )
{
TileCraftingTile cp = this.getTileEntity( w, x, y, z );
final TileCraftingTile cp = this.getTileEntity( w, x, y, z );
if( cp != null )
{
cp.updateMultiBlock();
@@ -154,15 +154,15 @@ public class BlockCraftingUnit extends AEBaseTileBlock
}
@Override
public int damageDropped( int meta )
public int damageDropped( final int meta )
{
return meta & 3;
}
@Override
public int getDamageValue( World w, int x, int y, int z )
public int getDamageValue( final World w, final int x, final int y, final int z )
{
int meta = w.getBlockMetadata( x, y, z );
final int meta = w.getBlockMetadata( x, y, z );
return this.damageDropped( meta );
}
}
@@ -30,7 +30,6 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockAssembler;
import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge;
@@ -41,7 +40,7 @@ import appeng.util.Platform;
public class BlockMolecularAssembler extends AEBaseTileBlock
{
public static boolean booleanAlphaPass = false;
private static boolean booleanAlphaPass = false;
public BlockMolecularAssembler()
{
@@ -60,23 +59,23 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
}
@Override
public boolean canRenderInPass( int pass )
public boolean canRenderInPass( final int pass )
{
booleanAlphaPass = pass == 1;
setBooleanAlphaPass( pass == 1 );
return pass == 0 || pass == 1;
}
@Override
@SideOnly( Side.CLIENT )
public Class<? extends BaseBlockRender> getRenderer()
public RenderBlockAssembler getRenderer()
{
return RenderBlockAssembler.class;
return new RenderBlockAssembler();
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
{
TileMolecularAssembler tg = this.getTileEntity( w, x, y, z );
final TileMolecularAssembler tg = this.getTileEntity( w, x, y, z );
if( tg != null && !p.isSneaking() )
{
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_MAC );
@@ -84,4 +83,14 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
}
return false;
}
public static boolean isBooleanAlphaPass()
{
return booleanAlphaPass;
}
private static void setBooleanAlphaPass( final boolean booleanAlphaPass )
{
BlockMolecularAssembler.booleanAlphaPass = booleanAlphaPass;
}
}
@@ -31,15 +31,15 @@ import appeng.core.features.AEFeature;
public class ItemCraftingStorage extends AEBaseItemBlock
{
public ItemCraftingStorage( Block id )
public ItemCraftingStorage( final Block id )
{
super( id );
}
@Override
public ItemStack getContainerItem( ItemStack itemStack )
public ItemStack getContainerItem( final ItemStack itemStack )
{
for( ItemStack stack : AEApi.instance().definitions().blocks().craftingUnit().maybeStack( 1 ).asSet() )
for( final ItemStack stack : AEApi.instance().definitions().blocks().craftingUnit().maybeStack( 1 ).asSet() )
{
return stack;
}
@@ -48,8 +48,8 @@ public class ItemCraftingStorage extends AEBaseItemBlock
}
@Override
public boolean hasContainerItem( ItemStack stack )
public boolean hasContainerItem( final ItemStack stack )
{
return AEConfig.instance.isFeatureEnabled( AEFeature.enableDisassemblyCrafting );
return AEConfig.instance.isFeatureEnabled( AEFeature.EnableDisassemblyCrafting );
}
}
@@ -31,9 +31,11 @@ import net.minecraft.world.World;
import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.api.implementations.tiles.ICrankable;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockCrank;
import appeng.core.features.AEFeature;
import appeng.core.stats.Stats;
@@ -56,13 +58,14 @@ public class BlockCrank extends AEBaseTileBlock
}
@Override
public Class<? extends BaseBlockRender> getRenderer()
@SideOnly( Side.CLIENT )
public RenderBlockCrank getRenderer()
{
return RenderBlockCrank.class;
return new RenderBlockCrank();
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ )
{
if( player instanceof FakePlayer || player == null )
{
@@ -70,7 +73,7 @@ public class BlockCrank extends AEBaseTileBlock
return true;
}
AEBaseTile tile = this.getTileEntity( w, x, y, z );
final AEBaseTile tile = this.getTileEntity( w, x, y, z );
if( tile instanceof TileCrank )
{
if( ( (TileCrank) tile ).power() )
@@ -82,19 +85,19 @@ public class BlockCrank extends AEBaseTileBlock
return true;
}
private void dropCrank( World world, int x, int y, int z )
private void dropCrank( final World world, final int x, final int y, final int z )
{
world.func_147480_a( x, y, z, true ); // w.destroyBlock( x, y, z, true );
world.markBlockForUpdate( x, y, z );
}
@Override
public void onBlockPlacedBy( World world, int x, int y, int z, EntityLivingBase placer, ItemStack itemStack )
public void onBlockPlacedBy( final World world, final int x, final int y, final int z, final EntityLivingBase placer, final ItemStack itemStack )
{
AEBaseTile tile = this.getTileEntity( world, x, y, z );
final AEBaseTile tile = this.getTileEntity( world, x, y, z );
if( tile != null )
{
ForgeDirection mnt = this.findCrankable( world, x, y, z );
final ForgeDirection mnt = this.findCrankable( world, x, y, z );
ForgeDirection forward = ForgeDirection.UP;
if( mnt == ForgeDirection.UP || mnt == ForgeDirection.DOWN )
{
@@ -109,15 +112,15 @@ public class BlockCrank extends AEBaseTileBlock
}
@Override
public boolean isValidOrientation( World world, int x, int y, int z, ForgeDirection forward, ForgeDirection up )
public boolean isValidOrientation( final World world, final int x, final int y, final int z, final ForgeDirection forward, final ForgeDirection up )
{
TileEntity te = world.getTileEntity( x, y, z );
final TileEntity te = world.getTileEntity( x, y, z );
return !( te instanceof TileCrank ) || this.isCrankable( world, x, y, z, up.getOpposite() );
}
private ForgeDirection findCrankable( World world, int x, int y, int z )
private ForgeDirection findCrankable( final World world, final int x, final int y, final int z )
{
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
for( final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
{
if( this.isCrankable( world, x, y, z, dir ) )
{
@@ -127,17 +130,17 @@ public class BlockCrank extends AEBaseTileBlock
return ForgeDirection.UNKNOWN;
}
private boolean isCrankable( World world, int x, int y, int z, ForgeDirection offset )
private boolean isCrankable( final World world, final int x, final int y, final int z, final ForgeDirection offset )
{
TileEntity te = world.getTileEntity( x + offset.offsetX, y + offset.offsetY, z + offset.offsetZ );
final TileEntity te = world.getTileEntity( x + offset.offsetX, y + offset.offsetY, z + offset.offsetZ );
return te instanceof ICrankable && ( (ICrankable) te ).canCrankAttach( offset.getOpposite() );
}
@Override
public void onNeighborBlockChange( World world, int x, int y, int z, Block block )
public void onNeighborBlockChange( final World world, final int x, final int y, final int z, final Block block )
{
AEBaseTile tile = this.getTileEntity( world, x, y, z );
final AEBaseTile tile = this.getTileEntity( world, x, y, z );
if( tile != null )
{
if( !this.isCrankable( world, x, y, z, tile.getUp().getOpposite() ) )
@@ -152,7 +155,7 @@ public class BlockCrank extends AEBaseTileBlock
}
@Override
public boolean canPlaceBlockAt( World world, int x, int y, int z )
public boolean canPlaceBlockAt( final World world, final int x, final int y, final int z )
{
return this.findCrankable( world, x, y, z ) != ForgeDirection.UNKNOWN;
}
@@ -46,9 +46,9 @@ public class BlockGrinder extends AEBaseTileBlock
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
{
TileGrinder tg = this.getTileEntity( w, x, y, z );
final TileGrinder tg = this.getTileEntity( w, x, y, z );
if( tg != null && !p.isSneaking() )
{
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_GRINDER );
@@ -45,14 +45,14 @@ public class BlockCellWorkbench extends AEBaseTileBlock
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileCellWorkbench tg = this.getTileEntity( w, x, y, z );
final TileCellWorkbench tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
@@ -37,7 +37,6 @@ import cpw.mods.fml.relauncher.SideOnly;
import appeng.api.AEApi;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockCharger;
import appeng.client.render.effects.LightningFX;
import appeng.core.AEConfig;
@@ -63,13 +62,14 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
}
@Override
protected Class<? extends BaseBlockRender> getRenderer()
@SideOnly( Side.CLIENT )
protected RenderBlockCharger getRenderer()
{
return RenderBlockCharger.class;
return new RenderBlockCharger();
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ )
{
if( player.isSneaking() )
{
@@ -78,7 +78,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
if( Platform.isServer() )
{
TileCharger tc = this.getTileEntity( w, x, y, z );
final TileCharger tc = this.getTileEntity( w, x, y, z );
if( tc != null )
{
tc.activate( player );
@@ -90,7 +90,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
@Override
@SideOnly( Side.CLIENT )
public void randomDisplayTick( World w, int x, int y, int z, Random r )
public void randomDisplayTick( final World w, final int x, final int y, final int z, final Random r )
{
if( !AEConfig.instance.enableEffects )
{
@@ -102,22 +102,22 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
return;
}
AEBaseTile tile = this.getTileEntity( w, x, y, z );
final AEBaseTile tile = this.getTileEntity( w, x, y, z );
if( tile instanceof TileCharger )
{
TileCharger tc = (TileCharger) tile;
final TileCharger tc = (TileCharger) tile;
if( AEApi.instance().definitions().materials().certusQuartzCrystalCharged().isSameAs( tc.getStackInSlot( 0 ) ) )
{
double xOff = 0.0;
double yOff = 0.0;
double zOff = 0.0;
final double xOff = 0.0;
final double yOff = 0.0;
final double zOff = 0.0;
for( int bolts = 0; bolts < 3; bolts++ )
{
if( CommonHelper.proxy.shouldAddParticles( r ) )
{
LightningFX fx = new LightningFX( w, xOff + 0.5 + x, yOff + 0.5 + y, zOff + 0.5 + z, 0.0D, 0.0D, 0.0D );
final LightningFX fx = new LightningFX( w, xOff + 0.5 + x, yOff + 0.5 + y, zOff + 0.5 + z, 0.0D, 0.0D, 0.0D );
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
}
}
@@ -126,15 +126,15 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
}
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual )
{
TileCharger tile = this.getTileEntity( w, x, y, z );
final TileCharger tile = this.getTileEntity( w, x, y, z );
if( tile != null )
{
double twoPixels = 2.0 / 16.0;
ForgeDirection up = tile.getUp();
ForgeDirection forward = tile.getForward();
AxisAlignedBB bb = AxisAlignedBB.getBoundingBox( twoPixels, twoPixels, twoPixels, 1.0 - twoPixels, 1.0 - twoPixels, 1.0 - twoPixels );
final double twoPixels = 2.0 / 16.0;
final ForgeDirection up = tile.getUp();
final ForgeDirection forward = tile.getForward();
final AxisAlignedBB bb = AxisAlignedBB.getBoundingBox( twoPixels, twoPixels, twoPixels, 1.0 - twoPixels, 1.0 - twoPixels, 1.0 - twoPixels );
if( up.offsetX != 0 )
{
@@ -182,7 +182,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
}
@Override
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e )
public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
{
out.add( AxisAlignedBB.getBoundingBox( 0.0, 0.0, 0.0, 1.0, 1.0, 1.0 ) );
}
@@ -45,7 +45,7 @@ public class BlockCondenser extends AEBaseTileBlock
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ )
{
if( player.isSneaking() )
{
@@ -54,7 +54,7 @@ public class BlockCondenser extends AEBaseTileBlock
if( Platform.isServer() )
{
TileCondenser tc = this.getTileEntity( w, x, y, z );
final TileCondenser tc = this.getTileEntity( w, x, y, z );
if( tc != null && !player.isSneaking() )
{
Platform.openGUI( player, tc, ForgeDirection.getOrientation( side ), GuiBridge.GUI_CONDENSER );
@@ -26,8 +26,10 @@ import net.minecraft.entity.player.EntityPlayer;
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.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockInscriber;
import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge;
@@ -49,20 +51,21 @@ public class BlockInscriber extends AEBaseTileBlock
}
@Override
protected Class<? extends BaseBlockRender> getRenderer()
@SideOnly( Side.CLIENT )
protected RenderBlockInscriber getRenderer()
{
return RenderBlockInscriber.class;
return new RenderBlockInscriber();
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileInscriber tg = this.getTileEntity( w, x, y, z );
final TileInscriber tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
@@ -26,9 +26,11 @@ import net.minecraft.entity.player.EntityPlayer;
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.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockInterface;
import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge;
@@ -48,20 +50,21 @@ public class BlockInterface extends AEBaseTileBlock
}
@Override
protected Class<? extends BaseBlockRender> getRenderer()
@SideOnly( Side.CLIENT )
protected RenderBlockInterface getRenderer()
{
return RenderBlockInterface.class;
return new RenderBlockInterface();
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileInterface tg = this.getTileEntity( w, x, y, z );
final TileInterface tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
@@ -80,7 +83,7 @@ public class BlockInterface extends AEBaseTileBlock
}
@Override
protected void customRotateBlock( IOrientable rotatable, ForgeDirection axis )
protected void customRotateBlock( final IOrientable rotatable, final ForgeDirection axis )
{
if( rotatable instanceof TileInterface )
{
@@ -38,7 +38,6 @@ import cpw.mods.fml.relauncher.SideOnly;
import appeng.api.util.IOrientable;
import appeng.api.util.IOrientableBlock;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderQuartzTorch;
import appeng.core.features.AEFeature;
import appeng.helpers.ICustomCollision;
@@ -53,7 +52,6 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
{
super( Material.circuits );
this.setLightLevel( 0.9375F );
this.setLightOpacity( 0 );
this.isFullSize = false;
this.isOpaque = false;
@@ -63,7 +61,7 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
}
@Override
public int isProvidingWeakPower( IBlockAccess w, int x, int y, int z, int side )
public int isProvidingWeakPower( final IBlockAccess w, final int x, final int y, final int z, final int side )
{
if( w instanceof World && ( (TileLightDetector) this.getTileEntity( w, x, y, z ) ).isReady() )
{
@@ -74,11 +72,11 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
}
@Override
public void onNeighborChange( IBlockAccess world, int x, int y, int z, int tileX, int tileY, int tileZ )
public void onNeighborChange( final IBlockAccess world, final int x, final int y, final int z, final int tileX, final int tileY, final int tileZ )
{
super.onNeighborChange( world, x, y, z, tileX, tileY, tileZ );
TileLightDetector tld = this.getTileEntity( world, x, y, z );
final TileLightDetector tld = this.getTileEntity( world, x, y, z );
if( tld != null )
{
tld.updateLight();
@@ -87,40 +85,41 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
@Override
@SideOnly( Side.CLIENT )
public void randomDisplayTick( World w, int x, int y, int z, Random r )
public void randomDisplayTick( final World w, final int x, final int y, final int z, final Random r )
{
// cancel out lightning
}
@Override
protected Class<? extends RenderQuartzTorch> getRenderer()
@SideOnly( Side.CLIENT )
protected RenderQuartzTorch getRenderer()
{
return RenderQuartzTorch.class;
return new RenderQuartzTorch();
}
@Override
public boolean isValidOrientation( World w, int x, int y, int z, ForgeDirection forward, ForgeDirection up )
public boolean isValidOrientation( final World w, final int x, final int y, final int z, final ForgeDirection forward, final ForgeDirection up )
{
return this.canPlaceAt( w, x, y, z, up.getOpposite() );
}
private boolean canPlaceAt( World w, int x, int y, int z, ForgeDirection dir )
private boolean canPlaceAt( final World w, final int x, final int y, final int z, final 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 )
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final 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;
final ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
final double xOff = -0.3 * up.offsetX;
final double yOff = -0.3 * up.offsetY;
final 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 )
public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List out, final 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
@@ -129,16 +128,16 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
}
@Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block id )
public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block id )
{
ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
final 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 )
private void dropTorch( final World w, final int x, final int y, final int z )
{
w.func_147480_a( x, y, z, true );
// w.destroyBlock( x, y, z, true );
@@ -146,9 +145,9 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
}
@Override
public boolean canPlaceBlockAt( World w, int x, int y, int z )
public boolean canPlaceBlockAt( final World w, final int x, final int y, final int z )
{
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
for( final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
{
if( this.canPlaceAt( w, x, y, z, dir ) )
{
+15 -15
View File
@@ -37,7 +37,6 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockPaint;
import appeng.core.features.AEFeature;
import appeng.tile.misc.TilePaint;
@@ -59,34 +58,35 @@ public class BlockPaint extends AEBaseTileBlock
}
@Override
protected Class<? extends BaseBlockRender> getRenderer()
@SideOnly( Side.CLIENT )
protected RenderBlockPaint getRenderer()
{
return RenderBlockPaint.class;
return new RenderBlockPaint();
}
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
// do nothing
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool( World world, int x, int y, int z )
public AxisAlignedBB getCollisionBoundingBoxFromPool( final World world, final int x, final int y, final int z )
{
return null;
}
@Override
public boolean canCollideCheck( int metadata, boolean isHoldingRightClick )
public boolean canCollideCheck( final int metadata, final boolean isHoldingRightClick )
{
return false;
}
@Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block junk )
public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block junk )
{
TilePaint tp = this.getTileEntity( w, x, y, z );
final TilePaint tp = this.getTileEntity( w, x, y, z );
if( tp != null )
{
@@ -95,19 +95,19 @@ public class BlockPaint extends AEBaseTileBlock
}
@Override
public Item getItemDropped( int meta, Random random, int fortune )
public Item getItemDropped( final int meta, final Random random, final int fortune )
{
return null;
}
@Override
public void dropBlockAsItemWithChance( World world, int x, int y, int z, int meta, float chance, int fortune )
public void dropBlockAsItemWithChance( final World world, final int x, final int y, final int z, final int meta, final float chance, final int fortune )
{
}
@Override
public void fillWithRain( World w, int x, int y, int z )
public void fillWithRain( final World w, final int x, final int y, final int z )
{
if( Platform.isServer() )
{
@@ -116,9 +116,9 @@ public class BlockPaint extends AEBaseTileBlock
}
@Override
public int getLightValue( IBlockAccess w, int x, int y, int z )
public int getLightValue( final IBlockAccess w, final int x, final int y, final int z )
{
TilePaint tp = this.getTileEntity( w, x, y, z );
final TilePaint tp = this.getTileEntity( w, x, y, z );
if( tp != null )
{
@@ -129,13 +129,13 @@ public class BlockPaint extends AEBaseTileBlock
}
@Override
public boolean isReplaceable( IBlockAccess world, int x, int y, int z )
public boolean isReplaceable( final IBlockAccess world, final int x, final int y, final int z )
{
return true;
}
@Override
public boolean isAir( IBlockAccess world, int x, int y, int z )
public boolean isAir( final IBlockAccess world, final int x, final int y, final int z )
{
return true;
}
@@ -25,23 +25,19 @@ 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.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;
@@ -58,42 +54,42 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
}
@Override
protected Class<? extends BaseBlockRender> getRenderer()
@SideOnly( Side.CLIENT )
protected RenderBlockQuartzAccelerator getRenderer()
{
return RenderBlockQuartzAccelerator.class;
return new RenderBlockQuartzAccelerator();
}
@Override
@SideOnly( Side.CLIENT )
public void randomDisplayTick( World w, int x, int y, int z, Random r )
public void randomDisplayTick( final World w, final int x, final int y, final int z, final Random r )
{
if( !AEConfig.instance.enableEffects )
{
return;
}
TileQuartzGrowthAccelerator cga = this.getTileEntity( w, x, y, z );
final TileQuartzGrowthAccelerator cga = this.getTileEntity( w, x, y, z );
if( cga != null && cga.hasPower && CommonHelper.proxy.shouldAddParticles( r ) )
if( cga != null && cga.isPowered() && CommonHelper.proxy.shouldAddParticles( r ) )
{
double d0 = r.nextFloat() - 0.5F;
double d1 = r.nextFloat() - 0.5F;
final double d0 = r.nextFloat() - 0.5F;
final double d1 = r.nextFloat() - 0.5F;
ForgeDirection up = cga.getUp();
ForgeDirection forward = cga.getForward();
ForgeDirection west = Platform.crossProduct( forward, up );
final ForgeDirection up = cga.getUp();
final ForgeDirection forward = cga.getForward();
final ForgeDirection west = Platform.crossProduct( forward, up );
double rx = 0.5 + x;
double ry = 0.5 + y;
double rz = 0.5 + z;
double dx = 0;
double dz = 0;
rx += up.offsetX * d0;
ry += up.offsetY * d0;
rz += up.offsetZ * d0;
double dz = 0;
double dx = 0;
switch( r.nextInt( 4 ) )
{
case 0:
@@ -138,20 +134,20 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
ry += dz * forward.offsetY;
rz += dz * forward.offsetZ;
LightningFX fx = new LightningFX( w, rx, ry, rz, 0.0D, 0.0D, 0.0D );
final LightningFX fx = new LightningFX( w, rx, ry, rz, 0.0D, 0.0D, 0.0D );
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
}
}
@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 );
}
}
@@ -39,7 +39,6 @@ import cpw.mods.fml.relauncher.SideOnly;
import appeng.api.util.IOrientable;
import appeng.api.util.IOrientableBlock;
import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderQuartzTorch;
import appeng.client.render.effects.LightningFX;
import appeng.core.AEConfig;
@@ -63,34 +62,35 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
}
@Override
protected Class<? extends BaseBlockRender> getRenderer()
@SideOnly( Side.CLIENT )
protected RenderQuartzTorch getRenderer()
{
return RenderQuartzTorch.class;
return new RenderQuartzTorch();
}
@Override
public boolean isValidOrientation( World w, int x, int y, int z, ForgeDirection forward, ForgeDirection up )
public boolean isValidOrientation( final World w, final int x, final int y, final int z, final ForgeDirection forward, final ForgeDirection up )
{
return this.canPlaceAt( w, x, y, z, up.getOpposite() );
}
private boolean canPlaceAt( World w, int x, int y, int z, ForgeDirection dir )
private boolean canPlaceAt( final World w, final int x, final int y, final int z, final 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 )
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final 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;
final ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
final double xOff = -0.3 * up.offsetX;
final double yOff = -0.3 * up.offsetY;
final 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 )
public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List out, final 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
@@ -100,7 +100,7 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
@Override
@SideOnly( Side.CLIENT )
public void randomDisplayTick( World w, int x, int y, int z, Random r )
public void randomDisplayTick( final World w, final int x, final int y, final int z, final Random r )
{
if( !AEConfig.instance.enableEffects )
{
@@ -112,15 +112,15 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
return;
}
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;
final ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
final double xOff = -0.3 * up.offsetX;
final double yOff = -0.3 * up.offsetY;
final double zOff = -0.3 * up.offsetZ;
for( int bolts = 0; bolts < 3; bolts++ )
{
if( CommonHelper.proxy.shouldAddParticles( r ) )
{
LightningFX fx = new LightningFX( w, xOff + 0.5 + x, yOff + 0.5 + y, zOff + 0.5 + z, 0.0D, 0.0D, 0.0D );
final LightningFX fx = new LightningFX( w, xOff + 0.5 + x, yOff + 0.5 + y, zOff + 0.5 + z, 0.0D, 0.0D, 0.0D );
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
}
@@ -128,16 +128,16 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
}
@Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block id )
public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block id )
{
ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
final 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 )
private void dropTorch( final World w, final int x, final int y, final int z )
{
w.func_147480_a( x, y, z, true );
// w.destroyBlock( x, y, z, true );
@@ -145,9 +145,9 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
}
@Override
public boolean canPlaceBlockAt( World w, int x, int y, int z )
public boolean canPlaceBlockAt( final World w, final int x, final int y, final int z )
{
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
for( final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
{
if( this.canPlaceAt( w, x, y, z, dir ) )
{
@@ -26,8 +26,10 @@ import net.minecraft.entity.player.EntityPlayer;
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.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RendererSecurity;
import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge;
@@ -47,20 +49,21 @@ public class BlockSecurity extends AEBaseTileBlock
}
@Override
protected Class<? extends BaseBlockRender> getRenderer()
@SideOnly( Side.CLIENT )
protected RendererSecurity getRenderer()
{
return RendererSecurity.class;
return new RendererSecurity();
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileSecurity tg = this.getTileEntity( w, x, y, z );
final TileSecurity tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isClient() )
@@ -37,7 +37,6 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockSkyCompass;
import appeng.core.features.AEFeature;
import appeng.helpers.ICustomCollision;
@@ -57,28 +56,29 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
}
@Override
protected Class<? extends BaseBlockRender> getRenderer()
@SideOnly( Side.CLIENT )
protected RenderBlockSkyCompass getRenderer()
{
return RenderBlockSkyCompass.class;
return new RenderBlockSkyCompass();
}
@Override
@SideOnly( Side.CLIENT )
public IIcon getIcon( int direction, int metadata )
public IIcon getIcon( final int direction, final int metadata )
{
return Blocks.iron_block.getIcon( direction, metadata );
}
@Override
public void registerBlockIcons( IIconRegister iconRegistry )
public void registerBlockIcons( final IIconRegister iconRegistry )
{
// :P
}
@Override
public boolean isValidOrientation( World w, int x, int y, int z, ForgeDirection forward, ForgeDirection up )
public boolean isValidOrientation( final World w, final int x, final int y, final int z, final ForgeDirection forward, final ForgeDirection up )
{
TileSkyCompass sc = this.getTileEntity( w, x, y, z );
final TileSkyCompass sc = this.getTileEntity( w, x, y, z );
if( sc != null )
{
return false;
@@ -86,23 +86,23 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
return this.canPlaceAt( w, x, y, z, forward.getOpposite() );
}
private boolean canPlaceAt( World w, int x, int y, int z, ForgeDirection dir )
private boolean canPlaceAt( final World w, final int x, final int y, final int z, final ForgeDirection dir )
{
return w.isSideSolid( x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, dir.getOpposite(), false );
}
@Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block id )
public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block id )
{
TileSkyCompass sc = this.getTileEntity( w, x, y, z );
ForgeDirection up = sc.getForward();
final TileSkyCompass sc = this.getTileEntity( w, x, y, z );
final 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 )
private void dropTorch( final World w, final int x, final int y, final int z )
{
w.func_147480_a( x, y, z, true );
// w.destroyBlock( x, y, z, true );
@@ -110,9 +110,9 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
}
@Override
public boolean canPlaceBlockAt( World w, int x, int y, int z )
public boolean canPlaceBlockAt( final World w, final int x, final int y, final int z )
{
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
for( final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
{
if( this.canPlaceAt( w, x, y, z, dir ) )
{
@@ -123,12 +123,12 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
}
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual )
{
TileSkyCompass tile = this.getTileEntity( w, x, y, z );
final TileSkyCompass tile = this.getTileEntity( w, x, y, z );
if( tile != null )
{
ForgeDirection forward = tile.getForward();
final ForgeDirection forward = tile.getForward();
double minX = 0;
double minY = 0;
@@ -185,7 +185,7 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
}
@Override
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e )
public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List out, final Entity e )
{
}
@@ -40,9 +40,10 @@ import net.minecraft.world.Explosion;
import net.minecraft.world.World;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderTinyTNT;
import appeng.client.texture.FullIcon;
import appeng.core.AppEng;
@@ -66,13 +67,14 @@ 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.get( EntityTinyTNTPrimed.class ), AppEng.instance(), 16, 4, true );
}
@Override
protected Class<? extends BaseBlockRender> getRenderer()
@SideOnly( Side.CLIENT )
protected RenderTinyTNT getRenderer()
{
return RenderTinyTNT.class;
return new RenderTinyTNT();
}
@Override
@@ -83,45 +85,34 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
}
@Override
public IIcon getIcon( int direction, int metadata )
public IIcon getIcon( final int direction, final int metadata )
{
return new FullIcon( Blocks.tnt.getIcon( direction, metadata ) );
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
public boolean onBlockActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
{
if( player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.flint_and_steel )
{
this.startFuse( w, x, y, z, player );
w.setBlockToAir( x, y, z );
player.getCurrentEquippedItem().damageItem( 1, player );
return true;
}
else
{
return super.onActivated( w, x, y, z, player, side, hitX, hitY, hitZ );
}
return super.onBlockActivated( w, x, y, z, player, side, hitX, hitY, hitZ );
}
@Override
public void registerBlockIcons( IIconRegister iconRegistry )
public void registerBlockIcons( final IIconRegister iconRegistry )
{
// no images required.
}
public void startFuse( World w, int x, int y, int z, EntityLivingBase igniter )
{
if( !w.isRemote )
{
EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, x + 0.5F, y + 0.5F, z + 0.5F, igniter );
w.spawnEntityInWorld( primedTinyTNTEntity );
w.playSoundAtEntity( primedTinyTNTEntity, "game.tnt.primed", 1.0F, 1.0F );
}
}
@Override
public void onBlockAdded( World w, int x, int y, int z )
public void onBlockAdded( final World w, final int x, final int y, final int z )
{
super.onBlockAdded( w, x, y, z );
@@ -133,7 +124,7 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
}
@Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block id )
public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block id )
{
if( w.isBlockIndirectlyGettingPowered( x, y, z ) )
{
@@ -143,22 +134,22 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
}
@Override
public void onBlockDestroyedByExplosion( World w, int x, int y, int z, Explosion exp )
public void onBlockDestroyedByExplosion( final World w, final int x, final int y, final int z, final Explosion exp )
{
if( !w.isRemote )
{
EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, x + 0.5F, y + 0.5F, z + 0.5F, exp.getExplosivePlacedBy() );
final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, x + 0.5F, y + 0.5F, z + 0.5F, exp.getExplosivePlacedBy() );
primedTinyTNTEntity.fuse = w.rand.nextInt( primedTinyTNTEntity.fuse / 4 ) + primedTinyTNTEntity.fuse / 8;
w.spawnEntityInWorld( primedTinyTNTEntity );
}
}
@Override
public void onEntityCollidedWithBlock( World w, int x, int y, int z, Entity entity )
public void onEntityCollidedWithBlock( final World w, final int x, final int y, final int z, final Entity entity )
{
if( entity instanceof EntityArrow && !w.isRemote )
{
EntityArrow entityarrow = (EntityArrow) entity;
final EntityArrow entityarrow = (EntityArrow) entity;
if( entityarrow.isBurning() )
{
@@ -169,20 +160,30 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
}
@Override
public boolean canDropFromExplosion( Explosion exp )
public boolean canDropFromExplosion( final Explosion exp )
{
return false;
}
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual )
{
return Collections.singletonList( AxisAlignedBB.getBoundingBox( 0.25, 0, 0.25, 0.75, 0.5, 0.75 ) );
}
@Override
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e )
public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
{
out.add( AxisAlignedBB.getBoundingBox( 0.25, 0, 0.25, 0.75, 0.5, 0.75 ) );
}
public void startFuse( final World w, final int x, final int y, final int z, final EntityLivingBase igniter )
{
if( !w.isRemote )
{
final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, x + 0.5F, y + 0.5F, z + 0.5F, igniter );
w.spawnEntityInWorld( primedTinyTNTEntity );
w.playSoundAtEntity( primedTinyTNTEntity, "game.tnt.primed", 1.0F, 1.0F );
}
}
}
@@ -51,10 +51,10 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
}
@Override
public IIcon getIcon( IBlockAccess w, int x, int y, int z, int s )
public IIcon getIcon( final IBlockAccess w, final int x, final int y, final int z, final int s )
{
IIcon ico = super.getIcon( w, x, y, z, s );
TileVibrationChamber tvc = this.getTileEntity( w, x, y, z );
final IIcon ico = super.getIcon( w, x, y, z, s );
final TileVibrationChamber tvc = this.getTileEntity( w, x, y, z );
if( tvc != null && tvc.isOn && ico == this.getRendererInstance().getTexture( ForgeDirection.SOUTH ) )
{
@@ -65,7 +65,7 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ )
{
if( player.isSneaking() )
{
@@ -74,7 +74,7 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
if( Platform.isServer() )
{
TileVibrationChamber tc = this.getTileEntity( w, x, y, z );
final TileVibrationChamber tc = this.getTileEntity( w, x, y, z );
if( tc != null && !player.isSneaking() )
{
Platform.openGUI( player, tc, ForgeDirection.getOrientation( side ), GuiBridge.GUI_VIBRATION_CHAMBER );
@@ -86,36 +86,36 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
}
@Override
public void randomDisplayTick( World w, int x, int y, int z, Random r )
public void randomDisplayTick( final World w, final int x, final int y, final int z, final Random r )
{
if( !AEConfig.instance.enableEffects )
{
return;
}
AEBaseTile tile = this.getTileEntity( w, x, y, z );
final AEBaseTile tile = this.getTileEntity( w, x, y, z );
if( tile instanceof TileVibrationChamber )
{
TileVibrationChamber tc = (TileVibrationChamber) tile;
final TileVibrationChamber tc = (TileVibrationChamber) tile;
if( tc.isOn )
{
float f1 = x + 0.5F;
float f2 = y + 0.5F;
float f3 = z + 0.5F;
ForgeDirection forward = tc.getForward();
ForgeDirection up = tc.getUp();
final ForgeDirection forward = tc.getForward();
final ForgeDirection up = tc.getUp();
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;
final int west_x = forward.offsetY * up.offsetZ - forward.offsetZ * up.offsetY;
final int west_y = forward.offsetZ * up.offsetX - forward.offsetX * up.offsetZ;
final int west_z = forward.offsetX * up.offsetY - forward.offsetY * up.offsetX;
f1 += forward.offsetX * 0.6;
f2 += forward.offsetY * 0.6;
f3 += forward.offsetZ * 0.6;
float ox = r.nextFloat();
float oy = r.nextFloat() * 0.2f;
final float ox = r.nextFloat();
final float oy = r.nextFloat() * 0.2f;
f1 += up.offsetX * ( -0.3 + oy );
f2 += up.offsetY * ( -0.3 + oy );
@@ -54,7 +54,6 @@ import appeng.api.parts.PartItemStack;
import appeng.api.parts.SelectedPart;
import appeng.api.util.AEColor;
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;
@@ -64,6 +63,7 @@ import appeng.core.CommonHelper;
import appeng.core.features.AECableBusFeatureHandler;
import appeng.core.features.AEFeature;
import appeng.helpers.AEGlassMaterial;
import appeng.helpers.Reflected;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IFMP;
@@ -77,18 +77,24 @@ import appeng.transformer.annotations.Integration.Method;
import appeng.util.Platform;
@Interface( iface = "powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection", iname = "MFR" )
@Interface( iface = "powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection", iname = IntegrationType.MFR )
public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
{
private static final ICableBusContainer NULL_CABLE_BUS = new NullCableBusContainer();
public static Class<? extends TileEntity> noTesrTile;
public static Class<? extends TileEntity> tesrTile;
private static Class<? extends TileEntity> noTesrTile;
private static Class<? extends TileEntity> tesrTile;
/**
* Immibis MB Support.
*
* It will look for a field named ImmibisMicroblocks_TransformableBlockMarker or
* ImmibisMicroblocks_TransformableTileEntityMarker, modifiers, type, etc can be ignored.
*/
boolean ImmibisMicroblocks_TransformableBlockMarker = true;
int myColorMultiplier = 0xffffff;
@Reflected
private static final boolean ImmibisMicroblocks_TransformableBlockMarker = true;
private int myColorMultiplier = 0xffffff;
public BlockCableBus()
{
@@ -102,19 +108,19 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
public void randomDisplayTick( World world, int x, int y, int z, Random r )
public void randomDisplayTick( final World world, final int x, final int y, final int z, final Random r )
{
this.cb( world, x, y, z ).randomDisplayTick( world, x, y, z, r );
}
@Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block meh )
public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block meh )
{
this.cb( w, x, y, z ).onNeighborChanged();
}
@Override
public Item getItemDropped( int i, Random r, int k )
public Item getItemDropped( final int i, final Random r, final int k )
{
return null;
}
@@ -130,13 +136,13 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
public int colorMultiplier( IBlockAccess world, int x, int y, int z )
public int colorMultiplier( final IBlockAccess world, final int x, final int y, final int z )
{
return this.myColorMultiplier;
}
@Override
public int isProvidingWeakPower( IBlockAccess w, int x, int y, int z, int side )
public int isProvidingWeakPower( final IBlockAccess w, final int x, final int y, final int z, final int side )
{
return this.cb( w, x, y, z ).isProvidingWeakPower( ForgeDirection.getOrientation( side ).getOpposite() );
}
@@ -148,21 +154,21 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
public void onEntityCollidedWithBlock( World w, int x, int y, int z, Entity e )
public void onEntityCollidedWithBlock( final World w, final int x, final int y, final int z, final Entity e )
{
this.cb( w, x, y, z ).onEntityCollision( e );
}
@Override
public int isProvidingStrongPower( IBlockAccess w, int x, int y, int z, int side )
public int isProvidingStrongPower( final IBlockAccess w, final int x, final int y, final int z, final int side )
{
return this.cb( w, x, y, z ).isProvidingStrongPower( ForgeDirection.getOrientation( side ).getOpposite() );
}
@Override
public int getLightValue( IBlockAccess world, int x, int y, int z )
public int getLightValue( final IBlockAccess world, final int x, final int y, final int z )
{
Block block = world.getBlock( x, y, z );
final Block block = world.getBlock( x, y, z );
if( block != null && block != this )
{
return block.getLightValue( world, x, y, z );
@@ -175,30 +181,30 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
public boolean isLadder( IBlockAccess world, int x, int y, int z, EntityLivingBase entity )
public boolean isLadder( final IBlockAccess world, final int x, final int y, final int z, final EntityLivingBase entity )
{
return this.cb( world, x, y, z ).isLadder( entity );
}
@Override
public boolean isSideSolid( IBlockAccess w, int x, int y, int z, ForgeDirection side )
public boolean isSideSolid( final IBlockAccess w, final int x, final int y, final int z, final ForgeDirection side )
{
return this.cb( w, x, y, z ).isSolidOnSide( side );
}
@Override
public boolean isReplaceable( IBlockAccess world, int x, int y, int z )
public boolean isReplaceable( final IBlockAccess world, final int x, final int y, final int z )
{
return this.cb( world, x, y, z ).isEmpty();
}
@SuppressWarnings( "deprecation" )
@Override
public boolean removedByPlayer( World world, EntityPlayer player, int x, int y, int z )
public boolean removedByPlayer( final World world, final EntityPlayer player, final int x, final int y, final int z )
{
if( player.capabilities.isCreativeMode )
{
AEBaseTile tile = this.getTileEntity( world, x, y, z );
final AEBaseTile tile = this.getTileEntity( world, x, y, z );
if( tile != null )
{
tile.disableDrops();
@@ -209,7 +215,7 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
public boolean canConnectRedstone( IBlockAccess w, int x, int y, int z, int side )
public boolean canConnectRedstone( final IBlockAccess w, final int x, final int y, final int z, final int side )
{
switch( side )
{
@@ -229,7 +235,7 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
public boolean canRenderInPass( int pass )
public boolean canRenderInPass( final int pass )
{
BusRenderHelper.INSTANCE.setPass( pass );
@@ -242,10 +248,10 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
public ItemStack getPickBlock( MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player )
public ItemStack getPickBlock( final MovingObjectPosition target, final World world, final int x, final int y, final int z, final EntityPlayer player )
{
Vec3 v3 = target.hitVec.addVector( -x, -y, -z );
SelectedPart sp = this.cb( world, x, y, z ).selectPart( v3 );
final Vec3 v3 = target.hitVec.addVector( -x, -y, -z );
final SelectedPart sp = this.cb( world, x, y, z ).selectPart( v3 );
if( sp.part != null )
{
@@ -261,24 +267,24 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
@Override
@SideOnly( Side.CLIENT )
public boolean addHitEffects( World world, MovingObjectPosition target, EffectRenderer effectRenderer )
public boolean addHitEffects( final World world, final MovingObjectPosition target, final EffectRenderer effectRenderer )
{
Object object = this.cb( world, target.blockX, target.blockY, target.blockZ );
final Object object = this.cb( world, target.blockX, target.blockY, target.blockZ );
if( object instanceof IPartHost )
{
IPartHost host = (IPartHost) object;
final IPartHost host = (IPartHost) object;
for( ForgeDirection side : ForgeDirection.values() )
for( final ForgeDirection side : ForgeDirection.values() )
{
IPart p = host.getPart( side );
IIcon ico = this.getIcon( p );
final IPart p = host.getPart( side );
final IIcon ico = this.getIcon( p );
if( ico == null )
{
continue;
}
byte b0 = (byte) ( Platform.getRandomInt() % 2 == 0 ? 1 : 0 );
final byte b0 = (byte) ( Platform.getRandomInt() % 2 == 0 ? 1 : 0 );
for( int i1 = 0; i1 < b0; ++i1 )
{
@@ -286,14 +292,14 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
{
for( int k1 = 0; k1 < b0; ++k1 )
{
double d0 = target.blockX + ( i1 + 0.5D ) / b0;
double d1 = target.blockY + ( j1 + 0.5D ) / b0;
double d2 = target.blockZ + ( k1 + 0.5D ) / b0;
final double d0 = target.blockX + ( i1 + 0.5D ) / b0;
final double d1 = target.blockY + ( j1 + 0.5D ) / b0;
final double d2 = target.blockZ + ( k1 + 0.5D ) / b0;
double dd0 = target.hitVec.xCoord;
double dd1 = target.hitVec.yCoord;
double dd2 = target.hitVec.zCoord;
EntityDiggingFX fx = ( new EntityDiggingFX( world, dd0, dd1, dd2, d0 - target.blockX - 0.5D, d1 - target.blockY - 0.5D, d2 - target.blockZ - 0.5D, this, 0 ) ).applyColourMultiplier( target.blockX, target.blockY, target.blockZ );
final double dd0 = target.hitVec.xCoord;
final double dd1 = target.hitVec.yCoord;
final double dd2 = target.hitVec.zCoord;
final EntityDiggingFX fx = ( new EntityDiggingFX( world, dd0, dd1, dd2, d0 - target.blockX - 0.5D, d1 - target.blockY - 0.5D, d2 - target.blockZ - 0.5D, this, 0 ) ).applyColourMultiplier( target.blockX, target.blockY, target.blockZ );
fx.setParticleIcon( ico );
@@ -309,24 +315,24 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
@Override
@SideOnly( Side.CLIENT )
public boolean addDestroyEffects( World world, int x, int y, int z, int meta, EffectRenderer effectRenderer )
public boolean addDestroyEffects( final World world, final int x, final int y, final int z, final int meta, final EffectRenderer effectRenderer )
{
Object object = this.cb( world, x, y, z );
final Object object = this.cb( world, x, y, z );
if( object instanceof IPartHost )
{
IPartHost host = (IPartHost) object;
final IPartHost host = (IPartHost) object;
for( ForgeDirection side : ForgeDirection.values() )
for( final ForgeDirection side : ForgeDirection.values() )
{
IPart p = host.getPart( side );
IIcon ico = this.getIcon( p );
final IPart p = host.getPart( side );
final IIcon ico = this.getIcon( p );
if( ico == null )
{
continue;
}
byte b0 = 3;
final byte b0 = 3;
for( int i1 = 0; i1 < b0; ++i1 )
{
@@ -334,10 +340,10 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
{
for( int k1 = 0; k1 < b0; ++k1 )
{
double d0 = x + ( i1 + 0.5D ) / b0;
double d1 = y + ( j1 + 0.5D ) / b0;
double d2 = z + ( k1 + 0.5D ) / b0;
EntityDiggingFX fx = ( new EntityDiggingFX( world, d0, d1, d2, d0 - x - 0.5D, d1 - y - 0.5D, d2 - z - 0.5D, this, meta ) ).applyColourMultiplier( x, y, z );
final double d0 = x + ( i1 + 0.5D ) / b0;
final double d1 = y + ( j1 + 0.5D ) / b0;
final double d2 = z + ( k1 + 0.5D ) / b0;
final EntityDiggingFX fx = ( new EntityDiggingFX( world, d0, d1, d2, d0 - x - 0.5D, d1 - y - 0.5D, d2 - z - 0.5D, this, meta ) ).applyColourMultiplier( x, y, z );
fx.setParticleIcon( ico );
@@ -352,7 +358,7 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
public void onNeighborChange( IBlockAccess w, int x, int y, int z, int tileX, int tileY, int tileZ )
public void onNeighborChange( final IBlockAccess w, final int x, final int y, final int z, final int tileX, final int tileY, final int tileZ )
{
if( Platform.isServer() )
{
@@ -360,7 +366,7 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
}
private IIcon getIcon( IPart p )
private IIcon getIcon( final IPart p )
{
if( p == null )
{
@@ -369,18 +375,18 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
try
{
IIcon ico = p.getBreakingTexture();
final IIcon ico = p.getBreakingTexture();
if( ico != null )
{
return ico;
}
}
catch( Throwable t )
catch( final Throwable t )
{
// nothing.
}
ItemStack is = p.getItemStack( PartItemStack.Network );
final ItemStack is = p.getItemStack( PartItemStack.Network );
if( is == null || is.getItem() == null )
{
return null;
@@ -389,14 +395,14 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
return is.getItem().getIcon( is, 0 );
}
private ICableBusContainer cb( IBlockAccess w, int x, int y, int z )
private ICableBusContainer cb( final IBlockAccess w, final int x, final int y, final int z )
{
TileEntity te = w.getTileEntity( x, y, z );
final TileEntity te = w.getTileEntity( x, y, z );
ICableBusContainer out = null;
if( te instanceof TileCableBus )
{
out = ( (TileCableBus) te ).cb;
out = ( (TileCableBus) te ).getCableBus();
}
else if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FMP ) )
{
@@ -407,21 +413,22 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
protected Class<? extends BaseBlockRender> getRenderer()
@SideOnly( Side.CLIENT )
protected RendererCableBus getRenderer()
{
return RendererCableBus.class;
return new RendererCableBus();
}
@Override
public IIcon getIcon( IBlockAccess w, int x, int y, int z, int s )
public IIcon getIcon( final IBlockAccess w, final int x, final int y, final int z, final int s )
{
return this.getIcon( s, 0 );
}
@Override
public IIcon getIcon( int direction, int metadata )
public IIcon getIcon( final int direction, final int metadata )
{
IIcon i = super.getIcon( direction, metadata );
final IIcon i = super.getIcon( direction, metadata );
if( i != null )
{
return i;
@@ -431,45 +438,46 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ )
{
return this.cb( w, x, y, z ).activate( player, Vec3.createVectorHelper( hitX, hitY, hitZ ) );
}
@Override
public void registerBlockIcons( IIconRegister iconRegistry )
public void registerBlockIcons( final IIconRegister iconRegistry )
{
}
@Override
public boolean recolourBlock( World world, int x, int y, int z, ForgeDirection side, int colour )
public boolean recolourBlock( final World world, final int x, final int y, final int z, final ForgeDirection side, final int colour )
{
return this.recolourBlock( world, x, y, z, side, colour, null );
}
public boolean recolourBlock( World world, int x, int y, int z, ForgeDirection side, int colour, EntityPlayer who )
public boolean recolourBlock( final World world, final int x, final int y, final int z, final ForgeDirection side, final int colour, final EntityPlayer who )
{
try
{
return this.cb( world, x, y, z ).recolourBlock( side, AEColor.values()[colour], who );
}
catch( Throwable ignored )
{}
catch( final Throwable ignored )
{
}
return false;
}
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
// do nothing
}
@Override
public <T extends AEBaseTile> T getTileEntity( IBlockAccess w, int x, int y, int z )
public <T extends AEBaseTile> T getTileEntity( final IBlockAccess w, final int x, final int y, final int z )
{
TileEntity te = w.getTileEntity( x, y, z );
final TileEntity te = w.getTileEntity( x, y, z );
if( noTesrTile.isInstance( te ) )
{
@@ -485,7 +493,7 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
protected void setFeature( EnumSet<AEFeature> f )
protected void setFeature( final EnumSet<AEFeature> f )
{
final AECableBusFeatureHandler featureHandler = new AECableBusFeatureHandler( f, this, this.featureSubName );
this.setHandler( featureHandler );
@@ -505,14 +513,24 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
@Method( iname = "MFR" )
public RedNetConnectionType getConnectionType( World world, int x, int y, int z, ForgeDirection side )
@Method( iname = IntegrationType.MFR )
public RedNetConnectionType getConnectionType( final World world, final int x, final int y, final int z, final ForgeDirection side )
{
return this.cb( world, x, y, z ).canConnectRedstone( EnumSet.allOf( ForgeDirection.class ) ) ? RedNetConnectionType.CableSingle : RedNetConnectionType.None;
}
public void setRenderColor( int color )
public void setRenderColor( final int color )
{
this.myColorMultiplier = color;
}
public static Class<? extends TileEntity> getTesrTile()
{
return BlockCableBus.tesrTile;
}
public static Class<? extends TileEntity> getNoTesrTile()
{
return BlockCableBus.noTesrTile;
}
}
@@ -25,8 +25,10 @@ import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
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;
@@ -44,9 +46,9 @@ public class BlockController extends AEBaseTileBlock
}
@Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block neighborBlock )
public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block neighborBlock )
{
TileController tc = this.getTileEntity( w, x, y, z );
final TileController tc = this.getTileEntity( w, x, y, z );
if( tc != null )
{
tc.onNeighborChange( false );
@@ -54,8 +56,9 @@ public class BlockController extends AEBaseTileBlock
}
@Override
protected Class<? extends BaseBlockRender> getRenderer()
@SideOnly( Side.CLIENT )
protected RenderBlockController getRenderer()
{
return RenderBlockController.class;
return new RenderBlockController();
}
}
@@ -38,7 +38,7 @@ public class BlockDenseEnergyCell extends BlockEnergyCell
}
@Override
public IIcon getIcon( int direction, int metadata )
public IIcon getIcon( final int direction, final int metadata )
{
switch( metadata )
{
@@ -34,7 +34,6 @@ import cpw.mods.fml.relauncher.SideOnly;
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;
import appeng.core.features.AEFeature;
@@ -55,13 +54,14 @@ public class BlockEnergyCell extends AEBaseTileBlock
}
@Override
protected Class<? extends BaseBlockRender> getRenderer()
@SideOnly( Side.CLIENT )
protected RenderBlockEnergyCube getRenderer()
{
return RenderBlockEnergyCube.class;
return new RenderBlockEnergyCube();
}
@Override
public IIcon getIcon( int direction, int metadata )
public IIcon getIcon( final int direction, final int metadata )
{
switch( metadata )
{
@@ -87,12 +87,12 @@ public class BlockEnergyCell extends AEBaseTileBlock
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
super.getCheckedSubBlocks( item, tabs, itemStacks );
ItemStack charged = new ItemStack( this, 1 );
NBTTagCompound tag = Platform.openNbtData( charged );
final ItemStack charged = new ItemStack( this, 1 );
final NBTTagCompound tag = Platform.openNbtData( charged );
tag.setDouble( "internalCurrentPower", this.getMaxPower() );
tag.setDouble( "internalMaxPower", this.getMaxPower() );
@@ -29,8 +29,10 @@ import net.minecraft.util.AxisAlignedBB;
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.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockWireless;
import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge;
@@ -54,20 +56,21 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
}
@Override
protected Class<? extends BaseBlockRender> getRenderer()
@SideOnly( Side.CLIENT )
protected RenderBlockWireless getRenderer()
{
return RenderBlockWireless.class;
return new RenderBlockWireless();
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileWireless tg = this.getTileEntity( w, x, y, z );
final TileWireless tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
@@ -80,12 +83,12 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
}
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual )
{
TileWireless tile = this.getTileEntity( w, x, y, z );
final TileWireless tile = this.getTileEntity( w, x, y, z );
if( tile != null )
{
ForgeDirection forward = tile.getForward();
final ForgeDirection forward = tile.getForward();
double minX = 0;
double minY = 0;
@@ -142,12 +145,12 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
}
@Override
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e )
public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
{
TileWireless tile = this.getTileEntity( w, x, y, z );
final TileWireless tile = this.getTileEntity( w, x, y, z );
if( tile != null )
{
ForgeDirection forward = tile.getForward();
final ForgeDirection forward = tile.getForward();
double minX = 0;
double minY = 0;
@@ -25,8 +25,10 @@ import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderQNB;
import appeng.core.features.AEFeature;
import appeng.helpers.ICustomCollision;
@@ -36,11 +38,11 @@ import appeng.tile.qnb.TileQuantumBridge;
public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICustomCollision
{
public BlockQuantumBase( Material mat )
public BlockQuantumBase( final Material mat )
{
super( mat );
this.setTileEntity( TileQuantumBridge.class );
float shave = 2.0f / 16.0f;
final 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;
@@ -48,9 +50,9 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto
}
@Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block pointlessNumber )
public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block pointlessNumber )
{
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
final TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
if( bridge != null )
{
bridge.neighborUpdate();
@@ -58,9 +60,9 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto
}
@Override
public void breakBlock( World w, int x, int y, int z, Block a, int b )
public void breakBlock( final World w, final int x, final int y, final int z, final Block a, final int b )
{
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
final TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
if( bridge != null )
{
bridge.breakCluster();
@@ -70,9 +72,10 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto
}
@Override
protected Class<? extends RenderQNB> getRenderer()
@SideOnly( Side.CLIENT )
protected RenderQNB getRenderer()
{
return RenderQNB.class;
return new RenderQNB();
}
}
@@ -50,9 +50,9 @@ public class BlockQuantumLinkChamber extends BlockQuantumBase
@Override
@SideOnly( Side.CLIENT )
public void randomDisplayTick( World w, int bx, int by, int bz, Random r )
public void randomDisplayTick( final World w, final int bx, final int by, final int bz, final Random r )
{
TileQuantumBridge bridge = this.getTileEntity( w, bx, by, bz );
final TileQuantumBridge bridge = this.getTileEntity( w, bx, by, bz );
if( bridge != null )
{
if( bridge.hasQES() )
@@ -66,14 +66,14 @@ public class BlockQuantumLinkChamber extends BlockQuantumBase
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileQuantumBridge tg = this.getTileEntity( w, x, y, z );
final TileQuantumBridge tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
@@ -86,16 +86,16 @@ public class BlockQuantumLinkChamber extends BlockQuantumBase
}
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual )
{
double onePixel = 2.0 / 16.0;
final 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 )
public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
{
double onePixel = 2.0 / 16.0;
final double onePixel = 2.0 / 16.0;
out.add( AxisAlignedBB.getBoundingBox( onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel ) );
}
}
@@ -20,7 +20,6 @@ package appeng.block.qnb;
import java.util.Collections;
import java.util.EnumSet;
import java.util.List;
import net.minecraft.block.material.Material;
@@ -28,7 +27,6 @@ import net.minecraft.entity.Entity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import appeng.core.features.AEFeature;
import appeng.tile.qnb.TileQuantumBridge;
@@ -41,10 +39,10 @@ public class BlockQuantumRing extends BlockQuantumBase
}
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual )
{
double onePixel = 2.0 / 16.0;
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
final TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
if( bridge != null && bridge.isCorner() )
{
onePixel = 4.0 / 16.0;
@@ -57,10 +55,10 @@ public class BlockQuantumRing extends BlockQuantumBase
}
@Override
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e )
public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
{
double onePixel = 2.0 / 16.0;
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
final TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
if( bridge != null && bridge.isCorner() )
{
onePixel = 4.0 / 16.0;

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