Compare commits

..

24 Commits

Author SHA1 Message Date
thatsIch 643f559186 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-14 10:10:51 +02:00
thatsIch 09ed06e47f Fixes #1588: Charged Certus Quartz Ore has its own oredictionary entry 2015-06-14 10:10:36 +02:00
Uristqwerty c1c3655db6 Cleaned up CraftGuide Integration
A NPE caused to open CraftGuide very slowly (several seconds)

Added Grinder recipes
Added Inscriber recipes

Conflicts:
	src/main/java/appeng/integration/modules/CraftGuide.java
2015-06-09 23:42:03 +02:00
yueh b05796e62b No longer invalidate the cache of MEMonitorIInventory on simulate.
Should fix #1036
2015-06-05 23:06:57 +02:00
thatsIch 200e56a509 Fixes #1536: Checking for all required BC classes 2015-06-01 20:47:04 +02:00
thatsIch 9540bbce49 Merge pull request #1499 from TheJulianJES/patch-5
Changed version from PartStack provider to rv2 (rv3)
2015-05-23 13:52:58 +02:00
TheJulianJES c6d932da04 Changed version from PartStack provider to rv2 (rv3)
because @thatsIch merged it also to rv2
2015-05-23 13:49:52 +02:00
yueh 6e7100361c Fixes #1465 faulty item comparison 2015-05-19 21:16:30 +02:00
TheJulianJES ca50ee0762 Removes default RF tooltip
Removed tab

Did something
2015-05-19 21:16:10 +02:00
TheJulianJES f00d5c297f Parts display correctly in WAILA
Register an method that can be overidden

Register the same method in the interface

New class that picks the item and displays it to WAILA

Register the new class and call the other class method

Import in PartWailaDataProvider

Fixed errors

Renamed all Display -> Stack

Stuff
2015-05-19 21:15:50 +02:00
yueh b13f5ced01 Fixes #1389 Enabled repeatable keyboard events 2015-05-19 21:14:49 +02:00
thatsIch 1c0f1ea243 Merge branch 'rv2' of https://github.com/AppliedEnergistics/Applied-Energistics-2 into rv2 2015-05-19 21:11:26 +02:00
Jeremiah Winsley b612ff47a3 Test with V6e of RotaryCraft
Conflicts:
	gradle.properties
2015-05-19 21:10:08 +02:00
Jeremiah Winsley e8a68cc531 Fixes #1384 - implement AdvancedShaftPowerReceiver for RotaryCraft powersink 2015-05-19 21:08:37 +02:00
thatsIch d9f362270b Merge pull request #1454 from TheJulianJES/doublePlayerInvInscriber
Don't add the player inventory two times (rv2)
2015-05-14 12:43:21 +02:00
TheJulianJES 37aef15a02 Don't add the player inventory two times (rv2) 2015-05-14 12:38:44 +02:00
thatsIch 2d8728f0e1 Merge pull request #1437 from TheJulianJES/GermanLang
Changed things in de_DE.lang (rv2)
2015-05-10 12:12:08 +02:00
thatsIch 3498a0902b Merge pull request #1434 from plumpudding/errorEclipse
Error eclipse for rv2 branch
2015-05-10 12:11:58 +02:00
TheJulianJES bb4b6719fe Changed things in de_DE.lang 2015-05-10 10:34:54 +02:00
TheJulianJES 34f78a7ce4 Fix warnings in eclipse
Close scanner instead of doing it with a warning

Make the scanner final..
2015-05-10 00:14:56 +02:00
thatsIch 064acc21ee Fixes #1411: Adds recipes for stairs 2015-05-08 18:36:42 +02:00
Lorenzo Dalla Costa Cervelin deeb67f07d Update pt_BR.lang 2015-05-08 17:59:55 +02:00
thatsIch 2eeaa80b59 Merge pull request #1380 from thatsIch/e-fix-javadoc
Fixed missing Javadoc parameter
2015-05-03 21:48:53 +02:00
thatsIch 7cb485aa48 Fixed missing Javadoc parameter
Reworked the instantiation a bit
Added some additional checks due to the new nonnullability.
2015-05-03 16:45:27 +02:00
443 changed files with 5351 additions and 9785 deletions
+1 -2
View File
@@ -11,8 +11,7 @@
# include markdowns # include markdowns
!README.md !README.md
!LICENSE !License.md
!CONTRIBUTING.md
# include sourcecode # include sourcecode
!src/ !src/
+3 -4
View File
@@ -1,6 +1,5 @@
<!--[![Latest Release](https://img.shields.io/github/tag/AppliedEnergistics/Applied-Energistics-2.svg?label=Latest Release)](https://github.com/AppliedEnergistics/Applied-Energistics-2/releases) -->
[![Latest Build](https://img.shields.io/teamcity/http/ci.tsr.me/s/AppliedEnergistics_AutoHeadBuild.svg?label=Latest Build)](http://ci.tsr.me/viewType.html?buildTypeId=AppliedEnergistics_AutoHeadBuild&tab=buildTypeStatusDiv) [![Latest Build](https://img.shields.io/teamcity/http/ci.tsr.me/s/AppliedEnergistics_AutoHeadBuild.svg?label=Latest Build)](http://ci.tsr.me/viewType.html?buildTypeId=AppliedEnergistics_AutoHeadBuild&tab=buildTypeStatusDiv)
[![Latest Tag](https://img.shields.io/github/tag/AppliedEnergistics/Applied-Energistics-2.svg?label=Latest Tag)](https://github.com/AppliedEnergistics/Applied-Energistics-2/tags)
[![Latest Release](https://img.shields.io/github/release/AppliedEnergistics/Applied-Energistics-2.svg?label=Latest Release)](https://github.com/AppliedEnergistics/Applied-Energistics-2/releases)
# Applied Energistics 2 # Applied Energistics 2
@@ -32,7 +31,7 @@ A Mod about Matter, Energy and using them to conquer the world..
* Applied Energistics 2 API * Applied Energistics 2 API
- (c) 2013 - 2015 AlgorithmX2 et al - (c) 2013 - 2015 AlgorithmX2 et al
- [![License](https://img.shields.io/badge/License-MIT-red.svg?style=flat)](http://opensource.org/licenses/MIT) - ![License](https://img.shields.io/badge/License-MIT-red.svg?style=flat)
* Applied Energistics 2 * Applied Energistics 2
- (c) 2013 - 2015 AlgorithmX2 et al - (c) 2013 - 2015 AlgorithmX2 et al
- [![License](https://img.shields.io/badge/License-LGPLv3-blue.svg?style=flat)](https://raw.githubusercontent.com/AppliedEnergistics/Applied-Energistics-2/rv2/LICENSE) - [![License](https://img.shields.io/badge/License-LGPLv3-blue.svg?style=flat)](https://raw.githubusercontent.com/AppliedEnergistics/Applied-Energistics-2/rv2/LICENSE)
@@ -40,7 +39,7 @@ A Mod about Matter, Energy and using them to conquer the world..
- (c) 2013 - 2015 AlgorithmX2 et al - (c) 2013 - 2015 AlgorithmX2 et al
- [![License](https://img.shields.io/badge/License-CC%20BY--NC--SA%203.0-yellow.svg?style=flat)](https://creativecommons.org/licenses/by-nc-sa/3.0/) - [![License](https://img.shields.io/badge/License-CC%20BY--NC--SA%203.0-yellow.svg?style=flat)](https://creativecommons.org/licenses/by-nc-sa/3.0/)
* Text and Translations * Text and Translations
- [![License](https://img.shields.io/badge/License-No%20Restriction-green.svg?style=flat)](https://creativecommons.org/publicdomain/zero/1.0/) - ![License](https://img.shields.io/badge/License-No%20Restriction-green.svg?style=flat)
## Downloads ## Downloads
+2 -6
View File
@@ -99,16 +99,11 @@ sourceSets {
resources { resources {
srcDir "src/main/resources/" srcDir "src/main/resources/"
include "assets/appliedenergistics2/recipes/*.recipe", include "assets/appliedenergistics2/recipes/*.recipe",
"assets/appliedenergistics2/recipes/README.html",
"assets/appliedenergistics2/oredict/*.oredict",
"assets/appliedenergistics2/lang/*.lang", "assets/appliedenergistics2/lang/*.lang",
"assets/appliedenergistics2/textures/blocks/*", "assets/appliedenergistics2/textures/blocks/*",
"assets/appliedenergistics2/textures/guis/*", "assets/appliedenergistics2/textures/guis/*",
"assets/appliedenergistics2/textures/models/*", "assets/appliedenergistics2/textures/models/*",
"assets/appliedenergistics2/textures/items/*", "assets/appliedenergistics2/textures/items/*"
"assets/appliedenergistics2/meta/*",
"mcmod.info",
"pack.mcmeta"
} }
} }
} }
@@ -118,5 +113,6 @@ processResources {
from(sourceSets.main.resources.srcDirs) { from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info' include 'mcmod.info'
expand 'version': project.version, 'mcversion': minecraft_version expand 'version': project.version, 'mcversion': minecraft_version
include 'pack.mcmeta'
} }
} }
Binary file not shown.
+10
View File
@@ -0,0 +1,10 @@
#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"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="12"> <profiles version="12">
<profile kind="CodeFormatterProfile" name="AE2" version="12"> <profile kind="CodeFormatterProfile" name="Algo" 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_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_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"/> <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_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_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_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="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_space_after_semicolon_in_for" 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.disabling_tag" value="@formatter:off"/>
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/> <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.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.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_after_closing_brace_in_block" 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.insert_space_before_parenthesized_expression_in_return" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="0"/> <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.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.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_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_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" 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_space_after_prefix_operator" value="do not 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.blank_lines_between_type_declarations" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/> <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_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_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.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="false"/> <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.insert_new_line_after_annotation_on_local_variable" value="insert"/> <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.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.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.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.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.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="do not insert"/> <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.keep_else_statement_on_same_line" value="false"/> <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.alignment_for_binary_expression" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/> <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.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.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_comma_in_type_parameters" value="do not 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_catch" value="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.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.put_empty_statement_on_new_line" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="0"/> <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.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.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_new_line_before_catch_in_try_statement" 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_space_before_opening_paren_in_try" value="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.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.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"/> <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_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_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_space_before_and_in_type_parameter" value="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_new_line_in_empty_type_declaration" value="do not 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.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.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.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.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.alignment_for_assignment" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/> <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.indent_body_declarations_compare_to_type_header" value="true"/> <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_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"/> <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_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.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.format_guardian_clause_on_one_line" value="false"/>
<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_space_before_opening_paren_in_if" value="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_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.insert_space_before_opening_brace_in_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="next_line"/> <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.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.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_after_opening_paren_in_method_invocation" 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.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/> <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.insert_space_before_closing_paren_in_switch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/> <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.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_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.alignment_for_superinterfaces_in_enum_declaration" value="0"/>
<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_parenthesized_expression_in_throw" value="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.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.compiler.codegen.targetPlatform" value="1.8"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="next_line"/> <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_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_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_angle_bracket_in_type_arguments" value="do not 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_closing_paren_in_cast" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="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.blank_lines_before_member_type" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="insert"/> <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_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_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_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="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.comment.format_block_comments" value="true"/> <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_before_lambda_arrow" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" 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_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.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.blank_lines_before_package" value="1"/>
<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_for" value="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_opening_paren_in_synchronized" value="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_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_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"/> <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.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_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.insert_space_before_question_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="false"/> <setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="insert"/> <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.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.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.blank_lines_between_import_groups" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="160"/> <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_after_opening_paren_in_annotation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
</profile> </profile>
</profiles> </profiles>
-11
View File
@@ -1,11 +0,0 @@
#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
+11 -11
View File
@@ -1,5 +1,5 @@
aeversion=rv3 aeversion=rv2
aechannel=alpha aechannel=stable
aebuild=0 aebuild=0
aegroup=appeng aegroup=appeng
aebasename=appliedenergistics2 aebasename=appliedenergistics2
@@ -8,15 +8,15 @@ aebasename=appliedenergistics2
# Versions # # Versions #
######################################################### #########################################################
minecraft_version=1.7.10 minecraft_version=1.7.10
forge_version=10.13.4.1448-1.7.10 forge_version=10.13.2.1291
######################################################### #########################################################
# Installable # # Installable #
######################################################### #########################################################
waila_version=1.5.10 waila_version=1.5.10
jabba_version=1.2.1a jabba_version=1.2.1a
enderstorage_version=1.4.7.36 enderstorage_version=1.4.7.33
translocator_version=1.1.2.15 translocator_version=1.1.1.14
ic2_version=2.2.717 ic2_version=2.2.717
enderio_version=2.3.0.375_beta enderio_version=2.3.0.375_beta
#cofhlib_version=1.0.1-157 #cofhlib_version=1.0.1-157
@@ -29,12 +29,11 @@ invtweaks_version=1.58
######################################################### #########################################################
# Provided APIs # # Provided APIs #
######################################################### #########################################################
fmp_version=1.2.0.345 fmp_version=1.1.1.324
code_chicken_lib_version=1.1.3.138 code_chicken_lib_version=1.1.3.127
code_chicken_core_version=1.0.7.46 code_chicken_core_version=1.0.4.35
nei_version=1.0.5.111 nei_version=1.0.4.90
bc_version=7.0.9 bc_version=6.4.6
opencomputers_version=1.5.12.26
######################################################### #########################################################
# Self Compiled APIs # # Self Compiled APIs #
@@ -54,4 +53,5 @@ api_craftguide_version=1
api_immibis_version=1 api_immibis_version=1
api_mfr_version=1 api_mfr_version=1
api_railcraft_version=1 api_railcraft_version=1
api_rblocks_version=1
api_rf_version=2 api_rf_version=2
-6
View File
@@ -10,11 +10,6 @@ task javadocJar(type: Jar, dependsOn: myJavadocs) {
from 'build/docs/javadoc/' from 'build/docs/javadoc/'
} }
task sourceJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task devJar(type: Jar) { task devJar(type: Jar) {
manifest { manifest {
@@ -45,5 +40,4 @@ artifacts {
archives devJar archives devJar
archives apiJar archives apiJar
archives javadocJar archives javadocJar
archives sourceJar
} }
+1 -15
View File
@@ -1,4 +1,3 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
@@ -50,17 +49,6 @@ repositories {
name = "RX14 Proxy" name = "RX14 Proxy"
url = "http://mvn.rx14.co.uk/repo/" url = "http://mvn.rx14.co.uk/repo/"
} }
maven {
name "OpenComputers Repo"
url = "http://maven.cil.li/"
}
ivy {
name "BuildCraft"
artifactPattern "http://www.mod-buildcraft.com/releases/BuildCraft/[revision]/[module]-[revision]-[classifier].[ext]"
}
// CurseForge DNS for TE is not available or I am just being unlucky, code part can stay since this is applicable to any other curseforge mod though // 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 { // ivy {
// name = "CoFHLib" // name = "CoFHLib"
@@ -97,8 +85,6 @@ dependencies {
mods "com.enderio:EnderIO:${minecraft_version}-${enderio_version}:dev" mods "com.enderio:EnderIO:${minecraft_version}-${enderio_version}:dev"
mods "net.mcft.copy.betterstorage:BetterStorage:${minecraft_version}-${betterstorage_version}:deobf" mods "net.mcft.copy.betterstorage:BetterStorage:${minecraft_version}-${betterstorage_version}:deobf"
mods "inventorytweaks:InventoryTweaks:${invtweaks_version}:deobf" mods "inventorytweaks:InventoryTweaks:${invtweaks_version}:deobf"
mods "li.cil.oc:OpenComputers:MC${minecraft_version}-${opencomputers_version}:dev"
// mods name: 'CoFHLib', version: "[${minecraft_version}]${cofhlib_version}-dev", ext: 'jar' // mods name: 'CoFHLib', version: "[${minecraft_version}]${cofhlib_version}-dev", ext: 'jar'
// mods name: 'CoFHCore', version: "[${minecraft_version}]${cofhcore_version}-dev", ext: 'jar' // mods name: 'CoFHCore', version: "[${minecraft_version}]${cofhcore_version}-dev", ext: 'jar'
// mods name: 'ThermalExpansion', version: "[${minecraft_version}]${texpansion_version}-dev", ext: 'jar' // mods name: 'ThermalExpansion', version: "[${minecraft_version}]${texpansion_version}-dev", ext: 'jar'
@@ -111,7 +97,6 @@ dependencies {
compile "com.mod-buildcraft:buildcraft:${bc_version}:dev" compile "com.mod-buildcraft:buildcraft:${bc_version}:dev"
// provided APIs // provided APIs
compile "li.cil.oc:OpenComputers:MC${minecraft_version}-${opencomputers_version}:api"
compile "net.industrial-craft:industrialcraft-2:${ic2_version}-experimental:api" compile "net.industrial-craft:industrialcraft-2:${ic2_version}-experimental:api"
compile "net.mcft.copy.betterstorage:BetterStorage:${minecraft_version}-${betterstorage_version}:api" compile "net.mcft.copy.betterstorage:BetterStorage:${minecraft_version}-${betterstorage_version}:api"
@@ -127,6 +112,7 @@ dependencies {
compile(group: 'api', name: 'immibis', version: "${api_immibis_version}") compile(group: 'api', name: 'immibis', version: "${api_immibis_version}")
compile(group: 'api', name: 'mfr', version: "${api_mfr_version}") compile(group: 'api', name: 'mfr', version: "${api_mfr_version}")
compile(group: 'api', name: 'railcraft', version: "${api_railcraft_version}") compile(group: 'api', name: 'railcraft', version: "${api_railcraft_version}")
compile(group: 'api', name: 'rblocks', version: "${api_rblocks_version}")
compile(group: 'api', name: 'rf', version: "${api_rf_version}") compile(group: 'api', name: 'rf', version: "${api_rf_version}")
testCompile "junit:junit:4.11" testCompile "junit:junit:4.11"
+2 -12
View File
@@ -1,5 +1,5 @@
task wrapper(type: Wrapper) { task wrapper(type: Wrapper) {
gradleVersion = "2.4" gradleVersion = "2.3"
} }
// WAILA // WAILA
@@ -103,14 +103,4 @@ task installBetterStorage(type: Copy, dependsOn: "deinstallBetterStorage") {
task deinstallBetterStorage(type: Delete) { task deinstallBetterStorage(type: Delete) {
delete fileTree(dir: minecraft.runDir + "/mods", include: "*BetterStorage*.jar") delete fileTree(dir: minecraft.runDir + "/mods", include: "*BetterStorage*.jar")
} }
task installOpenComputers(type: Copy, dependsOn: "deinstallOpenComputers") {
from { configurations.mods }
include "**/*OpenComputer*dev*.jar"
into file(minecraft.runDir + "/mods")
}
task deinstallOpenComputers(type: Delete) {
delete fileTree(dir: minecraft.runDir + "/mods", include: "*OpenComputers*.jar")
}
Binary file not shown.
+2 -2
View File
@@ -1,6 +1,6 @@
#Sat May 16 13:19:14 CEST 2015 #Sat May 02 19:28:20 CEST 2015
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-2.3-bin.zip
@@ -1,30 +0,0 @@
/*
* 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
}
+2 -4
View File
@@ -54,15 +54,13 @@ public enum Settings
INTERFACE_TERMINAL( EnumSet.of( YesNo.YES, YesNo.NO ) ), CRAFT_VIA_REDSTONE( EnumSet.of( YesNo.YES, YesNo.NO ) ), 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; private final EnumSet<? extends Enum<?>> values;
Settings( @Nonnull EnumSet<? extends Enum<?>> possibleOptions ) Settings( @Nonnull EnumSet<? extends Enum<?>> possibleOptions )
{ {
if( possibleOptions.isEmpty() ) if ( possibleOptions.isEmpty() )
{ {
throw new IllegalArgumentException( "Tried to instantiate an empty setting." ); throw new IllegalArgumentException( "Tried to instantiate an empty setting." );
} }
@@ -77,22 +77,6 @@ public interface IBlocks
IBlockDefinition quartzPillarStair(); IBlockDefinition quartzPillarStair();
IBlockDefinition skyStoneSlab();
IBlockDefinition skyStoneBlockSlab();
IBlockDefinition skyStoneBrickSlab();
IBlockDefinition skyStoneSmallBrickSlab();
IBlockDefinition fluixSlab();
IBlockDefinition quartzSlab();
IBlockDefinition chiseledQuartzSlab();
IBlockDefinition quartzPillarSlab();
/* /*
* misc * misc
*/ */
@@ -106,7 +90,7 @@ public interface IBlocks
ITileDefinition charger(); ITileDefinition charger();
IBlockDefinition tinyTNT(); ITileDefinition tinyTNT();
ITileDefinition security(); ITileDefinition security();
@@ -1,34 +1,11 @@
/*
* 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; package appeng.api.definitions;
import com.google.common.base.Optional;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import com.google.common.base.Optional;
public interface IItemDefinition extends IComparableDefinition public interface IItemDefinition extends IComparableDefinition
{ {
@@ -41,9 +18,4 @@ public interface IItemDefinition extends IComparableDefinition
* @return an {@link ItemStack} with specified quantity of this item. * @return an {@link ItemStack} with specified quantity of this item.
*/ */
Optional<ItemStack> maybeStack( int stackSize ); Optional<ItemStack> maybeStack( int stackSize );
/**
* @return <tt>true</tt> if definition is enabled
*/
boolean isEnabled();
} }
@@ -66,8 +66,6 @@ public interface IParts
IItemDefinition annihilationPlane(); IItemDefinition annihilationPlane();
IItemDefinition identityAnnihilationPlane();
IItemDefinition formationPlane(); IItemDefinition formationPlane();
IItemDefinition p2PTunnelME(); IItemDefinition p2PTunnelME();
@@ -84,8 +82,6 @@ public interface IParts
IItemDefinition p2PTunnelLight(); IItemDefinition p2PTunnelLight();
IItemDefinition p2PTunnelOpenComputers();
IItemDefinition cableAnchor(); IItemDefinition cableAnchor();
IItemDefinition monitor(); IItemDefinition monitor();
@@ -1,15 +1,10 @@
package appeng.api.features; package appeng.api.features;
import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import com.google.common.base.Optional;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@@ -17,26 +12,22 @@ import net.minecraft.item.ItemStack;
* Lets you manipulate Inscriber Recipes, by adding or editing existing ones. * Lets you manipulate Inscriber Recipes, by adding or editing existing ones.
* *
* @author thatsIch * @author thatsIch
* @version rv3 * @version rv2
* @since rv2 * @since rv2
*/ */
public interface IInscriberRegistry public interface IInscriberRegistry
{ {
/** /**
* An immutable copy of currently registered recipes. * Current list of registered recipes, you can modify this if you want too.
* * Will never contain a null recipe
* Use the provided methods to actually modify the inscriber recipes.
*
* @see IInscriberRegistry#addRecipe(IInscriberRecipe)
* @see IInscriberRegistry#removeRecipe(IInscriberRecipe)
* *
* @return currentlyRegisteredRecipes * @return currentlyRegisteredRecipes
*/ */
@Nonnull @Nonnull
Collection<IInscriberRecipe> getRecipes(); List<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 * @return set of all optional items
*/ */
@@ -44,7 +35,7 @@ public interface IInscriberRegistry
Set<ItemStack> getOptionals(); 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 * @return set of all input items
*/ */
@@ -52,7 +43,7 @@ public interface IInscriberRegistry
Set<ItemStack> getInputs(); Set<ItemStack> getInputs();
/** /**
* Extensible way to create an inscriber recipe. * Extensible way to create an inscriber recipe
* *
* @return builder for inscriber recipes * @return builder for inscriber recipes
*/ */
@@ -70,10 +61,9 @@ public interface IInscriberRegistry
void addRecipe( IInscriberRecipe recipe ); void addRecipe( IInscriberRecipe recipe );
/** /**
* Removes all equal recipes from the registry. * Removes a recipe 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 ); void removeRecipe( IInscriberRecipe toBeRemovedRecipe );
} }
@@ -1,7 +1,7 @@
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (c) 2013 - 2015 AlgorithmX2 * Copyright (c) 2013 AlgorithmX2
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * 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 * this software and associated documentation files (the "Software"), to deal in
@@ -24,8 +24,6 @@
package appeng.api.features; package appeng.api.features;
import javax.annotation.Nullable;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import appeng.api.config.TunnelType; import appeng.api.config.TunnelType;
@@ -41,10 +39,10 @@ public interface IP2PTunnelRegistry
* Allows third parties to register items from their mod as potential * Allows third parties to register items from their mod as potential
* attunements for AE's P2P Tunnels * attunements for AE's P2P Tunnels
* *
* @param trigger - the item which triggers attunement. Nullable, but then ignored * @param trigger - the item which triggers attunement
* @param type - the type of tunnel. Nullable, but then ignored * @param type - the type of tunnel
*/ */
void addNewAttunement( @Nullable ItemStack trigger, @Nullable TunnelType type ); void addNewAttunement( ItemStack trigger, TunnelType type );
/** /**
* returns null if no attunement can be found. * returns null if no attunement can be found.
@@ -53,6 +51,5 @@ public interface IP2PTunnelRegistry
* *
* @return null if no attunement can be found or attunement * @return null if no attunement can be found or attunement
*/ */
@Nullable
TunnelType getTunnelTypeByItem( ItemStack trigger ); TunnelType getTunnelTypeByItem( ItemStack trigger );
} }
@@ -1,7 +1,7 @@
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (c) 2013 - 2015 AlgorithmX2 * Copyright (c) 2013 AlgorithmX2
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * 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 * this software and associated documentation files (the "Software"), to deal in
@@ -24,12 +24,10 @@
package appeng.api.features; package appeng.api.features;
import javax.annotation.Nullable; import net.minecraft.entity.player.EntityPlayer;
import com.mojang.authlib.GameProfile; 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 * Maintains a save specific list of userids and username combinations this greatly simplifies storage internally and
@@ -57,6 +55,5 @@ public interface IPlayerRegistry
* *
* @return PlayerEntity, or null if the player could not be found. * @return PlayerEntity, or null if the player could not be found.
*/ */
@Nullable
EntityPlayer findPlayer( int playerID ); EntityPlayer findPlayer( int playerID );
} }
@@ -1,7 +1,7 @@
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (c) 2013 - 2015 AlgorithmX2 * Copyright (c) 2013 AlgorithmX2
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * 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 * this software and associated documentation files (the "Software"), to deal in
@@ -38,8 +38,8 @@ public interface ISecurityRegistry
/** /**
* Submit Permissions into the register. * Submit Permissions into the register.
* *
* @param playerID player id * @param PlayerID player id
* @param permissions permissions of player * @param permissions permissions of player
*/ */
void addPlayer( int playerID, EnumSet<SecurityPermissions> permissions ); void addPlayer( int PlayerID, EnumSet<SecurityPermissions> permissions );
} }
@@ -1,7 +1,7 @@
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (c) 2013 - 2015 AlgorithmX2 * Copyright (c) 2013 AlgorithmX2
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * 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 * this software and associated documentation files (the "Software"), to deal in
@@ -94,7 +94,7 @@ public interface IFacadePart
int getItemDamage(); int getItemDamage();
boolean notAEFacade(); boolean isBC();
void setThinFacades( boolean useThinFacades ); void setThinFacades( boolean useThinFacades );
+1 -4
View File
@@ -1,7 +1,7 @@
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (c) 2013 - 2015 AlgorithmX2 * Copyright (c) 2013 AlgorithmX2
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * 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 * this software and associated documentation files (the "Software"), to deal in
@@ -24,8 +24,6 @@
package appeng.api.parts; package appeng.api.parts;
import javax.annotation.Nullable;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
//@formatter:off //@formatter:off
@@ -65,6 +63,5 @@ public interface IPartItem
* *
* @return part from item * @return part from item
*/ */
@Nullable
IPart createPartFromItemStack( ItemStack is ); IPart createPartFromItemStack( ItemStack is );
} }
@@ -1,7 +1,7 @@
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (c) 2013 - 2015 AlgorithmX2 * Copyright (c) 2013 AlgorithmX2
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * 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 * this software and associated documentation files (the "Software"), to deal in
@@ -25,17 +25,10 @@ package appeng.api.recipes;
import java.io.BufferedReader; import java.io.BufferedReader;
import javax.annotation.Nonnull;
public interface IRecipeLoader public interface IRecipeLoader
{ {
/**
* @param filePath the path to the to be loaded file BufferedReader getFile( String s ) throws Exception;
*
* @return reader handler of the file
*
* @throws Exception if reading goes wrong
*/
BufferedReader getFile( @Nonnull String filePath ) throws Exception;
} }
@@ -24,7 +24,7 @@
package appeng.api.util; package appeng.api.util;
import java.util.List; import java.util.ArrayList;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.world.World; import net.minecraft.world.World;
@@ -43,5 +43,5 @@ public interface ICommonTile
* @param z z pos of tile entity * @param z z pos of tile entity
* @param drops drops of tile entity * @param drops drops of tile entity
*/ */
void getDrops( World world, int x, int y, int z, List<ItemStack> drops ); void getDrops( World world, int x, int y, int z, ArrayList<ItemStack> drops );
} }
+380 -82
View File
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU Lesser General Public License as published by
@@ -22,19 +22,24 @@ package appeng.block;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.List; import java.util.List;
import javax.annotation.Nullable;
import com.google.common.base.Optional;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.client.resources.IResource; import net.minecraft.client.resources.IResource;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
@@ -44,11 +49,21 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.ReflectionHelper;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import com.google.common.base.Optional;
import com.google.common.collect.Lists;
import appeng.api.implementations.items.IMemoryCard;
import appeng.api.implementations.items.MemoryCardMessages;
import appeng.api.implementations.tiles.IColorableTile;
import appeng.api.util.AEColor;
import appeng.api.util.IOrientable; import appeng.api.util.IOrientable;
import appeng.api.util.IOrientableBlock; import appeng.api.util.IOrientableBlock;
import appeng.block.networking.BlockCableBus;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.BlockRenderInfo; import appeng.client.render.BlockRenderInfo;
import appeng.client.render.WorldRender; import appeng.client.render.WorldRender;
@@ -56,38 +71,48 @@ import appeng.client.texture.FlippableIcon;
import appeng.client.texture.MissingIcon; import appeng.client.texture.MissingIcon;
import appeng.core.features.AEBlockFeatureHandler; import appeng.core.features.AEBlockFeatureHandler;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.core.features.ActivityState;
import appeng.core.features.FeatureNameExtractor; import appeng.core.features.FeatureNameExtractor;
import appeng.core.features.IAEFeature; import appeng.core.features.IAEFeature;
import appeng.core.features.IFeatureHandler; import appeng.core.features.IFeatureHandler;
import appeng.core.features.ItemStackSrc;
import appeng.helpers.AEGlassMaterial; import appeng.helpers.AEGlassMaterial;
import appeng.helpers.ICustomCollision; import appeng.helpers.ICustomCollision;
import appeng.tile.AEBaseTile;
import appeng.tile.networking.TileCableBus;
import appeng.tile.storage.TileSkyChest;
import appeng.util.LookDirection; import appeng.util.LookDirection;
import appeng.util.Platform; import appeng.util.Platform;
import appeng.util.SettingsFrom;
public abstract class AEBaseBlock extends Block implements IAEFeature public class AEBaseBlock extends BlockContainer implements IAEFeature
{ {
private final String featureFullName; private final String featureFullName;
protected final Optional<String> featureSubName; private final Optional<String> featureSubName;
@SideOnly( Side.CLIENT )
public IIcon renderIcon;
protected boolean isOpaque = true; protected boolean isOpaque = true;
protected boolean isFullSize = true; protected boolean isFullSize = true;
protected boolean hasSubtypes = false; protected boolean hasSubtypes = false;
protected boolean isInventory = false; protected boolean isInventory = false;
private IFeatureHandler handler;
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
BlockRenderInfo renderInfo; BlockRenderInfo renderInfo;
private IFeatureHandler handler;
protected AEBaseBlock( Material mat ) @Nullable
private Class<? extends TileEntity> tileEntityType = null;
protected AEBaseBlock( Class<? extends AEBaseBlock> c, Material mat )
{ {
this( mat, Optional.<String>absent() ); this( c, mat, Optional.<String>absent() );
this.setLightOpacity( 255 ); this.setLightOpacity( 255 );
this.setLightLevel( 0 ); this.setLightLevel( 0 );
this.setHardness( 2.2F ); this.setHardness( 2.2F );
this.setTileProvider( false );
this.setHarvestLevel( "pickaxe", 0 ); this.setHarvestLevel( "pickaxe", 0 );
} }
protected AEBaseBlock( Material mat, Optional<String> subName ) protected AEBaseBlock( Class<?> c, Material mat, Optional<String> subName )
{ {
super( mat ); super( mat );
@@ -108,10 +133,16 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
this.setStepSound( Block.soundTypeMetal ); this.setStepSound( Block.soundTypeMetal );
} }
this.featureFullName = new FeatureNameExtractor( this.getClass(), subName ).get(); this.featureFullName = new FeatureNameExtractor( c, subName ).get();
this.featureSubName = subName; this.featureSubName = subName;
} }
// update Block value.
private void setTileProvider( boolean b )
{
ReflectionHelper.setPrivateValue( Block.class, this, b, "isTileProvider" );
}
@Override @Override
public String toString() public String toString()
{ {
@@ -120,8 +151,8 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
public void registerNoIcons() public void registerNoIcons()
{ {
final BlockRenderInfo info = this.getRendererInstance(); BlockRenderInfo info = this.getRendererInstance();
final FlippableIcon i = new FlippableIcon( new MissingIcon( this ) ); FlippableIcon i = new FlippableIcon( new MissingIcon( this ) );
info.updateIcons( i, i, i, i, i, i ); info.updateIcons( i, i, i, i, i, i );
} }
@@ -140,7 +171,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
return this.renderInfo; return this.renderInfo;
} }
catch( InstantiationException e ) catch ( InstantiationException e )
{ {
throw new IllegalStateException( "Failed to create a new instance of an illegal class " + this.getRenderer(), e ); throw new IllegalStateException( "Failed to create a new instance of an illegal class " + this.getRenderer(), e );
} }
@@ -161,10 +192,24 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
return super.getIcon( w, x, y, z, s ); return super.getIcon( w, x, y, z, s );
} }
protected void setTileEntity( Class<? extends TileEntity> c )
{
this.tileEntityType = c;
AEBaseTile.registerTileItem( c, new ItemStackSrc( this, 0 ) );
GameRegistry.registerTileEntity( this.tileEntityType, this.featureFullName );
this.isInventory = IInventory.class.isAssignableFrom( c );
this.setTileProvider( this.hasBlockTileEntity() );
}
public boolean hasBlockTileEntity()
{
return this.tileEntityType != null;
}
protected void setFeature( EnumSet<AEFeature> f ) protected void setFeature( EnumSet<AEFeature> f )
{ {
final AEBlockFeatureHandler featureHandler = new AEBlockFeatureHandler( f, this, this.featureSubName ); this.handler = new AEBlockFeatureHandler( f, this, this.featureSubName );
this.setHandler( featureHandler );
} }
@Override @Override
@@ -173,11 +218,6 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
return this.handler; return this.handler;
} }
protected final void setHandler( IFeatureHandler handler )
{
this.handler = handler;
}
@Override @Override
public void postInit() public void postInit()
{ {
@@ -212,16 +252,12 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
public IIcon getIcon( int direction, int metadata ) public IIcon getIcon( int direction, int metadata )
{ {
return this.getRendererInstance().getTexture( ForgeDirection.getOrientation( direction ) ); if( this.renderIcon != null )
}
protected ICustomCollision getCustomCollision( World w, int x, int y, int z )
{
if( this instanceof ICustomCollision )
{ {
return (ICustomCollision) this; return this.renderIcon;
} }
return null;
return this.getRendererInstance().getTexture( ForgeDirection.getOrientation( direction ) );
} }
@Override @Override
@@ -229,7 +265,20 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
// NOTE: WAS FINAL, changed for Immibis // NOTE: WAS FINAL, changed for Immibis
public void addCollisionBoxesToList( World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e ) public void addCollisionBoxesToList( World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e )
{ {
final ICustomCollision collisionHandler = this.getCustomCollision( w, x, y, z ); ICustomCollision collisionHandler = null;
if( this instanceof ICustomCollision )
{
collisionHandler = (ICustomCollision) this;
}
else
{
AEBaseTile te = this.getTileEntity( w, x, y, z );
if( te instanceof ICustomCollision )
{
collisionHandler = (ICustomCollision) te;
}
}
if( collisionHandler != null && bb != null ) if( collisionHandler != null && bb != null )
{ {
@@ -259,16 +308,30 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
public final AxisAlignedBB getSelectedBoundingBoxFromPool( World w, int x, int y, int z ) public final AxisAlignedBB getSelectedBoundingBoxFromPool( World w, int x, int y, int z )
{ {
final ICustomCollision collisionHandler = this.getCustomCollision( w, x, y, z ); ICustomCollision collisionHandler = null;
AxisAlignedBB b = null;
if( this instanceof ICustomCollision )
{
collisionHandler = (ICustomCollision) this;
}
else
{
AEBaseTile te = this.getTileEntity( w, x, y, z );
if( te instanceof ICustomCollision )
{
collisionHandler = (ICustomCollision) te;
}
}
if( collisionHandler != null ) if( collisionHandler != null )
{ {
if( Platform.isClient() ) if( Platform.isClient() )
{ {
final EntityPlayer player = Minecraft.getMinecraft().thePlayer; EntityPlayer player = Minecraft.getMinecraft().thePlayer;
final LookDirection ld = Platform.getPlayerRay( player, Platform.getEyeOffset( player ) ); LookDirection ld = Platform.getPlayerRay( player, Platform.getEyeOffset( player ) );
final Iterable<AxisAlignedBB> bbs = collisionHandler.getSelectedBoundingBoxesFromPool( w, x, y, z, Minecraft.getMinecraft().thePlayer, true ); Iterable<AxisAlignedBB> bbs = collisionHandler.getSelectedBoundingBoxesFromPool( w, x, y, z, Minecraft.getMinecraft().thePlayer, true );
AxisAlignedBB br = null; AxisAlignedBB br = null;
double lastDist = 0; double lastDist = 0;
@@ -283,12 +346,11 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
if( r != null ) if( r != null )
{ {
final double xLen = ( ld.a.xCoord - r.hitVec.xCoord ); double xLen = ( ld.a.xCoord - r.hitVec.xCoord );
final double yLen = ( ld.a.yCoord - r.hitVec.yCoord ); double yLen = ( ld.a.yCoord - r.hitVec.yCoord );
final double zLen = ( ld.a.zCoord - r.hitVec.zCoord ); double zLen = ( ld.a.zCoord - r.hitVec.zCoord );
final double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
if( br == null || lastDist > thisDist ) if( br == null || lastDist > thisDist )
{ {
lastDist = thisDist; lastDist = thisDist;
@@ -304,26 +366,32 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
} }
} }
final AxisAlignedBB b = AxisAlignedBB.getBoundingBox( 16d, 16d, 16d, 0d, 0d, 0d );
for( AxisAlignedBB bx : collisionHandler.getSelectedBoundingBoxesFromPool( w, x, y, z, null, false ) ) for( AxisAlignedBB bx : collisionHandler.getSelectedBoundingBoxesFromPool( w, x, y, z, null, false ) )
{ {
final double minX = Math.min( b.minX, bx.minX ); if( b == null )
final double minY = Math.min( b.minY, bx.minY ); {
final double minZ = Math.min( b.minZ, bx.minZ ); b = bx;
final double maxX = Math.max( b.maxX, bx.maxX ); }
final double maxY = Math.max( b.maxY, bx.maxY ); else
final double maxZ = Math.max( b.maxZ, bx.maxZ ); {
double minX = Math.min( b.minX, bx.minX );
b.setBounds( minX, minY, minZ, maxX, maxY, maxZ ); double minY = Math.min( b.minY, bx.minY );
double minZ = Math.min( b.minZ, bx.minZ );
double maxX = Math.max( b.maxX, bx.maxX );
double maxY = Math.max( b.maxY, bx.maxY );
double maxZ = Math.max( b.maxZ, bx.maxZ );
b.setBounds( minX, minY, minZ, maxX, maxY, maxZ );
}
} }
b.setBounds( b.minX + x, b.minY + y, b.minZ + z, b.maxX + x, b.maxY + y, b.maxZ + z ); b.setBounds( b.minX + x, b.minY + y, b.minZ + z, b.maxX + x, b.maxY + y, b.maxZ + z );
}
return b; else
{
b = super.getSelectedBoundingBoxFromPool( w, x, y, z );
} }
return super.getSelectedBoundingBoxFromPool( w, x, y, z ); return b;
} }
@Override @Override
@@ -335,11 +403,24 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
@Override @Override
public MovingObjectPosition collisionRayTrace( World w, int x, int y, int z, Vec3 a, Vec3 b ) public MovingObjectPosition collisionRayTrace( World w, int x, int y, int z, Vec3 a, Vec3 b )
{ {
final ICustomCollision collisionHandler = this.getCustomCollision( w, x, y, z ); ICustomCollision collisionHandler = null;
if( this instanceof ICustomCollision )
{
collisionHandler = (ICustomCollision) this;
}
else
{
AEBaseTile te = this.getTileEntity( w, x, y, z );
if( te instanceof ICustomCollision )
{
collisionHandler = (ICustomCollision) te;
}
}
if( collisionHandler != null ) if( collisionHandler != null )
{ {
final Iterable<AxisAlignedBB> bbs = collisionHandler.getSelectedBoundingBoxesFromPool( w, x, y, z, null, true ); Iterable<AxisAlignedBB> bbs = collisionHandler.getSelectedBoundingBoxesFromPool( w, x, y, z, null, true );
MovingObjectPosition br = null; MovingObjectPosition br = null;
double lastDist = 0; double lastDist = 0;
@@ -371,7 +452,6 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
{ {
return br; return br;
} }
return null; return null;
} }
@@ -379,11 +459,114 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
return super.collisionRayTrace( w, x, y, z, a, b ); return super.collisionRayTrace( w, x, y, z, a, b );
} }
@Override
public final boolean onBlockActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
{
if( player != null )
{
ItemStack is = player.inventory.getCurrentItem();
if( is != null )
{
if( Platform.isWrench( player, is, x, y, z ) && player.isSneaking() )
{
Block id = w.getBlock( x, y, z );
if( id != null )
{
AEBaseTile tile = this.getTileEntity( w, x, y, z );
ItemStack[] drops = Platform.getBlockDrops( w, x, y, z );
if( tile == null )
{
return false;
}
if( tile instanceof TileCableBus || tile instanceof TileSkyChest )
{
return false;
}
ItemStack op = new ItemStack( this );
for( ItemStack ol : drops )
{
if( Platform.isSameItemType( ol, op ) )
{
NBTTagCompound tag = tile.downloadSettings( SettingsFrom.DISMANTLE_ITEM );
if( tag != null )
{
ol.setTagCompound( tag );
}
}
}
if( id.removedByPlayer( w, player, x, y, z, false ) )
{
List<ItemStack> l = Lists.newArrayList( drops );
Platform.spawnDrops( w, x, y, z, l );
w.setBlockToAir( x, y, z );
}
}
return false;
}
if( is.getItem() instanceof IMemoryCard && !( this instanceof BlockCableBus ) )
{
IMemoryCard memoryCard = (IMemoryCard) is.getItem();
if( player.isSneaking() )
{
AEBaseTile t = this.getTileEntity( w, x, y, z );
if( t != null )
{
String name = this.getUnlocalizedName();
NBTTagCompound data = t.downloadSettings( SettingsFrom.MEMORY_CARD );
if( data != null )
{
memoryCard.setMemoryCardContents( is, name, data );
memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_SAVED );
return true;
}
}
}
else
{
String name = memoryCard.getSettingsName( is );
NBTTagCompound data = memoryCard.getData( is );
if( this.getUnlocalizedName().equals( name ) )
{
AEBaseTile t = this.getTileEntity( w, x, y, z );
t.uploadSettings( SettingsFrom.MEMORY_CARD, data );
memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_LOADED );
}
else
{
memoryCard.notifyUser( player, MemoryCardMessages.INVALID_MACHINE );
}
return false;
}
}
}
}
return this.onActivated( w, x, y, z, player, side, hitX, hitY, hitZ );
}
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ ) public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
{ {
return false; return false;
} }
@Override
public void onBlockPlacedBy( World w, int x, int y, int z, EntityLivingBase player, ItemStack is )
{
if( is.hasDisplayName() )
{
TileEntity te = this.getTileEntity( w, x, y, z );
if( te instanceof AEBaseTile )
{
( (AEBaseTile) w.getTileEntity( x, y, z ) ).setName( is.getDisplayName() );
}
}
}
@Override @Override
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
@SuppressWarnings( "unchecked" ) @SuppressWarnings( "unchecked" )
@@ -401,6 +584,11 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
@Override @Override
public int getComparatorInputOverride( World w, int x, int y, int z, int s ) public int getComparatorInputOverride( World w, int x, int y, int z, int s )
{ {
TileEntity te = this.getTileEntity( w, x, y, z );
if( te instanceof IInventory )
{
return Container.calcRedstoneFromInventory( (IInventory) te );
}
return 0; return 0;
} }
@@ -408,14 +596,14 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
public void registerBlockIcons( IIconRegister iconRegistry ) public void registerBlockIcons( IIconRegister iconRegistry )
{ {
final BlockRenderInfo info = this.getRendererInstance(); BlockRenderInfo info = this.getRendererInstance();
final FlippableIcon topIcon; FlippableIcon topIcon;
final FlippableIcon bottomIcon; FlippableIcon bottomIcon;
final FlippableIcon sideIcon; FlippableIcon sideIcon;
final FlippableIcon eastIcon; FlippableIcon eastIcon;
final FlippableIcon westIcon; FlippableIcon westIcon;
final FlippableIcon southIcon; FlippableIcon southIcon;
final FlippableIcon northIcon; FlippableIcon northIcon;
this.blockIcon = topIcon = this.optionalIcon( iconRegistry, this.getTextureName(), null ); this.blockIcon = topIcon = this.optionalIcon( iconRegistry, this.getTextureName(), null );
bottomIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Bottom", topIcon ); bottomIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Bottom", topIcon );
@@ -434,19 +622,19 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
return this.isFullSize; return this.isFullSize;
} }
public IOrientable getOrientable( IBlockAccess w, int x, int y, int z )
{
if( this instanceof IOrientableBlock )
{
return ( (IOrientableBlock) this ).getOrientable( w, x, y, z );
}
return null;
}
@Override @Override
public final boolean rotateBlock( World w, int x, int y, int z, ForgeDirection axis ) public final boolean rotateBlock( World w, int x, int y, int z, ForgeDirection axis )
{ {
final IOrientable rotatable = this.getOrientable( w, x, y, z ); IOrientable rotatable = null;
if( this.hasBlockTileEntity() )
{
rotatable = (AEBaseTile) this.getTileEntity( w, x, y, z );
}
else if( this instanceof IOrientableBlock )
{
rotatable = ( (IOrientableBlock) this ).getOrientable( w, x, y, z );
}
if( rotatable != null && rotatable.canBeRotated() ) if( rotatable != null && rotatable.canBeRotated() )
{ {
@@ -493,13 +681,44 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
} }
@Override @Override
public ForgeDirection[] getValidRotations( World w, int x, int y, int z ) public final ForgeDirection[] getValidRotations( World w, int x, int y, int z )
{ {
if( this.hasBlockTileEntity() )
{
AEBaseTile obj = this.getTileEntity( w, x, y, z );
if( obj != null && obj.canBeRotated() )
{
return ForgeDirection.VALID_DIRECTIONS;
}
}
return new ForgeDirection[0]; return new ForgeDirection[0];
} }
@Override
public boolean recolourBlock( World world, int x, int y, int z, ForgeDirection side, int colour )
{
TileEntity te = this.getTileEntity( world, x, y, z );
if( te instanceof IColorableTile )
{
IColorableTile ct = (IColorableTile) te;
AEColor c = ct.getColor();
AEColor newColor = AEColor.values()[colour];
if( c != newColor )
{
ct.recolourBlock( side, newColor, null );
return true;
}
return false;
}
return super.recolourBlock( world, x, y, z, side, colour );
}
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
private FlippableIcon optionalIcon( IIconRegister ir, String name, IIcon substitute ) private FlippableIcon optionalIcon( IIconRegister ir, String Name, IIcon substitute )
{ {
// if the input is an flippable IIcon find the original. // if the input is an flippable IIcon find the original.
while( substitute instanceof FlippableIcon ) while( substitute instanceof FlippableIcon )
@@ -511,13 +730,13 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
{ {
try try
{ {
ResourceLocation resLoc = new ResourceLocation( name ); ResourceLocation resLoc = new ResourceLocation( Name );
resLoc = new ResourceLocation( resLoc.getResourceDomain(), String.format( "%s/%s%s", "textures/blocks", resLoc.getResourcePath(), ".png" ) ); resLoc = new ResourceLocation( resLoc.getResourceDomain(), String.format( "%s/%s%s", "textures/blocks", resLoc.getResourcePath(), ".png" ) );
IResource res = Minecraft.getMinecraft().getResourceManager().getResource( resLoc ); IResource res = Minecraft.getMinecraft().getResourceManager().getResource( resLoc );
if( res != null ) if( res != null )
{ {
return new FlippableIcon( ir.registerIcon( name ) ); return new FlippableIcon( ir.registerIcon( Name ) );
} }
} }
catch( Throwable e ) catch( Throwable e )
@@ -526,7 +745,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
} }
} }
return new FlippableIcon( ir.registerIcon( name ) ); return new FlippableIcon( ir.registerIcon( Name ) );
} }
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
@@ -537,7 +756,16 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
int mapRotation( IBlockAccess w, int x, int y, int z, int s ) int mapRotation( IBlockAccess w, int x, int y, int z, int s )
{ {
final IOrientable ori = this.getOrientable( w, x, y, z ); IOrientable ori = null;
if( this.hasBlockTileEntity() )
{
ori = (AEBaseTile) this.getTileEntity( w, x, y, z );
}
else if( this instanceof IOrientableBlock )
{
ori = ( (IOrientableBlock) this ).getOrientable( w, x, y, z );
}
if( ori != null && ori.canBeRotated() ) if( ori != null && ori.canBeRotated() )
{ {
@@ -547,6 +775,23 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
return s; return s;
} }
@Nullable
public <T extends TileEntity> T getTileEntity( IBlockAccess w, int x, int y, int z )
{
if( !this.hasBlockTileEntity() )
{
return null;
}
TileEntity te = w.getTileEntity( x, y, z );
if( this.tileEntityType.isInstance( te ) )
{
return (T) te;
}
return null;
}
public ForgeDirection mapRotation( IOrientable ori, ForgeDirection dir ) public ForgeDirection mapRotation( IOrientable ori, ForgeDirection dir )
{ {
// case DOWN: return bottomIcon; // case DOWN: return bottomIcon;
@@ -556,8 +801,8 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
// case WEST: return sideIcon; // case WEST: return sideIcon;
// case EAST: return sideIcon; // case EAST: return sideIcon;
final ForgeDirection forward = ori.getForward(); ForgeDirection forward = ori.getForward();
final ForgeDirection up = ori.getUp(); ForgeDirection up = ori.getUp();
ForgeDirection west = ForgeDirection.UNKNOWN; ForgeDirection west = ForgeDirection.UNKNOWN;
if( forward == null || up == null ) if( forward == null || up == null )
@@ -607,12 +852,66 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
return ForgeDirection.UNKNOWN; return ForgeDirection.UNKNOWN;
} }
public Class<? extends TileEntity> getTileEntityClass()
{
return this.tileEntityType;
}
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
public void setRenderStateByMeta( int itemDamage ) public void setRenderStateByMeta( int itemDamage )
{ {
} }
@Override
public final TileEntity createNewTileEntity( World var1, int var2 )
{
if( this.hasBlockTileEntity() )
{
try
{
return this.tileEntityType.newInstance();
}
catch( InstantiationException e )
{
throw new IllegalStateException( "Failed to create a new instance of an illegal class " + this.tileEntityType , e );
}
catch( IllegalAccessException e )
{
throw new IllegalStateException( "Failed to create a new instance of " + this.tileEntityType + ", because lack of permissions", e );
}
}
return null;
}
@Override
public void breakBlock( World w, int x, int y, int z, Block a, int b )
{
AEBaseTile te = this.getTileEntity( w, x, y, z );
if( te != null )
{
ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
if( te.dropItems() )
{
te.getDrops( w, x, y, z, drops );
}
else
{
te.getNoDrops( w, x, y, z, drops );
}
// Cry ;_; ...
Platform.spawnDrops( w, x, y, z, drops );
}
super.breakBlock( w, x, y, z, a, b );
if( te != null )
{
w.setTileEntity( x, y, z, null );
}
}
public String getUnlocalizedName( ItemStack is ) public String getUnlocalizedName( ItemStack is )
{ {
return this.getUnlocalizedName(); return this.getUnlocalizedName();
@@ -632,5 +931,4 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
{ {
return this.hasSubtypes; return this.hasSubtypes;
} }
} }
@@ -47,7 +47,7 @@ import appeng.util.Platform;
public class AEBaseItemBlock extends ItemBlock public class AEBaseItemBlock extends ItemBlock
{ {
private final AEBaseBlock blockType; final AEBaseBlock blockType;
public AEBaseItemBlock( Block id ) public AEBaseItemBlock( Block id )
{ {
@@ -105,7 +105,7 @@ public class AEBaseItemBlock extends ItemBlock
IOrientable ori = null; IOrientable ori = null;
if( this.blockType instanceof AEBaseTileBlock ) if( this.blockType.hasBlockTileEntity() )
{ {
if( this.blockType instanceof BlockLightDetector ) if( this.blockType instanceof BlockLightDetector )
{ {
@@ -185,9 +185,9 @@ public class AEBaseItemBlock extends ItemBlock
if( super.placeBlockAt( stack, player, w, x, y, z, side, hitX, hitY, hitZ, metadata ) ) if( super.placeBlockAt( stack, player, w, x, y, z, side, hitX, hitY, hitZ, metadata ) )
{ {
if( this.blockType instanceof AEBaseTileBlock && !( this.blockType instanceof BlockLightDetector ) ) if( this.blockType.hasBlockTileEntity() && !( this.blockType instanceof BlockLightDetector ) )
{ {
AEBaseTile tile = ( (AEBaseTileBlock) this.blockType ).getTileEntity( w, x, y, z ); AEBaseTile tile = this.blockType.getTileEntity( w, x, y, z );
ori = tile; ori = tile;
if( tile == null ) if( tile == null )
@@ -198,7 +198,7 @@ public class AEBaseItemBlock extends ItemBlock
if( ori.canBeRotated() && !this.blockType.hasCustomRotation() ) if( ori.canBeRotated() && !this.blockType.hasCustomRotation() )
{ {
if( ori.getForward() == null || ori.getUp() == null || // null if( ori.getForward() == null || ori.getUp() == null || // null
tile.getForward() == ForgeDirection.UNKNOWN || ori.getUp() == ForgeDirection.UNKNOWN ) tile.getForward() == ForgeDirection.UNKNOWN || ori.getUp() == ForgeDirection.UNKNOWN )
{ {
ori.setOrientation( forward, up ); ori.setOrientation( forward, up );
} }
@@ -51,7 +51,7 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
public void addCheckedInformation( ItemStack itemStack, EntityPlayer player, List<String> toolTip, boolean advancedTooltips ) public void addCheckedInformation( ItemStack itemStack, EntityPlayer player, List<String> toolTip, boolean advancedTooltips )
{ {
final NBTTagCompound tag = itemStack.getTagCompound(); NBTTagCompound tag = itemStack.getTagCompound();
double internalCurrentPower = 0; double internalCurrentPower = 0;
double internalMaxPower = this.getMaxEnergyCapacity(); double internalMaxPower = this.getMaxEnergyCapacity();
@@ -60,14 +60,14 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
internalCurrentPower = tag.getDouble( "internalCurrentPower" ); internalCurrentPower = tag.getDouble( "internalCurrentPower" );
} }
final double percent = internalCurrentPower / internalMaxPower; double percent = internalCurrentPower / internalMaxPower;
toolTip.add( GuiText.StoredEnergy.getLocal() + ':' + MessageFormat.format( " {0,number,#} ", internalCurrentPower ) + Platform.gui_localize( PowerUnits.AE.unlocalizedName ) + " - " + MessageFormat.format( " {0,number,#.##%} ", percent ) ); toolTip.add( GuiText.StoredEnergy.getLocal() + ':' + MessageFormat.format( " {0,number,#} ", internalCurrentPower ) + Platform.gui_localize( PowerUnits.AE.unlocalizedName ) + " - " + MessageFormat.format( " {0,number,#.##%} ", percent ) );
} }
private double getMaxEnergyCapacity() private double getMaxEnergyCapacity()
{ {
final Block blockID = Block.getBlockFromItem( this ); Block blockID = Block.getBlockFromItem( this );
final IBlockDefinition energyCell = Api.INSTANCE.definitions().blocks().energyCell(); final IBlockDefinition energyCell = Api.INSTANCE.definitions().blocks().energyCell();
for( Block block : energyCell.maybeBlock().asSet() ) for( Block block : energyCell.maybeBlock().asSet() )
{ {
@@ -104,13 +104,13 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
private double getInternal( ItemStack is ) private double getInternal( ItemStack is )
{ {
final NBTTagCompound nbt = Platform.openNbtData( is ); NBTTagCompound nbt = Platform.openNbtData( is );
return nbt.getDouble( "internalCurrentPower" ); return nbt.getDouble( "internalCurrentPower" );
} }
private void setInternal( ItemStack is, double amt ) private void setInternal( ItemStack is, double amt )
{ {
final NBTTagCompound nbt = Platform.openNbtData( is ); NBTTagCompound nbt = Platform.openNbtData( is );
nbt.setDouble( "internalCurrentPower", amt ); nbt.setDouble( "internalCurrentPower", amt );
} }
@@ -1,12 +0,0 @@
package appeng.block;
import net.minecraft.block.Block;
import net.minecraft.item.ItemSlab;
public class AEBaseItemBlockSlab extends ItemSlab {
public AEBaseItemBlockSlab(Block block, AEBaseSlabBlock singleSlab, AEBaseSlabBlock doubleSlab, Boolean isDoubleSlab)
{
super( block, singleSlab, doubleSlab, isDoubleSlab );
}
}
@@ -1,129 +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.block;
import java.util.EnumSet;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSlab;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import appeng.core.features.AEFeature;
import appeng.core.features.IAEFeature;
import appeng.core.features.IFeatureHandler;
import appeng.core.features.SlabBlockFeatureHandler;
public class AEBaseSlabBlock extends BlockSlab implements IAEFeature
{
private final IFeatureHandler features;
private final AEBaseBlock block;
private final int meta;
private AEBaseSlabBlock slabs;
private AEBaseSlabBlock doubleSlabs;
private final String name;
public AEBaseSlabBlock( AEBaseBlock block, int meta, EnumSet<AEFeature> features, boolean isDoubleSlab, String name )
{
super( isDoubleSlab, block.getMaterial() );
this.block = block;
this.meta = meta;
this.name = name;
this.setBlockName( "appliedenergistics2." + name );
this.setHardness( block.getBlockHardness( null, 0, 0, 0 ) );
this.setResistance( block.getExplosionResistance( null ) * 5.0F / 3.0F );
this.setStepSound( block.stepSound );
this.useNeighborBrightness = true;
if (!field_150004_a) this.doubleSlabs = new AEBaseSlabBlock( block, meta, features, true, name + ".double" ).setSlabs(this);
this.features = !field_150004_a ? new SlabBlockFeatureHandler( features, this ) : null;
}
public AEBaseSlabBlock setSlabs(AEBaseSlabBlock slabs)
{
this.slabs = slabs;
return this;
}
public AEBaseSlabBlock slabs()
{
return slabs;
}
public AEBaseSlabBlock doubleSlabs()
{
return doubleSlabs;
}
@Override
public IFeatureHandler handler()
{
return this.features;
}
@Override
public void postInit()
{
// Override to do stuff
}
@Override
public IIcon getIcon(int dir, int meta)
{
return block.getIcon( dir, this.meta );
}
@Override
public String func_150002_b(int p_150002_1_)
{
return this.getUnlocalizedName();
}
@Override
public void registerBlockIcons(IIconRegister reg) { }
@Override
public Item getItemDropped(int meta, Random rand, int fortune)
{
return this.field_150004_a ? Item.getItemFromBlock(this.slabs) : Item.getItemFromBlock(this);
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
{
AEBaseSlabBlock block = (AEBaseSlabBlock) world.getBlock(x, y, z);
if (block == null) return null;
if (block.field_150004_a) block = this.slabs;
int meta = world.getBlockMetadata(x, y, z) & 7;
return new ItemStack(block, 1, meta);
}
public String name()
{
return name;
}
}
@@ -21,11 +21,11 @@ package appeng.block;
import java.util.EnumSet; import java.util.EnumSet;
import com.google.common.base.Optional;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockStairs; import net.minecraft.block.BlockStairs;
import com.google.common.base.Optional;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.core.features.IAEFeature; import appeng.core.features.IAEFeature;
import appeng.core.features.IFeatureHandler; import appeng.core.features.IFeatureHandler;
@@ -1,350 +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.block;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import com.google.common.base.Optional;
import com.google.common.collect.Lists;
import net.minecraft.block.Block;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.ReflectionHelper;
import appeng.api.implementations.items.IMemoryCard;
import appeng.api.implementations.items.MemoryCardMessages;
import appeng.api.implementations.tiles.IColorableTile;
import appeng.api.util.AEColor;
import appeng.api.util.IOrientable;
import appeng.block.networking.BlockCableBus;
import appeng.core.features.AEFeature;
import appeng.core.features.AETileBlockFeatureHandler;
import appeng.core.features.ActivityState;
import appeng.core.features.IAEFeature;
import appeng.core.features.ItemStackSrc;
import appeng.helpers.ICustomCollision;
import appeng.tile.AEBaseTile;
import appeng.tile.networking.TileCableBus;
import appeng.tile.storage.TileSkyChest;
import appeng.util.Platform;
import appeng.util.SettingsFrom;
public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, ITileEntityProvider
{
@Nonnull
private Class<? extends TileEntity> tileEntityType;
public AEBaseTileBlock( Material mat )
{
super( mat );
}
protected AEBaseTileBlock( Material mat, Optional<String> subName )
{
super( mat, subName );
}
@Override
protected void setFeature( EnumSet<AEFeature> f )
{
final AETileBlockFeatureHandler featureHandler = new AETileBlockFeatureHandler( f, this, this.featureSubName );
this.setHandler( featureHandler );
}
protected void setTileEntity( Class<? extends TileEntity> c )
{
this.tileEntityType = c;
this.isInventory = IInventory.class.isAssignableFrom( c );
this.setTileProvider( this.hasBlockTileEntity() );
}
// update Block value.
private void setTileProvider( boolean b )
{
ReflectionHelper.setPrivateValue( Block.class, this, b, "isTileProvider" );
}
public boolean hasBlockTileEntity()
{
return this.tileEntityType != null;
}
public Class<? extends TileEntity> getTileEntityClass()
{
return this.tileEntityType;
}
@Nullable
public <T extends AEBaseTile> T getTileEntity( IBlockAccess w, int x, int y, int z )
{
if( !this.hasBlockTileEntity() )
{
return null;
}
final TileEntity te = w.getTileEntity( x, y, z );
if( this.tileEntityType.isInstance( te ) )
{
return (T) te;
}
return null;
}
@Override
public final TileEntity createNewTileEntity( World var1, int var2 )
{
if( this.hasBlockTileEntity() )
{
try
{
return this.tileEntityType.newInstance();
}
catch( InstantiationException e )
{
throw new IllegalStateException( "Failed to create a new instance of an illegal class " + this.tileEntityType, e );
}
catch( IllegalAccessException e )
{
throw new IllegalStateException( "Failed to create a new instance of " + this.tileEntityType + ", because lack of permissions", e );
}
}
return null;
}
@Override
public void breakBlock( World w, int x, int y, int z, Block a, int b )
{
final AEBaseTile te = this.getTileEntity( w, x, y, z );
if( te != null )
{
final ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
if( te.dropItems() )
{
te.getDrops( w, x, y, z, drops );
}
else
{
te.getNoDrops( w, x, y, z, drops );
}
// Cry ;_; ...
Platform.spawnDrops( w, x, y, z, drops );
}
// super will remove the TE, as it is not an instance of BlockContainer
super.breakBlock( w, x, y, z, a, b );
}
@Override
public final ForgeDirection[] getValidRotations( World w, int x, int y, int z )
{
final AEBaseTile obj = this.getTileEntity( w, x, y, z );
if( obj != null && obj.canBeRotated() )
{
return ForgeDirection.VALID_DIRECTIONS;
}
return super.getValidRotations( w, x, y, z );
}
@Override
public boolean recolourBlock( World world, int x, int y, int z, ForgeDirection side, int colour )
{
final TileEntity te = this.getTileEntity( world, x, y, z );
if( te instanceof IColorableTile )
{
final IColorableTile ct = (IColorableTile) te;
final AEColor c = ct.getColor();
final AEColor newColor = AEColor.values()[colour];
if( c != newColor )
{
ct.recolourBlock( side, newColor, null );
return true;
}
return false;
}
return super.recolourBlock( world, x, y, z, side, colour );
}
@Override
public int getComparatorInputOverride( World w, int x, int y, int z, int s )
{
final TileEntity te = this.getTileEntity( w, x, y, z );
if( te instanceof IInventory )
{
return Container.calcRedstoneFromInventory( (IInventory) te );
}
return 0;
}
@Override
public boolean onBlockEventReceived( World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, int p_149696_5_, int p_149696_6_ )
{
super.onBlockEventReceived( p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, p_149696_5_, p_149696_6_ );
final TileEntity tileentity = p_149696_1_.getTileEntity( p_149696_2_, p_149696_3_, p_149696_4_ );
return tileentity != null ? tileentity.receiveClientEvent( p_149696_5_, p_149696_6_ ) : false;
}
@Override
public void onBlockPlacedBy( World w, int x, int y, int z, EntityLivingBase player, ItemStack is )
{
if( is.hasDisplayName() )
{
final TileEntity te = this.getTileEntity( w, x, y, z );
if( te instanceof AEBaseTile )
{
( (AEBaseTile) w.getTileEntity( x, y, z ) ).setName( is.getDisplayName() );
}
}
}
@Override
public final boolean onBlockActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
{
if( player != null )
{
final ItemStack is = player.inventory.getCurrentItem();
if( is != null )
{
if( Platform.isWrench( player, is, x, y, z ) && player.isSneaking() )
{
final Block id = w.getBlock( x, y, z );
if( id != null )
{
final AEBaseTile tile = this.getTileEntity( w, x, y, z );
final ItemStack[] drops = Platform.getBlockDrops( w, x, y, z );
if( tile == null )
{
return false;
}
if( tile instanceof TileCableBus || tile instanceof TileSkyChest )
{
return false;
}
final ItemStack op = new ItemStack( this );
for( ItemStack ol : drops )
{
if( Platform.isSameItemType( ol, op ) )
{
final NBTTagCompound tag = tile.downloadSettings( SettingsFrom.DISMANTLE_ITEM );
if( tag != null )
{
ol.setTagCompound( tag );
}
}
}
if( id.removedByPlayer( w, player, x, y, z, false ) )
{
final List<ItemStack> l = Lists.newArrayList( drops );
Platform.spawnDrops( w, x, y, z, l );
w.setBlockToAir( x, y, z );
}
}
return false;
}
if( is.getItem() instanceof IMemoryCard && !( this instanceof BlockCableBus ) )
{
final IMemoryCard memoryCard = (IMemoryCard) is.getItem();
if( player.isSneaking() )
{
final AEBaseTile t = this.getTileEntity( w, x, y, z );
if( t != null )
{
final String name = this.getUnlocalizedName();
final NBTTagCompound data = t.downloadSettings( SettingsFrom.MEMORY_CARD );
if( data != null )
{
memoryCard.setMemoryCardContents( is, name, data );
memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_SAVED );
return true;
}
}
}
else
{
final String name = memoryCard.getSettingsName( is );
final NBTTagCompound data = memoryCard.getData( is );
if( this.getUnlocalizedName().equals( name ) )
{
final AEBaseTile t = this.getTileEntity( w, x, y, z );
t.uploadSettings( SettingsFrom.MEMORY_CARD, data );
memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_LOADED );
}
else
{
memoryCard.notifyUser( player, MemoryCardMessages.INVALID_MACHINE );
}
return false;
}
}
}
}
return this.onActivated( w, x, y, z, player, side, hitX, hitY, hitZ );
}
@Override
public IOrientable getOrientable( IBlockAccess w, int x, int y, int z )
{
return this.getTileEntity( w, x, y, z );
}
@Override
public ICustomCollision getCustomCollision( World w, int x, int y, int z )
{
final AEBaseTile te = this.getTileEntity( w, x, y, z );
if( te instanceof ICustomCollision )
{
return (ICustomCollision) te;
}
return super.getCustomCollision( w, x, y, z );
}
}
@@ -26,9 +26,9 @@ import net.minecraft.world.IBlockAccess;
public class AEDecorativeBlock extends AEBaseBlock public class AEDecorativeBlock extends AEBaseBlock
{ {
public AEDecorativeBlock( Material mat ) public AEDecorativeBlock( Class<? extends AEBaseBlock> c, Material mat )
{ {
super( mat ); super( c, mat );
} }
@Override @Override
@@ -40,8 +40,11 @@ import appeng.tile.crafting.TileCraftingMonitorTile;
public class BlockCraftingMonitor extends BlockCraftingUnit public class BlockCraftingMonitor extends BlockCraftingUnit
{ {
public BlockCraftingMonitor() public BlockCraftingMonitor()
{ {
super( BlockCraftingMonitor.class );
this.setTileEntity( TileCraftingMonitorTile.class ); this.setTileEntity( TileCraftingMonitorTile.class );
} }
@@ -37,6 +37,8 @@ public class BlockCraftingStorage extends BlockCraftingUnit
{ {
public BlockCraftingStorage() public BlockCraftingStorage()
{ {
super( BlockCraftingStorage.class );
this.setTileEntity( TileCraftingStorageTile.class ); this.setTileEntity( TileCraftingStorageTile.class );
} }
@@ -35,7 +35,7 @@ import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockCraftingCPU; import appeng.client.render.blocks.RenderBlockCraftingCPU;
import appeng.client.texture.ExtraBlockTextures; import appeng.client.texture.ExtraBlockTextures;
@@ -45,16 +45,22 @@ import appeng.tile.crafting.TileCraftingTile;
import appeng.util.Platform; import appeng.util.Platform;
public class BlockCraftingUnit extends AEBaseTileBlock public class BlockCraftingUnit extends AEBaseBlock
{ {
public static final int FLAG_FORMED = 8; public static final int FLAG_FORMED = 8;
public BlockCraftingUnit() public BlockCraftingUnit()
{ {
super( Material.iron ); this( BlockCraftingUnit.class );
this.setTileEntity( TileCraftingTile.class );
}
public BlockCraftingUnit( Class<? extends BlockCraftingUnit> childClass )
{
super( childClass, Material.iron );
this.hasSubtypes = true; this.hasSubtypes = true;
this.setTileEntity( TileCraftingTile.class );
this.setFeature( EnumSet.of( AEFeature.CraftingCPU ) ); this.setFeature( EnumSet.of( AEFeature.CraftingCPU ) );
} }
@@ -29,7 +29,7 @@ import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockAssembler; import appeng.client.render.blocks.RenderBlockAssembler;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
@@ -38,15 +38,14 @@ import appeng.tile.crafting.TileMolecularAssembler;
import appeng.util.Platform; import appeng.util.Platform;
public class BlockMolecularAssembler extends AEBaseTileBlock public class BlockMolecularAssembler extends AEBaseBlock
{ {
public static boolean booleanAlphaPass = false; public static boolean booleanAlphaPass = false;
public BlockMolecularAssembler() public BlockMolecularAssembler()
{ {
super( Material.iron ); super( BlockMolecularAssembler.class, Material.iron );
this.setTileEntity( TileMolecularAssembler.class ); this.setTileEntity( TileMolecularAssembler.class );
this.isOpaque = false; this.isOpaque = false;
this.lightOpacity = 1; this.lightOpacity = 1;
@@ -32,7 +32,7 @@ import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.implementations.tiles.ICrankable; import appeng.api.implementations.tiles.ICrankable;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockCrank; import appeng.client.render.blocks.RenderBlockCrank;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
@@ -41,13 +41,12 @@ import appeng.tile.AEBaseTile;
import appeng.tile.grindstone.TileCrank; import appeng.tile.grindstone.TileCrank;
public class BlockCrank extends AEBaseTileBlock public class BlockCrank extends AEBaseBlock
{ {
public BlockCrank() public BlockCrank()
{ {
super( Material.wood ); super( BlockCrank.class, Material.wood );
this.setTileEntity( TileCrank.class ); this.setTileEntity( TileCrank.class );
this.setLightOpacity( 0 ); this.setLightOpacity( 0 );
this.setHarvestLevel( "axe", 0 ); this.setHarvestLevel( "axe", 0 );
@@ -26,20 +26,19 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseBlock;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge; import appeng.core.sync.GuiBridge;
import appeng.tile.grindstone.TileGrinder; import appeng.tile.grindstone.TileGrinder;
import appeng.util.Platform; import appeng.util.Platform;
public class BlockGrinder extends AEBaseTileBlock public class BlockGrinder extends AEBaseBlock
{ {
public BlockGrinder() public BlockGrinder()
{ {
super( Material.rock ); super( BlockGrinder.class, Material.rock );
this.setTileEntity( TileGrinder.class ); this.setTileEntity( TileGrinder.class );
this.setHardness( 3.2F ); this.setHardness( 3.2F );
this.setFeature( EnumSet.of( AEFeature.GrindStone ) ); this.setFeature( EnumSet.of( AEFeature.GrindStone ) );
@@ -26,20 +26,19 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseBlock;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge; import appeng.core.sync.GuiBridge;
import appeng.tile.misc.TileCellWorkbench; import appeng.tile.misc.TileCellWorkbench;
import appeng.util.Platform; import appeng.util.Platform;
public class BlockCellWorkbench extends AEBaseTileBlock public class BlockCellWorkbench extends AEBaseBlock
{ {
public BlockCellWorkbench() public BlockCellWorkbench()
{ {
super( Material.iron ); super( BlockCellWorkbench.class, Material.iron );
this.setTileEntity( TileCellWorkbench.class ); this.setTileEntity( TileCellWorkbench.class );
this.setFeature( EnumSet.of( AEFeature.StorageCells ) ); this.setFeature( EnumSet.of( AEFeature.StorageCells ) );
} }
@@ -36,7 +36,7 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockCharger; import appeng.client.render.blocks.RenderBlockCharger;
import appeng.client.render.effects.LightningFX; import appeng.client.render.effects.LightningFX;
@@ -49,13 +49,12 @@ import appeng.tile.misc.TileCharger;
import appeng.util.Platform; import appeng.util.Platform;
public class BlockCharger extends AEBaseTileBlock implements ICustomCollision public class BlockCharger extends AEBaseBlock implements ICustomCollision
{ {
public BlockCharger() public BlockCharger()
{ {
super( Material.iron ); super( BlockCharger.class, Material.iron );
this.setTileEntity( TileCharger.class ); this.setTileEntity( TileCharger.class );
this.setLightOpacity( 2 ); this.setLightOpacity( 2 );
this.isFullSize = this.isOpaque = false; this.isFullSize = this.isOpaque = false;
@@ -26,20 +26,19 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseBlock;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge; import appeng.core.sync.GuiBridge;
import appeng.tile.misc.TileCondenser; import appeng.tile.misc.TileCondenser;
import appeng.util.Platform; import appeng.util.Platform;
public class BlockCondenser extends AEBaseTileBlock public class BlockCondenser extends AEBaseBlock
{ {
public BlockCondenser() public BlockCondenser()
{ {
super( Material.iron ); super( BlockCondenser.class, Material.iron );
this.setTileEntity( TileCondenser.class ); this.setTileEntity( TileCondenser.class );
this.setFeature( EnumSet.of( AEFeature.Core ) ); this.setFeature( EnumSet.of( AEFeature.Core ) );
} }
@@ -26,7 +26,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockInscriber; import appeng.client.render.blocks.RenderBlockInscriber;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
@@ -35,13 +35,12 @@ import appeng.tile.misc.TileInscriber;
import appeng.util.Platform; import appeng.util.Platform;
public class BlockInscriber extends AEBaseTileBlock public class BlockInscriber extends AEBaseBlock
{ {
public BlockInscriber() public BlockInscriber()
{ {
super( Material.iron ); super( BlockInscriber.class, Material.iron );
this.setTileEntity( TileInscriber.class ); this.setTileEntity( TileInscriber.class );
this.setLightOpacity( 2 ); this.setLightOpacity( 2 );
this.isFullSize = this.isOpaque = false; this.isFullSize = this.isOpaque = false;
@@ -27,7 +27,7 @@ import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.util.IOrientable; import appeng.api.util.IOrientable;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockInterface; import appeng.client.render.blocks.RenderBlockInterface;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
@@ -36,13 +36,12 @@ import appeng.tile.misc.TileInterface;
import appeng.util.Platform; import appeng.util.Platform;
public class BlockInterface extends AEBaseTileBlock public class BlockInterface extends AEBaseBlock
{ {
public BlockInterface() public BlockInterface()
{ {
super( Material.iron ); super( BlockInterface.class, Material.iron );
this.setTileEntity( TileInterface.class ); this.setTileEntity( TileInterface.class );
this.setFeature( EnumSet.of( AEFeature.Core ) ); this.setFeature( EnumSet.of( AEFeature.Core ) );
} }
@@ -19,43 +19,25 @@
package appeng.block.misc; package appeng.block.misc;
import java.util.Collections;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.List;
import java.util.Random; import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import appeng.api.util.IOrientable;
import appeng.api.util.IOrientableBlock;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.blocks.RenderQuartzTorch;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.helpers.ICustomCollision;
import appeng.helpers.MetaRotation;
import appeng.tile.misc.TileLightDetector; import appeng.tile.misc.TileLightDetector;
public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBlock, ICustomCollision public class BlockLightDetector extends BlockQuartzTorch
{ {
public BlockLightDetector() public BlockLightDetector()
{ {
super( Material.circuits ); super( BlockLightDetector.class );
this.setLightOpacity( 0 );
this.isFullSize = false;
this.isOpaque = false;
this.setTileEntity( TileLightDetector.class ); this.setTileEntity( TileLightDetector.class );
this.setFeature( EnumSet.of( AEFeature.LightDetector ) ); this.setFeature( EnumSet.of( AEFeature.LightDetector ) );
} }
@@ -89,82 +71,4 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
{ {
// cancel out lightning // cancel out lightning
} }
@Override
protected Class<? extends RenderQuartzTorch> getRenderer()
{
return RenderQuartzTorch.class;
}
@Override
public boolean isValidOrientation( World w, int x, int y, int z, ForgeDirection forward, ForgeDirection up )
{
return this.canPlaceAt( w, x, y, z, up.getOpposite() );
}
private boolean canPlaceAt( World w, int x, int y, int z, ForgeDirection dir )
{
return w.isSideSolid( x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, dir.getOpposite(), false );
}
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
{
ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
double xOff = -0.3 * up.offsetX;
double yOff = -0.3 * up.offsetY;
double zOff = -0.3 * up.offsetZ;
return Collections.singletonList( AxisAlignedBB.getBoundingBox( xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7 ) );
}
@Override
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e )
{/*
* double xOff = -0.15 * getUp().offsetX; double yOff = -0.15 * getUp().offsetY; double zOff = -0.15 *
* getUp().offsetZ; out.add( AxisAlignedBB.getBoundingBox( xOff + (double) x + 0.15, yOff + (double) y + 0.15, zOff
* + (double) z + 0.15,// ahh xOff + (double) x + 0.85, yOff + (double) y + 0.85, zOff + (double) z + 0.85 ) );
*/
}
@Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block id )
{
ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
if( !this.canPlaceAt( w, x, y, z, up.getOpposite() ) )
{
this.dropTorch( w, x, y, z );
}
}
private void dropTorch( World w, int x, int y, int z )
{
w.func_147480_a( x, y, z, true );
// w.destroyBlock( x, y, z, true );
w.markBlockForUpdate( x, y, z );
}
@Override
public boolean canPlaceBlockAt( World w, int x, int y, int z )
{
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
{
if( this.canPlaceAt( w, x, y, z, dir ) )
{
return true;
}
}
return false;
}
@Override
public boolean usesMetadata()
{
return true;
}
@Override
public IOrientable getOrientable( final IBlockAccess w, final int x, final int y, final int z )
{
return new MetaRotation( w, x, y, z );
}
} }
@@ -36,7 +36,7 @@ import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockPaint; import appeng.client.render.blocks.RenderBlockPaint;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
@@ -44,13 +44,12 @@ import appeng.tile.misc.TilePaint;
import appeng.util.Platform; import appeng.util.Platform;
public class BlockPaint extends AEBaseTileBlock public class BlockPaint extends AEBaseBlock
{ {
public BlockPaint() public BlockPaint()
{ {
super( new MaterialLiquid( MapColor.airColor ) ); super( BlockPaint.class, new MaterialLiquid( MapColor.airColor ) );
this.setTileEntity( TilePaint.class ); this.setTileEntity( TilePaint.class );
this.setLightOpacity( 0 ); this.setLightOpacity( 0 );
this.isFullSize = false; this.isFullSize = false;
@@ -72,13 +71,13 @@ public class BlockPaint extends AEBaseTileBlock
} }
@Override @Override
public AxisAlignedBB getCollisionBoundingBoxFromPool( World world, int x, int y, int z ) public AxisAlignedBB getCollisionBoundingBoxFromPool( World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_ )
{ {
return null; return null;
} }
@Override @Override
public boolean canCollideCheck( int metadata, boolean isHoldingRightClick ) public boolean canCollideCheck( int p_149678_1_, boolean p_149678_2_ )
{ {
return false; return false;
} }
@@ -95,13 +94,13 @@ public class BlockPaint extends AEBaseTileBlock
} }
@Override @Override
public Item getItemDropped( int meta, Random random, int fortune ) public Item getItemDropped( int p_149650_1_, Random p_149650_2_, int p_149650_3_ )
{ {
return null; return null;
} }
@Override @Override
public void dropBlockAsItemWithChance( World world, int x, int y, int z, int meta, float chance, int fortune ) public void dropBlockAsItemWithChance( World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_ )
{ {
} }
@@ -111,7 +110,7 @@ public class BlockPaint extends AEBaseTileBlock
{ {
if( Platform.isServer() ) if( Platform.isServer() )
{ {
w.setBlock( x, y, z, Platform.AIR_BLOCK, 0, 3 ); w.setBlock( x, y, z, Platform.AIR, 0, 3 );
} }
} }
@@ -25,30 +25,33 @@ import java.util.Random;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import appeng.api.util.IOrientable;
import appeng.api.util.IOrientableBlock; import appeng.api.util.IOrientableBlock;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockQuartzAccelerator; import appeng.client.render.blocks.RenderBlockQuartzAccelerator;
import appeng.client.render.effects.LightningFX; import appeng.client.render.effects.LightningFX;
import appeng.core.AEConfig; import appeng.core.AEConfig;
import appeng.core.CommonHelper; import appeng.core.CommonHelper;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.helpers.MetaRotation;
import appeng.tile.misc.TileQuartzGrowthAccelerator; import appeng.tile.misc.TileQuartzGrowthAccelerator;
import appeng.util.Platform; import appeng.util.Platform;
public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOrientableBlock public class BlockQuartzGrowthAccelerator extends AEBaseBlock implements IOrientableBlock
{ {
public BlockQuartzGrowthAccelerator() public BlockQuartzGrowthAccelerator()
{ {
super( Material.rock ); super( BlockQuartzGrowthAccelerator.class, Material.rock );
this.setStepSound( Block.soundTypeMetal ); this.setStepSound( Block.soundTypeMetal );
this.setTileEntity( TileQuartzGrowthAccelerator.class ); this.setTileEntity( TileQuartzGrowthAccelerator.class );
this.setFeature( EnumSet.of( AEFeature.Core ) ); this.setFeature( EnumSet.of( AEFeature.Core ) );
@@ -69,15 +72,15 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
return; return;
} }
TileQuartzGrowthAccelerator cga = this.getTileEntity( w, x, y, z ); TileQuartzGrowthAccelerator tileQuartzGrowthAccelerator = this.getTileEntity( w, x, y, z );
if( cga != null && cga.hasPower && CommonHelper.proxy.shouldAddParticles( r ) ) if( tileQuartzGrowthAccelerator != null && tileQuartzGrowthAccelerator.hasPower && CommonHelper.proxy.shouldAddParticles( r ) )
{ {
double d0 = r.nextFloat() - 0.5F; double d0 = r.nextFloat() - 0.5F;
double d1 = r.nextFloat() - 0.5F; double d1 = r.nextFloat() - 0.5F;
ForgeDirection up = cga.getUp(); ForgeDirection up = tileQuartzGrowthAccelerator.getUp();
ForgeDirection forward = cga.getForward(); ForgeDirection forward = tileQuartzGrowthAccelerator.getForward();
ForgeDirection west = Platform.crossProduct( forward, up ); ForgeDirection west = Platform.crossProduct( forward, up );
double rx = 0.5 + x; double rx = 0.5 + x;
@@ -141,14 +144,14 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
} }
@Override @Override
/**
* TODO: remove with 1.8 or later
*
* @Deprecated no longer true, only kept to prevent missing blocks.
*/
@Deprecated
public boolean usesMetadata() public boolean usesMetadata()
{ {
return true; return true;
} }
@Override
public IOrientable getOrientable( final IBlockAccess w, final int x, final int y, final int z )
{
return new MetaRotation( w, x, y, z );
}
} }
@@ -51,15 +51,19 @@ import appeng.helpers.MetaRotation;
public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, ICustomCollision public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, ICustomCollision
{ {
public BlockQuartzTorch() public BlockQuartzTorch()
{ {
super( Material.circuits ); this( BlockQuartzTorch.class );
this.setFeature( EnumSet.of( AEFeature.DecorativeLights ) );
this.setLightLevel( 0.9375F ); this.setLightLevel( 0.9375F );
this.setFeature( EnumSet.of( AEFeature.DecorativeLights ) );
}
protected BlockQuartzTorch( Class which )
{
super( which, Material.circuits );
this.setLightOpacity( 0 ); this.setLightOpacity( 0 );
this.isFullSize = false; this.isFullSize = this.isOpaque = false;
this.isOpaque = false;
} }
@Override @Override
@@ -26,7 +26,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RendererSecurity; import appeng.client.render.blocks.RendererSecurity;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
@@ -35,13 +35,12 @@ import appeng.tile.misc.TileSecurity;
import appeng.util.Platform; import appeng.util.Platform;
public class BlockSecurity extends AEBaseTileBlock public class BlockSecurity extends AEBaseBlock
{ {
public BlockSecurity() public BlockSecurity()
{ {
super( Material.iron ); super( BlockSecurity.class, Material.iron );
this.setTileEntity( TileSecurity.class ); this.setTileEntity( TileSecurity.class );
this.setFeature( EnumSet.of( AEFeature.Security ) ); this.setFeature( EnumSet.of( AEFeature.Security ) );
} }
@@ -36,7 +36,7 @@ import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockSkyCompass; import appeng.client.render.blocks.RenderBlockSkyCompass;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
@@ -44,12 +44,12 @@ import appeng.helpers.ICustomCollision;
import appeng.tile.misc.TileSkyCompass; import appeng.tile.misc.TileSkyCompass;
public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision public class BlockSkyCompass extends AEBaseBlock implements ICustomCollision
{ {
public BlockSkyCompass() public BlockSkyCompass()
{ {
super( Material.iron ); super( BlockSkyCompass.class, Material.iron );
this.setTileEntity( TileSkyCompass.class ); this.setTileEntity( TileSkyCompass.class );
this.isOpaque = this.isFullSize = false; this.isOpaque = this.isFullSize = false;
this.lightOpacity = 0; this.lightOpacity = 0;
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU Lesser General Public License as published by
@@ -58,7 +58,7 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
public BlockTinyTNT() public BlockTinyTNT()
{ {
super( Material.tnt ); super( BlockTinyTNT.class, Material.tnt );
this.setLightOpacity( 1 ); this.setLightOpacity( 1 );
this.setBlockBounds( 0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f ); this.setBlockBounds( 0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f );
this.isFullSize = this.isOpaque = false; this.isFullSize = this.isOpaque = false;
@@ -66,7 +66,7 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
this.setHardness( 0F ); this.setHardness( 0F );
this.setFeature( EnumSet.of( AEFeature.TinyTNT ) ); this.setFeature( EnumSet.of( AEFeature.TinyTNT ) );
EntityRegistry.registerModEntity( EntityTinyTNTPrimed.class, "EntityTinyTNTPrimed", EntityIds.TINY_TNT, AppEng.instance(), 16, 4, true ); EntityRegistry.registerModEntity( EntityTinyTNTPrimed.class, "EntityTinyTNTPrimed", EntityIds.TINY_TNT, AppEng.instance, 16, 4, true );
} }
@Override @Override
@@ -29,7 +29,7 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseBlock;
import appeng.client.texture.ExtraBlockTextures; import appeng.client.texture.ExtraBlockTextures;
import appeng.core.AEConfig; import appeng.core.AEConfig;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
@@ -39,12 +39,12 @@ import appeng.tile.misc.TileVibrationChamber;
import appeng.util.Platform; import appeng.util.Platform;
public final class BlockVibrationChamber extends AEBaseTileBlock public final class BlockVibrationChamber extends AEBaseBlock
{ {
public BlockVibrationChamber() public BlockVibrationChamber()
{ {
super( Material.iron ); super( BlockVibrationChamber.class, Material.iron );
this.setTileEntity( TileVibrationChamber.class ); this.setTileEntity( TileVibrationChamber.class );
this.setHardness( 4.2F ); this.setHardness( 4.2F );
this.setFeature( EnumSet.of( AEFeature.PowerGen ) ); this.setFeature( EnumSet.of( AEFeature.PowerGen ) );
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU Lesser General Public License as published by
@@ -53,18 +53,17 @@ import appeng.api.parts.IPartHost;
import appeng.api.parts.PartItemStack; import appeng.api.parts.PartItemStack;
import appeng.api.parts.SelectedPart; import appeng.api.parts.SelectedPart;
import appeng.api.util.AEColor; import appeng.api.util.AEColor;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.BusRenderHelper; import appeng.client.render.BusRenderHelper;
import appeng.client.render.blocks.RendererCableBus; import appeng.client.render.blocks.RendererCableBus;
import appeng.client.texture.ExtraBlockTextures; import appeng.client.texture.ExtraBlockTextures;
import appeng.core.AEConfig; import appeng.core.AEConfig;
import appeng.core.Api; import appeng.core.Api;
import appeng.core.AppEng;
import appeng.core.CommonHelper; import appeng.core.CommonHelper;
import appeng.core.features.AECableBusFeatureHandler;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.helpers.AEGlassMaterial; import appeng.helpers.AEGlassMaterial;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IFMP; import appeng.integration.abstraction.IFMP;
import appeng.parts.ICableBusContainer; import appeng.parts.ICableBusContainer;
@@ -78,7 +77,7 @@ import appeng.util.Platform;
@Interface( iface = "powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection", iname = "MFR" ) @Interface( iface = "powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection", iname = "MFR" )
public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
{ {
private static final ICableBusContainer NULL_CABLE_BUS = new NullCableBusContainer(); private static final ICableBusContainer NULL_CABLE_BUS = new NullCableBusContainer();
@@ -92,12 +91,9 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
public BlockCableBus() public BlockCableBus()
{ {
super( AEGlassMaterial.INSTANCE ); super( BlockCableBus.class, AEGlassMaterial.INSTANCE );
this.setLightOpacity( 0 ); this.setLightOpacity( 0 );
this.isFullSize = this.isOpaque = false; this.isFullSize = this.isOpaque = false;
// this will actually be overwritten later through setupTile and the combined layers
this.setTileEntity( TileCableBus.class );
this.setFeature( EnumSet.of( AEFeature.Core ) ); this.setFeature( EnumSet.of( AEFeature.Core ) );
} }
@@ -130,7 +126,7 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
} }
@Override @Override
public int colorMultiplier( IBlockAccess world, int x, int y, int z ) public int colorMultiplier( IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_ )
{ {
return this.myColorMultiplier; return this.myColorMultiplier;
} }
@@ -398,9 +394,9 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
{ {
out = ( (TileCableBus) te ).cb; out = ( (TileCableBus) te ).cb;
} }
else if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FMP ) ) else if( AppEng.instance.isIntegrationEnabled( IntegrationType.FMP ) )
{ {
out = ( (IFMP) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FMP ) ).getCableContainer( te ); out = ( (IFMP) AppEng.instance.getIntegration( IntegrationType.FMP ) ).getCableContainer( te );
} }
return out == null ? NULL_CABLE_BUS : out; return out == null ? NULL_CABLE_BUS : out;
@@ -455,7 +451,8 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
return this.cb( world, x, y, z ).recolourBlock( side, AEColor.values()[colour], who ); return this.cb( world, x, y, z ).recolourBlock( side, AEColor.values()[colour], who );
} }
catch( Throwable ignored ) catch( Throwable ignored )
{} {
}
return false; return false;
} }
@@ -467,7 +464,7 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
} }
@Override @Override
public <T extends AEBaseTile> T getTileEntity( IBlockAccess w, int x, int y, int z ) public <T extends TileEntity> T getTileEntity( IBlockAccess w, int x, int y, int z )
{ {
TileEntity te = w.getTileEntity( x, y, z ); TileEntity te = w.getTileEntity( x, y, z );
@@ -484,18 +481,9 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
return null; return null;
} }
@Override
protected void setFeature( EnumSet<AEFeature> f )
{
final AECableBusFeatureHandler featureHandler = new AECableBusFeatureHandler( f, this, this.featureSubName );
this.setHandler( featureHandler );
}
public void setupTile() public void setupTile()
{ {
noTesrTile = Api.INSTANCE.partHelper().getCombinedInstance( TileCableBus.class.getName() ); this.setTileEntity( noTesrTile = Api.INSTANCE.partHelper().getCombinedInstance( TileCableBus.class.getName() ) );
this.setTileEntity( noTesrTile );
GameRegistry.registerTileEntity( noTesrTile, "BlockCableBus" );
if( Platform.isClient() ) if( Platform.isClient() )
{ {
tesrTile = Api.INSTANCE.partHelper().getCombinedInstance( TileCableBusTESR.class.getName() ); tesrTile = Api.INSTANCE.partHelper().getCombinedInstance( TileCableBusTESR.class.getName() );
@@ -25,26 +25,26 @@ import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.world.World; import net.minecraft.world.World;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockController; import appeng.client.render.blocks.RenderBlockController;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.tile.networking.TileController; import appeng.tile.networking.TileController;
public class BlockController extends AEBaseTileBlock public class BlockController extends AEBaseBlock
{ {
public BlockController() public BlockController()
{ {
super( Material.iron ); super( BlockController.class, Material.iron );
this.setTileEntity( TileController.class ); this.setTileEntity( TileController.class );
this.setHardness( 6 ); this.setHardness( 6 );
this.setFeature( EnumSet.of( AEFeature.Channels ) ); this.setFeature( EnumSet.of( AEFeature.Channels ) );
} }
@Override @Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block neighborBlock ) public void onNeighborBlockChange( World w, int x, int y, int z, Block id_junk )
{ {
TileController tc = this.getTileEntity( w, x, y, z ); TileController tc = this.getTileEntity( w, x, y, z );
if( tc != null ) if( tc != null )
@@ -21,18 +21,18 @@ package appeng.block.networking;
import java.util.EnumSet; import java.util.EnumSet;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseBlock;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.helpers.AEGlassMaterial; import appeng.helpers.AEGlassMaterial;
import appeng.tile.networking.TileCreativeEnergyCell; import appeng.tile.networking.TileCreativeEnergyCell;
public class BlockCreativeEnergyCell extends AEBaseTileBlock public class BlockCreativeEnergyCell extends AEBaseBlock
{ {
public BlockCreativeEnergyCell() public BlockCreativeEnergyCell()
{ {
super( AEGlassMaterial.INSTANCE ); super( BlockCreativeEnergyCell.class, AEGlassMaterial.INSTANCE );
this.setTileEntity( TileCreativeEnergyCell.class ); this.setTileEntity( TileCreativeEnergyCell.class );
this.setFeature( EnumSet.of( AEFeature.Creative ) ); this.setFeature( EnumSet.of( AEFeature.Creative ) );
} }
@@ -33,6 +33,7 @@ public class BlockDenseEnergyCell extends BlockEnergyCell
public BlockDenseEnergyCell() public BlockDenseEnergyCell()
{ {
super( BlockDenseEnergyCell.class );
this.setTileEntity( TileDenseEnergyCell.class ); this.setTileEntity( TileDenseEnergyCell.class );
this.setFeature( EnumSet.of( AEFeature.DenseEnergyCells ) ); this.setFeature( EnumSet.of( AEFeature.DenseEnergyCells ) );
} }
@@ -23,17 +23,17 @@ import java.util.EnumSet;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseBlock;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.tile.networking.TileEnergyAcceptor; import appeng.tile.networking.TileEnergyAcceptor;
public class BlockEnergyAcceptor extends AEBaseTileBlock public class BlockEnergyAcceptor extends AEBaseBlock
{ {
public BlockEnergyAcceptor() public BlockEnergyAcceptor()
{ {
super( Material.iron ); super( BlockEnergyAcceptor.class, Material.iron );
this.setTileEntity( TileEnergyAcceptor.class ); this.setTileEntity( TileEnergyAcceptor.class );
this.setFeature( EnumSet.of( AEFeature.Core ) ); this.setFeature( EnumSet.of( AEFeature.Core ) );
} }
@@ -31,9 +31,9 @@ import net.minecraft.util.IIcon;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseItemBlock; import appeng.block.AEBaseItemBlock;
import appeng.block.AEBaseItemBlockChargeable; import appeng.block.AEBaseItemBlockChargeable;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockEnergyCube; import appeng.client.render.blocks.RenderBlockEnergyCube;
import appeng.client.texture.ExtraBlockTextures; import appeng.client.texture.ExtraBlockTextures;
@@ -43,17 +43,21 @@ import appeng.tile.networking.TileEnergyCell;
import appeng.util.Platform; import appeng.util.Platform;
public class BlockEnergyCell extends AEBaseTileBlock public class BlockEnergyCell extends AEBaseBlock
{ {
public BlockEnergyCell() public BlockEnergyCell()
{ {
super( AEGlassMaterial.INSTANCE ); this( BlockEnergyCell.class );
this.setTileEntity( TileEnergyCell.class ); this.setTileEntity( TileEnergyCell.class );
this.setFeature( EnumSet.of( AEFeature.Core ) ); this.setFeature( EnumSet.of( AEFeature.Core ) );
} }
public BlockEnergyCell( Class c )
{
super( c, AEGlassMaterial.INSTANCE );
}
@Override @Override
protected Class<? extends BaseBlockRender> getRenderer() protected Class<? extends BaseBlockRender> getRenderer()
{ {
@@ -29,7 +29,7 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockWireless; import appeng.client.render.blocks.RenderBlockWireless;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
@@ -40,12 +40,12 @@ import appeng.tile.networking.TileWireless;
import appeng.util.Platform; import appeng.util.Platform;
public class BlockWireless extends AEBaseTileBlock implements ICustomCollision public class BlockWireless extends AEBaseBlock implements ICustomCollision
{ {
public BlockWireless() public BlockWireless()
{ {
super( AEGlassMaterial.INSTANCE ); super( BlockWireless.class, AEGlassMaterial.INSTANCE );
this.setTileEntity( TileWireless.class ); this.setTileEntity( TileWireless.class );
this.setLightOpacity( 0 ); this.setLightOpacity( 0 );
this.isFullSize = false; this.isFullSize = false;
@@ -1,78 +0,0 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.block.qnb;
import java.util.EnumSet;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.world.World;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderQNB;
import appeng.core.features.AEFeature;
import appeng.helpers.ICustomCollision;
import appeng.tile.qnb.TileQuantumBridge;
public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICustomCollision
{
public BlockQuantumBase( Material mat )
{
super( mat );
this.setTileEntity( TileQuantumBridge.class );
float shave = 2.0f / 16.0f;
this.setBlockBounds( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave );
this.setLightOpacity( 0 );
this.isFullSize = this.isOpaque = false;
this.setFeature( EnumSet.of( AEFeature.QuantumNetworkBridge ) );
}
@Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block pointlessNumber )
{
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
if( bridge != null )
{
bridge.neighborUpdate();
}
}
@Override
public void breakBlock( World w, int x, int y, int z, Block a, int b )
{
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
if( bridge != null )
{
bridge.breakCluster();
}
super.breakBlock( w, x, y, z, a, b );
}
@Override
protected Class<? extends RenderQNB> getRenderer()
{
return RenderQNB.class;
}
}
@@ -20,9 +20,11 @@ package appeng.block.qnb;
import java.util.Collections; import java.util.Collections;
import java.util.EnumSet;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
@@ -32,20 +34,31 @@ import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseBlock;
import appeng.client.EffectType; import appeng.client.EffectType;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderQNB;
import appeng.core.CommonHelper; import appeng.core.CommonHelper;
import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge; import appeng.core.sync.GuiBridge;
import appeng.helpers.AEGlassMaterial; import appeng.helpers.AEGlassMaterial;
import appeng.helpers.ICustomCollision;
import appeng.tile.qnb.TileQuantumBridge; import appeng.tile.qnb.TileQuantumBridge;
import appeng.util.Platform; import appeng.util.Platform;
public class BlockQuantumLinkChamber extends BlockQuantumBase public class BlockQuantumLinkChamber extends AEBaseBlock implements ICustomCollision
{ {
public BlockQuantumLinkChamber() public BlockQuantumLinkChamber()
{ {
super( AEGlassMaterial.INSTANCE ); super( BlockQuantumLinkChamber.class, AEGlassMaterial.INSTANCE );
this.setTileEntity( TileQuantumBridge.class );
float shave = 2.0f / 16.0f;
this.setBlockBounds( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave );
this.setLightOpacity( 0 );
this.isFullSize = this.isOpaque = false;
this.setFeature( EnumSet.of( AEFeature.QuantumNetworkBridge ) );
} }
@Override @Override
@@ -65,6 +78,22 @@ public class BlockQuantumLinkChamber extends BlockQuantumBase
} }
} }
@Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block pointlessNumber )
{
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
if( bridge != null )
{
bridge.neighborUpdate();
}
}
@Override
protected Class<? extends BaseBlockRender> getRenderer()
{
return RenderQNB.class;
}
@Override @Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ ) public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{ {
@@ -85,17 +114,29 @@ public class BlockQuantumLinkChamber extends BlockQuantumBase
return false; return false;
} }
@Override
public void breakBlock( World w, int x, int y, int z, Block a, int b )
{
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
if( bridge != null )
{
bridge.breakCluster();
}
super.breakBlock( w, x, y, z, a, b );
}
@Override @Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual ) public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
{ {
double onePixel = 2.0 / 16.0; double OnePx = 2.0 / 16.0;
return Collections.singletonList( AxisAlignedBB.getBoundingBox( onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel ) ); return Collections.singletonList( AxisAlignedBB.getBoundingBox( OnePx, OnePx, OnePx, 1.0 - OnePx, 1.0 - OnePx, 1.0 - OnePx ) );
} }
@Override @Override
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e ) public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e )
{ {
double onePixel = 2.0 / 16.0; double OnePx = 2.0 / 16.0;
out.add( AxisAlignedBB.getBoundingBox( onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel ) ); out.add( AxisAlignedBB.getBoundingBox( OnePx, OnePx, OnePx, 1.0 - OnePx, 1.0 - OnePx, 1.0 - OnePx ) );
} }
} }
@@ -23,52 +23,91 @@ import java.util.Collections;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.List; import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World; import net.minecraft.world.World;
import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderQNB;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.helpers.ICustomCollision;
import appeng.tile.qnb.TileQuantumBridge; import appeng.tile.qnb.TileQuantumBridge;
public class BlockQuantumRing extends BlockQuantumBase public class BlockQuantumRing extends AEBaseBlock implements ICustomCollision
{ {
public BlockQuantumRing() public BlockQuantumRing()
{ {
super( Material.iron ); super( BlockQuantumRing.class, Material.iron );
this.setTileEntity( TileQuantumBridge.class );
float shave = 2.0f / 16.0f;
this.setBlockBounds( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave );
this.setLightOpacity( 1 );
this.isFullSize = this.isOpaque = false;
this.setFeature( EnumSet.of( AEFeature.QuantumNetworkBridge ) );
}
@Override
public void onNeighborBlockChange( World w, int x, int y, int z, Block pointlessNumber )
{
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
if( bridge != null )
{
bridge.neighborUpdate();
}
}
@Override
protected Class<? extends BaseBlockRender> getRenderer()
{
return RenderQNB.class;
}
@Override
public void breakBlock( World w, int x, int y, int z, Block a, int b )
{
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
if( bridge != null )
{
bridge.breakCluster();
}
super.breakBlock( w, x, y, z, a, b );
} }
@Override @Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual ) public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
{ {
double onePixel = 2.0 / 16.0; double OnePx = 2.0 / 16.0;
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z ); TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
if( bridge != null && bridge.isCorner() ) if( bridge != null && bridge.isCorner() )
{ {
onePixel = 4.0 / 16.0; OnePx = 4.0 / 16.0;
} }
else if( bridge != null && bridge.isFormed() ) else if( bridge != null && bridge.isFormed() )
{ {
onePixel = 1.0 / 16.0; OnePx = 1.0 / 16.0;
} }
return Collections.singletonList( AxisAlignedBB.getBoundingBox( onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel ) ); return Collections.singletonList( AxisAlignedBB.getBoundingBox( OnePx, OnePx, OnePx, 1.0 - OnePx, 1.0 - OnePx, 1.0 - OnePx ) );
} }
@Override @Override
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e ) public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e )
{ {
double onePixel = 2.0 / 16.0; double OnePx = 2.0 / 16.0;
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z ); TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
if( bridge != null && bridge.isCorner() ) if( bridge != null && bridge.isCorner() )
{ {
onePixel = 4.0 / 16.0; OnePx = 4.0 / 16.0;
} }
else if( bridge != null && bridge.isFormed() ) else if( bridge != null && bridge.isFormed() )
{ {
onePixel = 1.0 / 16.0; OnePx = 1.0 / 16.0;
} }
out.add( AxisAlignedBB.getBoundingBox( onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel ) ); out.add( AxisAlignedBB.getBoundingBox( OnePx, OnePx, OnePx, 1.0 - OnePx, 1.0 - OnePx, 1.0 - OnePx ) );
} }
} }
@@ -31,7 +31,7 @@ public class BlockFluix extends AEDecorativeBlock
{ {
public BlockFluix() public BlockFluix()
{ {
super( Material.rock ); super( BlockFluix.class, Material.rock );
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
} }
} }
@@ -32,7 +32,7 @@ public class BlockQuartz extends AEDecorativeBlock
public BlockQuartz() public BlockQuartz()
{ {
super( Material.rock ); super( BlockQuartz.class, Material.rock );
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
} }
} }
@@ -32,7 +32,7 @@ public class BlockQuartzChiseled extends AEDecorativeBlock
public BlockQuartzChiseled() public BlockQuartzChiseled()
{ {
super( Material.rock ); super( BlockQuartzChiseled.class, Material.rock );
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
} }
} }
@@ -36,9 +36,15 @@ import appeng.helpers.AEGlassMaterial;
public class BlockQuartzGlass extends AEBaseBlock public class BlockQuartzGlass extends AEBaseBlock
{ {
public BlockQuartzGlass() public BlockQuartzGlass()
{ {
super( Material.glass ); this( BlockQuartzGlass.class );
}
public BlockQuartzGlass( Class c )
{
super( c, Material.glass );
this.setLightOpacity( 0 ); this.setLightOpacity( 0 );
this.isOpaque = false; this.isOpaque = false;
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
@@ -39,6 +39,7 @@ public class BlockQuartzLamp extends BlockQuartzGlass
public BlockQuartzLamp() public BlockQuartzLamp()
{ {
super( BlockQuartzLamp.class );
this.setLightLevel( 1.0f ); this.setLightLevel( 1.0f );
this.setBlockTextureName( "BlockQuartzGlass" ); this.setBlockTextureName( "BlockQuartzGlass" );
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks, AEFeature.DecorativeLights ) ); this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks, AEFeature.DecorativeLights ) );
@@ -36,7 +36,7 @@ public class BlockQuartzPillar extends AEBaseBlock implements IOrientableBlock
public BlockQuartzPillar() public BlockQuartzPillar()
{ {
super( Material.rock ); super( BlockQuartzPillar.class, Material.rock );
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) ); this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
} }
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU Lesser General Public License as published by
@@ -29,6 +29,7 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
@@ -40,37 +41,40 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import rblocks.api.RotatableBlockEnable;
import appeng.api.util.IOrientable; import appeng.api.util.IOrientable;
import appeng.api.util.IOrientableBlock; import appeng.api.util.IOrientableBlock;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
import appeng.core.AppEng;
import appeng.core.WorldSettings;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.core.worlddata.WorldData;
import appeng.helpers.LocationRotation; import appeng.helpers.LocationRotation;
import appeng.helpers.NullRotation; import appeng.helpers.NullRotation;
import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IRB;
import appeng.util.Platform; import appeng.util.Platform;
@RotatableBlockEnable
public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
{ {
private static final float BLOCK_RESISTANCE = 150.0f;
private static final double BREAK_SPEAK_SCALAR = 0.1;
private static final double BREAK_SPEAK_THRESHOLD = 7.0;
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
private IIcon block; IIcon Block;
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
private IIcon brick; IIcon Brick;
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
private IIcon smallBrick; IIcon SmallBrick;
public BlockSkyStone() public BlockSkyStone()
{ {
super( Material.rock ); super( BlockSkyStone.class, Material.rock );
this.setHardness( 50 ); this.setHardness( 50 );
this.hasSubtypes = true; this.hasSubtypes = true;
this.blockResistance = BLOCK_RESISTANCE; this.blockResistance = 150.0f;
this.setHarvestLevel( "pickaxe", 3, 0 ); this.setHarvestLevel( "pickaxe", 3, 0 );
this.setFeature( EnumSet.of( AEFeature.Core ) ); this.setFeature( EnumSet.of( AEFeature.Core ) );
@@ -78,21 +82,21 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
} }
@SubscribeEvent @SubscribeEvent
public void breakFaster( PlayerEvent.BreakSpeed event ) public void breakFaster( PlayerEvent.BreakSpeed Ev )
{ {
if( event.block == this && event.entityPlayer != null ) if( Ev.block == this && Ev.entityPlayer != null )
{ {
ItemStack is = event.entityPlayer.inventory.getCurrentItem(); ItemStack is = Ev.entityPlayer.inventory.getCurrentItem();
int level = -1; int level = -1;
if( is != null && is.getItem() != null ) if( is != null )
{ {
level = is.getItem().getHarvestLevel( is, "pickaxe" ); level = is.getItem().getHarvestLevel( is, "pickaxe" );
} }
if( event.metadata > 0 || level >= 3 || event.originalSpeed > BREAK_SPEAK_THRESHOLD ) if( Ev.metadata > 0 || level >= 3 || Ev.originalSpeed > 7.0 )
{ {
event.newSpeed /= BREAK_SPEAK_SCALAR; Ev.newSpeed /= 0.1;
} }
} }
} }
@@ -118,10 +122,16 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
super.onBlockAdded( w, x, y, z ); super.onBlockAdded( w, x, y, z );
if( Platform.isServer() ) if( Platform.isServer() )
{ {
WorldData.instance().compassData().service().updateArea( w, x, y, z ); WorldSettings.getInstance().getCompass().updateArea( w, x, y, z );
} }
} }
// use AE2's renderer, no rotatable blocks.
int getRealRenderType()
{
return this.getRenderType();
}
@Override @Override
public boolean usesMetadata() public boolean usesMetadata()
{ {
@@ -131,6 +141,19 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
@Override @Override
public IOrientable getOrientable( final IBlockAccess w, final int x, final int y, final int z ) public IOrientable getOrientable( final IBlockAccess w, final int x, final int y, final int z )
{ {
if( AppEng.instance.isIntegrationEnabled( IntegrationType.RB ) )
{
TileEntity te = w.getTileEntity( x, y, z );
if( te != null )
{
IOrientable out = ( (IRB) AppEng.instance.getIntegration( IntegrationType.RB ) ).getOrientable( te );
if( out != null )
{
return out;
}
}
}
if( w.getBlockMetadata( x, y, z ) == 0 ) if( w.getBlockMetadata( x, y, z ) == 0 )
{ {
return new LocationRotation( w, x, y, z ); return new LocationRotation( w, x, y, z );
@@ -165,9 +188,9 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
public void registerBlockIcons( IIconRegister ir ) public void registerBlockIcons( IIconRegister ir )
{ {
super.registerBlockIcons( ir ); super.registerBlockIcons( ir );
this.block = ir.registerIcon( this.getTextureName() + ".Block" ); this.Block = ir.registerIcon( this.getTextureName() + ".Block" );
this.brick = ir.registerIcon( this.getTextureName() + ".Brick" ); this.Brick = ir.registerIcon( this.getTextureName() + ".Brick" );
this.smallBrick = ir.registerIcon( this.getTextureName() + ".SmallBrick" ); this.SmallBrick = ir.registerIcon( this.getTextureName() + ".SmallBrick" );
} }
@Override @Override
@@ -176,15 +199,15 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
{ {
if( metadata == 1 ) if( metadata == 1 )
{ {
return this.block; return this.Block;
} }
if( metadata == 2 ) if( metadata == 2 )
{ {
return this.brick; return this.Brick;
} }
if( metadata == 3 ) if( metadata == 3 )
{ {
return this.smallBrick; return this.SmallBrick;
} }
return super.getIcon( direction, metadata ); return super.getIcon( direction, metadata );
} }
@@ -207,12 +230,12 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
} }
@Override @Override
public void breakBlock( World w, int x, int y, int z, Block b, int metadata ) public void breakBlock( World w, int x, int y, int z, Block b, int WTF )
{ {
super.breakBlock( w, x, y, z, b, metadata ); super.breakBlock( w, x, y, z, b, WTF );
if( Platform.isServer() ) if( Platform.isServer() )
{ {
WorldData.instance().compassData().service().updateArea( w, x, y, z ); WorldSettings.getInstance().getCompass().updateArea( w, x, y, z );
} }
} }
} }
@@ -46,7 +46,12 @@ public class OreQuartz extends AEBaseBlock
public OreQuartz() public OreQuartz()
{ {
super( Material.rock ); this( OreQuartz.class );
}
public OreQuartz( Class<? extends OreQuartz> self )
{
super( self, Material.rock );
this.setHardness( 3.0F ); this.setHardness( 3.0F );
this.setResistance( 5.0F ); this.setResistance( 5.0F );
this.boostBrightnessLow = 0; this.boostBrightnessLow = 0;
@@ -20,7 +20,6 @@ package appeng.block.solids;
import java.util.Random; import java.util.Random;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
@@ -43,6 +42,7 @@ public class OreQuartzCharged extends OreQuartz
public OreQuartzCharged() public OreQuartzCharged()
{ {
super( OreQuartzCharged.class );
this.setBoostBrightnessLow( 2 ); this.setBoostBrightnessLow( 2 );
this.setBoostBrightnessHigh( 5 ); this.setBoostBrightnessHigh( 5 );
} }
@@ -49,7 +49,7 @@ public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision
public BlockMatrixFrame() public BlockMatrixFrame()
{ {
super( Material.anvil ); super( BlockMatrixFrame.class, Material.anvil );
this.setResistance( 6000000.0F ); this.setResistance( 6000000.0F );
this.setBlockUnbreakable(); this.setBlockUnbreakable();
this.setLightOpacity( 0 ); this.setLightOpacity( 0 );
@@ -27,19 +27,19 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseBlock;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge; import appeng.core.sync.GuiBridge;
import appeng.tile.spatial.TileSpatialIOPort; import appeng.tile.spatial.TileSpatialIOPort;
import appeng.util.Platform; import appeng.util.Platform;
public class BlockSpatialIOPort extends AEBaseTileBlock public class BlockSpatialIOPort extends AEBaseBlock
{ {
public BlockSpatialIOPort() public BlockSpatialIOPort()
{ {
super( Material.iron ); super( BlockSpatialIOPort.class, Material.iron );
this.setTileEntity( TileSpatialIOPort.class ); this.setTileEntity( TileSpatialIOPort.class );
this.setFeature( EnumSet.of( AEFeature.SpatialIO ) ); this.setFeature( EnumSet.of( AEFeature.SpatialIO ) );
} }
@@ -25,7 +25,7 @@ import net.minecraft.block.Block;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderSpatialPylon; import appeng.client.render.blocks.RenderSpatialPylon;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
@@ -33,12 +33,12 @@ import appeng.helpers.AEGlassMaterial;
import appeng.tile.spatial.TileSpatialPylon; import appeng.tile.spatial.TileSpatialPylon;
public class BlockSpatialPylon extends AEBaseTileBlock public class BlockSpatialPylon extends AEBaseBlock
{ {
public BlockSpatialPylon() public BlockSpatialPylon()
{ {
super( AEGlassMaterial.INSTANCE ); super( BlockSpatialPylon.class, AEGlassMaterial.INSTANCE );
this.setTileEntity( TileSpatialPylon.class ); this.setTileEntity( TileSpatialPylon.class );
this.setFeature( EnumSet.of( AEFeature.SpatialIO ) ); this.setFeature( EnumSet.of( AEFeature.SpatialIO ) );
} }
@@ -29,7 +29,7 @@ import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.api.storage.ICellHandler; import appeng.api.storage.ICellHandler;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderMEChest; import appeng.client.render.blocks.RenderMEChest;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
@@ -39,12 +39,12 @@ import appeng.tile.storage.TileChest;
import appeng.util.Platform; import appeng.util.Platform;
public class BlockChest extends AEBaseTileBlock public class BlockChest extends AEBaseBlock
{ {
public BlockChest() public BlockChest()
{ {
super( Material.iron ); super( BlockChest.class, Material.iron );
this.setTileEntity( TileChest.class ); this.setTileEntity( TileChest.class );
this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.MEChest ) ); this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.MEChest ) );
} }
@@ -26,7 +26,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderDrive; import appeng.client.render.blocks.RenderDrive;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
@@ -35,12 +35,12 @@ import appeng.tile.storage.TileDrive;
import appeng.util.Platform; import appeng.util.Platform;
public class BlockDrive extends AEBaseTileBlock public class BlockDrive extends AEBaseBlock
{ {
public BlockDrive() public BlockDrive()
{ {
super( Material.iron ); super( BlockDrive.class, Material.iron );
this.setTileEntity( TileDrive.class ); this.setTileEntity( TileDrive.class );
this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.MEDrive ) ); this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.MEDrive ) );
} }
@@ -27,19 +27,19 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseBlock;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge; import appeng.core.sync.GuiBridge;
import appeng.tile.storage.TileIOPort; import appeng.tile.storage.TileIOPort;
import appeng.util.Platform; import appeng.util.Platform;
public class BlockIOPort extends AEBaseTileBlock public class BlockIOPort extends AEBaseBlock
{ {
public BlockIOPort() public BlockIOPort()
{ {
super( Material.iron ); super( BlockIOPort.class, Material.iron );
this.setTileEntity( TileIOPort.class ); this.setTileEntity( TileIOPort.class );
this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.IOPort ) ); this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.IOPort ) );
} }
@@ -42,7 +42,7 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockSkyChest; import appeng.client.render.blocks.RenderBlockSkyChest;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
@@ -52,12 +52,12 @@ import appeng.tile.storage.TileSkyChest;
import appeng.util.Platform; import appeng.util.Platform;
public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
{ {
public BlockSkyChest() public BlockSkyChest()
{ {
super( Material.rock ); super( BlockSkyChest.class, Material.rock );
this.setTileEntity( TileSkyChest.class ); this.setTileEntity( TileSkyChest.class );
this.isOpaque = this.isFullSize = false; this.isOpaque = this.isFullSize = false;
this.lightOpacity = 0; this.lightOpacity = 0;
@@ -148,11 +148,11 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
o = sk.getUp(); o = sk.getUp();
} }
double offsetX = o.offsetX == 0 ? 0.06 : 0.0; double X = o.offsetX == 0 ? 0.06 : 0.0;
double offsetY = o.offsetY == 0 ? 0.06 : 0.0; double Y = o.offsetY == 0 ? 0.06 : 0.0;
double offsetZ = o.offsetZ == 0 ? 0.06 : 0.0; double Z = o.offsetZ == 0 ? 0.06 : 0.0;
return Collections.singletonList( AxisAlignedBB.getBoundingBox( Math.max( 0.0, offsetX - o.offsetX * sc ), Math.max( 0.0, offsetY - o.offsetY * sc ), Math.max( 0.0, offsetZ - o.offsetZ * sc ), Math.min( 1.0, ( 1.0 - offsetX ) - o.offsetX * sc ), Math.min( 1.0, ( 1.0 - offsetY ) - o.offsetY * sc ), Math.min( 1.0, ( 1.0 - offsetZ ) - o.offsetZ * sc ) ) ); return Collections.singletonList( AxisAlignedBB.getBoundingBox( Math.max( 0.0, X - o.offsetX * sc ), Math.max( 0.0, Y - o.offsetY * sc ), Math.max( 0.0, Z - o.offsetZ * sc ), Math.min( 1.0, ( 1.0 - X ) - o.offsetX * sc ), Math.min( 1.0, ( 1.0 - Y ) - o.offsetY * sc ), Math.min( 1.0, ( 1.0 - Z ) - o.offsetZ * sc ) ) );
} }
@Override @Override
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU Lesser General Public License as published by
@@ -84,6 +84,9 @@ import appeng.server.ServerHelper;
import appeng.transformer.MissingCoreMod; import appeng.transformer.MissingCoreMod;
import appeng.util.Platform; import appeng.util.Platform;
import static net.minecraftforge.client.IItemRenderer.ItemRenderType.ENTITY;
import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D;
public class ClientHelper extends ServerHelper public class ClientHelper extends ServerHelper
{ {
@@ -298,10 +301,10 @@ public class ClientHelper extends ServerHelper
GL11.glRotatef( 30.0f, 0.0f, 1.0f, 0.0f ); GL11.glRotatef( 30.0f, 0.0f, 1.0f, 0.0f );
} }
IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer( itemstack, IItemRenderer.ItemRenderType.ENTITY ); IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer( itemstack, ENTITY );
if( customRenderer != null && !( itemstack.getItem() instanceof ItemBlock ) ) if( customRenderer != null && !( itemstack.getItem() instanceof ItemBlock ) )
{ {
if( customRenderer.shouldUseRenderHelper( IItemRenderer.ItemRenderType.ENTITY, itemstack, IItemRenderer.ItemRendererHelper.BLOCK_3D ) ) if( customRenderer.shouldUseRenderHelper( ENTITY, itemstack, BLOCK_3D ) )
{ {
GL11.glTranslatef( 0, -0.04F, 0 ); GL11.glTranslatef( 0, -0.04F, 0 );
GL11.glScalef( 0.7f, 0.7f, 0.7f ); GL11.glScalef( 0.7f, 0.7f, 0.7f );
+16 -16
View File
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU Lesser General Public License as published by
@@ -30,9 +30,6 @@ import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import com.google.common.base.Joiner;
import com.google.common.base.Stopwatch;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse; import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
@@ -52,6 +49,9 @@ import net.minecraft.util.ResourceLocation;
import cpw.mods.fml.common.ObfuscationReflectionHelper; import cpw.mods.fml.common.ObfuscationReflectionHelper;
import com.google.common.base.Joiner;
import com.google.common.base.Stopwatch;
import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IAEItemStack;
import appeng.client.gui.widgets.GuiScrollbar; import appeng.client.gui.widgets.GuiScrollbar;
import appeng.client.gui.widgets.ITooltip; import appeng.client.gui.widgets.ITooltip;
@@ -72,11 +72,11 @@ import appeng.container.slot.SlotOutput;
import appeng.container.slot.SlotPatternTerm; import appeng.container.slot.SlotPatternTerm;
import appeng.container.slot.SlotRestrictedInput; import appeng.container.slot.SlotRestrictedInput;
import appeng.core.AELog; import appeng.core.AELog;
import appeng.core.AppEng;
import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketInventoryAction; import appeng.core.sync.packets.PacketInventoryAction;
import appeng.core.sync.packets.PacketSwapSlots; import appeng.core.sync.packets.PacketSwapSlots;
import appeng.helpers.InventoryAction; import appeng.helpers.InventoryAction;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.integration.abstraction.INEI; import appeng.integration.abstraction.INEI;
@@ -156,14 +156,14 @@ public abstract class AEBaseGui extends GuiContainer
} }
@Override @Override
public void drawScreen( int mouseX, int mouseY, float btn ) public void drawScreen( int mouse_x, int mouse_y, float btn )
{ {
super.drawScreen( mouseX, mouseY, btn ); super.drawScreen( mouse_x, mouse_y, btn );
boolean hasClicked = Mouse.isButtonDown( 0 ); boolean hasClicked = Mouse.isButtonDown( 0 );
if( hasClicked && this.myScrollBar != null ) if( hasClicked && this.myScrollBar != null )
{ {
this.myScrollBar.click( this, mouseX - this.guiLeft, mouseY - this.guiTop ); this.myScrollBar.click( this, mouse_x - this.guiLeft, mouse_y - this.guiTop );
} }
for( Object c : this.buttonList ) for( Object c : this.buttonList )
@@ -174,9 +174,9 @@ public abstract class AEBaseGui extends GuiContainer
int x = tooltip.xPos(); // ((GuiImgButton) c).xPosition; int x = tooltip.xPos(); // ((GuiImgButton) c).xPosition;
int y = tooltip.yPos(); // ((GuiImgButton) c).yPosition; int y = tooltip.yPos(); // ((GuiImgButton) c).yPosition;
if( x < mouseX && x + tooltip.getWidth() > mouseX && tooltip.isVisible() ) if( x < mouse_x && x + tooltip.getWidth() > mouse_x && tooltip.isVisible() )
{ {
if( y < mouseY && y + tooltip.getHeight() > mouseY ) if( y < mouse_y && y + tooltip.getHeight() > mouse_y )
{ {
if( y < 15 ) if( y < 15 )
{ {
@@ -194,14 +194,14 @@ public abstract class AEBaseGui extends GuiContainer
} }
} }
public void drawTooltip( int par2, int par3, int forceWidth, String message ) public void drawTooltip( int par2, int par3, int forceWidth, String Msg )
{ {
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS ); GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
GL11.glDisable( GL12.GL_RESCALE_NORMAL ); GL11.glDisable( GL12.GL_RESCALE_NORMAL );
RenderHelper.disableStandardItemLighting(); RenderHelper.disableStandardItemLighting();
GL11.glDisable( GL11.GL_LIGHTING ); GL11.glDisable( GL11.GL_LIGHTING );
GL11.glDisable( GL11.GL_DEPTH_TEST ); GL11.glDisable( GL11.GL_DEPTH_TEST );
String[] var4 = message.split( "\n" ); String[] var4 = Msg.split( "\n" );
if( var4.length > 0 ) if( var4.length > 0 )
{ {
@@ -590,7 +590,7 @@ public abstract class AEBaseGui extends GuiContainer
} }
@Override @Override
protected boolean checkHotbarKeys( int keyCode ) protected boolean checkHotbarKeys( int p_146983_1_ )
{ {
Slot theSlot; Slot theSlot;
@@ -607,7 +607,7 @@ public abstract class AEBaseGui extends GuiContainer
{ {
for( int j = 0; j < 9; ++j ) for( int j = 0; j < 9; ++j )
{ {
if( keyCode == this.mc.gameSettings.keyBindsHotbar[j].getKeyCode() ) if( p_146983_1_ == this.mc.gameSettings.keyBindsHotbar[j].getKeyCode() )
{ {
final List<Slot> slots = this.getInventorySlots(); final List<Slot> slots = this.getInventorySlots();
for( Slot s : slots ) for( Slot s : slots )
@@ -895,9 +895,9 @@ public abstract class AEBaseGui extends GuiContainer
private RenderItem setItemRender( RenderItem item ) private RenderItem setItemRender( RenderItem item )
{ {
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.NEI ) ) if( AppEng.instance.isIntegrationEnabled( IntegrationType.NEI ) )
{ {
return ( (INEI) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.NEI ) ).setItemRender( item ); return ( (INEI) AppEng.instance.getIntegration( IntegrationType.NEI ) ).setItemRender( item );
} }
else else
{ {
@@ -26,8 +26,6 @@ import java.util.Iterator;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import com.google.common.base.Joiner;
import org.lwjgl.input.Mouse; import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
@@ -35,6 +33,8 @@ import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import com.google.common.base.Joiner;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.api.storage.ITerminalHost; import appeng.api.storage.ITerminalHost;
import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IAEItemStack;
@@ -131,7 +131,7 @@ public class GuiCraftConfirm extends AEBaseGui
} }
@Override @Override
public void drawScreen( int mouseX, int mouseY, float btn ) public void drawScreen( int mouse_x, int mouse_y, float btn )
{ {
this.updateCPUButtonText(); this.updateCPUButtonText();
@@ -152,9 +152,9 @@ public class GuiCraftConfirm extends AEBaseGui
int minX = gx + 9 + x * 67; int minX = gx + 9 + x * 67;
int minY = gy + 22 + y * offY; int minY = gy + 22 + y * offY;
if( minX < mouseX && minX + 67 > mouseX ) if( minX < mouse_x && minX + 67 > mouse_x )
{ {
if( minY < mouseY && minY + offY - 2 > mouseY ) if( minY < mouse_y && minY + offY - 2 > mouse_y )
{ {
this.tooltip = z; this.tooltip = z;
break; break;
@@ -170,7 +170,7 @@ public class GuiCraftConfirm extends AEBaseGui
} }
} }
super.drawScreen( mouseX, mouseY, btn ); super.drawScreen( mouse_x, mouse_y, btn );
} }
private void updateCPUButtonText() private void updateCPUButtonText()
@@ -24,17 +24,15 @@ import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit;
import com.google.common.base.Joiner;
import org.apache.commons.lang3.time.DurationFormatUtils;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import com.google.common.base.Joiner;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.api.config.SortDir; import appeng.api.config.SortDir;
import appeng.api.config.SortOrder; import appeng.api.config.SortOrder;
@@ -52,45 +50,20 @@ import appeng.core.localization.GuiText;
import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketValueConfig; import appeng.core.sync.packets.PacketValueConfig;
import appeng.util.Platform; import appeng.util.Platform;
import appeng.util.ReadableNumberConverter;
public class GuiCraftingCPU extends AEBaseGui implements ISortSource public class GuiCraftingCPU extends AEBaseGui implements ISortSource
{ {
private final static int GUI_HEIGHT = 184;
private final static int GUI_WIDTH = 238;
private final static int DISPLAYED_ROWS = 6; final int rows = 6;
private final static int TEXT_COLOR = 0x404040; IItemList<IAEItemStack> storage = AEApi.instance().storage().createItemList();
private final static int BACKGROUND_ALPHA = 0x5A000000; IItemList<IAEItemStack> active = AEApi.instance().storage().createItemList();
IItemList<IAEItemStack> pending = AEApi.instance().storage().createItemList();
private final static int SECTION_LENGTH = 67; List<IAEItemStack> visual = new ArrayList<IAEItemStack>();
GuiButton cancel;
private final static int SCROLLBAR_TOP = 19; int tooltip = -1;
private final static int SCROLLBAR_LEFT = 218;
private final static int SCROLLBAR_HEIGHT = 137;
private final static int CANCEL_LEFT_OFFSET = 163;
private final static int CANCEL_TOP_OFFSET = 25;
private final static int CANCEL_HEIGHT = 20;
private final static int CANCEL_WIDTH = 50;
private final static int TITLE_TOP_OFFSET = 7;
private final static int TITLE_LEFT_OFFSET = 8;
private final static int ITEMSTACK_LEFT_OFFSET = 9;
private final static int ITEMSTACK_TOP_OFFSET = 22;
private final ContainerCraftingCPU craftingCpu;
private IItemList<IAEItemStack> storage = AEApi.instance().storage().createItemList();
private IItemList<IAEItemStack> active = AEApi.instance().storage().createItemList();
private IItemList<IAEItemStack> pending = AEApi.instance().storage().createItemList();
private List<IAEItemStack> visual = new ArrayList<IAEItemStack>();
private GuiButton cancel;
private int tooltip = -1;
public GuiCraftingCPU( InventoryPlayer inventoryPlayer, Object te ) public GuiCraftingCPU( InventoryPlayer inventoryPlayer, Object te )
{ {
@@ -100,9 +73,8 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
protected GuiCraftingCPU( ContainerCraftingCPU container ) protected GuiCraftingCPU( ContainerCraftingCPU container )
{ {
super( container ); super( container );
this.craftingCpu = container; this.ySize = 184;
this.ySize = GUI_HEIGHT; this.xSize = 238;
this.xSize = GUI_WIDTH;
this.myScrollBar = new GuiScrollbar(); this.myScrollBar = new GuiScrollbar();
} }
@@ -137,7 +109,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
{ {
super.initGui(); super.initGui();
this.setScrollBar(); this.setScrollBar();
this.cancel = new GuiButton( 0, this.guiLeft + CANCEL_LEFT_OFFSET, this.guiTop + this.ySize - CANCEL_TOP_OFFSET, CANCEL_WIDTH, CANCEL_HEIGHT, GuiText.Cancel.getLocal() ); this.cancel = new GuiButton( 0, this.guiLeft + 163, this.guiTop + this.ySize - 25, 50, 20, GuiText.Cancel.getLocal() );
this.buttonList.add( this.cancel ); this.buttonList.add( this.cancel );
} }
@@ -145,21 +117,21 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
{ {
int size = this.visual.size(); int size = this.visual.size();
this.myScrollBar.setTop( SCROLLBAR_TOP ).setLeft( SCROLLBAR_LEFT ).setHeight( SCROLLBAR_HEIGHT ); this.myScrollBar.setTop( 19 ).setLeft( 218 ).setHeight( 137 );
this.myScrollBar.setRange( 0, ( size + 2 ) / 3 - DISPLAYED_ROWS, 1 ); this.myScrollBar.setRange( 0, ( size + 2 ) / 3 - this.rows, 1 );
} }
@Override @Override
public void drawScreen( int mouseX, int mouseY, float btn ) public void drawScreen( int mouse_x, int mouse_y, float btn )
{ {
this.cancel.enabled = !this.visual.isEmpty(); this.cancel.enabled = !this.visual.isEmpty();
int x = 0; int x = 0;
int y = 0; int y = 0;
final int gx = ( this.width - this.xSize ) / 2; int gx = ( this.width - this.xSize ) / 2;
final int gy = ( this.height - this.ySize ) / 2; int gy = ( this.height - this.ySize ) / 2;
final int offY = 23; int offY = 23;
this.tooltip = -1; this.tooltip = -1;
@@ -168,9 +140,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
int minX = gx + 9 + x * 67; int minX = gx + 9 + x * 67;
int minY = gy + 22 + y * offY; int minY = gy + 22 + y * offY;
if( minX < mouseX && minX + 67 > mouseX ) if( minX < mouse_x && minX + 67 > mouse_x )
{ {
if( minY < mouseY && minY + offY - 2 > mouseY ) if( minY < mouse_y && minY + offY - 2 > mouse_y )
{ {
this.tooltip = z; this.tooltip = z;
break; break;
@@ -186,28 +158,22 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
} }
} }
super.drawScreen( mouseX, mouseY, btn ); super.drawScreen( mouse_x, mouse_y, btn );
} }
@Override @Override
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
{ {
final ReadableNumberConverter converter = ReadableNumberConverter.INSTANCE; this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.CraftingStatus.getLocal() ), 8, 7, 4210752 );
String title = this.getGuiDisplayName( GuiText.CraftingStatus.getLocal() );
if( this.craftingCpu.eta > 0 && !this.visual.isEmpty() ) int sectionLength = 67;
{
final long etaInMilliseconds = TimeUnit.MILLISECONDS.convert( this.craftingCpu.eta, TimeUnit.NANOSECONDS );
final String etaTimeText = DurationFormatUtils.formatDuration( etaInMilliseconds, GuiText.ETAFormat.getLocal() );
title += " - " + etaTimeText;
}
this.fontRendererObj.drawString( title, TITLE_LEFT_OFFSET, TITLE_TOP_OFFSET, TEXT_COLOR );
int x = 0; int x = 0;
int y = 0; int y = 0;
final int viewStart = this.myScrollBar.getCurrentScroll() * 3; int xo = 9;
final int viewEnd = viewStart + 3 * 6; int yo = 22;
int viewStart = this.myScrollBar.getCurrentScroll() * 3;
int viewEnd = viewStart + 3 * 6;
String dspToolTip = ""; String dspToolTip = "";
List<String> lineList = new LinkedList<String>(); List<String> lineList = new LinkedList<String>();
@@ -224,9 +190,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glScaled( 0.5, 0.5, 0.5 ); GL11.glScaled( 0.5, 0.5, 0.5 );
final IAEItemStack stored = this.storage.findPrecise( refStack ); IAEItemStack stored = this.storage.findPrecise( refStack );
final IAEItemStack activeStack = this.active.findPrecise( refStack ); IAEItemStack activeStack = this.active.findPrecise( refStack );
final IAEItemStack pendingStack = this.pending.findPrecise( refStack ); IAEItemStack pendingStack = this.pending.findPrecise( refStack );
int lines = 0; int lines = 0;
boolean active = false; boolean active = false;
@@ -249,10 +215,10 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
if( AEConfig.instance.useColoredCraftingStatus && ( active || scheduled ) ) if( AEConfig.instance.useColoredCraftingStatus && ( active || scheduled ) )
{ {
int bgColor = ( active ? AEColor.Green.blackVariant : AEColor.Yellow.blackVariant ) | BACKGROUND_ALPHA; int bgColor = ( active ? AEColor.Green.blackVariant : AEColor.Yellow.blackVariant ) | 0x5A000000;
int startX = ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET ) * 2; int startX = ( x * ( 1 + sectionLength ) + xo ) * 2;
int startY = ( ( y * offY + ITEMSTACK_TOP_OFFSET ) - 3 ) * 2; int startY = ( ( y * offY + yo ) - 3 ) * 2;
drawRect( startX, startY, startX + ( SECTION_LENGTH * 2 ), startY + ( offY * 2 ) - 2, bgColor ); drawRect( startX, startY, startX + ( sectionLength * 2 ), startY + ( offY * 2 ) - 2, bgColor );
} }
int negY = ( ( lines - 1 ) * 5 ) / 2; int negY = ( ( lines - 1 ) * 5 ) / 2;
@@ -260,9 +226,19 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
if( stored != null && stored.getStackSize() > 0 ) if( stored != null && stored.getStackSize() > 0 )
{ {
final String str = GuiText.Stored.getLocal() + ": " + converter.toWideReadableForm( stored.getStackSize() ); String str = Long.toString( stored.getStackSize() );
if( stored.getStackSize() >= 10000 )
{
str = Long.toString( stored.getStackSize() / 1000 ) + 'k';
}
if( stored.getStackSize() >= 10000000 )
{
str = Long.toString( stored.getStackSize() / 1000000 ) + 'm';
}
str = GuiText.Stored.getLocal() + ": " + str;
int w = 4 + this.fontRendererObj.getStringWidth( str ); int w = 4 + this.fontRendererObj.getStringWidth( str );
this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + ITEMSTACK_TOP_OFFSET + 6 - negY + downY ) * 2, TEXT_COLOR ); this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + yo + 6 - negY + downY ) * 2, 4210752 );
if( this.tooltip == z - viewStart ) if( this.tooltip == z - viewStart )
{ {
@@ -274,10 +250,19 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
if( activeStack != null && activeStack.getStackSize() > 0 ) if( activeStack != null && activeStack.getStackSize() > 0 )
{ {
final String str = GuiText.Crafting.getLocal() + ": " + converter.toWideReadableForm( activeStack.getStackSize() ); String str = Long.toString( activeStack.getStackSize() );
final int w = 4 + this.fontRendererObj.getStringWidth( str ); if( activeStack.getStackSize() >= 10000 )
{
str = Long.toString( activeStack.getStackSize() / 1000 ) + 'k';
}
if( activeStack.getStackSize() >= 10000000 )
{
str = Long.toString( activeStack.getStackSize() / 1000000 ) + 'm';
}
this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + ITEMSTACK_TOP_OFFSET + 6 - negY + downY ) * 2, TEXT_COLOR ); str = GuiText.Crafting.getLocal() + ": " + str;
int w = 4 + this.fontRendererObj.getStringWidth( str );
this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + yo + 6 - negY + downY ) * 2, 4210752 );
if( this.tooltip == z - viewStart ) if( this.tooltip == z - viewStart )
{ {
@@ -289,10 +274,19 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
if( pendingStack != null && pendingStack.getStackSize() > 0 ) if( pendingStack != null && pendingStack.getStackSize() > 0 )
{ {
final String str = GuiText.Scheduled.getLocal() + ": " + converter.toWideReadableForm( pendingStack.getStackSize() ); String str = Long.toString( pendingStack.getStackSize() );
final int w = 4 + this.fontRendererObj.getStringWidth( str ); if( pendingStack.getStackSize() >= 10000 )
{
str = Long.toString( pendingStack.getStackSize() / 1000 ) + 'k';
}
if( pendingStack.getStackSize() >= 10000000 )
{
str = Long.toString( pendingStack.getStackSize() / 1000000 ) + 'm';
}
this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + ITEMSTACK_TOP_OFFSET + 6 - negY + downY ) * 2, TEXT_COLOR ); str = GuiText.Scheduled.getLocal() + ": " + str;
int w = 4 + this.fontRendererObj.getStringWidth( str );
this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + yo + 6 - negY + downY ) * 2, 4210752 );
if( this.tooltip == z - viewStart ) if( this.tooltip == z - viewStart )
{ {
@@ -301,8 +295,8 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
} }
GL11.glPopMatrix(); GL11.glPopMatrix();
int posX = x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19; int posX = x * ( 1 + sectionLength ) + xo + sectionLength - 19;
int posY = y * offY + ITEMSTACK_TOP_OFFSET; int posY = y * offY + yo;
ItemStack is = refStack.copy().getItemStack(); ItemStack is = refStack.copy().getItemStack();
@@ -315,8 +309,8 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
dspToolTip = dspToolTip + '\n' + Joiner.on( "\n" ).join( lineList ); dspToolTip = dspToolTip + '\n' + Joiner.on( "\n" ).join( lineList );
} }
toolPosX = x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 8; toolPosX = x * ( 1 + sectionLength ) + xo + sectionLength - 8;
toolPosY = y * offY + ITEMSTACK_TOP_OFFSET; toolPosY = y * offY + yo;
} }
this.drawItem( posX, posY, is ); this.drawItem( posX, posY, is );
@@ -418,9 +412,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
private long getTotal( IAEItemStack is ) private long getTotal( IAEItemStack is )
{ {
final IAEItemStack a = this.storage.findPrecise( is ); IAEItemStack a = this.storage.findPrecise( is );
final IAEItemStack b = this.active.findPrecise( is ); IAEItemStack b = this.active.findPrecise( is );
final IAEItemStack c = this.pending.findPrecise( is ); IAEItemStack c = this.pending.findPrecise( is );
long total = 0; long total = 0;
@@ -444,8 +438,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
private void deleteVisualStack( IAEItemStack l ) private void deleteVisualStack( IAEItemStack l )
{ {
final Iterator<IAEItemStack> i = this.visual.iterator(); Iterator<IAEItemStack> i = this.visual.iterator();
while( i.hasNext() ) while( i.hasNext() )
{ {
IAEItemStack o = i.next(); IAEItemStack o = i.next();
@@ -467,9 +460,8 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
} }
} }
final IAEItemStack stack = l.copy(); IAEItemStack stack = l.copy();
this.visual.add( stack ); this.visual.add( stack );
return stack; return stack;
} }
@@ -28,8 +28,6 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.WeakHashMap; import java.util.WeakHashMap;
import com.google.common.collect.HashMultimap;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
@@ -37,6 +35,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagList;
import com.google.common.collect.HashMultimap;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.client.gui.AEBaseGui; import appeng.client.gui.AEBaseGui;
import appeng.client.gui.widgets.GuiScrollbar; import appeng.client.gui.widgets.GuiScrollbar;
@@ -45,7 +45,7 @@ import appeng.client.me.ClientDCInternalInv;
import appeng.client.me.SlotDisconnected; import appeng.client.me.SlotDisconnected;
import appeng.container.implementations.ContainerInterfaceTerminal; import appeng.container.implementations.ContainerInterfaceTerminal;
import appeng.core.localization.GuiText; import appeng.core.localization.GuiText;
import appeng.parts.reporting.PartInterfaceTerminal; import appeng.parts.reporting.PartMonitor;
import appeng.util.Platform; import appeng.util.Platform;
@@ -67,7 +67,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
private boolean refreshList = false; private boolean refreshList = false;
private MEGuiTextField searchField; private MEGuiTextField searchField;
public GuiInterfaceTerminal( InventoryPlayer inventoryPlayer, PartInterfaceTerminal te ) public GuiInterfaceTerminal( InventoryPlayer inventoryPlayer, PartMonitor te )
{ {
super( new ContainerInterfaceTerminal( inventoryPlayer, te ) ); super( new ContainerInterfaceTerminal( inventoryPlayer, te ) );
this.myScrollBar = new GuiScrollbar(); this.myScrollBar = new GuiScrollbar();
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU Lesser General Public License as published by
@@ -54,15 +54,14 @@ import appeng.container.slot.SlotCraftingMatrix;
import appeng.container.slot.SlotFakeCraftingMatrix; import appeng.container.slot.SlotFakeCraftingMatrix;
import appeng.core.AEConfig; import appeng.core.AEConfig;
import appeng.core.AELog; import appeng.core.AELog;
import appeng.core.AppEng;
import appeng.core.localization.GuiText; import appeng.core.localization.GuiText;
import appeng.core.sync.GuiBridge; import appeng.core.sync.GuiBridge;
import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketSwitchGuis; import appeng.core.sync.packets.PacketSwitchGuis;
import appeng.core.sync.packets.PacketValueConfig; import appeng.core.sync.packets.PacketValueConfig;
import appeng.helpers.WirelessTerminalGuiObject; import appeng.helpers.WirelessTerminalGuiObject;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.parts.reporting.AbstractPartTerminal;
import appeng.parts.reporting.PartTerminal; import appeng.parts.reporting.PartTerminal;
import appeng.tile.misc.TileSecurity; import appeng.tile.misc.TileSecurity;
import appeng.util.IConfigManagerHost; import appeng.util.IConfigManagerHost;
@@ -140,7 +139,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
{ {
this.myName = GuiText.Chest; this.myName = GuiText.Chest;
} }
else if( te instanceof AbstractPartTerminal ) else if( te instanceof PartTerminal )
{ {
this.myName = GuiText.Terminal; this.myName = GuiText.Terminal;
} }
@@ -225,7 +224,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
this.maxRows = this.getMaxRows(); this.maxRows = this.getMaxRows();
this.perRow = AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) != TerminalStyle.FULL ? 9 : 9 + ( ( this.width - this.standardSize ) / 18 ); this.perRow = AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) != TerminalStyle.FULL ? 9 : 9 + ( ( this.width - this.standardSize ) / 18 );
boolean hasNEI = IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.NEI ); boolean hasNEI = AppEng.instance.isIntegrationEnabled( IntegrationType.NEI );
int NEI = hasNEI ? 0 : 0; int NEI = hasNEI ? 0 : 0;
int top = hasNEI ? 22 : 0; int top = hasNEI ? 22 : 0;
@@ -334,7 +333,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
{ {
if( s instanceof AppEngSlot ) if( s instanceof AppEngSlot )
{ {
if( ( (Slot) s ).xDisplayPosition < 197 ) if( ( (AppEngSlot) s ).xDisplayPosition < 197 )
{ {
this.repositionSlot( (AppEngSlot) s ); this.repositionSlot( (AppEngSlot) s );
} }
@@ -89,7 +89,7 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
} }
@Override @Override
public void drawScreen( int mouseX, int mouseY, float btn ) public void drawScreen( int mouse_x, int mouse_y, float btn )
{ {
int x = 0; int x = 0;
int y = 0; int y = 0;
@@ -104,9 +104,9 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
int minX = gx + 14 + x * 31; int minX = gx + 14 + x * 31;
int minY = gy + 41 + y * 18; int minY = gy + 41 + y * 18;
if( minX < mouseX && minX + 28 > mouseX ) if( minX < mouse_x && minX + 28 > mouse_x )
{ {
if( minY < mouseY && minY + 20 > mouseY ) if( minY < mouse_y && minY + 20 > mouse_y )
{ {
this.tooltip = z; this.tooltip = z;
break; break;
@@ -122,7 +122,7 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
} }
} }
super.drawScreen( mouseX, mouseY, btn ); super.drawScreen( mouse_x, mouse_y, btn );
} }
@Override @Override
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU Lesser General Public License as published by
@@ -23,8 +23,8 @@ import net.minecraft.entity.player.InventoryPlayer;
import appeng.client.gui.AEBaseGui; import appeng.client.gui.AEBaseGui;
import appeng.container.implementations.ContainerSkyChest; import appeng.container.implementations.ContainerSkyChest;
import appeng.core.AppEng;
import appeng.core.localization.GuiText; import appeng.core.localization.GuiText;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType; import appeng.integration.IntegrationType;
import appeng.tile.storage.TileSkyChest; import appeng.tile.storage.TileSkyChest;
@@ -55,6 +55,6 @@ public class GuiSkyChest extends AEBaseGui
@Override @Override
protected boolean enableSpaceClicking() protected boolean enableSpaceClicking()
{ {
return !IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.InvTweaks ); return !AppEng.instance.isIntegrationEnabled( IntegrationType.InvTweaks );
} }
} }
@@ -26,7 +26,6 @@ import net.minecraft.entity.player.InventoryPlayer;
import appeng.api.config.FuzzyMode; import appeng.api.config.FuzzyMode;
import appeng.api.config.RedstoneMode; import appeng.api.config.RedstoneMode;
import appeng.api.config.SchedulingMode;
import appeng.api.config.Settings; import appeng.api.config.Settings;
import appeng.api.config.Upgrades; import appeng.api.config.Upgrades;
import appeng.api.config.YesNo; import appeng.api.config.YesNo;
@@ -37,7 +36,6 @@ import appeng.container.implementations.ContainerUpgradeable;
import appeng.core.localization.GuiText; import appeng.core.localization.GuiText;
import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketConfigButton; import appeng.core.sync.packets.PacketConfigButton;
import appeng.parts.automation.PartExportBus;
import appeng.parts.automation.PartImportBus; import appeng.parts.automation.PartImportBus;
@@ -50,7 +48,6 @@ public class GuiUpgradeable extends AEBaseGui
GuiImgButton redstoneMode; GuiImgButton redstoneMode;
GuiImgButton fuzzyMode; GuiImgButton fuzzyMode;
GuiImgButton craftMode; GuiImgButton craftMode;
GuiImgButton schedulingMode;
public GuiUpgradeable( InventoryPlayer inventoryPlayer, IUpgradeableHost te ) public GuiUpgradeable( InventoryPlayer inventoryPlayer, IUpgradeableHost te )
{ {
@@ -84,12 +81,10 @@ public class GuiUpgradeable extends AEBaseGui
this.redstoneMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE ); 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.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.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.craftMode );
this.buttonList.add( this.redstoneMode ); this.buttonList.add( this.redstoneMode );
this.buttonList.add( this.fuzzyMode ); this.buttonList.add( this.fuzzyMode );
this.buttonList.add( this.schedulingMode );
} }
@Override @Override
@@ -112,11 +107,6 @@ public class GuiUpgradeable extends AEBaseGui
{ {
this.craftMode.set( this.cvb.cMode ); this.craftMode.set( this.cvb.cMode );
} }
if( this.schedulingMode != null )
{
this.schedulingMode.set( this.cvb.schedulingMode );
}
} }
@Override @Override
@@ -150,10 +140,6 @@ public class GuiUpgradeable extends AEBaseGui
{ {
this.craftMode.setVisibility( this.bc.getInstalledUpgrades( Upgrades.CRAFTING ) > 0 ); 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() protected String getBackground()
@@ -192,10 +178,5 @@ public class GuiUpgradeable extends AEBaseGui
{ {
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.fuzzyMode.getSetting(), backwards ) ); NetworkHandler.instance.sendToServer( new PacketConfigButton( this.fuzzyMode.getSetting(), backwards ) );
} }
if( btn == this.schedulingMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.schedulingMode.getSetting(), backwards ) );
}
} }
} }
@@ -39,7 +39,6 @@ import appeng.api.config.OperationMode;
import appeng.api.config.PowerUnits; import appeng.api.config.PowerUnits;
import appeng.api.config.RedstoneMode; import appeng.api.config.RedstoneMode;
import appeng.api.config.RelativeDirection; import appeng.api.config.RelativeDirection;
import appeng.api.config.SchedulingMode;
import appeng.api.config.SearchBoxMode; import appeng.api.config.SearchBoxMode;
import appeng.api.config.Settings; import appeng.api.config.Settings;
import appeng.api.config.SortDir; import appeng.api.config.SortDir;
@@ -159,10 +158,6 @@ public class GuiImgButton extends GuiButton implements ITooltip
this.registerApp( 16 * 14, Settings.PLACE_BLOCK, YesNo.YES, ButtonToolTips.BlockPlacement, ButtonToolTips.BlockPlacementYes ); 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 * 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 );
} }
} }
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU Lesser General Public License as published by
@@ -28,17 +28,17 @@ public class GuiNumberBox extends GuiTextField
final Class type; final Class type;
public GuiNumberBox( FontRenderer fontRenderer, int x, int y, int width, int height, Class type ) public GuiNumberBox( FontRenderer p_i1032_1_, int p_i1032_2_, int p_i1032_3_, int p_i1032_4_, int p_i1032_5_, Class type )
{ {
super( fontRenderer, x, y, width, height ); super( p_i1032_1_, p_i1032_2_, p_i1032_3_, p_i1032_4_, p_i1032_5_ );
this.type = type; this.type = type;
} }
@Override @Override
public void writeText( String selectedText ) public void writeText( String p_146191_1_ )
{ {
String original = this.getText(); String original = this.getText();
super.writeText( selectedText ); super.writeText( p_146191_1_ );
try try
{ {
@@ -38,20 +38,20 @@ public class GuiProgressBar extends GuiButton implements ITooltip
private final String titleName; private final String titleName;
private String fullMsg; private String fullMsg;
public GuiProgressBar( IProgressProvider source, String texture, int posX, int posY, int u, int y, int width, int height, Direction dir ) public GuiProgressBar( IProgressProvider source, String texture, int posX, int posY, int u, int y, int _width, int _height, Direction dir )
{ {
this( source, texture, posX, posY, u, y, width, height, dir, null ); this( source, texture, posX, posY, u, y, _width, _height, dir, null );
} }
public GuiProgressBar( IProgressProvider source, String texture, int posX, int posY, int u, int y, int width, int height, Direction dir, String title ) public GuiProgressBar( IProgressProvider source, String texture, int posX, int posY, int u, int y, int _width, int _height, Direction dir, String title )
{ {
super( posX, posY, width, "" ); super( posX, posY, _width, "" );
this.source = source; this.source = source;
this.xPosition = posX; this.xPosition = posX;
this.yPosition = posY; this.yPosition = posY;
this.texture = new ResourceLocation( "appliedenergistics2", "textures/" + texture ); this.texture = new ResourceLocation( "appliedenergistics2", "textures/" + texture );
this.width = width; this.width = _width;
this.height = height; this.height = _height;
this.fill_u = u; this.fill_u = u;
this.fill_v = y; this.fill_v = y;
this.layout = dir; this.layout = dir;
+1 -1
View File
@@ -200,7 +200,7 @@ public class ItemRepo
{ {
for( Object lp : Platform.getTooltip( is ) ) for( Object lp : Platform.getTooltip( is ) )
{ {
if( lp instanceof String && m.matcher( (CharSequence) lp ).find() ) if( lp instanceof String && m.matcher( (String) lp ).find() )
{ {
this.view.add( is ); this.view.add( is );
notDone = false; notDone = false;
@@ -21,12 +21,12 @@ package appeng.client.render;
import java.nio.FloatBuffer; import java.nio.FloatBuffer;
import java.util.EnumSet; import java.util.EnumSet;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import org.lwjgl.BufferUtils; import org.lwjgl.BufferUtils;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.RenderHelper;
@@ -46,6 +46,7 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import appeng.api.util.IOrientable; import appeng.api.util.IOrientable;
import appeng.api.util.IOrientableBlock;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
import appeng.client.texture.ExtraBlockTextures; import appeng.client.texture.ExtraBlockTextures;
import appeng.tile.AEBaseTile; import appeng.tile.AEBaseTile;
@@ -53,7 +54,7 @@ import appeng.util.Platform;
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile> public class BaseBlockRender
{ {
private static final int ORIENTATION_BITS = 7; private static final int ORIENTATION_BITS = 7;
private static final int FLIP_H_BIT = 8; private static final int FLIP_H_BIT = 8;
@@ -69,10 +70,10 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
this( false, 20 ); this( false, 20 );
} }
public BaseBlockRender( boolean enableTESR, double renderDistance ) public BaseBlockRender( boolean enableTESR, double tileEntitySpecialRendererRange )
{ {
this.hasTESR = enableTESR; this.hasTESR = enableTESR;
this.renderDistance = renderDistance; this.renderDistance = tileEntitySpecialRendererRange;
setOriMap(); setOriMap();
} }
@@ -280,7 +281,7 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
return this.renderDistance; return this.renderDistance;
} }
public void renderInventory( B block, ItemStack item, RenderBlocks renderer, ItemRenderType type, Object[] data ) public void renderInventory( AEBaseBlock block, ItemStack item, RenderBlocks renderer, ItemRenderType type, Object[] data )
{ {
Tessellator tess = Tessellator.instance; Tessellator tess = Tessellator.instance;
@@ -328,7 +329,7 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
return ORIENTATION_MAP[a][b][c]; return ORIENTATION_MAP[a][b][c];
} }
public void renderInvBlock( EnumSet<ForgeDirection> sides, B block, ItemStack item, Tessellator tess, int color, RenderBlocks renderer ) public void renderInvBlock( EnumSet<ForgeDirection> sides, AEBaseBlock block, ItemStack item, Tessellator tess, int color, RenderBlocks renderer )
{ {
int meta = 0; int meta = 0;
if( block != null && block.hasSubtypes() && item != null ) if( block != null && block.hasSubtypes() && item != null )
@@ -403,7 +404,7 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
return ExtraBlockTextures.getMissing(); return ExtraBlockTextures.getMissing();
} }
public boolean renderInWorld( B block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer ) public boolean renderInWorld( AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
{ {
this.preRenderInWorld( block, world, x, y, z, renderer ); this.preRenderInWorld( block, world, x, y, z, renderer );
@@ -413,7 +414,7 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
return o; return o;
} }
public void preRenderInWorld( B block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer ) public void preRenderInWorld( AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
{ {
ForgeDirection forward = ForgeDirection.SOUTH; ForgeDirection forward = ForgeDirection.SOUTH;
ForgeDirection up = ForgeDirection.UP; ForgeDirection up = ForgeDirection.UP;
@@ -442,9 +443,17 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
} }
@Nullable @Nullable
public IOrientable getOrientable( B block, IBlockAccess w, int x, int y, int z ) public IOrientable getOrientable( AEBaseBlock block, IBlockAccess w, int x, int y, int z )
{ {
return block.getOrientable( w, x, y, z ); if( block.hasBlockTileEntity() )
{
return (AEBaseTile) block.getTileEntity( w, x, y, z );
}
else if( block instanceof IOrientableBlock )
{
return ( (IOrientableBlock) block ).getOrientable( w, x, y, z );
}
return null;
} }
protected void setInvRenderBounds( RenderBlocks renderer, int i, int j, int k, int l, int m, int n ) protected void setInvRenderBounds( RenderBlocks renderer, int i, int j, int k, int l, int m, int n )
@@ -502,7 +511,7 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
} }
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
protected void renderCutoutFace( B block, IIcon ico, int x, int y, int z, RenderBlocks renderer, ForgeDirection orientation, float edgeThickness ) protected void renderCutoutFace( Block block, IIcon ico, int x, int y, int z, RenderBlocks renderer, ForgeDirection orientation, float edgeThickness )
{ {
Tessellator tess = Tessellator.instance; Tessellator tess = Tessellator.instance;
@@ -614,7 +623,7 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
} }
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
protected void renderFace( int x, int y, int z, B block, IIcon ico, RenderBlocks renderer, ForgeDirection orientation ) protected void renderFace( int x, int y, int z, Block block, IIcon ico, RenderBlocks renderer, ForgeDirection orientation )
{ {
switch( orientation ) switch( orientation )
{ {
@@ -679,7 +688,7 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
return ( 16.0 - uv ) / 16.0; return ( 16.0 - uv ) / 16.0;
} }
public void renderTile( B block, T tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderer ) public void renderTile( AEBaseBlock block, AEBaseTile tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderer )
{ {
ForgeDirection forward = ForgeDirection.SOUTH; ForgeDirection forward = ForgeDirection.SOUTH;
ForgeDirection up = ForgeDirection.UP; ForgeDirection up = ForgeDirection.UP;
@@ -754,6 +763,7 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
GL11.glTranslated( x + 0.5, y + 0.5, z + 0.5 ); GL11.glTranslated( x + 0.5, y + 0.5, z + 0.5 );
GL11.glMultMatrix( this.rotMat ); GL11.glMultMatrix( this.rotMat );
GL11.glTranslated( -0.5, -0.5, -0.5 ); GL11.glTranslated( -0.5, -0.5, -0.5 );
GL11.glCullFace( GL11.GL_FRONT );
} }
else else
{ {
@@ -49,31 +49,31 @@ public class BlockRenderInfo
this.rendererInstance = inst; this.rendererInstance = inst;
} }
public void updateIcons( FlippableIcon bottom, FlippableIcon top, FlippableIcon north, FlippableIcon south, FlippableIcon east, FlippableIcon west ) public void updateIcons( FlippableIcon Bottom, FlippableIcon Top, FlippableIcon North, FlippableIcon South, FlippableIcon East, FlippableIcon West )
{ {
this.topIcon = top; this.topIcon = Top;
this.bottomIcon = bottom; this.bottomIcon = Bottom;
this.southIcon = south; this.southIcon = South;
this.northIcon = north; this.northIcon = North;
this.eastIcon = east; this.eastIcon = East;
this.westIcon = west; this.westIcon = West;
} }
public void setTemporaryRenderIcon( IIcon icon ) public void setTemporaryRenderIcon( IIcon IIcon )
{ {
if( icon == null ) if( IIcon == null )
{ {
this.useTmp = false; this.useTmp = false;
} }
else else
{ {
this.useTmp = true; this.useTmp = true;
this.tmpTopIcon.setOriginal( icon ); this.tmpTopIcon.setOriginal( IIcon );
this.tmpBottomIcon.setOriginal( icon ); this.tmpBottomIcon.setOriginal( IIcon );
this.tmpSouthIcon.setOriginal( icon ); this.tmpSouthIcon.setOriginal( IIcon );
this.tmpNorthIcon.setOriginal( icon ); this.tmpNorthIcon.setOriginal( IIcon );
this.tmpEastIcon.setOriginal( icon ); this.tmpEastIcon.setOriginal( IIcon );
this.tmpWestIcon.setOriginal( icon ); this.tmpWestIcon.setOriginal( IIcon );
} }
} }
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU Lesser General Public License as published by
@@ -22,9 +22,6 @@ package appeng.client.render;
import java.util.EnumSet; import java.util.EnumSet;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import com.google.common.base.Function;
import com.google.common.base.Optional;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
@@ -34,6 +31,9 @@ import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import com.google.common.base.Function;
import com.google.common.base.Optional;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.api.exceptions.MissingDefinition; import appeng.api.exceptions.MissingDefinition;
import appeng.api.parts.IBoxProvider; import appeng.api.parts.IBoxProvider;
@@ -44,7 +44,6 @@ import appeng.block.AEBaseBlock;
import appeng.block.networking.BlockCableBus; import appeng.block.networking.BlockCableBus;
import appeng.core.AEConfig; import appeng.core.AEConfig;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.tile.AEBaseTile;
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
@@ -76,7 +75,7 @@ public final class BusRenderHelper implements IPartRenderHelper
{ {
this.bbc = new BoundBoxCalculator( this ); this.bbc = new BoundBoxCalculator( this );
this.noAlphaPass = !AEConfig.instance.isFeatureEnabled( AEFeature.AlphaPass ); this.noAlphaPass = !AEConfig.instance.isFeatureEnabled( AEFeature.AlphaPass );
this.bbr = new BaseBlockRender<AEBaseBlock, AEBaseTile>(); this.bbr = new BaseBlockRender();
this.renderingForPass = 0; this.renderingForPass = 0;
this.currentPass = 0; this.currentPass = 0;
this.itemsRendered = 0; this.itemsRendered = 0;
@@ -231,6 +230,7 @@ public final class BusRenderHelper implements IPartRenderHelper
} }
} }
private static final class BaseBlockTransformFunction implements Function<Block, AEBaseBlock> private static final class BaseBlockTransformFunction implements Function<Block, AEBaseBlock>
{ {
@Nullable @Nullable
@@ -239,7 +239,7 @@ public final class BusRenderHelper implements IPartRenderHelper
{ {
if( input instanceof AEBaseBlock ) if( input instanceof AEBaseBlock )
{ {
return( (AEBaseBlock) input ); return ( (AEBaseBlock) input );
} }
return null; return null;
@@ -374,16 +374,16 @@ public final class BusRenderHelper implements IPartRenderHelper
} }
@Override @Override
public void setTexture( IIcon down, IIcon up, IIcon north, IIcon south, IIcon west, IIcon east ) public void setTexture( IIcon Down, IIcon Up, IIcon North, IIcon South, IIcon West, IIcon East )
{ {
IIcon[] list = new IIcon[6]; IIcon[] list = new IIcon[6];
list[0] = down; list[0] = Down;
list[1] = up; list[1] = Up;
list[2] = north; list[2] = North;
list[3] = south; list[3] = South;
list[4] = west; list[4] = West;
list[5] = east; list[5] = East;
for( AEBaseBlock baseBlock : this.maybeBaseBlock.asSet() ) for( AEBaseBlock baseBlock : this.maybeBaseBlock.asSet() )
{ {
@@ -456,10 +456,10 @@ public final class BusRenderHelper implements IPartRenderHelper
} }
@Override @Override
public void renderInventoryFace( IIcon icon, ForgeDirection face, RenderBlocks renderer ) public void renderInventoryFace( IIcon IIcon, ForgeDirection face, RenderBlocks renderer )
{ {
renderer.setRenderBounds( this.minX / 16.0, this.minY / 16.0, this.minZ / 16.0, this.maxX / 16.0, this.maxY / 16.0, this.maxZ / 16.0 ); renderer.setRenderBounds( this.minX / 16.0, this.minY / 16.0, this.minZ / 16.0, this.maxX / 16.0, this.maxY / 16.0, this.maxZ / 16.0 );
this.setTexture( icon ); this.setTexture( IIcon );
for( AEBaseBlock baseBlock : this.maybeBaseBlock.asSet() ) for( AEBaseBlock baseBlock : this.maybeBaseBlock.asSet() )
{ {
@@ -568,7 +568,7 @@ public final class BusRenderHelper implements IPartRenderHelper
break; break;
} }
for( AEBaseBlock block : this.maybeBaseBlock.asSet() ) for( Block block : this.maybeBlock.asSet() )
{ {
this.bbr.renderCutoutFace( block, ico, x, y, z, renderer, face, edgeThickness ); this.bbr.renderCutoutFace( block, ico, x, y, z, renderer, face, edgeThickness );
} }
@@ -609,7 +609,7 @@ public final class BusRenderHelper implements IPartRenderHelper
break; break;
} }
for( AEBaseBlock block : this.maybeBaseBlock.asSet() ) for( Block block : this.maybeBlock.asSet() )
{ {
this.bbr.renderFace( x, y, z, block, ico, renderer, face ); this.bbr.renderFace( x, y, z, block, ico, renderer, face );
} }
@@ -1,6 +1,6 @@
/* /*
* This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* *
* Applied Energistics 2 is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU Lesser General Public License as published by
@@ -21,7 +21,6 @@ package appeng.client.render;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import javax.annotation.Nullable;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
@@ -165,7 +164,6 @@ public class BusRenderer implements IItemRenderer
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
@Nullable
public IPart getRenderer( ItemStack is, IPartItem c ) public IPart getRenderer( ItemStack is, IPartItem c )
{ {
int id = ( Item.getIdFromItem( is.getItem() ) << Platform.DEF_OFFSET ) | is.getItemDamage(); int id = ( Item.getIdFromItem( is.getItem() ) << Platform.DEF_OFFSET ) | is.getItemDamage();
@@ -41,13 +41,13 @@ public class TESRWrapper extends TileEntitySpecialRenderer
public final RenderBlocks renderBlocksInstance = new RenderBlocks(); public final RenderBlocks renderBlocksInstance = new RenderBlocks();
private final BaseBlockRender blkRender; final BaseBlockRender blkRender;
private final double maxDistance; final double MAX_DISTANCE;
public TESRWrapper( BaseBlockRender render ) public TESRWrapper( BaseBlockRender render )
{ {
this.blkRender = render; this.blkRender = render;
this.maxDistance = this.blkRender.getTesrRenderDistance(); this.MAX_DISTANCE = this.blkRender.getTesrRenderDistance();
} }
@Override @Override
@@ -59,7 +59,7 @@ public class TESRWrapper extends TileEntitySpecialRenderer
if( b instanceof AEBaseBlock && ( (AEBaseTile) te ).requiresTESR() ) if( b instanceof AEBaseBlock && ( (AEBaseTile) te ).requiresTESR() )
{ {
if( Math.abs( x ) > this.maxDistance || Math.abs( y ) > this.maxDistance || Math.abs( z ) > this.maxDistance ) if( Math.abs( x ) > this.MAX_DISTANCE || Math.abs( y ) > this.MAX_DISTANCE || Math.abs( z ) > this.MAX_DISTANCE )
{ {
return; return;
} }
@@ -69,10 +69,12 @@ public class TESRWrapper extends TileEntitySpecialRenderer
try try
{ {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
this.renderBlocksInstance.blockAccess = te.getWorldObj(); this.renderBlocksInstance.blockAccess = te.getWorldObj();
this.blkRender.renderTile( (AEBaseBlock) b, (AEBaseTile) te, tess, x, y, z, f, this.renderBlocksInstance ); this.blkRender.renderTile( (AEBaseBlock) b, (AEBaseTile) te, tess, x, y, z, f, this.renderBlocksInstance );
GL11.glPopAttrib();
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
catch( Throwable t ) catch( Throwable t )
@@ -36,6 +36,7 @@ import appeng.api.parts.IPart;
import appeng.api.parts.IPartCollisionHelper; import appeng.api.parts.IPartCollisionHelper;
import appeng.api.parts.IPartHost; import appeng.api.parts.IPartHost;
import appeng.api.util.IOrientable; import appeng.api.util.IOrientable;
import appeng.block.AEBaseBlock;
import appeng.block.crafting.BlockMolecularAssembler; import appeng.block.crafting.BlockMolecularAssembler;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.BusRenderHelper; import appeng.client.render.BusRenderHelper;
@@ -47,7 +48,7 @@ import appeng.tile.crafting.TileMolecularAssembler;
import appeng.util.Platform; import appeng.util.Platform;
public class RenderBlockAssembler extends BaseBlockRender<BlockMolecularAssembler, TileMolecularAssembler> implements IBoxProvider public class RenderBlockAssembler extends BaseBlockRender implements IBoxProvider
{ {
public RenderBlockAssembler() public RenderBlockAssembler()
@@ -56,7 +57,7 @@ public class RenderBlockAssembler extends BaseBlockRender<BlockMolecularAssemble
} }
@Override @Override
public void renderInventory( BlockMolecularAssembler blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj ) public void renderInventory( AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj )
{ {
renderer.setOverrideBlockTexture( blk.getIcon( 0, 0 ) ); renderer.setOverrideBlockTexture( blk.getIcon( 0, 0 ) );
@@ -103,7 +104,7 @@ public class RenderBlockAssembler extends BaseBlockRender<BlockMolecularAssemble
} }
@Override @Override
public boolean renderInWorld( BlockMolecularAssembler block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer ) public boolean renderInWorld( AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
{ {
BlockMolecularAssembler blk = (BlockMolecularAssembler) block; BlockMolecularAssembler blk = (BlockMolecularAssembler) block;
TileMolecularAssembler tma = blk.getTileEntity( world, x, y, z ); TileMolecularAssembler tma = blk.getTileEntity( world, x, y, z );
@@ -200,49 +201,49 @@ public class RenderBlockAssembler extends BaseBlockRender<BlockMolecularAssemble
return true; return true;
} }
public void renderCableAt( double thickness, IBlockAccess world, int x, int y, int z, BlockMolecularAssembler block, RenderBlocks renderer, double pull, boolean covered ) public void renderCableAt( double Thickness, IBlockAccess world, int x, int y, int z, AEBaseBlock block, RenderBlocks renderer, double pull, boolean covered )
{ {
IIcon texture = null; IIcon texture = null;
block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.WEST, covered ) ); block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.WEST, covered ) );
if( texture != null ) if( texture != null )
{ {
renderer.setRenderBounds( 0.0D, 0.5D - thickness, 0.5D - thickness, 0.5D - thickness - pull, 0.5D + thickness, 0.5D + thickness ); renderer.setRenderBounds( 0.0D, 0.5D - Thickness, 0.5D - Thickness, 0.5D - Thickness - pull, 0.5D + Thickness, 0.5D + Thickness );
renderer.renderStandardBlock( block, x, y, z ); renderer.renderStandardBlock( block, x, y, z );
} }
block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.EAST, covered ) ); block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.EAST, covered ) );
if( texture != null ) if( texture != null )
{ {
renderer.setRenderBounds( 0.5D + thickness + pull, 0.5D - thickness, 0.5D - thickness, 1.0D, 0.5D + thickness, 0.5D + thickness ); renderer.setRenderBounds( 0.5D + Thickness + pull, 0.5D - Thickness, 0.5D - Thickness, 1.0D, 0.5D + Thickness, 0.5D + Thickness );
renderer.renderStandardBlock( block, x, y, z ); renderer.renderStandardBlock( block, x, y, z );
} }
block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.NORTH, covered ) ); block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.NORTH, covered ) );
if( texture != null ) if( texture != null )
{ {
renderer.setRenderBounds( 0.5D - thickness, 0.5D - thickness, 0.0D, 0.5D + thickness, 0.5D + thickness, 0.5D - thickness - pull ); renderer.setRenderBounds( 0.5D - Thickness, 0.5D - Thickness, 0.0D, 0.5D + Thickness, 0.5D + Thickness, 0.5D - Thickness - pull );
renderer.renderStandardBlock( block, x, y, z ); renderer.renderStandardBlock( block, x, y, z );
} }
block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.SOUTH, covered ) ); block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.SOUTH, covered ) );
if( texture != null ) if( texture != null )
{ {
renderer.setRenderBounds( 0.5D - thickness, 0.5D - thickness, 0.5D + thickness + pull, 0.5D + thickness, 0.5D + thickness, 1.0D ); renderer.setRenderBounds( 0.5D - Thickness, 0.5D - Thickness, 0.5D + Thickness + pull, 0.5D + Thickness, 0.5D + Thickness, 1.0D );
renderer.renderStandardBlock( block, x, y, z ); renderer.renderStandardBlock( block, x, y, z );
} }
block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.DOWN, covered ) ); block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.DOWN, covered ) );
if( texture != null ) if( texture != null )
{ {
renderer.setRenderBounds( 0.5D - thickness, 0.0D, 0.5D - thickness, 0.5D + thickness, 0.5D - thickness - pull, 0.5D + thickness ); renderer.setRenderBounds( 0.5D - Thickness, 0.0D, 0.5D - Thickness, 0.5D + Thickness, 0.5D - Thickness - pull, 0.5D + Thickness );
renderer.renderStandardBlock( block, x, y, z ); renderer.renderStandardBlock( block, x, y, z );
} }
block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.UP, covered ) ); block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.UP, covered ) );
if( texture != null ) if( texture != null )
{ {
renderer.setRenderBounds( 0.5D - thickness, 0.5D + thickness + pull, 0.5D - thickness, 0.5D + thickness, 1.0D, 0.5D + thickness ); renderer.setRenderBounds( 0.5D - Thickness, 0.5D + Thickness + pull, 0.5D - Thickness, 0.5D + Thickness, 1.0D, 0.5D + Thickness );
renderer.renderStandardBlock( block, x, y, z ); renderer.renderStandardBlock( block, x, y, z );
} }
@@ -35,15 +35,16 @@ import net.minecraftforge.client.IItemRenderer.ItemRenderType;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.util.IOrientable; import appeng.api.util.IOrientable;
import appeng.block.AEBaseBlock;
import appeng.block.misc.BlockCharger; import appeng.block.misc.BlockCharger;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.texture.ExtraBlockTextures; import appeng.client.texture.ExtraBlockTextures;
import appeng.core.AELog; import appeng.core.AELog;
import appeng.tile.misc.TileCharger; import appeng.tile.AEBaseTile;
import appeng.util.Platform; import appeng.util.Platform;
public class RenderBlockCharger extends BaseBlockRender<BlockCharger, TileCharger> public class RenderBlockCharger extends BaseBlockRender
{ {
public RenderBlockCharger() public RenderBlockCharger()
@@ -52,9 +53,9 @@ public class RenderBlockCharger extends BaseBlockRender<BlockCharger, TileCharge
} }
@Override @Override
public void renderInventory( BlockCharger blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj ) public void renderInventory( AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj )
{ {
final Tessellator tess = Tessellator.instance; Tessellator tess = Tessellator.instance;
renderer.renderAllFaces = true; renderer.renderAllFaces = true;
this.setInvRenderBounds( renderer, 6, 1, 0, 10, 15, 2 ); this.setInvRenderBounds( renderer, 6, 1, 0, 10, 15, 2 );
@@ -83,17 +84,17 @@ public class RenderBlockCharger extends BaseBlockRender<BlockCharger, TileCharge
} }
@Override @Override
public boolean renderInWorld( BlockCharger block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer ) public boolean renderInWorld( AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
{ {
this.preRenderInWorld( block, world, x, y, z, renderer ); this.preRenderInWorld( block, world, x, y, z, renderer );
final BlockCharger blk = (BlockCharger) block; BlockCharger blk = (BlockCharger) block;
final IOrientable te = this.getOrientable( block, world, x, y, z ); IOrientable te = this.getOrientable( block, world, x, y, z );
final ForgeDirection fdy = te.getUp(); ForgeDirection fdy = te.getUp();
final ForgeDirection fdz = te.getForward(); ForgeDirection fdz = te.getForward();
final ForgeDirection fdx = Platform.crossProduct( fdz, fdy ).getOpposite(); ForgeDirection fdx = Platform.crossProduct( fdz, fdy ).getOpposite();
renderer.renderAllFaces = true; renderer.renderAllFaces = true;
this.renderBlockBounds( renderer, 6, 1, 0, 10, 15, 2, fdx, fdy, fdz ); this.renderBlockBounds( renderer, 6, 1, 0, 10, 15, 2, fdx, fdy, fdz );
@@ -125,7 +126,7 @@ public class RenderBlockCharger extends BaseBlockRender<BlockCharger, TileCharge
} }
@Override @Override
public void renderTile( BlockCharger block, TileCharger tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderer ) public void renderTile( AEBaseBlock block, AEBaseTile tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderer )
{ {
ItemStack sis = null; ItemStack sis = null;
if( tile instanceof IInventory ) if( tile instanceof IInventory )
@@ -144,7 +145,7 @@ public class RenderBlockCharger extends BaseBlockRender<BlockCharger, TileCharge
GL11.glScalef( 1.0f / 1.1f, 1.0f / 1.1f, 1.0f / 1.1f ); GL11.glScalef( 1.0f / 1.1f, 1.0f / 1.1f, 1.0f / 1.1f );
GL11.glScalef( 1.0f, 1.0f, 1.0f ); GL11.glScalef( 1.0f, 1.0f, 1.0f );
final Block blk = Block.getBlockFromItem( sis.getItem() ); Block blk = Block.getBlockFromItem( sis.getItem() );
if( sis.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d( blk.getRenderType() ) ) if( sis.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d( blk.getRenderType() ) )
{ {
GL11.glRotatef( 25.0f, 1.0f, 0.0f, 0.0f ); GL11.glRotatef( 25.0f, 1.0f, 0.0f, 0.0f );
@@ -152,11 +153,9 @@ public class RenderBlockCharger extends BaseBlockRender<BlockCharger, TileCharge
GL11.glRotatef( 30.0f, 0.0f, 1.0f, 0.0f ); GL11.glRotatef( 30.0f, 0.0f, 1.0f, 0.0f );
} }
// << 20 | light << 4; int br = tile.getWorldObj().getLightBrightnessForSkyBlocks( tile.xCoord, tile.yCoord, tile.zCoord, 0 );// << 20 | light << 4;
final int br = tile.getWorldObj().getLightBrightnessForSkyBlocks( tile.xCoord, tile.yCoord, tile.zCoord, 0 ); int var11 = br % 65536;
final int var11 = br % 65536; int var12 = br / 65536;
final int var12 = br / 65536;
OpenGlHelper.setLightmapTextureCoords( OpenGlHelper.lightmapTexUnit, var11, var12 ); OpenGlHelper.setLightmapTextureCoords( OpenGlHelper.lightmapTexUnit, var11, var12 );
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F ); GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
@@ -25,13 +25,12 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
import appeng.block.networking.BlockController;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.texture.ExtraBlockTextures; import appeng.client.texture.ExtraBlockTextures;
import appeng.tile.networking.TileController; import appeng.tile.networking.TileController;
public class RenderBlockController extends BaseBlockRender<BlockController, TileController> public class RenderBlockController extends BaseBlockRender
{ {
public RenderBlockController() public RenderBlockController()
@@ -40,7 +39,7 @@ public class RenderBlockController extends BaseBlockRender<BlockController, Tile
} }
@Override @Override
public boolean renderInWorld( BlockController blk, IBlockAccess world, int x, int y, int z, RenderBlocks renderer ) public boolean renderInWorld( AEBaseBlock blk, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
{ {
boolean xx = this.getTileEntity( world, x - 1, y, z ) instanceof TileController && this.getTileEntity( world, x + 1, y, z ) instanceof TileController; boolean xx = this.getTileEntity( world, x - 1, y, z ) instanceof TileController && this.getTileEntity( world, x + 1, y, z ) instanceof TileController;

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