Compare commits

...

95 Commits

Author SHA1 Message Date
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
389 changed files with 8272 additions and 5379 deletions
+1 -1
View File
@@ -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.46
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 #
+12
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"
@@ -0,0 +1,30 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2013 AlgorithmX2
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package appeng.api.config;
public enum SchedulingMode
{
DEFAULT, ROUNDROBIN, RANDOM
}
+4 -2
View File
@@ -54,13 +54,15 @@ public enum Settings
INTERFACE_TERMINAL( EnumSet.of( YesNo.YES, YesNo.NO ) ), CRAFT_VIA_REDSTONE( EnumSet.of( YesNo.YES, YesNo.NO ) ),
STORAGE_FILTER( EnumSet.allOf( StorageFilter.class ) ), PLACE_BLOCK( EnumSet.of( YesNo.YES, YesNo.NO ) );
STORAGE_FILTER( EnumSet.allOf( StorageFilter.class ) ), PLACE_BLOCK( EnumSet.of( YesNo.YES, YesNo.NO ) ),
SCHEDULING_MODE( EnumSet.allOf( SchedulingMode.class ) );
private final EnumSet<? extends Enum<?>> values;
Settings( @Nonnull EnumSet<? extends Enum<?>> possibleOptions )
{
if ( possibleOptions.isEmpty() )
if( possibleOptions.isEmpty() )
{
throw new IllegalArgumentException( "Tried to instantiate an empty setting." );
}
@@ -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
}
@@ -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();
@@ -1,10 +1,15 @@
package appeng.api.features;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import javax.annotation.Nonnull;
import com.google.common.base.Optional;
import net.minecraft.item.ItemStack;
@@ -12,22 +17,26 @@ import net.minecraft.item.ItemStack;
* Lets you manipulate Inscriber Recipes, by adding or editing existing ones.
*
* @author thatsIch
* @version rv2
* @version rv3
* @since rv2
*/
public interface IInscriberRegistry
{
/**
* Current list of registered recipes, you can modify this if you want too.
* Will never contain a null recipe
* An immutable copy of currently registered recipes.
*
* Use the provided methods to actually modify the inscriber recipes.
*
* @see IInscriberRegistry#addRecipe(IInscriberRecipe)
* @see IInscriberRegistry#removeRecipe(IInscriberRecipe)
*
* @return currentlyRegisteredRecipes
*/
@Nonnull
List<IInscriberRecipe> getRecipes();
Collection<IInscriberRecipe> getRecipes();
/**
* Optional items which are used in the top or bottom slot
* Optional items which are used in the top or bottom slot.
*
* @return set of all optional items
*/
@@ -35,7 +44,7 @@ public interface IInscriberRegistry
Set<ItemStack> getOptionals();
/**
* Get all registered items which are valid inputs
* Get all registered items which are valid inputs.
*
* @return set of all input items
*/
@@ -43,7 +52,7 @@ public interface IInscriberRegistry
Set<ItemStack> getInputs();
/**
* Extensible way to create an inscriber recipe
* Extensible way to create an inscriber recipe.
*
* @return builder for inscriber recipes
*/
@@ -61,9 +70,10 @@ public interface IInscriberRegistry
void addRecipe( IInscriberRecipe recipe );
/**
* Removes a recipe from the registry
* Removes all equal recipes from the registry.
*
* @param toBeRemovedRecipe to be removed recipe, can be null, makes just no sense
* @param toBeRemovedRecipe to be removed recipe, can be null, makes just no sense.
*/
void removeRecipe( IInscriberRecipe toBeRemovedRecipe );
}
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2013 AlgorithmX2
* Copyright (c) 2013 - 2015 AlgorithmX2
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
@@ -24,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 );
}
@@ -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,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( Block block, AEBaseSlabBlock singleSlab, AEBaseSlabBlock doubleSlab, Boolean isDoubleSlab )
{
super( block, singleSlab, doubleSlab, isDoubleSlab );
}
+34 -24
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;
@@ -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)
public AEBaseSlabBlock setSlabs( 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( int dir, 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( 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( 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( int meta, Random rand, 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( MovingObjectPosition target, World world, int x, int y, 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;
}
int meta = world.getBlockMetadata( x, y, z ) & 7;
return new ItemStack( block, 1, meta );
}
public String name()
{
return name;
return this.name;
}
}
@@ -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;
@@ -88,8 +88,6 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
protected void setTileEntity( Class<? extends TileEntity> c )
{
this.tileEntityType = c;
AEBaseTile.registerTileItem( c, new ItemStackSrc( this, 0 ) );
this.isInventory = IInventory.class.isAssignableFrom( c );
this.setTileProvider( this.hasBlockTileEntity() );
}
@@ -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() )
@@ -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;
@@ -25,14 +25,12 @@ 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;
@@ -41,7 +39,6 @@ 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;
@@ -144,14 +141,14 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
}
@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 );
}
}
@@ -455,7 +455,8 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
return this.cb( world, x, y, z ).recolourBlock( side, AEColor.values()[colour], who );
}
catch( Throwable ignored )
{}
{
}
return false;
}
@@ -26,7 +26,6 @@ import net.minecraft.block.material.Material;
import net.minecraft.world.World;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderQNB;
import appeng.core.features.AEFeature;
import appeng.helpers.ICustomCollision;
@@ -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;
@@ -1,6 +1,6 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -43,8 +43,8 @@ import cpw.mods.fml.relauncher.SideOnly;
import appeng.api.util.IOrientable;
import appeng.api.util.IOrientableBlock;
import appeng.block.AEBaseBlock;
import appeng.core.WorldSettings;
import appeng.core.features.AEFeature;
import appeng.core.worlddata.WorldData;
import appeng.helpers.LocationRotation;
import appeng.helpers.NullRotation;
import appeng.util.Platform;
@@ -118,7 +118,7 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
super.onBlockAdded( w, x, y, z );
if( Platform.isServer() )
{
WorldSettings.getInstance().getCompass().updateArea( w, x, y, z );
WorldData.instance().compassData().service().updateArea( w, x, y, z );
}
}
@@ -212,7 +212,7 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
super.breakBlock( w, x, y, z, b, metadata );
if( Platform.isServer() )
{
WorldSettings.getInstance().getCompass().updateArea( w, x, y, z );
WorldData.instance().compassData().service().updateArea( w, x, y, z );
}
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -30,7 +30,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import appeng.api.AEApi;
import appeng.api.exceptions.MissingDefinition;
@@ -63,12 +62,6 @@ public class OreQuartz extends AEBaseBlock
return RenderQuartzOre.class;
}
@Override
public void postInit()
{
OreDictionary.registerOre( "oreCertusQuartz", new ItemStack( this ) );
}
@Override
public int getMixedBrightnessForBlock( IBlockAccess par1iBlockAccess, int par2, int par3, int par4 )
{
@@ -62,7 +62,7 @@ public class OreQuartzCharged extends OreQuartz
@Override
public int damageDropped( int id )
{
for ( ItemStack crystalStack : AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeStack( 1 ).asSet() )
for( ItemStack crystalStack : AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeStack( 1 ).asSet() )
{
return crystalStack.getItemDamage();
}
@@ -74,7 +74,7 @@ public class OreQuartzCharged extends OreQuartz
@SideOnly( Side.CLIENT )
public void randomDisplayTick( World w, int x, int y, int z, Random r )
{
if ( !AEConfig.instance.enableEffects )
if( !AEConfig.instance.enableEffects )
{
return;
}
@@ -76,8 +76,8 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
private final static int CANCEL_HEIGHT = 20;
private final static int CANCEL_WIDTH = 50;
private final static int ETA_TOP_OFFSET = 165;
private final static int ETA_LEFT_OFFSET = 8;
private final static int TITLE_TOP_OFFSET = 7;
private final static int TITLE_LEFT_OFFSET = 8;
private final static int ITEMSTACK_LEFT_OFFSET = 9;
private final static int ITEMSTACK_TOP_OFFSET = 22;
@@ -192,18 +192,18 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
@Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
{
ReadableNumberConverter converter = ReadableNumberConverter.INSTANCE;
final ReadableNumberConverter converter = ReadableNumberConverter.INSTANCE;
String title = this.getGuiDisplayName( GuiText.CraftingStatus.getLocal() );
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.CraftingStatus.getLocal() ), 8, 7, TEXT_COLOR );
if( this.craftingCpu.eta > 0 )
if( this.craftingCpu.eta > 0 && !this.visual.isEmpty() )
{
final String etaText = this.getGuiDisplayName( GuiText.ETA.getLocal() );
final long etaInMilliseconds = TimeUnit.MILLISECONDS.convert( this.craftingCpu.eta, TimeUnit.NANOSECONDS );
final String etaTimeText = DurationFormatUtils.formatDuration( etaInMilliseconds, this.getGuiDisplayName( GuiText.ETAFormat.getLocal() ) );
this.fontRendererObj.drawString( String.format( etaText, etaTimeText ), ETA_LEFT_OFFSET, ETA_TOP_OFFSET, TEXT_COLOR );
final String etaTimeText = DurationFormatUtils.formatDuration( etaInMilliseconds, GuiText.ETAFormat.getLocal() );
title += " - " + etaTimeText;
}
this.fontRendererObj.drawString( title, TITLE_LEFT_OFFSET, TITLE_TOP_OFFSET, TEXT_COLOR );
int x = 0;
int y = 0;
final int viewStart = this.myScrollBar.getCurrentScroll() * 3;
@@ -45,7 +45,7 @@ import appeng.client.me.ClientDCInternalInv;
import appeng.client.me.SlotDisconnected;
import appeng.container.implementations.ContainerInterfaceTerminal;
import appeng.core.localization.GuiText;
import appeng.parts.reporting.PartMonitor;
import appeng.parts.reporting.PartInterfaceTerminal;
import appeng.util.Platform;
@@ -67,7 +67,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
private boolean refreshList = false;
private MEGuiTextField searchField;
public GuiInterfaceTerminal( InventoryPlayer inventoryPlayer, PartMonitor te )
public GuiInterfaceTerminal( InventoryPlayer inventoryPlayer, PartInterfaceTerminal te )
{
super( new ContainerInterfaceTerminal( inventoryPlayer, te ) );
this.myScrollBar = new GuiScrollbar();
@@ -62,7 +62,7 @@ import appeng.core.sync.packets.PacketValueConfig;
import appeng.helpers.WirelessTerminalGuiObject;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType;
import appeng.parts.reporting.PartTerminal;
import appeng.parts.reporting.AbstractPartTerminal;
import appeng.tile.misc.TileSecurity;
import appeng.util.IConfigManagerHost;
import appeng.util.Platform;
@@ -139,7 +139,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
{
this.myName = GuiText.Chest;
}
else if( te instanceof PartTerminal )
else if( te instanceof AbstractPartTerminal )
{
this.myName = GuiText.Terminal;
}
@@ -26,6 +26,7 @@ import net.minecraft.entity.player.InventoryPlayer;
import appeng.api.config.FuzzyMode;
import appeng.api.config.RedstoneMode;
import appeng.api.config.SchedulingMode;
import appeng.api.config.Settings;
import appeng.api.config.Upgrades;
import appeng.api.config.YesNo;
@@ -36,6 +37,7 @@ import appeng.container.implementations.ContainerUpgradeable;
import appeng.core.localization.GuiText;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketConfigButton;
import appeng.parts.automation.PartExportBus;
import appeng.parts.automation.PartImportBus;
@@ -48,6 +50,7 @@ public class GuiUpgradeable extends AEBaseGui
GuiImgButton redstoneMode;
GuiImgButton fuzzyMode;
GuiImgButton craftMode;
GuiImgButton schedulingMode;
public GuiUpgradeable( InventoryPlayer inventoryPlayer, IUpgradeableHost te )
{
@@ -81,10 +84,12 @@ public class GuiUpgradeable extends AEBaseGui
this.redstoneMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE );
this.fuzzyMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 28, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL );
this.craftMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 48, Settings.CRAFT_ONLY, YesNo.NO );
this.schedulingMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 68, Settings.SCHEDULING_MODE, SchedulingMode.DEFAULT );
this.buttonList.add( this.craftMode );
this.buttonList.add( this.redstoneMode );
this.buttonList.add( this.fuzzyMode );
this.buttonList.add( this.schedulingMode );
}
@Override
@@ -107,6 +112,11 @@ public class GuiUpgradeable extends AEBaseGui
{
this.craftMode.set( this.cvb.cMode );
}
if( this.schedulingMode != null )
{
this.schedulingMode.set( this.cvb.schedulingMode );
}
}
@Override
@@ -140,6 +150,10 @@ public class GuiUpgradeable extends AEBaseGui
{
this.craftMode.setVisibility( this.bc.getInstalledUpgrades( Upgrades.CRAFTING ) > 0 );
}
if( this.schedulingMode != null )
{
this.schedulingMode.setVisibility(this.bc.getInstalledUpgrades( Upgrades.CAPACITY ) > 0 && this.bc instanceof PartExportBus );
}
}
protected String getBackground()
@@ -178,5 +192,10 @@ public class GuiUpgradeable extends AEBaseGui
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.fuzzyMode.getSetting(), backwards ) );
}
if( btn == this.schedulingMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.schedulingMode.getSetting(), backwards ) );
}
}
}
@@ -39,6 +39,7 @@ import appeng.api.config.OperationMode;
import appeng.api.config.PowerUnits;
import appeng.api.config.RedstoneMode;
import appeng.api.config.RelativeDirection;
import appeng.api.config.SchedulingMode;
import appeng.api.config.SearchBoxMode;
import appeng.api.config.Settings;
import appeng.api.config.SortDir;
@@ -158,6 +159,10 @@ public class GuiImgButton extends GuiButton implements ITooltip
this.registerApp( 16 * 14, Settings.PLACE_BLOCK, YesNo.YES, ButtonToolTips.BlockPlacement, ButtonToolTips.BlockPlacementYes );
this.registerApp( 16 * 14 + 1, Settings.PLACE_BLOCK, YesNo.NO, ButtonToolTips.BlockPlacement, ButtonToolTips.BlockPlacementNo );
this.registerApp( 16 * 15, Settings.SCHEDULING_MODE, SchedulingMode.DEFAULT, ButtonToolTips.SchedulingMode, ButtonToolTips.SchedulingModeDefault );
this.registerApp( 16 * 15 + 1, Settings.SCHEDULING_MODE, SchedulingMode.ROUNDROBIN, ButtonToolTips.SchedulingMode, ButtonToolTips.SchedulingModeRoundRobin );
this.registerApp( 16 * 15 + 2, Settings.SCHEDULING_MODE, SchedulingMode.RANDOM, ButtonToolTips.SchedulingMode, ButtonToolTips.SchedulingModeRandom );
}
}
@@ -389,7 +394,6 @@ public class GuiImgButton extends GuiButton implements ITooltip
}
}
private static class ButtonAppearance
{
public int index;
@@ -56,11 +56,11 @@ public class GuiTabButton extends GuiButton implements ITooltip
/**
* Using itemstack as an icon
*
* @param x x pos of button
* @param y y pos of button
* @param ico used icon
* @param x x pos of button
* @param y y pos of button
* @param ico used icon
* @param message mouse over message
* @param ir renderer
* @param ir renderer
*/
public GuiTabButton( int x, int y, ItemStack ico, String message, RenderItem ir )
{
@@ -45,10 +45,10 @@ public class MEGuiTextField extends GuiTextField
* Pays attention to the '_' caret.
*
* @param fontRenderer renderer for the strings
* @param xPos absolute left position
* @param yPos absolute top position
* @param width absolute width
* @param height absolute height
* @param xPos absolute left position
* @param yPos absolute top position
* @param width absolute width
* @param height absolute height
*/
public MEGuiTextField( FontRenderer fontRenderer, int xPos, int yPos, int width, int height )
{
@@ -20,6 +20,7 @@ package appeng.client.render;
import java.util.EnumSet;
import javax.annotation.Nullable;
import com.google.common.base.Function;
@@ -1,6 +1,6 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -21,6 +21,7 @@ package appeng.client.render;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Nullable;
import org.lwjgl.opengl.GL11;
@@ -164,6 +165,7 @@ public class BusRenderer implements IItemRenderer
GL11.glPopMatrix();
}
@Nullable
public IPart getRenderer( ItemStack is, IPartItem c )
{
int id = ( Item.getIdFromItem( is.getItem() ) << Platform.DEF_OFFSET ) | is.getItemDamage();
@@ -24,7 +24,6 @@ import net.minecraft.client.renderer.Tessellator;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockAccess;
import appeng.block.AEBaseBlock;
import appeng.block.networking.BlockController;
import appeng.client.render.BaseBlockRender;
import appeng.client.texture.ExtraBlockTextures;
@@ -159,6 +159,7 @@ public class RenderBlockInscriber extends BaseBlockRender<BlockInscriber, TileIn
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
GL11.glDisable( GL11.GL_LIGHTING );
GL11.glDisable( GL12.GL_RESCALE_NORMAL );
GL11.glCullFace( GL11.GL_FRONT );
Minecraft mc = Minecraft.getMinecraft();
mc.renderEngine.bindTexture( TextureMap.locationBlocksTexture );
@@ -224,6 +225,9 @@ public class RenderBlockInscriber extends BaseBlockRender<BlockInscriber, TileIn
tess.draw();
GL11.glCullFace( GL11.GL_BACK );
GL11.glEnable( GL11.GL_LIGHTING );
GL11.glEnable( GL12.GL_RESCALE_NORMAL );
GL11.glPopMatrix();
int items = 0;
@@ -29,7 +29,6 @@ import net.minecraft.world.IBlockAccess;
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseTileBlock;
import appeng.block.misc.BlockPaint;
import appeng.client.render.BaseBlockRender;
import appeng.client.texture.ExtraBlockTextures;
@@ -20,6 +20,7 @@ package appeng.client.render.blocks;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderBlocks;
@@ -73,7 +74,7 @@ public class RenderBlockSkyCompass extends BaseBlockRender<BlockSkyCompass, Tile
}
}
GL11.glEnable( 32826 /* GL_RESCALE_NORMAL_EXT */);
GL11.glEnable( GL12.GL_RESCALE_NORMAL );
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
ResourceLocation loc = new ResourceLocation( "appliedenergistics2", "textures/models/compass.png" );
@@ -167,7 +168,7 @@ public class RenderBlockSkyCompass extends BaseBlockRender<BlockSkyCompass, Tile
this.model.renderAll( ( now / 50000.0f ) * (float) Math.PI * 500.0f );
}
GL11.glDisable( 32826 /* GL_RESCALE_NORMAL_EXT */);
GL11.glDisable( GL12.GL_RESCALE_NORMAL );
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
}
@@ -192,8 +193,9 @@ public class RenderBlockSkyCompass extends BaseBlockRender<BlockSkyCompass, Tile
return;
}
GL11.glEnable( 32826 /* GL_RESCALE_NORMAL_EXT */);
GL11.glEnable( GL12.GL_RESCALE_NORMAL );
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
GL11.glCullFace( GL11.GL_FRONT );
ResourceLocation loc = new ResourceLocation( "appliedenergistics2", "textures/models/compass.png" );
@@ -234,7 +236,8 @@ public class RenderBlockSkyCompass extends BaseBlockRender<BlockSkyCompass, Tile
this.model.renderAll( ( now / 500000.0f ) * (float) Math.PI * 500.0f );
}
GL11.glDisable( 32826 /* GL_RESCALE_NORMAL_EXT */);
GL11.glCullFace( GL11.GL_BACK );
GL11.glDisable( GL12.GL_RESCALE_NORMAL );
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
}
@@ -32,7 +32,6 @@ import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.util.IOrientable;
import appeng.api.util.IOrientableBlock;
import appeng.block.AEBaseBlock;
import appeng.block.misc.BlockQuartzTorch;
import appeng.client.render.BaseBlockRender;
import appeng.tile.AEBaseTile;
@@ -99,8 +98,6 @@ public class RenderQuartzTorch extends BaseBlockRender<AEBaseBlock, AEBaseTile>
@Override
public boolean renderInWorld( AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
{
BlockQuartzTorch blk = (BlockQuartzTorch) block;
IOrientable te = ( (IOrientableBlock) block ).getOrientable( world, x, y, z );
float Point2 = 6.0f / 16.0f;
@@ -149,19 +146,19 @@ public class RenderQuartzTorch extends BaseBlockRender<AEBaseBlock, AEBaseTile>
super.renderInWorld( block, world, x, y, z, renderer );
}
blk.getRendererInstance().setTemporaryRenderIcon( Blocks.hopper.getIcon( 0, 0 ) );
block.getRendererInstance().setTemporaryRenderIcon( Blocks.hopper.getIcon( 0, 0 ) );
renderer.setRenderBounds( Point2 + xOff, bottom + yOff, Point2 + zOff, Point13 + xOff, top + yOff, Point3 + zOff );
boolean out = renderer.renderStandardBlock( blk, x, y, z );
boolean out = renderer.renderStandardBlock( block, x, y, z );
renderer.setRenderBounds( Point2 + xOff, bottom + yOff, Point12 + zOff, Point13 + xOff, top + yOff, Point13 + zOff );
renderer.renderStandardBlock( blk, x, y, z );
renderer.renderStandardBlock( block, x, y, z );
renderer.setRenderBounds( Point2 + xOff, bottom + yOff, Point3 + zOff, Point3 + xOff, top + yOff, Point12 + zOff );
renderer.renderStandardBlock( blk, x, y, z );
renderer.renderStandardBlock( block, x, y, z );
renderer.setRenderBounds( Point12 + xOff, bottom + yOff, Point3 + zOff, Point13 + xOff, top + yOff, Point12 + zOff );
renderer.renderStandardBlock( blk, x, y, z );
renderer.renderStandardBlock( block, x, y, z );
if( te != null )
{
@@ -170,46 +167,46 @@ public class RenderQuartzTorch extends BaseBlockRender<AEBaseBlock, AEBaseTile>
{
case EAST:
renderer.setRenderBounds( 0, bottom + yOff, bottom + zOff, Point2 + xOff, top + yOff, top + zOff );
renderer.renderStandardBlock( blk, x, y, z );
renderer.renderStandardBlock( block, x, y, z );
break;
case WEST:
renderer.setRenderBounds( Point13 + xOff, bottom + yOff, bottom + zOff, 1.0, top + yOff, top + zOff );
renderer.renderStandardBlock( blk, x, y, z );
renderer.renderStandardBlock( block, x, y, z );
break;
case NORTH:
renderer.setRenderBounds( bottom + xOff, bottom + yOff, Point13 + zOff, top + xOff, top + yOff, 1.0 );
renderer.renderStandardBlock( blk, x, y, z );
renderer.renderStandardBlock( block, x, y, z );
break;
case SOUTH:
renderer.setRenderBounds( bottom + xOff, bottom + yOff, 0, top + xOff, top + yOff, Point2 + zOff );
renderer.renderStandardBlock( blk, x, y, z );
renderer.renderStandardBlock( block, x, y, z );
break;
case UP:
renderer.setRenderBounds( Point2, 0, Point2, Point3, bottom + yOff, Point3 );
renderer.renderStandardBlock( blk, x, y, z );
renderer.renderStandardBlock( block, x, y, z );
renderer.setRenderBounds( Point2, 0, Point12, Point3, bottom + yOff, Point13 );
renderer.renderStandardBlock( blk, x, y, z );
renderer.renderStandardBlock( block, x, y, z );
renderer.setRenderBounds( Point12, 0, Point2, Point13, bottom + yOff, Point3 );
renderer.renderStandardBlock( blk, x, y, z );
renderer.renderStandardBlock( block, x, y, z );
renderer.setRenderBounds( Point12, 0, Point12, Point13, bottom + yOff, Point13 );
renderer.renderStandardBlock( blk, x, y, z );
renderer.renderStandardBlock( block, x, y, z );
break;
case DOWN:
renderer.setRenderBounds( Point2, top + yOff, Point2, Point3, 1.0, Point3 );
renderer.renderStandardBlock( blk, x, y, z );
renderer.renderStandardBlock( block, x, y, z );
renderer.setRenderBounds( Point2, top + yOff, Point12, Point3, 1.0, Point13 );
renderer.renderStandardBlock( blk, x, y, z );
renderer.renderStandardBlock( block, x, y, z );
renderer.setRenderBounds( Point12, top + yOff, Point2, Point13, 1.0, Point3 );
renderer.renderStandardBlock( blk, x, y, z );
renderer.renderStandardBlock( block, x, y, z );
renderer.setRenderBounds( Point12, top + yOff, Point12, Point13, 1.0, Point13 );
renderer.renderStandardBlock( blk, x, y, z );
renderer.renderStandardBlock( block, x, y, z );
break;
default:
}
}
renderer.renderAllFaces = false;
blk.getRendererInstance().setTemporaryRenderIcon( null );
block.getRendererInstance().setTemporaryRenderIcon( null );
return out;
}
@@ -47,13 +47,13 @@ public enum CableBusTextures
PartPatternTerm_Bright( "PartPatternTerm_Bright" ), PartPatternTerm_Colored( "PartPatternTerm_Colored" ), PartPatternTerm_Dark( "PartPatternTerm_Dark" ),
PartConversionMonitor_Bright( "PartConversionMonitor_Bright" ), PartConversionMonitor_Colored( "PartConversionMonitor_Colored" ), PartConversionMonitor_Dark( "PartConversionMonitor_Dark" ),
PartConversionMonitor_Bright( "PartConversionMonitor_Bright" ), PartConversionMonitor_Colored( "PartConversionMonitor_Colored" ), PartConversionMonitor_Dark( "PartConversionMonitor_Dark" ), PartConversionMonitor_Dark_Locked( "PartConversionMonitor_Dark_Locked" ),
PartInterfaceTerm_Bright( "PartInterfaceTerm_Bright" ), PartInterfaceTerm_Colored( "PartInterfaceTerm_Colored" ), PartInterfaceTerm_Dark( "PartInterfaceTerm_Dark" ),
PartCraftingTerm_Bright( "PartCraftingTerm_Bright" ), PartCraftingTerm_Colored( "PartCraftingTerm_Colored" ), PartCraftingTerm_Dark( "PartCraftingTerm_Dark" ), //
PartStorageMonitor_Bright( "PartStorageMonitor_Bright" ), PartStorageMonitor_Colored( "PartStorageMonitor_Colored" ), PartStorageMonitor_Dark( "PartStorageMonitor_Dark" ),
PartStorageMonitor_Bright( "PartStorageMonitor_Bright" ), PartStorageMonitor_Colored( "PartStorageMonitor_Colored" ), PartStorageMonitor_Dark( "PartStorageMonitor_Dark" ), PartStorageMonitor_Colored_Locked( "PartStorageMonitor_Colored_Locked" ),
PartTerminal_Bright( "PartTerminal_Bright" ), PartTerminal_Colored( "PartTerminal_Colored" ), PartTerminal_Dark( "PartTerminal_Dark" ),
@@ -140,6 +140,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
{
this.monitor = null;
this.cpuName = "";
this.eta = -1;
}
}
@@ -76,7 +76,7 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
@Override
/**
* Overridden super.setupConfig to prevent setting up the fake slots
*/ protected void setupConfig()
*/protected void setupConfig()
{
this.setupUpgrades();
}
@@ -127,10 +127,10 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
for( IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() )
{
boolean matchA = ( top == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( top, recipe.getTopOptional().orNull() ) ) && // and...
( bot == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.isSameItemPrecise( bot, recipe.getBottomOptional().orNull() ) );
( bot == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.isSameItemPrecise( bot, recipe.getBottomOptional().orNull() ) );
boolean matchB = ( bot == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( bot, recipe.getTopOptional().orNull() ) ) && // and...
( top == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.isSameItemPrecise( top, recipe.getBottomOptional().orNull() ) );
( top == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.isSameItemPrecise( top, recipe.getBottomOptional().orNull() ) );
if( matchA || matchB )
{
@@ -44,7 +44,7 @@ import appeng.helpers.IInterfaceHost;
import appeng.helpers.InventoryAction;
import appeng.items.misc.ItemEncodedPattern;
import appeng.parts.misc.PartInterface;
import appeng.parts.reporting.PartMonitor;
import appeng.parts.reporting.PartInterfaceTerminal;
import appeng.tile.inventory.AppEngInternalInventory;
import appeng.tile.misc.TileInterface;
import appeng.util.InventoryAdaptor;
@@ -67,7 +67,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
IGrid grid;
NBTTagCompound data = new NBTTagCompound();
public ContainerInterfaceTerminal( InventoryPlayer ip, PartMonitor anchor )
public ContainerInterfaceTerminal( InventoryPlayer ip, PartInterfaceTerminal anchor )
{
super( ip, anchor );
@@ -419,7 +419,6 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
}
}
static class PatternInvSlot extends WrapperInvSlot
{
@@ -27,6 +27,7 @@ import net.minecraft.world.World;
import appeng.api.config.FuzzyMode;
import appeng.api.config.RedstoneMode;
import appeng.api.config.SchedulingMode;
import appeng.api.config.SecurityPermissions;
import appeng.api.config.Settings;
import appeng.api.config.Upgrades;
@@ -58,6 +59,8 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
public FuzzyMode fzMode = FuzzyMode.IGNORE_ALL;
@GuiSync( 5 )
public YesNo cMode = YesNo.NO;
@GuiSync( 6 )
public SchedulingMode schedulingMode = SchedulingMode.DEFAULT;
int tbSlot;
NetworkToolViewer tbInventory;
@@ -217,6 +220,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
if( this.upgradeable instanceof PartExportBus )
{
this.cMode = (YesNo) cm.getSetting( Settings.CRAFT_ONLY );
this.schedulingMode = (SchedulingMode) cm.getSetting( Settings.SCHEDULING_MODE );
}
}
@@ -21,8 +21,8 @@ package appeng.container.slot;
import net.minecraft.inventory.IInventory;
// there is nothing special about this slot, its simply used to represent the players inventory, vs a container slot.
// there is nothing special about this slot, its simply used to represent the players inventory, vs a container slot.
public class SlotPlayerInv extends AppEngSlot
{
@@ -145,7 +145,8 @@ public class SlotRestrictedInput extends AppEngSlot
{
return true;
}
// ICraftingPatternDetails pattern = i.getItem() instanceof ICraftingPatternItem ? ((ICraftingPatternItem)
// ICraftingPatternDetails pattern = i.getItem() instanceof ICraftingPatternItem ?
// ((ICraftingPatternItem)
// i.getItem()).getPatternForItem( i ) : null;
return false;// pattern != null;
}
@@ -179,8 +180,8 @@ public class SlotRestrictedInput extends AppEngSlot
case INSCRIBER_INPUT:
return true;/*
* for (ItemStack is : Inscribe.inputs) if ( Platform.isSameItemPrecise( is, i ) ) return true;
*
* for (ItemStack is : Inscribe.inputs) if ( Platform.isSameItemPrecise( is, i ) ) return
* true;
* return false;
*/
+1 -1
View File
@@ -118,7 +118,7 @@ public final class Api implements IAppEngApi
@Override
public IGridNode createGridNode( IGridBlock blk )
{
if ( Platform.isClient() )
if( Platform.isClient() )
{
throw new IllegalStateException( "Grid features for " + blk + " are server side only." );
}
+7 -5
View File
@@ -21,6 +21,7 @@ package appeng.core;
import java.io.File;
import java.util.concurrent.TimeUnit;
import javax.annotation.Nonnull;
import com.google.common.base.Stopwatch;
@@ -44,6 +45,7 @@ import appeng.core.crash.ModCrashEnhancement;
import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.worlddata.WorldData;
import appeng.hooks.TickHandler;
import appeng.integration.IntegrationRegistry;
import appeng.server.AECommand;
@@ -187,16 +189,16 @@ public final class AppEng
}
@EventHandler
private void serverStopping( FMLServerStoppingEvent event )
private void serverAboutToStart( FMLServerAboutToStartEvent evt )
{
WorldSettings.getInstance().shutdown();
TickHandler.INSTANCE.shutdown();
WorldData.onServerAboutToStart();
}
@EventHandler
private void serverAboutToStart( FMLServerAboutToStartEvent evt )
private void serverStopping( FMLServerStoppingEvent event )
{
WorldSettings.getInstance().init();
WorldData.instance().onServerStopping();
TickHandler.INSTANCE.shutdown();
}
@EventHandler
+10 -7
View File
@@ -20,6 +20,7 @@ package appeng.core;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import cpw.mods.fml.common.event.FMLInterModComms;
@@ -35,6 +36,10 @@ import appeng.core.api.imc.IMCSpatial;
/**
* Handles the delegation of the corresponding IMC messages to the suitable IMC processors
*
* @author thatsIch
* @version rv3 - 10.08.2015
* @since rv1
*/
public class IMCHandler
{
@@ -43,8 +48,7 @@ public class IMCHandler
/**
* Contains the processors,
*
* is mutable,
* but write access only by the constructor
* is mutable, but write access only by the constructor
*/
private final Map<String, IIMCProcessor> processors;
@@ -62,13 +66,12 @@ public class IMCHandler
for( TunnelType type : TunnelType.values() )
{
this.processors.put( "add-p2p-attunement-" + type.name().replace( '_', '-' ).toLowerCase(), new IMCP2PAttunement() );
this.processors.put( "add-p2p-attunement-" + type.name().replace( '_', '-' ).toLowerCase( Locale.ENGLISH ), new IMCP2PAttunement() );
}
}
/**
* Tries to find every message matching the internal IMC keys.
* When found the corresponding handler will process the attached message.
* Tries to find every message matching the internal IMC keys. When found the corresponding handler will process the attached message.
*
* @param event Event carrying the identifier and message for the handlers
*/
@@ -80,7 +83,7 @@ public class IMCHandler
try
{
IIMCProcessor handler = this.processors.get( key );
final IIMCProcessor handler = this.processors.get( key );
if( handler != null )
{
handler.process( message );
@@ -90,7 +93,7 @@ public class IMCHandler
throw new IllegalStateException( "Invalid IMC Called: " + key );
}
}
catch( Throwable t )
catch( Exception t )
{
AELog.warning( "Problem detected when processing IMC " + key + " from " + message.getSender() );
AELog.error( t );
+2 -1
View File
@@ -22,6 +22,7 @@ package appeng.core;
import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import javax.annotation.Nonnull;
import com.google.common.base.Preconditions;
@@ -68,7 +69,7 @@ public class RecipeLoader implements Runnable
final File readmeGenDest = new File( generatedRecipesDir, "README.html" );
final File readmeUserDest = new File( userRecipesDir, "README.html" );
// generates generated and user recipes dir
// generates generated and user recipes dir
// will clean the generated every time to keep it up to date
// copies over the recipes in the jar over to the generated folder
// copies over the readmes
+5 -5
View File
@@ -343,10 +343,10 @@ public final class Registration
target.partCableCovered = source.cableCovered();
target.partCableGlass = source.cableGlass();
target.partCableDense = source.cableDense();
// target.partLumenCableSmart = source.lumenCableSmart();
// target.partLumenCableCovered = source.lumenCableCovered();
// target.partLumenCableGlass = source.lumenCableGlass();
// target.partLumenCableDense = source.lumenCableDense();
// target.partLumenCableSmart = source.lumenCableSmart();
// target.partLumenCableCovered = source.lumenCableCovered();
// target.partLumenCableGlass = source.lumenCableGlass();
// target.partLumenCableDense = source.lumenCableDense();
target.partQuartzFiber = this.converter.of( source.quartzFiber() );
target.partToggleBus = this.converter.of( source.toggleBus() );
target.partInvertedToggleBus = this.converter.of( source.invertedToggleBus() );
@@ -532,7 +532,7 @@ public final class Registration
partHelper.registerNewLayer( "appeng.parts.layers.LayerIEnergyHandler", "cofh.api.energy.IEnergyReceiver" );
}
if ( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.OpenComputers ) )
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.OpenComputers ) )
{
partHelper.registerNewLayer( "appeng.parts.layers.LayerSidedEnvironment", "li.cil.oc.api.network.SidedEnvironment" );
}
@@ -1,490 +0,0 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.core;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.WeakHashMap;
import com.google.common.base.Optional;
import com.mojang.authlib.GameProfile;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.CompressedStreamTools;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.config.ConfigCategory;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
import appeng.api.util.WorldCoord;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketNewStorageDimension;
import appeng.hooks.TickHandler;
import appeng.hooks.TickHandler.PlayerColor;
import appeng.me.GridStorage;
import appeng.me.GridStorageSearch;
import appeng.services.CompassService;
public class WorldSettings extends Configuration
{
private static final String SPAWNDATA_FOLDER = "spawndata";
private static final String COMPASS_FOLDER = "compass";
private static WorldSettings instance;
private final List<Integer> storageCellDims = new ArrayList<Integer>();
private final File spawnDataFolder;
private final CompassService compass;
private final PlayerMappings mappings;
private final Map<GridStorageSearch, WeakReference<GridStorageSearch>> loadedStorage = new WeakHashMap<GridStorageSearch, WeakReference<GridStorageSearch>>();
private long lastGridStorage;
private int lastPlayer;
public WorldSettings( File aeFolder )
{
super( new File( aeFolder.getPath(), "settings.cfg" ) );
this.spawnDataFolder = new File( aeFolder, SPAWNDATA_FOLDER );
this.compass = new CompassService( aeFolder );
for( int dimID : this.get( "DimensionManager", "StorageCells", new int[0] ).getIntList() )
{
this.storageCellDims.add( dimID );
DimensionManager.registerDimension( dimID, AEConfig.instance.storageProviderID );
}
try
{
this.lastGridStorage = Long.parseLong( this.get( "Counters", "lastGridStorage", 0 ).getString() );
this.lastPlayer = this.get( "Counters", "lastPlayer", 0 ).getInt();
}
catch( NumberFormatException err )
{
this.lastGridStorage = 0;
this.lastPlayer = 0;
}
final ConfigCategory playerList = this.getCategory( "players" );
this.mappings = new PlayerMappings( playerList, AELog.INSTANCE );
}
public static WorldSettings getInstance()
{
if( instance == null )
{
File world = DimensionManager.getCurrentSaveRootDirectory();
File aeBaseFolder = new File( world.getPath(), "AE2" );
if( !aeBaseFolder.isDirectory() && !aeBaseFolder.mkdir() )
{
throw new IllegalStateException( "Failed to create " + aeBaseFolder.getAbsolutePath() );
}
File compass = new File( aeBaseFolder, COMPASS_FOLDER );
if( !compass.isDirectory() && !compass.mkdir() )
{
throw new IllegalStateException( "Failed to create " + compass.getAbsolutePath() );
}
File spawnData = new File( aeBaseFolder, SPAWNDATA_FOLDER );
if( !spawnData.isDirectory() && !spawnData.mkdir() )
{
throw new IllegalStateException( "Failed to create " + spawnData.getAbsolutePath() );
}
instance = new WorldSettings( aeBaseFolder );
}
return instance;
}
public Collection<NBTTagCompound> getNearByMeteorites( int dim, int chunkX, int chunkZ )
{
Collection<NBTTagCompound> ll = new LinkedList<NBTTagCompound>();
synchronized( WorldSettings.class )
{
for( int x = -1; x <= 1; x++ )
{
for( int z = -1; z <= 1; z++ )
{
int cx = x + ( chunkX >> 4 );
int cz = z + ( chunkZ >> 4 );
NBTTagCompound data = this.loadSpawnData( dim, cx << 4, cz << 4 );
if( data != null )
{
// edit.
int size = data.getInteger( "num" );
for( int s = 0; s < size; s++ )
{
ll.add( data.getCompoundTag( String.valueOf( s ) ) );
}
}
}
}
}
return ll;
}
NBTTagCompound loadSpawnData( int dim, int chunkX, int chunkZ )
{
if( !Thread.holdsLock( WorldSettings.class ) )
{
throw new IllegalStateException( "Invalid Request" );
}
NBTTagCompound data = null;
File file = new File( this.spawnDataFolder, dim + '_' + ( chunkX >> 4 ) + '_' + ( chunkZ >> 4 ) + ".dat" );
if( file.isFile() )
{
FileInputStream fileInputStream = null;
try
{
fileInputStream = new FileInputStream( file );
data = CompressedStreamTools.readCompressed( fileInputStream );
}
catch( Throwable e )
{
data = new NBTTagCompound();
AELog.error( e );
}
finally
{
if( fileInputStream != null )
{
try
{
fileInputStream.close();
}
catch( IOException e )
{
AELog.error( e );
}
}
}
}
else
{
data = new NBTTagCompound();
}
return data;
}
public boolean hasGenerated( int dim, int chunkX, int chunkZ )
{
synchronized( WorldSettings.class )
{
NBTTagCompound data = this.loadSpawnData( dim, chunkX, chunkZ );
return data.getBoolean( chunkX + "," + chunkZ );
}
}
public void setGenerated( int dim, int chunkX, int chunkZ )
{
synchronized( WorldSettings.class )
{
NBTTagCompound data = this.loadSpawnData( dim, chunkX, chunkZ );
// edit.
data.setBoolean( chunkX + "," + chunkZ, true );
this.writeSpawnData( dim, chunkX, chunkZ, data );
}
}
void writeSpawnData( int dim, int chunkX, int chunkZ, NBTTagCompound data )
{
if( !Thread.holdsLock( WorldSettings.class ) )
{
throw new IllegalStateException( "Invalid Request" );
}
File file = new File( this.spawnDataFolder, dim + '_' + ( chunkX >> 4 ) + '_' + ( chunkZ >> 4 ) + ".dat" );
FileOutputStream fileOutputStream = null;
try
{
fileOutputStream = new FileOutputStream( file );
CompressedStreamTools.writeCompressed( data, fileOutputStream );
}
catch( Throwable e )
{
AELog.error( e );
}
finally
{
if( fileOutputStream != null )
{
try
{
fileOutputStream.close();
}
catch( IOException e )
{
AELog.error( e );
}
}
}
}
public boolean addNearByMeteorites( int dim, int chunkX, int chunkZ, NBTTagCompound newData )
{
synchronized( WorldSettings.class )
{
NBTTagCompound data = this.loadSpawnData( dim, chunkX, chunkZ );
// edit.
int size = data.getInteger( "num" );
data.setTag( String.valueOf( size ), newData );
data.setInteger( "num", size + 1 );
this.writeSpawnData( dim, chunkX, chunkZ, data );
return true;
}
}
public void shutdown()
{
this.save();
for( Integer dimID : this.storageCellDims )
{
DimensionManager.unregisterDimension( dimID );
}
this.storageCellDims.clear();
this.compass.kill();
instance = null;
}
@Override
public void save()
{
// populate new data
for( GridStorageSearch gs : this.loadedStorage.keySet() )
{
GridStorage thisStorage = gs.gridStorage.get();
if( thisStorage != null && thisStorage.getGrid() != null && !thisStorage.getGrid().isEmpty() )
{
String value = thisStorage.getValue();
this.get( "gridstorage", String.valueOf( thisStorage.getID() ), value ).set( value );
}
}
// save to files
if( this.hasChanged() )
{
super.save();
}
}
public void addStorageCellDim( int newDim )
{
this.storageCellDims.add( newDim );
DimensionManager.registerDimension( newDim, AEConfig.instance.storageProviderID );
NetworkHandler.instance.sendToAll( new PacketNewStorageDimension( newDim ) );
String[] values = new String[this.storageCellDims.size()];
for( int x = 0; x < values.length; x++ )
{
values[x] = String.valueOf( this.storageCellDims.get( x ) );
}
this.get( "DimensionManager", "StorageCells", new int[0] ).set( values );
this.save();
}
public CompassService getCompass()
{
return this.compass;
}
public void sendToPlayer( NetworkManager manager )
{
if( manager != null )
{
for( int newDim : this.get( "DimensionManager", "StorageCells", new int[0] ).getIntList() )
{
manager.scheduleOutboundPacket( ( new PacketNewStorageDimension( newDim ) ).getProxy() );
}
}
else
{
for( PlayerColor pc : TickHandler.INSTANCE.getPlayerColors().values() )
{
NetworkHandler.instance.sendToAll( pc.getPacket() );
}
}
}
public void init()
{
this.save();
}
public WorldCoord getStoredSize( int dim )
{
int x = this.get( "StorageCell" + dim, "scaleX", 0 ).getInt();
int y = this.get( "StorageCell" + dim, "scaleY", 0 ).getInt();
int z = this.get( "StorageCell" + dim, "scaleZ", 0 ).getInt();
return new WorldCoord( x, y, z );
}
public void setStoredSize( int dim, int targetX, int targetY, int targetZ )
{
this.get( "StorageCell" + dim, "scaleX", 0 ).set( targetX );
this.get( "StorageCell" + dim, "scaleY", 0 ).set( targetY );
this.get( "StorageCell" + dim, "scaleZ", 0 ).set( targetZ );
this.save();
}
/**
* lazy loading, can load any id, even ones that don't exist anymore.
*
* @param storageID ID of grid storage
*
* @return corresponding grid storage
*/
public GridStorage getGridStorage( long storageID )
{
GridStorageSearch gss = new GridStorageSearch( storageID );
WeakReference<GridStorageSearch> result = this.loadedStorage.get( gss );
if( result == null || result.get() == null )
{
String id = String.valueOf( storageID );
String Data = this.get( "gridstorage", id, "" ).getString();
GridStorage thisStorage = new GridStorage( Data, storageID, gss );
gss.gridStorage = new WeakReference<GridStorage>( thisStorage );
this.loadedStorage.put( gss, new WeakReference<GridStorageSearch>( gss ) );
return thisStorage;
}
return result.get().gridStorage.get();
}
/**
* create a new storage
*/
public GridStorage getNewGridStorage()
{
long storageID = this.nextGridStorage();
GridStorageSearch gss = new GridStorageSearch( storageID );
GridStorage newStorage = new GridStorage( storageID, gss );
gss.gridStorage = new WeakReference<GridStorage>( newStorage );
this.loadedStorage.put( gss, new WeakReference<GridStorageSearch>( gss ) );
return newStorage;
}
private long nextGridStorage()
{
long r = this.lastGridStorage;
this.lastGridStorage++;
this.get( "Counters", "lastGridStorage", this.lastGridStorage ).set( Long.toString( this.lastGridStorage ) );
return r;
}
public void destroyGridStorage( long id )
{
String stringID = String.valueOf( id );
this.getCategory( "gridstorage" ).remove( stringID );
}
public int getNextOrderedValue( String name )
{
Property p = this.get( "orderedValues", name, 0 );
int myValue = p.getInt();
p.set( myValue + 1 );
return myValue;
}
public int getPlayerID( GameProfile profile )
{
ConfigCategory playerList = this.getCategory( "players" );
if( playerList == null || profile == null || !profile.isComplete() )
{
return -1;
}
String uuid = profile.getId().toString();
Property prop = playerList.get( uuid );
if( prop != null && prop.isIntValue() )
{
return prop.getInt();
}
else
{
playerList.put( uuid, prop = new Property( uuid, String.valueOf( this.nextPlayer() ), Property.Type.INTEGER ) );
this.mappings.put( prop.getInt(), profile.getId() ); // add to reverse map
this.save();
return prop.getInt();
}
}
private long nextPlayer()
{
long r = this.lastPlayer;
this.lastPlayer++;
this.get( "Counters", "lastPlayer", this.lastPlayer ).set( this.lastPlayer );
return r;
}
public EntityPlayer getPlayerFromID( int playerID )
{
Optional<UUID> maybe = this.mappings.get( playerID );
if( maybe.isPresent() )
{
final UUID uuid = maybe.get();
for( EntityPlayer player : CommonHelper.proxy.getPlayers() )
{
if( player.getUniqueID().equals( uuid ) )
{
return player;
}
}
}
return null;
}
}
@@ -241,14 +241,15 @@ public final class ApiBlocks implements IBlocks
this.quartzPillarStair = constructor.registerBlockDefinition( new QuartzPillarStairBlock( quartzPillar ) );
this.skyStoneSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "SkyStoneSlabBlock" ) );
this.skyStoneBlockSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 1, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "SkyStoneBlockSlabBlock" ) );
this.skyStoneBrickSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 2, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "SkyStoneBrickSlabBlock" ) );
this.skyStoneSmallBrickSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 3, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "SkyStoneSmallBrickSlabBlock" ) );
this.fluixSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( fluixBlock, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "FluixSlabBlock" ) );
this.quartzSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( quartzBlock, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "QuartzSlabBlock" ) );
this.chiseledQuartzSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( chiseledQuartz, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "ChiseledQuartzSlabBlock" ) );;
this.quartzPillarSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( quartzPillar, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "QuartzPillarSlabBlock" ) );
this.skyStoneSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 0, EnumSet.of( AEFeature.DecorativeQuartzBlocks ), false, "SkyStoneSlabBlock" ) );
this.skyStoneBlockSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 1, EnumSet.of( AEFeature.DecorativeQuartzBlocks ), false, "SkyStoneBlockSlabBlock" ) );
this.skyStoneBrickSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 2, EnumSet.of( AEFeature.DecorativeQuartzBlocks ), false, "SkyStoneBrickSlabBlock" ) );
this.skyStoneSmallBrickSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 3, EnumSet.of( AEFeature.DecorativeQuartzBlocks ), false, "SkyStoneSmallBrickSlabBlock" ) );
this.fluixSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( fluixBlock, 0, EnumSet.of( AEFeature.DecorativeQuartzBlocks ), false, "FluixSlabBlock" ) );
this.quartzSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( quartzBlock, 0, EnumSet.of( AEFeature.DecorativeQuartzBlocks ), false, "QuartzSlabBlock" ) );
this.chiseledQuartzSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( chiseledQuartz, 0, EnumSet.of( AEFeature.DecorativeQuartzBlocks ), false, "ChiseledQuartzSlabBlock" ) );
;
this.quartzPillarSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( quartzPillar, 0, EnumSet.of( AEFeature.DecorativeQuartzBlocks ), false, "QuartzPillarSlabBlock" ) );
this.itemGen = constructor.registerBlockDefinition( new BlockItemGen() );
this.chunkLoader = constructor.registerBlockDefinition( new BlockChunkloader() );
@@ -61,6 +61,7 @@ public final class ApiParts implements IParts
private final IItemDefinition p2PTunnelRF;
private final IItemDefinition p2PTunnelLight;
private final IItemDefinition p2PTunnelOpenComputers;
private final IItemDefinition p2PTunnelPneumaticCraft;
private final IItemDefinition cableAnchor;
private final IItemDefinition monitor;
private final IItemDefinition semiDarkMonitor;
@@ -104,6 +105,7 @@ public final class ApiParts implements IParts
this.p2PTunnelRF = new DamagedItemDefinition( itemMultiPart.createPart( PartType.P2PTunnelRF ) );
this.p2PTunnelLight = new DamagedItemDefinition( itemMultiPart.createPart( PartType.P2PTunnelLight ) );
this.p2PTunnelOpenComputers = new DamagedItemDefinition( itemMultiPart.createPart( PartType.P2PTunnelOpenComputers ) );
this.p2PTunnelPneumaticCraft = new DamagedItemDefinition( itemMultiPart.createPart( PartType.P2PTunnelPressure ) );
this.cableAnchor = new DamagedItemDefinition( itemMultiPart.createPart( PartType.CableAnchor ) );
this.monitor = new DamagedItemDefinition( itemMultiPart.createPart( PartType.Monitor ) );
this.semiDarkMonitor = new DamagedItemDefinition( itemMultiPart.createPart( PartType.SemiDarkMonitor ) );
@@ -282,6 +284,12 @@ public final class ApiParts implements IParts
return this.p2PTunnelOpenComputers;
}
@Override
public IItemDefinition p2PTunnelPneumaticCraft()
{
return this.p2PTunnelPneumaticCraft;
}
@Override
public IItemDefinition cableAnchor()
{
@@ -1,3 +1,21 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.core.api.definitions;
@@ -10,6 +28,7 @@ import appeng.api.util.AEColor;
import appeng.api.util.AEColoredItemDefinition;
import appeng.core.FeatureHandlerRegistry;
import appeng.core.FeatureRegistry;
import appeng.core.features.ActivityState;
import appeng.core.features.ColoredItemDefinition;
import appeng.core.features.IAEFeature;
import appeng.core.features.IFeatureHandler;
@@ -35,7 +54,7 @@ public class DefinitionConstructor
if( definition instanceof ITileDefinition )
{
return ( (ITileDefinition) definition );
return( (ITileDefinition) definition );
}
throw new IllegalStateException( "No tile definition for " + feature );
@@ -47,7 +66,7 @@ public class DefinitionConstructor
if( definition instanceof IBlockDefinition )
{
return ( (IBlockDefinition) definition );
return( (IBlockDefinition) definition );
}
throw new IllegalStateException( "No block definition for " + feature );
@@ -76,7 +95,9 @@ public class DefinitionConstructor
{
for( AEColor color : AEColor.VALID_COLORS )
{
definition.add( color, new ItemStackSrc( targetItem, offset + color.ordinal() ) );
final ActivityState state = ActivityState.from( target.isEnabled() );
definition.add( color, new ItemStackSrc( targetItem, offset + color.ordinal(), state ) );
}
}
@@ -18,35 +18,35 @@
/* Example:
NBTTagCompound msg = new NBTTagCompound();
NBTTagCompound in = new NBTTagCompound();
NBTTagCompound out = new NBTTagCompound();
NBTTagCompound msg = new NBTTagCompound();
NBTTagCompound in = new NBTTagCompound();
NBTTagCompound out = new NBTTagCompound();
new ItemStack( Blocks.iron_ore ).writeToNBT( in );
new ItemStack( Items.iron_ingot ).writeToNBT( out );
msg.setTag( "in", in );
msg.setTag( "out", out );
msg.setInteger( "turns", 8 );
new ItemStack( Blocks.iron_ore ).writeToNBT( in );
new ItemStack( Items.iron_ingot ).writeToNBT( out );
msg.setTag( "in", in );
msg.setTag( "out", out );
msg.setInteger( "turns", 8 );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-grindable", msg );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-grindable", msg );
-- or --
NBTTagCompound msg = new NBTTagCompound();
NBTTagCompound in = new NBTTagCompound();
NBTTagCompound out = new NBTTagCompound();
NBTTagCompound optional = new NBTTagCompound();
NBTTagCompound msg = new NBTTagCompound();
NBTTagCompound in = new NBTTagCompound();
NBTTagCompound out = new NBTTagCompound();
NBTTagCompound optional = new NBTTagCompound();
new ItemStack( Blocks.iron_ore ).writeToNBT( in );
new ItemStack( Items.iron_ingot ).writeToNBT( out );
new ItemStack( Blocks.gravel ).writeToNBT( optional );
msg.setTag( "in", in );
msg.setTag( "out", out );
msg.setTag( "optional", optional );
msg.setFloat( "chance", 0.5 );
msg.setInteger( "turns", 8 );
new ItemStack( Blocks.iron_ore ).writeToNBT( in );
new ItemStack( Items.iron_ingot ).writeToNBT( out );
new ItemStack( Blocks.gravel ).writeToNBT( optional );
msg.setTag( "in", in );
msg.setTag( "out", out );
msg.setTag( "optional", optional );
msg.setFloat( "chance", 0.5 );
msg.setInteger( "turns", 8 );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-grindable", msg );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-grindable", msg );
*/
@@ -18,14 +18,14 @@
/* Example:
NBTTagCompound msg = new NBTTagCompound();
NBTTagCompound item = new NBTTagCompound();
NBTTagCompound msg = new NBTTagCompound();
NBTTagCompound item = new NBTTagCompound();
new ItemStack( Blocks.anvil ).writeToNBT( item );
msg.setTag( "item", item );
msg.setDouble( "weight", 32.0 );
new ItemStack( Blocks.anvil ).writeToNBT( item );
msg.setTag( "item", item );
msg.setDouble( "weight", 32.0 );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-mattercannon-ammo", msg );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-mattercannon-ammo", msg );
*/
@@ -1,6 +1,6 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -18,12 +18,12 @@
/* Example:
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-me", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-bc-power", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-ic2-power", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-redstone", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-fluid", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-item", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-me", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-bc-power", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-ic2-power", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-redstone", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-fluid", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-item", new ItemStack( myBlockOrItem ) );
*/
@@ -31,6 +31,7 @@ package appeng.core.api.imc;
import java.util.Arrays;
import java.util.Locale;
import net.minecraft.item.ItemStack;
@@ -47,7 +48,7 @@ public class IMCP2PAttunement implements IIMCProcessor
@Override
public void process( IMCMessage m )
{
String key = m.key.substring( "add-p2p-attunement-".length() ).replace( '-', '_' ).toUpperCase();
String key = m.key.substring( "add-p2p-attunement-".length() ).replace( '-', '_' ).toUpperCase( Locale.ENGLISH );
TunnelType type = TunnelType.valueOf( key );
@@ -18,7 +18,7 @@
/* Example:
FMLInterModComms.sendMessage( "appliedenergistics2", "whitelist-spatial", "mymod.tileentities.MyTileEntity" );
FMLInterModComms.sendMessage( "appliedenergistics2", "whitelist-spatial", "mymod.tileentities.MyTileEntity" );
*/
@@ -1,3 +1,4 @@
package appeng.core.crash;
@@ -1,3 +1,4 @@
package appeng.core.crash;
@@ -7,7 +8,7 @@ import appeng.core.AEConfig;
public class ModCrashEnhancement extends BaseCrashEnhancement
{
private static final String MOD_VERSION = AEConfig.CHANNEL + ' ' + AEConfig.VERSION + " for Forge " + // WHAT?
net.minecraftforge.common.ForgeVersion.majorVersion + '.' // majorVersion
net.minecraftforge.common.ForgeVersion.majorVersion + '.' // majorVersion
+ net.minecraftforge.common.ForgeVersion.minorVersion + '.' // minorVersion
+ net.minecraftforge.common.ForgeVersion.revisionVersion + '.' // revisionVersion
+ net.minecraftforge.common.ForgeVersion.buildVersion;
@@ -27,9 +27,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
import appeng.api.definitions.IBlockDefinition;
import appeng.block.AEBaseBlock;
import appeng.core.CommonHelper;
import appeng.core.CreativeTab;
import appeng.util.Platform;
public final class AEBlockFeatureHandler implements IFeatureHandler
@@ -57,7 +57,7 @@ public enum AEFeature
DenseEnergyCells( "HigherCapacity" ), DenseCables( "HigherCapacity" ),
P2PTunnelRF( "P2PTunnels" ), P2PTunnelME( "P2PTunnels" ), P2PTunnelItems( "P2PTunnels" ), P2PTunnelRedstone( "P2PTunnels" ), P2PTunnelEU( "P2PTunnels" ), P2PTunnelLiquids( "P2PTunnels" ), P2PTunnelLight( "P2PTunnels" ), P2PTunnelOpenComputers( "P2PTunnels" ),
P2PTunnelRF( "P2PTunnels" ), P2PTunnelME( "P2PTunnels" ), P2PTunnelItems( "P2PTunnels" ), P2PTunnelRedstone( "P2PTunnels" ), P2PTunnelEU( "P2PTunnels" ), P2PTunnelLiquids( "P2PTunnels" ), P2PTunnelLight( "P2PTunnels" ), P2PTunnelOpenComputers( "P2PTunnels" ), P2PTunnelPressure( "P2PTunnels" ),
MassCannonBlockDamage( "BlockFeatures" ), TinyTNTBlockDamage( "BlockFeatures" ), Facades( "Facades" ),
@@ -79,7 +79,7 @@ public enum AEFeature
AEFeature( String cat )
{
this(cat, true);
this( cat, true );
}
AEFeature( String cat, boolean defaultValue )
@@ -29,6 +29,7 @@ import appeng.api.definitions.ITileDefinition;
import appeng.block.AEBaseTileBlock;
import appeng.core.CommonHelper;
import appeng.core.CreativeTab;
import appeng.tile.AEBaseTile;
import appeng.util.Platform;
@@ -82,6 +83,7 @@ public final class AETileBlockFeatureHandler implements IFeatureHandler
GameRegistry.registerBlock( this.featured, null, registryName );
GameRegistry.registerItem( this.definition.maybeItem().get(), registryName );
GameRegistry.registerTileEntity( this.featured.getTileEntityClass(), this.featured.toString() );
AEBaseTile.registerTileItem( this.featured.getTileEntityClass(), new BlockStackSrc( this.featured, 0, ActivityState.from( this.isFeatureAvailable() ) ) );
}
}
}
@@ -1,7 +1,38 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.core.features;
public enum ActivityState
{
Enabled, Disabled
Enabled,
Disabled;
public static ActivityState from( boolean enabled )
{
if( enabled )
{
return ActivityState.Enabled;
}
else
{
return ActivityState.Disabled;
}
}
}
@@ -21,6 +21,7 @@ package appeng.core.features;
import java.lang.reflect.Constructor;
import com.google.common.base.Function;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.collect.ObjectArrays;
@@ -37,8 +38,8 @@ import appeng.block.AEBaseBlock;
public class BlockDefinition extends ItemDefinition implements IBlockDefinition
{
private final Block block;
private final boolean enabled;
private static final ItemBlockTransformer ITEMBLOCK_TRANSFORMER = new ItemBlockTransformer();
private final Optional<Block> block;
public BlockDefinition( Block block, ActivityState state )
{
@@ -47,8 +48,14 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition
Preconditions.checkNotNull( block );
Preconditions.checkNotNull( state );
this.block = block;
this.enabled = state == ActivityState.Enabled;
if( state == ActivityState.Enabled )
{
this.block = Optional.of( block );
}
else
{
this.block = Optional.absent();
}
}
/**
@@ -92,7 +99,7 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition
*
* TODO: throw an exception instead of returning null? As this could cause issue later on.
*
* @param block the block to create the {@link ItemBlock} from
* @param block the block to create the {@link ItemBlock} from
* @param itemclass the class used to construct it.
*
* @return an {@link Item} for the block. Actually always a sub type of {@link ItemBlock}
@@ -121,38 +128,51 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition
@Override
public final Optional<Block> maybeBlock()
{
return Optional.of( this.block );
return this.block;
}
@Override
public final Optional<ItemBlock> maybeItemBlock()
{
if( this.enabled )
{
return Optional.of( new ItemBlock( this.block ) );
}
else
{
return Optional.absent();
}
return this.block.transform( ITEMBLOCK_TRANSFORMER );
}
@Override
public final Optional<ItemStack> maybeStack( int stackSize )
{
if( this.enabled )
{
return Optional.of( new ItemStack( this.block ) );
}
else
{
return Optional.absent();
}
return this.block.transform( new ItemStackTransformer( stackSize ) );
}
@Override
public final boolean isSameAs( IBlockAccess world, int x, int y, int z )
{
return this.enabled && world.getBlock( x, y, z ) == this.block;
return this.isEnabled() && world.getBlock( x, y, z ) == this.block.get();
}
private static class ItemBlockTransformer implements Function<Block, ItemBlock>
{
@Override
public ItemBlock apply( Block input )
{
return new ItemBlock( input );
}
}
private static class ItemStackTransformer implements Function<Block, ItemStack>
{
private final int stackSize;
public ItemStackTransformer( int stackSize )
{
Preconditions.checkArgument( stackSize > 0 );
this.stackSize = stackSize;
}
@Override
public ItemStack apply( Block input )
{
return new ItemStack( input, this.stackSize );
}
}
}
@@ -0,0 +1,74 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.core.features;
import javax.annotation.Nullable;
import com.google.common.base.Preconditions;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class BlockStackSrc implements IStackSrc
{
public final Block block;
public final int damage;
private final boolean enabled;
public BlockStackSrc( Block block, int damage, ActivityState state )
{
Preconditions.checkNotNull( block );
Preconditions.checkArgument( damage >= 0 );
Preconditions.checkNotNull( state );
Preconditions.checkArgument( state == ActivityState.Enabled || state == ActivityState.Disabled );
this.block = block;
this.damage = damage;
this.enabled = state == ActivityState.Enabled;
}
@Nullable
@Override
public ItemStack stack( int i )
{
return new ItemStack( this.block, i, this.damage );
}
@Override
public Item getItem()
{
return null;
}
@Override
public int getDamage()
{
return this.damage;
}
@Override
public boolean isEnabled()
{
return this.enabled;
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -54,7 +54,7 @@ public final class ColoredItemDefinition implements AEColoredItemDefinition
return null;
}
return is.item;
return is.getItem();
}
@Override
@@ -97,6 +97,6 @@ public final class ColoredItemDefinition implements AEColoredItemDefinition
return false;
}
return comparableItem.getItem() == is.item && comparableItem.getItemDamage() == is.damage;
return comparableItem.getItem() == is.getItem() && comparableItem.getItemDamage() == is.damage;
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -21,6 +21,7 @@ package appeng.core.features;
import javax.annotation.Nonnull;
import com.google.common.base.Function;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
@@ -33,27 +34,39 @@ import appeng.api.definitions.IItemDefinition;
public final class DamagedItemDefinition implements IItemDefinition
{
private final IStackSrc source;
private static final ItemTransformer ITEM_TRANSFORMER = new ItemTransformer();
private final Optional<IStackSrc> source;
public DamagedItemDefinition( @Nonnull IStackSrc source )
{
this.source = Preconditions.checkNotNull( source );
Preconditions.checkNotNull( source );
if( source.isEnabled() )
{
this.source = Optional.of( source );
}
else
{
this.source = Optional.absent();
}
}
@Override
public Optional<Item> maybeItem()
{
final Item item = this.source.getItem();
return Optional.fromNullable( item );
return this.source.transform( ITEM_TRANSFORMER );
}
@Override
public Optional<ItemStack> maybeStack( int stackSize )
{
final ItemStack stack = this.source.stack( stackSize );
return this.source.transform( new ItemStackTransformer( stackSize ) );
}
return Optional.fromNullable( stack );
@Override
public boolean isEnabled()
{
return this.source.isPresent();
}
@Override
@@ -64,7 +77,7 @@ public final class DamagedItemDefinition implements IItemDefinition
return false;
}
return comparableStack.getItem() == this.source.getItem() && comparableStack.getItemDamage() == this.source.getDamage();
return this.isEnabled() && comparableStack.getItem() == this.source.get().getItem() && comparableStack.getItemDamage() == this.source.get().getDamage();
}
@Override
@@ -72,4 +85,31 @@ public final class DamagedItemDefinition implements IItemDefinition
{
return false;
}
private static class ItemTransformer implements Function<IStackSrc, Item>
{
@Override
public Item apply( IStackSrc input )
{
return input.getItem();
}
}
private static class ItemStackTransformer implements Function<IStackSrc, ItemStack>
{
private final int stackSize;
public ItemStackTransformer( int stackSize )
{
Preconditions.checkArgument( stackSize > 0 );
this.stackSize = stackSize;
}
@Override
public ItemStack apply( IStackSrc input )
{
return input.stack( this.stackSize );
}
}
}
@@ -1,3 +1,4 @@
package appeng.core.features;
@@ -92,7 +93,6 @@ public final class DefinitionConverter
}
}
private static class AEItem extends AEComparable
{
private final IItemDefinition definition;
@@ -119,7 +119,6 @@ public final class DefinitionConverter
}
}
private static class AEBlock extends AEItem
{
private final IBlockDefinition definition;
@@ -145,7 +144,6 @@ public final class DefinitionConverter
}
}
private static class AETile extends AEBlock
{
private final ITileDefinition definition;
@@ -1,6 +1,6 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -31,4 +31,6 @@ public interface IStackSrc
Item getItem();
int getDamage();
boolean isEnabled();
}
@@ -1,6 +1,6 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -19,6 +19,7 @@
package appeng.core.features;
import com.google.common.base.Function;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
@@ -32,41 +33,45 @@ import appeng.util.Platform;
public class ItemDefinition implements IItemDefinition
{
private final Item item;
private final boolean enabled;
private final Optional<Item> item;
public ItemDefinition( Item item, ActivityState state )
{
Preconditions.checkNotNull( item );
Preconditions.checkNotNull( state );
this.item = item;
this.enabled = state == ActivityState.Enabled;
if( state == ActivityState.Enabled )
{
this.item = Optional.of( item );
}
else
{
this.item = Optional.absent();
}
}
@Override
public final Optional<Item> maybeItem()
{
return Optional.of( this.item );
return this.item;
}
@Override
public Optional<ItemStack> maybeStack( int stackSize )
{
if( this.enabled )
{
return Optional.of( new ItemStack( this.item ) );
}
else
{
return Optional.absent();
}
return this.item.transform( new ItemStackTransformer( stackSize ) );
}
@Override
public boolean isEnabled()
{
return this.item.isPresent();
}
@Override
public final boolean isSameAs( ItemStack comparableStack )
{
return this.enabled && Platform.isSameItemType( comparableStack, this.maybeStack( 1 ).get() );
return this.isEnabled() && Platform.isSameItemType( comparableStack, this.maybeStack( 1 ).get() );
}
@Override
@@ -74,4 +79,22 @@ public class ItemDefinition implements IItemDefinition
{
return false;
}
private static class ItemStackTransformer implements Function<Item, ItemStack>
{
private final int stackSize;
public ItemStackTransformer( int stackSize )
{
Preconditions.checkArgument( stackSize > 0 );
this.stackSize = stackSize;
}
@Override
public ItemStack apply( Item input )
{
return new ItemStack( input, this.stackSize );
}
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -21,7 +21,8 @@ package appeng.core.features;
import javax.annotation.Nullable;
import net.minecraft.block.Block;
import com.google.common.base.Preconditions;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -29,39 +30,27 @@ import net.minecraft.item.ItemStack;
public class ItemStackSrc implements IStackSrc
{
public final Item item;
public final Block block;
private final Item item;
public final int damage;
private final boolean enabled;
public ItemStackSrc( Item i, int dmg )
public ItemStackSrc( Item item, int damage, ActivityState state )
{
this.block = null;
this.item = i;
this.damage = dmg;
}
Preconditions.checkNotNull( item );
Preconditions.checkArgument( damage >= 0 );
Preconditions.checkNotNull( state );
Preconditions.checkArgument( state == ActivityState.Enabled || state == ActivityState.Disabled );
public ItemStackSrc( Block b, int dmg )
{
this.item = null;
this.block = b;
this.damage = dmg;
this.item = item;
this.damage = damage;
this.enabled = state == ActivityState.Enabled;
}
@Nullable
@Override
public ItemStack stack( int i )
{
if( this.block != null )
{
return new ItemStack( this.block, i, this.damage );
}
if( this.item != null )
{
return new ItemStack( this.item, i, this.damage );
}
return null;
return new ItemStack( this.item, i, this.damage );
}
@Override
@@ -75,4 +64,10 @@ public class ItemStackSrc implements IStackSrc
{
return this.damage;
}
@Override
public boolean isEnabled()
{
return this.enabled;
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -19,6 +19,8 @@
package appeng.core.features;
import com.google.common.base.Preconditions;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -27,12 +29,11 @@ import appeng.items.materials.MaterialType;
public class MaterialStackSrc implements IStackSrc
{
final MaterialType src;
private final MaterialType src;
public MaterialStackSrc( MaterialType src )
{
assert src != null;
Preconditions.checkNotNull( src );
this.src = src;
}
@@ -54,4 +55,10 @@ public class MaterialStackSrc implements IStackSrc
{
return this.src.damageValue;
}
@Override
public boolean isEnabled()
{
return true;
}
}
@@ -21,17 +21,15 @@ package appeng.core.features;
import java.util.EnumSet;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSlab;
import com.google.common.base.Optional;
import cpw.mods.fml.common.registry.GameRegistry;
import appeng.api.definitions.IBlockDefinition;
import appeng.block.AEBaseItemBlockSlab;
import appeng.block.AEBaseSlabBlock;
import appeng.core.CreativeTab;
import com.google.common.base.Optional;
import cpw.mods.fml.common.registry.GameRegistry;
public class SlabBlockFeatureHandler implements IFeatureHandler
{
@@ -44,7 +42,7 @@ public class SlabBlockFeatureHandler implements IFeatureHandler
{
final ActivityState state = new FeaturedActiveChecker( features ).getActivityState();
this.slabs = slabs;
this.extractor = new FeatureNameExtractor( slabs.getClass(), Optional.<String>absent());
this.extractor = new FeatureNameExtractor( slabs.getClass(), Optional.<String>absent() );
this.enabled = state == ActivityState.Enabled;
this.definition = new BlockDefinition( slabs, state );
}
@@ -67,8 +65,8 @@ public class SlabBlockFeatureHandler implements IFeatureHandler
if( this.enabled )
{
this.slabs.setCreativeTab( CreativeTab.instance );
GameRegistry.registerBlock( slabs, AEBaseItemBlockSlab.class, "tile." + slabs.name(), slabs, slabs.doubleSlabs(), false);
GameRegistry.registerBlock( slabs.doubleSlabs(), AEBaseItemBlockSlab.class, "tile." + slabs.name() + ".double", slabs, slabs.doubleSlabs(), true);
GameRegistry.registerBlock( this.slabs, AEBaseItemBlockSlab.class, "tile." + this.slabs.name(), this.slabs, this.slabs.doubleSlabs(), false );
GameRegistry.registerBlock( this.slabs.doubleSlabs(), AEBaseItemBlockSlab.class, "tile." + this.slabs.name() + ".double", this.slabs, this.slabs.doubleSlabs(), true );
}
}
}
@@ -19,6 +19,7 @@
package appeng.core.features;
import com.google.common.base.Function;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
@@ -30,7 +31,8 @@ import appeng.block.AEBaseTileBlock;
public final class TileDefinition extends BlockDefinition implements ITileDefinition
{
private final AEBaseTileBlock block;
private static final TileEntityTransformer TILEENTITY_TRANSFORMER = new TileEntityTransformer();
private final Optional<AEBaseTileBlock> block;
public TileDefinition( AEBaseTileBlock block, ActivityState state )
{
@@ -40,14 +42,30 @@ public final class TileDefinition extends BlockDefinition implements ITileDefini
Preconditions.checkNotNull( state );
Preconditions.checkNotNull( block.getTileEntityClass() );
this.block = block;
if( state == ActivityState.Enabled )
{
this.block = Optional.of( block );
}
else
{
this.block = Optional.absent();
}
}
@Override
public Optional<? extends Class<? extends TileEntity>> maybeEntity()
{
final Class<? extends TileEntity> entity = this.block.getTileEntityClass();
return this.block.transform( TILEENTITY_TRANSFORMER );
}
return Optional.of( entity );
private static class TileEntityTransformer implements Function<AEBaseTileBlock, Class<? extends TileEntity>>
{
@Override
public Class<? extends TileEntity> apply( AEBaseTileBlock input )
{
final Class<? extends TileEntity> entity = input.getTileEntityClass();
return entity;
}
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -77,6 +77,12 @@ public final class WrappedDamageItemDefinition implements ITileDefinition
return this.definition.maybeBlock().transform( new BlockTransformFunction( stackSize, this.damage ) );
}
@Override
public boolean isEnabled()
{
return this.definition.isEnabled();
}
@Override
public boolean isSameAs( ItemStack comparableStack )
{
@@ -1,8 +1,27 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.core.features.registries;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -21,12 +40,12 @@ import appeng.core.features.registries.entries.InscriberRecipe;
/**
* @author thatsIch
* @version rv2
* @version rv3
* @since rv2
*/
public final class InscriberRegistry implements IInscriberRegistry
{
private final List<IInscriberRecipe> recipes;
private final Set<IInscriberRecipe> recipes;
private final Set<ItemStack> optionals;
private final Set<ItemStack> inputs;
@@ -34,14 +53,14 @@ public final class InscriberRegistry implements IInscriberRegistry
{
this.inputs = new HashSet<ItemStack>();
this.optionals = new HashSet<ItemStack>();
this.recipes = new ArrayList<IInscriberRecipe>();
this.recipes = new HashSet<IInscriberRecipe>();
}
@Nonnull
@Override
public List<IInscriberRecipe> getRecipes()
public Collection<IInscriberRecipe> getRecipes()
{
return this.recipes;
return Collections.unmodifiableCollection( this.recipes );
}
@Nonnull
@@ -168,11 +187,11 @@ public final class InscriberRegistry implements IInscriberRegistry
{
throw new IllegalStateException( "Output must be defined." );
}
if ( this.topOptional == null && this.bottomOptional == null )
if( this.topOptional == null && this.bottomOptional == null )
{
throw new IllegalStateException( "One optional must be defined." );
}
if ( this.type == null )
if( this.type == null )
{
throw new IllegalStateException( "Process type must be defined." );
}
@@ -21,6 +21,7 @@ package appeng.core.features.registries;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Nullable;
import net.minecraft.init.Blocks;
@@ -1,6 +1,6 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -19,12 +19,14 @@
package appeng.core.features.registries;
import javax.annotation.Nullable;
import com.mojang.authlib.GameProfile;
import net.minecraft.entity.player.EntityPlayer;
import appeng.api.features.IPlayerRegistry;
import appeng.core.WorldSettings;
import appeng.core.worlddata.WorldData;
public class PlayerRegistry implements IPlayerRegistry
@@ -33,18 +35,24 @@ public class PlayerRegistry implements IPlayerRegistry
@Override
public int getID( GameProfile username )
{
return WorldSettings.getInstance().getPlayerID( username );
if( username == null || !username.isComplete() )
{
return -1;
}
return WorldData.instance().playerData().getPlayerID( username );
}
@Override
public int getID( EntityPlayer player )
{
return WorldSettings.getInstance().getPlayerID( player.getGameProfile() );
return this.getID( player.getGameProfile() );
}
@Nullable
@Override
public EntityPlayer findPlayer( int playerID )
{
return WorldSettings.getInstance().getPlayerFromID( playerID );
return WorldData.instance().playerData().getPlayerFromID( playerID );
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -19,8 +19,12 @@
package appeng.core.features.registries;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Locale;
import java.util.Map;
import javax.annotation.Nullable;
import appeng.api.features.IRecipeHandlerRegistry;
import appeng.api.recipes.ICraftHandler;
@@ -30,16 +34,21 @@ import appeng.core.AELog;
import appeng.recipes.RecipeHandler;
/**
* @author AlgorithmX2
* @author thatsIch
* @version rv3 - 10.08.2015
* @since rv0
*/
public class RecipeHandlerRegistry implements IRecipeHandlerRegistry
{
final HashMap<String, Class<? extends ICraftHandler>> handlers = new HashMap<String, Class<? extends ICraftHandler>>();
final LinkedList<ISubItemResolver> resolvers = new LinkedList<ISubItemResolver>();
private final Map<String, Class<? extends ICraftHandler>> handlers = new HashMap<String, Class<? extends ICraftHandler>>( 20 );
private final Collection<ISubItemResolver> resolvers = new LinkedList<ISubItemResolver>();
@Override
public void addNewCraftHandler( String name, Class<? extends ICraftHandler> handler )
{
this.handlers.put( name.toLowerCase(), handler );
this.handlers.put( name.toLowerCase( Locale.ENGLISH ), handler );
}
@Override
@@ -48,6 +57,7 @@ public class RecipeHandlerRegistry implements IRecipeHandlerRegistry
this.resolvers.add( sir );
}
@Nullable
@Override
public ICraftHandler getCraftHandlerFor( String name )
{
@@ -64,7 +74,9 @@ public class RecipeHandlerRegistry implements IRecipeHandlerRegistry
{
AELog.severe( "Error Caused when trying to construct " + clz.getName() );
AELog.error( e );
this.handlers.put( name, null ); // clear it..
return null;
}
}
@@ -75,6 +87,7 @@ public class RecipeHandlerRegistry implements IRecipeHandlerRegistry
return new RecipeHandler();
}
@Nullable
@Override
public Object resolveItem( String nameSpace, String itemName )
{
@@ -1,3 +1,4 @@
package appeng.core.features.registries.entries;
@@ -1,3 +1,4 @@
package appeng.core.features.registries.entries;
@@ -94,7 +95,7 @@ public class InscriberRecipe implements IInscriberRecipe
{
return true;
}
if( !(o instanceof IInscriberRecipe) )
if( !( o instanceof IInscriberRecipe ) )
{
return false;
}
@@ -113,7 +114,7 @@ public class InscriberRecipe implements IInscriberRecipe
{
return false;
}
if( !this.maybeBot.equals( that.getBottomOptional()) )
if( !this.maybeBot.equals( that.getBottomOptional() ) )
{
return false;
}
@@ -61,7 +61,9 @@ public enum ButtonToolTips
BlockPlacement, BlockPlacementYes, BlockPlacementNo,
// Used in the tooltips of the items in the terminal, when moused over
ItemsStored, ItemsRequestable;
ItemsStored, ItemsRequestable,
SchedulingMode, SchedulingModeDefault, SchedulingModeRoundRobin, SchedulingModeRandom;
final String root;
@@ -45,7 +45,7 @@ public enum GuiText
CraftingTerminal, FormationPlane, Inscriber, QuartzCuttingKnife,
// tunnel names
METunnel, ItemTunnel, RedstoneTunnel, EUTunnel, FluidTunnel, OCTunnel, LightTunnel, RFTunnel,
METunnel, ItemTunnel, RedstoneTunnel, EUTunnel, FluidTunnel, OCTunnel, LightTunnel, RFTunnel, PressureTunnel,
StoredSize, CopyMode, CopyModeDesc, PatternTerminal, CraftingPattern,
@@ -30,7 +30,7 @@ public enum PlayerMessages
isNowLocked, isNowUnlocked,
AmmoDepleted,
CommunicationError, OutOfRange, DeviceNotPowered, DeviceNotWirelessTerminal, DeviceNotLinked, StationCanNotBeLocated,
SettingCleared,;
SettingCleared, ;
public IChatComponent get()
{
@@ -47,7 +47,9 @@ public enum TickRates
LightTunnel( 5, 120 ),
OpenComputersTunnel( 1, 5 );
OpenComputersTunnel( 1, 5 ),
PressureTunnel( 1, 120 );
public int min;
public int max;
@@ -38,20 +38,24 @@ import appeng.core.features.AEFeature;
public class PlayerStatsRegistration
{
/**
* {@link cpw.mods.fml.common.eventhandler.EventBus} to which the handlers might get posted to depending if the feature is enabled
* {@link cpw.mods.fml.common.eventhandler.EventBus} to which the handlers might get posted to depending if the
* feature is enabled
*/
private final EventBus bus;
/**
* is true if the {@link appeng.core.features.AEFeature#Achievements} is enabled in the {@param config}
* is true if the {@link appeng.core.features.AEFeature#Achievements} is enabled in the
*
* @param config}
*/
private final boolean isAchievementFeatureEnabled;
/**
* Constructs this with an {@link cpw.mods.fml.common.eventhandler.EventBus} and {@link appeng.core.AEConfig}.
*
* @param bus {@see #bus}
* @param config {@link appeng.core.AEConfig} which is used to determine if the {@link appeng.core.features.AEFeature#Achievements} is enabled
* @param bus {@see #bus}
* @param config {@link appeng.core.AEConfig} which is used to determine if the
* {@link appeng.core.features.AEFeature#Achievements} is enabled
*/
public PlayerStatsRegistration( EventBus bus, AEConfig config )
{
@@ -60,7 +64,9 @@ public class PlayerStatsRegistration
}
/**
* Registers the {@link appeng.core.stats.AchievementCraftingHandler} and {@link appeng.core.stats.AchievementPickupHandler} to the {@link #bus} if {@link #isAchievementFeatureEnabled} is true.
* Registers the {@link appeng.core.stats.AchievementCraftingHandler} and
* {@link appeng.core.stats.AchievementPickupHandler} to the {@link #bus} if {@link #isAchievementFeatureEnabled} is
* true.
*/
public void registerAchievementHandlers()
{
@@ -76,7 +82,8 @@ public class PlayerStatsRegistration
}
/**
* Registers the {@link appeng.core.stats.AchievementHierarchy} and adds all {@link appeng.core.stats.Achievements} to a new {@link net.minecraftforge.common.AchievementPage}.
* Registers the {@link appeng.core.stats.AchievementHierarchy} and adds all {@link appeng.core.stats.Achievements}
* to a new {@link net.minecraftforge.common.AchievementPage}.
*/
public void registerAchievements()
{
@@ -56,7 +56,6 @@ public class AppEngPacketHandlerBase
{
private static final Map<Class<? extends AppEngPacket>, PacketTypes> REVERSE_LOOKUP = new HashMap<Class<? extends AppEngPacket>, AppEngPacketHandlerBase.PacketTypes>();
public enum PacketTypes
{
PACKET_COMPASS_REQUEST( PacketCompassRequest.class ),
@@ -100,7 +100,7 @@ import appeng.parts.automation.PartFormationPlane;
import appeng.parts.automation.PartLevelEmitter;
import appeng.parts.misc.PartStorageBus;
import appeng.parts.reporting.PartCraftingTerminal;
import appeng.parts.reporting.PartMonitor;
import appeng.parts.reporting.PartInterfaceTerminal;
import appeng.parts.reporting.PartPatternTerminal;
import appeng.tile.crafting.TileCraftingTile;
import appeng.tile.crafting.TileMolecularAssembler;
@@ -187,7 +187,7 @@ public enum GuiBridge implements IGuiHandler
GUI_CRAFTING_CONFIRM( ContainerCraftConfirm.class, ITerminalHost.class, GuiHostType.ITEM_OR_WORLD, SecurityPermissions.CRAFT ),
GUI_INTERFACE_TERMINAL( ContainerInterfaceTerminal.class, PartMonitor.class, GuiHostType.WORLD, SecurityPermissions.BUILD ),
GUI_INTERFACE_TERMINAL( ContainerInterfaceTerminal.class, PartInterfaceTerminal.class, GuiHostType.WORLD, SecurityPermissions.BUILD ),
GUI_CRAFTING_STATUS( ContainerCraftingStatus.class, ITerminalHost.class, GuiHostType.ITEM_OR_WORLD, SecurityPermissions.CRAFT );
@@ -1,6 +1,6 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -31,8 +31,8 @@ import cpw.mods.fml.common.network.FMLNetworkEvent.ServerConnectionFromClientEve
import cpw.mods.fml.common.network.FMLNetworkEvent.ServerCustomPacketEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import appeng.core.WorldSettings;
import appeng.core.sync.AppEngPacket;
import appeng.core.worlddata.WorldData;
public class NetworkHandler
@@ -83,7 +83,7 @@ public class NetworkHandler
@SubscribeEvent
public void newConnection( ServerConnectionFromClientEvent ev )
{
WorldSettings.getInstance().sendToPlayer( ev.manager );
WorldData.instance().dimensionData().sendToPlayer( ev.manager );
}
@SubscribeEvent
@@ -91,7 +91,7 @@ public class NetworkHandler
{
if( loginEvent.player instanceof EntityPlayerMP )
{
WorldSettings.getInstance().sendToPlayer( null );
WorldData.instance().dimensionData().sendToPlayer( null );
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -26,10 +26,10 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import appeng.api.util.DimensionalCoord;
import appeng.core.WorldSettings;
import appeng.core.sync.AppEngPacket;
import appeng.core.sync.network.INetworkInfo;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.worlddata.WorldData;
import appeng.services.compass.ICompassCallback;
@@ -79,6 +79,6 @@ public class PacketCompassRequest extends AppEngPacket implements ICompassCallba
this.talkBackTo = player;
DimensionalCoord loc = new DimensionalCoord( player.worldObj, this.cx << 4, this.cdy << 5, this.cz << 4 );
WorldSettings.getInstance().getCompass().getCompassDirection( loc, 174, this );
WorldData.instance().compassData().service().getCompassDirection( loc, 174, this );
}
}
@@ -67,7 +67,7 @@ public final class PacketConfigButton extends AppEngPacket
public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player )
{
EntityPlayerMP sender = (EntityPlayerMP) player;
if ( sender.openContainer instanceof AEBaseContainer )
if( sender.openContainer instanceof AEBaseContainer )
{
final AEBaseContainer baseContainer = (AEBaseContainer) sender.openContainer;
if( baseContainer.getTarget() instanceof IConfigurableObject )
@@ -219,7 +219,7 @@ public class PacketNEIRecipe extends AppEngPacket
// If that doesn't work, grab from the player's inventory
if( whichItem == null && playerInventory != null )
{
whichItem = extractItemFromPlayerInventory( player, realForFake, patternItem );
whichItem = this.extractItemFromPlayerInventory( player, realForFake, patternItem );
}
craftMatrix.setInventorySlotContents( x, whichItem );
@@ -0,0 +1,60 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.core.worlddata;
import java.io.File;
import javax.annotation.Nonnull;
import com.google.common.base.Preconditions;
import appeng.services.CompassService;
/**
* @author thatsIch
* @version rv3 - 30.05.2015
* @since rv3 30.05.2015
*/
final class CompassData implements IWorldCompassData, IOnWorldStoppable
{
@Nonnull
private final CompassService service;
public CompassData( @Nonnull final File compassDirectory, @Nonnull final CompassService service )
{
Preconditions.checkNotNull( compassDirectory );
Preconditions.checkNotNull( service );
this.service = service;
}
@Override
public CompassService service()
{
return this.service;
}
@Override
public void onWorldStop()
{
this.service.kill();
}
}
@@ -0,0 +1,174 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.core.worlddata;
import java.io.File;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import net.minecraft.network.NetworkManager;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
import appeng.api.util.WorldCoord;
import appeng.core.AEConfig;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketNewStorageDimension;
import appeng.hooks.TickHandler;
/**
* @author thatsIch
* @version rv3 - 30.05.2015
* @since rv3 30.05.2015
*/
final class DimensionData implements IWorldDimensionData, IOnWorldStartable, IOnWorldStoppable
{
private static final String CONFIG_CATEGORY = "DimensionManager";
private static final String CONFIG_KEY = "StorageCells";
private static final int[] STORAGE_CELLS_DEFAULT = new int[0];
private static final String STORAGE_CELL_CATEGORY = "StorageCell";
private static final String STORAGE_CELL_SCALE_X_KEY = "scaleX";
private static final String STORAGE_CELL_SCALE_Y_KEY = "scaleY";
private static final String STORAGE_CELL_SCALE_Z_KEY = "scaleZ";
private static final String PACKAGE_DEST_CATEGORY = "DimensionManager";
private static final String PACKAGE_KEY_CATEGORY = "StorageCells";
private static final int[] PACKAGE_DEF_CATEGORY = new int[0];
private final Configuration config;
private final List<Integer> storageCellDimensionIDs;
DimensionData( @Nonnull final File parentFile, @Nonnull final String configVersion )
{
Preconditions.checkNotNull( parentFile );
Preconditions.checkNotNull( configVersion );
Preconditions.checkArgument( !configVersion.isEmpty() );
this.config = new Configuration( parentFile, configVersion );
final int[] storageCellIDs = this.storageCellIDsProperty().getIntList();
this.storageCellDimensionIDs = Lists.newArrayList();
for( int storageCellID : storageCellIDs )
{
this.storageCellDimensionIDs.add( storageCellID );
}
}
private Property storageCellIDsProperty()
{
return this.config.get( CONFIG_CATEGORY, CONFIG_KEY, STORAGE_CELLS_DEFAULT );
}
@Override
public void onWorldStart()
{
for( Integer storageCellDimID : this.storageCellDimensionIDs )
{
DimensionManager.registerDimension( storageCellDimID, AEConfig.instance.storageProviderID );
}
this.config.save();
}
@Override
public void onWorldStop()
{
this.config.save();
for( Integer storageCellDimID : this.storageCellDimensionIDs )
{
DimensionManager.unregisterDimension( storageCellDimID );
}
this.storageCellDimensionIDs.clear();
}
@Override
public void addStorageCell( int newStorageCellID )
{
this.storageCellDimensionIDs.add( newStorageCellID );
DimensionManager.registerDimension( newStorageCellID, AEConfig.instance.storageProviderID );
NetworkHandler.instance.sendToAll( new PacketNewStorageDimension( newStorageCellID ) );
String[] values = new String[this.storageCellDimensionIDs.size()];
for( int x = 0; x < values.length; x++ )
{
values[x] = String.valueOf( this.storageCellDimensionIDs.get( x ) );
}
this.storageCellIDsProperty().set( values );
this.config.save();
}
@Override
public WorldCoord getStoredSize( int dim )
{
final String category = STORAGE_CELL_CATEGORY + dim;
final int x = this.config.get( category, STORAGE_CELL_SCALE_X_KEY, 0 ).getInt();
final int y = this.config.get( category, STORAGE_CELL_SCALE_Y_KEY, 0 ).getInt();
final int z = this.config.get( category, STORAGE_CELL_SCALE_Z_KEY, 0 ).getInt();
return new WorldCoord( x, y, z );
}
@Override
public void setStoredSize( int dim, int targetX, int targetY, int targetZ )
{
final String category = STORAGE_CELL_CATEGORY + dim;
this.config.get( category, STORAGE_CELL_SCALE_X_KEY, 0 ).set( targetX );
this.config.get( category, STORAGE_CELL_SCALE_Y_KEY, 0 ).set( targetY );
this.config.get( category, STORAGE_CELL_SCALE_Z_KEY, 0 ).set( targetZ );
this.config.save();
}
@Override
public void sendToPlayer( @Nullable final NetworkManager manager )
{
if( manager != null )
{
for( int newDim : this.config.get( PACKAGE_DEST_CATEGORY, PACKAGE_KEY_CATEGORY, PACKAGE_DEF_CATEGORY ).getIntList() )
{
manager.scheduleOutboundPacket( ( new PacketNewStorageDimension( newDim ) ).getProxy() );
}
}
else
{
for( TickHandler.PlayerColor pc : TickHandler.INSTANCE.getPlayerColors().values() )
{
NetworkHandler.instance.sendToAll( pc.getPacket() );
}
}
}
}
@@ -0,0 +1,30 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.core.worlddata;
/**
* @author thatsIch
* @version rv3 - 30.05.2015
* @since rv3 30.05.2015
*/
public interface IOnWorldStartable
{
void onWorldStart();
}

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