Compare commits

..

20 Commits

Author SHA1 Message Date
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
1046 changed files with 21133 additions and 31009 deletions
+1 -2
View File
@@ -11,8 +11,7 @@
# include markdowns
!README.md
!LICENSE
!CONTRIBUTING.md
!License.md
# include sourcecode
!src/
+16 -29
View File
@@ -11,32 +11,20 @@ top of things.
Applied Energistics 2 crashing, have a suggestion, found a bug? Create an issue now!
1. Make sure your issue has not already been answered or fixed and you are using the latest version. Also think about whether your issue is a valid one before submitting it.
2. Go to [the issues page](https://github.com/AppliedEnergistics/Applied-Energistics-2/issues) and click [new issue](https://github.com/AppliedEnergistics/Applied-Energistics-2/issues/new)
3. Enter your a title of your issue (something that summarizes your issue), and then create a detailed description of the issue.
* Do not tag it with something like `[Feature]` or `[Bug]`. When it is applicable, we will take care of it.
* The following details are required. Not including them can cause the issue to be closed.
* Forge version
* AE2 version
* Crash log, when reporting a crash (Please make sure to use [pastebin](http://pastebin.com/))
* Do not post an excerpt of what you consider important, instead:
* Post the full log
* Other mods and their version, when reporting an issue between AE and another mod
* Also consider updating these before submitting a new issue, it might be already fixed
* A detailed description of the bug or feature
* To further help in resolving your issues please try to include the follow if applicable:
* What was expected?
* How to reproduce the problem?
* This is usually a great detail and allows us to fix it way faster
* Server or Single Player?
* Screen shots or Pictures of the problem
* Mod Pack using and version?
* Keep in mind that some mods might use an outdated version of AE2
* If so you should report it to your modpack
1. Make sure your issue hasn't already been answered or fixed. Also think about whether your issue is a valid one before submitting it.
2. Go to [the issues page](https://github.com/AppliedEnergistics/Applied-Energistics-2/issues)
3. Click new issue
4. Enter your Issue's title (something that summarizes your issue), and then create a detailed description of the issue.
* To help in resolving your issues please try to include the follow if applicable:
* The problem that is happening?
* What was expected?
* How to reproduce the problem?
* Server or Single Player?
* Mod Pack using and version?
* Crash log (Please make sure to use [pastebin](http://pastebin.com/) for the log file)
* Screen shots or Pictures of the problem
5. Click `Submit New Issue`, and wait for feedback!
Providing as many details as possible does help us to find and resolve the issue faster and also you getting a fixed version as fast as possible.
### Submitting Changes
* Submit an issue to the github project, assuming one does not already exist.
@@ -67,8 +55,10 @@ Providing as many details as possible does help us to find and resolve the issue
from our issue tracker. The body describes the behavior without the patch,
why this is a problem, and how the patch fixes the problem when applied.
````
* Always fully test your changes. If they are large engouh in scope, then fully test AE2.
* Describing the process you used to test your changes in detail will help speed up this process.
* Always fully test your changes. If they are large engouh in scope, then fully
test AE2.
* Describing the process you used to test your changes in detail will help speed
up this process.
## Making Trivial Changes
@@ -107,9 +97,6 @@ the styling guidelines used by AE.
PRs that do not conform to these standards will be rejected.
You can find presets for Eclipse and IntelliJ IDEA in the `codeformat` folder.
We try to keep them up to date, but in case you find them not formatting it correctly, then please report it
### Whitespace
#### Tabs or spaces
+16 -31
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 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
@@ -32,7 +31,7 @@ A Mod about Matter, Energy and using them to conquer the world..
* Applied Energistics 2 API
- (c) 2013 - 2015 AlgorithmX2 et al
- [![License](https://img.shields.io/badge/License-MIT-red.svg?style=flat)](http://opensource.org/licenses/MIT)
- ![License](https://img.shields.io/badge/License-MIT-red.svg?style=flat)
* Applied Energistics 2
- (c) 2013 - 2015 AlgorithmX2 et al
- [![License](https://img.shields.io/badge/License-LGPLv3-blue.svg?style=flat)](https://raw.githubusercontent.com/AppliedEnergistics/Applied-Energistics-2/rv2/LICENSE)
@@ -40,7 +39,7 @@ A Mod about Matter, Energy and using them to conquer the world..
- (c) 2013 - 2015 AlgorithmX2 et al
- [![License](https://img.shields.io/badge/License-CC%20BY--NC--SA%203.0-yellow.svg?style=flat)](https://creativecommons.org/licenses/by-nc-sa/3.0/)
* Text and Translations
- [![License](https://img.shields.io/badge/License-No%20Restriction-green.svg?style=flat)](https://creativecommons.org/publicdomain/zero/1.0/)
- ![License](https://img.shields.io/badge/License-No%20Restriction-green.svg?style=flat)
## Downloads
@@ -54,32 +53,20 @@ You install this mod by putting it into the `minecraft/mods/` folder. It has no
Applied Energistics 2 crashing, have a suggestion, found a bug? Create an issue now!
1. Make sure your issue has not already been answered or fixed and you are using the latest version. Also think about whether your issue is a valid one before submitting it.
2. Go to [the issues page](https://github.com/AppliedEnergistics/Applied-Energistics-2/issues) and click [new issue](https://github.com/AppliedEnergistics/Applied-Energistics-2/issues/new)
3. Enter your a title of your issue (something that summarizes your issue), and then create a detailed description of the issue.
* Do not tag it with something like `[Feature]` or `[Bug]`. When it is applicable, we will take care of it.
* The following details are required. Not including them can cause the issue to be closed.
* Forge version
* AE2 version
* Crash log, when reporting a crash (Please make sure to use [pastebin](http://pastebin.com/))
* Do not post an excerpt of what you consider important, instead:
* Post the full log
* Other mods and their version, when reporting an issue between AE and another mod
* Also consider updating these before submitting a new issue, it might be already fixed
* A detailed description of the bug or feature
* To further help in resolving your issues please try to include the follow if applicable:
* What was expected?
* How to reproduce the problem?
* This is usually a great detail and allows us to fix it way faster
* Server or Single Player?
* Screen shots or Pictures of the problem
* Mod Pack using and version?
* Keep in mind that some mods might use an outdated version of AE2
* If so you should report it to your modpack
1. Make sure your issue hasn't already been answered or fixed. Also think about whether your issue is a valid one before submitting it.
2. Go to [the issues page](https://github.com/AppliedEnergistics/Applied-Energistics-2/issues)
3. Click new issue
4. Enter your Issue's title (something that summarizes your issue), and then create a detailed description of the issue.
* To help in resolving your issues please try to include the follow if applicable:
* The problem that is happening?
* What was expected?
* How to reproduce the problem?
* Server or Single Player?
* Mod Pack using and version?
* Crash log (Please make sure to use [pastebin](http://pastebin.com/) for the log file)
* Screen shots or Pictures of the problem
5. Click `Submit New Issue`, and wait for feedback!
Providing as many details as possible does help us to find and resolve the issue faster and also you getting a fixed version as fast as possible.
## Building
1. Clone this repository via
@@ -102,8 +89,6 @@ Providing as many details as possible does help us to find and resolve the issue
Before you want to add major changes, you might want to discuss them with us first, before wasting your time.
If you are still willing to contribute to this project, you can contribute via [Pull-Request](https://help.github.com/articles/creating-a-pull-request).
The [guidelines for contributing](https://github.com/AppliedEnergistics/Applied-Energistics-2/blob/master/CONTRIBUTING.md) contain more detailed information about topics like the used code style and should also be considered.
Here are a few things to keep in mind that will help get your PR approved.
* A PR should be focused on content. Any PRs where the changes are only syntax will be rejected.
@@ -141,7 +126,7 @@ Development and standard builds can be obtained [Here](http://ae2.ae-mod.info/Do
When compiling against the AE2 API you can use gradle dependencies, just add
dependencies {
compile "appeng:appliedenergistics2:rv_-_____-__:dev"
compile "appeng:appliedenergistics2:rv_-_____-__:dev"
}
or add the compile line to your existing dependencies task to your build.gradle
+7 -6
View File
@@ -45,6 +45,10 @@ buildscript {
}
}
configurations.all {
resolutionStrategy.cacheDynamicVersionsFor 7200, 'hours'
}
sourceCompatibility = JavaVersion.VERSION_1_6
targetCompatibility = JavaVersion.VERSION_1_6
@@ -94,16 +98,12 @@ sourceSets {
resources {
srcDir "src/main/resources/"
include "assets/appliedenergistics2/recipes/**/*.recipe",
"assets/appliedenergistics2/recipes/README.html",
include "assets/appliedenergistics2/recipes/*.recipe",
"assets/appliedenergistics2/lang/*.lang",
"assets/appliedenergistics2/textures/blocks/*",
"assets/appliedenergistics2/textures/guis/*",
"assets/appliedenergistics2/textures/models/*",
"assets/appliedenergistics2/textures/items/*",
"assets/appliedenergistics2/meta/*",
"mcmod.info",
"pack.mcmeta"
"assets/appliedenergistics2/textures/items/*"
}
}
}
@@ -113,5 +113,6 @@ processResources {
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
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"?>
<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_comma_in_enum_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="do not insert"/>
@@ -22,7 +22,7 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="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.disabling_tag" value="@formatter:off"/>
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
@@ -37,13 +37,13 @@
<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="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.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="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.blank_lines_between_type_declarations" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
@@ -72,14 +72,14 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="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.brace_position_for_method_declaration" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="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.alignment_for_binary_expression" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
@@ -96,7 +96,7 @@
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="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.put_empty_statement_on_new_line" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="0"/>
@@ -106,7 +106,7 @@
<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="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.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
@@ -122,13 +122,13 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="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.comment.format_line_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="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.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="insert"/>
@@ -138,7 +138,7 @@
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="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_space_before_opening_brace_in_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="next_line"/>
@@ -147,7 +147,7 @@
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="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.formatter.insert_space_before_closing_paren_in_switch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
@@ -182,7 +182,7 @@
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="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.compiler.codegen.targetPlatform" value="1.8"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="next_line"/>
@@ -215,7 +215,7 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="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.blank_lines_before_member_type" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="insert"/>
@@ -231,7 +231,7 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="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.insert_space_before_lambda_arrow" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="insert"/>
@@ -267,8 +267,8 @@
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="insert"/>
@@ -283,13 +283,13 @@
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="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.tabulation.char" value="tab"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="160"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
</profile>
</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 -12
View File
@@ -1,5 +1,5 @@
aeversion=rv3
aechannel=alpha
aeversion=rv2
aechannel=stable
aebuild=0
aegroup=appeng
aebasename=appliedenergistics2
@@ -8,15 +8,15 @@ aebasename=appliedenergistics2
# Versions #
#########################################################
minecraft_version=1.7.10
forge_version=10.13.4.1448-1.7.10
forge_version=10.13.2.1291
#########################################################
# Installable #
#########################################################
waila_version=1.5.10
jabba_version=1.2.1a
enderstorage_version=1.4.7.36
translocator_version=1.1.2.15
enderstorage_version=1.4.7.33
translocator_version=1.1.1.14
ic2_version=2.2.717
enderio_version=2.3.0.375_beta
#cofhlib_version=1.0.1-157
@@ -29,13 +29,11 @@ invtweaks_version=1.58
#########################################################
# Provided APIs #
#########################################################
fmp_version=1.2.0.345
code_chicken_lib_version=1.1.3.138
code_chicken_core_version=1.0.7.47
nei_version=1.0.5.111
bc_version=7.0.9
opencomputers_version=1.5.12.26
pneumaticcraft_version=1.9.15-105
fmp_version=1.1.1.324
code_chicken_lib_version=1.1.3.127
code_chicken_core_version=1.0.4.35
nei_version=1.0.4.90
bc_version=6.4.6
#########################################################
# Self Compiled APIs #
@@ -55,4 +53,5 @@ api_craftguide_version=1
api_immibis_version=1
api_mfr_version=1
api_railcraft_version=1
api_rblocks_version=1
api_rf_version=2
-6
View File
@@ -10,11 +10,6 @@ task javadocJar(type: Jar, dependsOn: myJavadocs) {
from 'build/docs/javadoc/'
}
task sourceJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task devJar(type: Jar) {
manifest {
@@ -45,5 +40,4 @@ artifacts {
archives devJar
archives apiJar
archives javadocJar
archives sourceJar
}
+2 -22
View File
@@ -1,4 +1,3 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
@@ -50,22 +49,6 @@ repositories {
name = "RX14 Proxy"
url = "http://mvn.rx14.co.uk/repo/"
}
maven {
name "OpenComputers Repo"
url = "http://maven.cil.li/"
}
maven {
name = "MM repo"
url = "http://maven.k-4u.nl/"
}
ivy {
name "BuildCraft"
artifactPattern "http://www.mod-buildcraft.com/releases/BuildCraft/[revision]/[module]-[revision]-[classifier].[ext]"
}
// CurseForge DNS for TE is not available or I am just being unlucky, code part can stay since this is applicable to any other curseforge mod though
// ivy {
// name = "CoFHLib"
@@ -102,8 +85,6 @@ dependencies {
mods "com.enderio:EnderIO:${minecraft_version}-${enderio_version}:dev"
mods "net.mcft.copy.betterstorage:BetterStorage:${minecraft_version}-${betterstorage_version}:deobf"
mods "inventorytweaks:InventoryTweaks:${invtweaks_version}:deobf"
mods "li.cil.oc:OpenComputers:MC${minecraft_version}-${opencomputers_version}:dev"
// mods name: 'CoFHLib', version: "[${minecraft_version}]${cofhlib_version}-dev", ext: 'jar'
// mods name: 'CoFHCore', version: "[${minecraft_version}]${cofhcore_version}-dev", ext: 'jar'
// mods name: 'ThermalExpansion', version: "[${minecraft_version}]${texpansion_version}-dev", ext: 'jar'
@@ -114,10 +95,8 @@ dependencies {
compile "codechicken:CodeChickenCore:${minecraft_version}-${code_chicken_core_version}:dev"
compile "codechicken:NotEnoughItems:${minecraft_version}-${nei_version}:dev"
compile "com.mod-buildcraft:buildcraft:${bc_version}:dev"
compile "pneumaticCraft:PneumaticCraft-${minecraft_version}:${pneumaticcraft_version}:api"
// provided APIs
compile "li.cil.oc:OpenComputers:MC${minecraft_version}-${opencomputers_version}:api"
compile "net.industrial-craft:industrialcraft-2:${ic2_version}-experimental:api"
compile "net.mcft.copy.betterstorage:BetterStorage:${minecraft_version}-${betterstorage_version}:api"
@@ -133,7 +112,8 @@ dependencies {
compile(group: 'api', name: 'immibis', version: "${api_immibis_version}")
compile(group: 'api', name: 'mfr', version: "${api_mfr_version}")
compile(group: 'api', name: 'railcraft', version: "${api_railcraft_version}")
compile(group: 'api', name: 'rblocks', version: "${api_rblocks_version}")
compile(group: 'api', name: 'rf', version: "${api_rf_version}")
testCompile "junit:junit:4.12"
testCompile "junit:junit:4.11"
}
+2 -12
View File
@@ -1,5 +1,5 @@
task wrapper(type: Wrapper) {
gradleVersion = "2.4"
gradleVersion = "2.3"
}
// WAILA
@@ -103,14 +103,4 @@ task installBetterStorage(type: Copy, dependsOn: "deinstallBetterStorage") {
task deinstallBetterStorage(type: Delete) {
delete fileTree(dir: minecraft.runDir + "/mods", include: "*BetterStorage*.jar")
}
task installOpenComputers(type: Copy, dependsOn: "deinstallOpenComputers") {
from { configurations.mods }
include "**/*OpenComputer*dev*.jar"
into file(minecraft.runDir + "/mods")
}
task deinstallOpenComputers(type: Delete) {
delete fileTree(dir: minecraft.runDir + "/mods", include: "*OpenComputers*.jar")
}
}
Binary file not shown.
+2 -2
View File
@@ -1,6 +1,6 @@
#Tue Sep 01 22:00:39 CEST 2015
#Sat May 02 19:28:20 CEST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.3-bin.zip
+3 -3
View File
@@ -51,15 +51,15 @@ public enum AEApi
HELD_API = (IAppEngApi) apiField.get( apiClass );
}
catch( final ClassNotFoundException e )
catch( ClassNotFoundException e )
{
throw new CoreInaccessibleException( "AE2 API tried to access the " + CORE_API_FQN + " class, without it being declared." );
}
catch( final NoSuchFieldException e )
catch( NoSuchFieldException e )
{
throw new CoreInaccessibleException( "AE2 API tried to access the " + CORE_API_FIELD + " field in " + CORE_API_FQN + " without it being declared." );
}
catch( final IllegalAccessException e )
catch( IllegalAccessException e )
{
throw new CoreInaccessibleException( "AE2 API tried to access the " + CORE_API_FIELD + " field in " + CORE_API_FQN + " without enough access permissions." );
}
@@ -30,22 +30,22 @@ public enum AccessRestriction
private final int permissionBit;
AccessRestriction( final int v )
AccessRestriction( int v )
{
this.permissionBit = v;
}
public boolean hasPermission( final AccessRestriction ar )
public boolean hasPermission( AccessRestriction ar )
{
return ( this.permissionBit & ar.permissionBit ) == ar.permissionBit;
}
public AccessRestriction restrictPermissions( final AccessRestriction ar )
public AccessRestriction restrictPermissions( AccessRestriction ar )
{
return this.getPermByBit( this.permissionBit & ar.permissionBit );
}
private AccessRestriction getPermByBit( final int bit )
private AccessRestriction getPermByBit( int bit )
{
switch( bit )
{
@@ -61,12 +61,12 @@ public enum AccessRestriction
}
}
public AccessRestriction addPermissions( final AccessRestriction ar )
public AccessRestriction addPermissions( AccessRestriction ar )
{
return this.getPermByBit( this.permissionBit | ar.permissionBit );
}
public AccessRestriction removePermissions( final AccessRestriction ar )
public AccessRestriction removePermissions( AccessRestriction ar )
{
return this.getPermByBit( this.permissionBit & ( ~ar.permissionBit ) );
}
@@ -32,13 +32,13 @@ public enum FuzzyMode
public final float breakPoint;
public final float percentage;
FuzzyMode( final float p )
FuzzyMode( float p )
{
this.percentage = p;
this.breakPoint = p / 100.0f;
}
public int calculateBreakPoint( final int maxDamage )
public int calculateBreakPoint( int maxDamage )
{
return (int) ( ( this.percentage * maxDamage ) / 100.0f );
}
@@ -1,30 +0,0 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 AlgorithmX2
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package appeng.api.config;
public enum ItemSubstitution
{
ENABLED, DISABLED;
}
@@ -33,12 +33,12 @@ public enum PowerMultiplier
*/
public double multiplier = 1.0;
public double multiply( final double in )
public double multiply( double in )
{
return in * this.multiplier;
}
public double divide( final double in )
public double divide( double in )
{
return in / this.multiplier;
}
@@ -41,7 +41,7 @@ public enum PowerUnits
*/
public double conversionRatio = 1.0;
PowerUnits( final String un )
PowerUnits( String un )
{
this.unlocalizedName = un;
}
@@ -58,7 +58,7 @@ public enum PowerUnits
*
* @return value converted to target units, from this units.
*/
public double convertTo( final PowerUnits target, final double value )
public double convertTo( PowerUnits target, double value )
{
return ( value * this.conversionRatio ) / target.conversionRatio;
}
@@ -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
}
+3 -5
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 ) ),
STORAGE_FILTER( EnumSet.allOf( StorageFilter.class ) ), PLACE_BLOCK( EnumSet.of( YesNo.YES, YesNo.NO ) ),
SCHEDULING_MODE( EnumSet.allOf( SchedulingMode.class ) );
STORAGE_FILTER( EnumSet.allOf( StorageFilter.class ) ), PLACE_BLOCK( EnumSet.of( YesNo.YES, YesNo.NO ) );
private final EnumSet<? extends Enum<?>> values;
Settings( @Nonnull final 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." );
}
@@ -34,6 +34,5 @@ public enum TunnelType
ITEM, // Item Tunnel
LIGHT, // Light Tunnel
BUNDLED_REDSTONE, // Bundled Redstone Tunnel
COMPUTER_MESSAGE, // Computer Message Tunnel
PRESSURE // PneumaticCraft Tunnel
COMPUTER_MESSAGE // Computer Message Tunnel
}
+5 -5
View File
@@ -59,7 +59,7 @@ public enum Upgrades
@Deprecated
private final Map<ItemStack, Integer> supportedMax = new HashMap<ItemStack, Integer>();
Upgrades( final int tier )
Upgrades( int tier )
{
this.tier = tier;
}
@@ -78,10 +78,10 @@ public enum Upgrades
* @param item machine in which this upgrade can be installed
* @param maxSupported amount how many upgrades can be installed
*/
public void registerItem( final IItemDefinition item, final int maxSupported )
public void registerItem( IItemDefinition item, int maxSupported )
{
final Optional<ItemStack> maybeStack = item.maybeStack( 1 );
for( final ItemStack stack : maybeStack.asSet() )
for( ItemStack stack : maybeStack.asSet() )
{
this.registerItem( stack, maxSupported );
}
@@ -93,7 +93,7 @@ public enum Upgrades
* @param stack machine in which this upgrade can be installed
* @param maxSupported amount how many upgrades can be installed
*/
public void registerItem( final ItemStack stack, final int maxSupported )
public void registerItem( ItemStack stack, int maxSupported )
{
if( stack != null )
{
@@ -110,7 +110,7 @@ public enum Upgrades
* @deprecated use {@link Upgrades#registerItem(IItemDefinition, int)}
*/
@Deprecated
public void registerItem( final AEItemDefinition item, final int maxSupported )
public void registerItem( AEItemDefinition item, int maxSupported )
{
if( item != null )
{
@@ -77,22 +77,6 @@ public interface IBlocks
IBlockDefinition quartzPillarStair();
IBlockDefinition skyStoneSlab();
IBlockDefinition skyStoneBlockSlab();
IBlockDefinition skyStoneBrickSlab();
IBlockDefinition skyStoneSmallBrickSlab();
IBlockDefinition fluixSlab();
IBlockDefinition quartzSlab();
IBlockDefinition chiseledQuartzSlab();
IBlockDefinition quartzPillarSlab();
/*
* misc
*/
@@ -106,7 +90,7 @@ public interface IBlocks
ITileDefinition charger();
IBlockDefinition tinyTNT();
ITileDefinition tinyTNT();
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;
import com.google.common.base.Optional;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import com.google.common.base.Optional;
public interface IItemDefinition extends IComparableDefinition
{
@@ -41,9 +18,4 @@ public interface IItemDefinition extends IComparableDefinition
* @return an {@link ItemStack} with specified quantity of this item.
*/
Optional<ItemStack> maybeStack( int stackSize );
/**
* @return <tt>true</tt> if definition is enabled
*/
boolean isEnabled();
}
@@ -66,8 +66,6 @@ public interface IParts
IItemDefinition annihilationPlane();
IItemDefinition identityAnnihilationPlane();
IItemDefinition formationPlane();
IItemDefinition p2PTunnelME();
@@ -84,10 +82,6 @@ public interface IParts
IItemDefinition p2PTunnelLight();
IItemDefinition p2PTunnelOpenComputers();
IItemDefinition p2PTunnelPneumaticCraft();
IItemDefinition cableAnchor();
IItemDefinition monitor();
@@ -40,7 +40,7 @@ public class LocatableEventAnnounce extends Event
public final ILocatable target;
public final LocatableEvent change;
public LocatableEventAnnounce( final ILocatable o, final LocatableEvent ev )
public LocatableEventAnnounce( ILocatable o, LocatableEvent ev )
{
this.target = o;
this.change = ev;
@@ -29,7 +29,7 @@ public class AppEngException extends Exception
private static final long serialVersionUID = -9051434206368465494L;
public AppEngException( final String t )
public AppEngException( String t )
{
super( t );
}
@@ -3,7 +3,7 @@ package appeng.api.exceptions;
public class CoreInaccessibleException extends RuntimeException
{
public CoreInaccessibleException( final String message )
public CoreInaccessibleException( String message )
{
super( message );
}
@@ -1,56 +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.exceptions;
import appeng.api.networking.IGridNode;
/**
* Exception occurred because of an already existing connection between the two {@link IGridNode}s
*
* Intended to signal an internal exception and not intended to be thrown by
* any 3rd party module.
*
* @author yueh
* @version rv3
* @since rv3
*/
public class ExistingConnectionException extends FailedConnection
{
private static final long serialVersionUID = 2975450379720353182L;
private static final String DEFAULT_MESSAGE = "Connection between both nodes already exists.";
public ExistingConnectionException()
{
super( DEFAULT_MESSAGE );
}
public ExistingConnectionException( String message )
{
super( message );
}
}
@@ -24,22 +24,6 @@
package appeng.api.exceptions;
import appeng.api.networking.IGridNode;
/**
* Exception indicating a failed connection between two {@link IGridNode}s.
*
* Intended to signal an internal exception and not intended to be thrown by
* any 3rd party module.
*
* See any subclass for a more specific reason.
*
* @author AlgorithmX2
* @author yueh
* @version rv3
* @since rv0
*/
public class FailedConnection extends Exception
{
@@ -48,9 +32,4 @@ public class FailedConnection extends Exception
public FailedConnection()
{
}
public FailedConnection( String message )
{
super( message );
}
}
@@ -3,7 +3,7 @@ package appeng.api.exceptions;
public class MissingDefinition extends RuntimeException
{
public MissingDefinition( final String message )
public MissingDefinition( String message )
{
super( message );
}
@@ -29,7 +29,7 @@ public class MissingIngredientError extends Exception
private static final long serialVersionUID = -998858343831371697L;
public MissingIngredientError( final String n )
public MissingIngredientError( String n )
{
super( n );
}
@@ -29,7 +29,7 @@ public class ModNotInstalled extends Exception
private static final long serialVersionUID = -9052435206368425494L;
public ModNotInstalled( final String t )
public ModNotInstalled( String t )
{
super( t );
}
@@ -1,53 +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.exceptions;
/**
* Exception due to trying to connect one or more null values.
*
* Intended to signal an internal exception and not intended to be thrown by
* any 3rd party module.
*
* @author yueh
* @version rv3
* @since rv3
*/
public class NullNodeConnectionException extends FailedConnection
{
private static final long serialVersionUID = -2143719383495321764L;
private static final String DEFAULT_MESSAGE = "Connection forged between null entities.";
public NullNodeConnectionException()
{
super( DEFAULT_MESSAGE );
}
public NullNodeConnectionException( String message )
{
super( message );
}
}
@@ -29,7 +29,7 @@ public class RecipeError extends Exception
private static final long serialVersionUID = -6602870588617670262L;
public RecipeError( final String n )
public RecipeError( String n )
{
super( n );
}
@@ -29,7 +29,7 @@ public class RegistrationError extends Exception
private static final long serialVersionUID = -6602870588617670263L;
public RegistrationError( final String n )
public RegistrationError( String n )
{
super( n );
}
@@ -1,52 +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.exceptions;
/**
* Exception due to trying to connect different security realms.
*
* Intended to signal an internal exception and not intended to be thrown by
* any 3rd party module.
*
* @author yueh
* @version rv3
* @since rv3
*/
public class SecurityConnectionException extends FailedConnection
{
private static final long serialVersionUID = 5048714900434215426L;
private static final String DEFAULT_MESSAGE = "Connection failed due to different security realms.";
public SecurityConnectionException()
{
super( DEFAULT_MESSAGE );
}
public SecurityConnectionException( String message )
{
super( message );
}
}
@@ -1,10 +1,8 @@
package appeng.api.features;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import javax.annotation.Nonnull;
import net.minecraft.item.ItemStack;
@@ -14,26 +12,22 @@ import net.minecraft.item.ItemStack;
* Lets you manipulate Inscriber Recipes, by adding or editing existing ones.
*
* @author thatsIch
* @version rv3
* @version rv2
* @since rv2
*/
public interface IInscriberRegistry
{
/**
* An immutable copy of currently registered recipes.
*
* Use the provided methods to actually modify the inscriber recipes.
*
* @see IInscriberRegistry#addRecipe(IInscriberRecipe)
* @see IInscriberRegistry#removeRecipe(IInscriberRecipe)
* Current list of registered recipes, you can modify this if you want too.
* Will never contain a null recipe
*
* @return currentlyRegisteredRecipes
*/
@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
*/
@@ -41,7 +35,7 @@ public interface IInscriberRegistry
Set<ItemStack> getOptionals();
/**
* Get all registered items which are valid inputs.
* Get all registered items which are valid inputs
*
* @return set of all input items
*/
@@ -49,7 +43,7 @@ public interface IInscriberRegistry
Set<ItemStack> getInputs();
/**
* Extensible way to create an inscriber recipe.
* Extensible way to create an inscriber recipe
*
* @return builder for inscriber recipes
*/
@@ -67,10 +61,9 @@ public interface IInscriberRegistry
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 );
}
@@ -1,7 +1,7 @@
/*
* 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
* this software and associated documentation files (the "Software"), to deal in
@@ -24,8 +24,6 @@
package appeng.api.features;
import javax.annotation.Nullable;
import net.minecraft.item.ItemStack;
import appeng.api.config.TunnelType;
@@ -41,10 +39,10 @@ public interface IP2PTunnelRegistry
* Allows third parties to register items from their mod as potential
* attunements for AE's P2P Tunnels
*
* @param trigger - the item which triggers attunement. Nullable, but then ignored
* @param type - the type of tunnel. Nullable, but then ignored
* @param trigger - the item which triggers attunement
* @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.
@@ -53,6 +51,5 @@ public interface IP2PTunnelRegistry
*
* @return null if no attunement can be found or attunement
*/
@Nullable
TunnelType getTunnelTypeByItem( ItemStack trigger );
}
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2013 - 2015 AlgorithmX2
* 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
@@ -24,12 +24,10 @@
package appeng.api.features;
import javax.annotation.Nullable;
import net.minecraft.entity.player.EntityPlayer;
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
@@ -57,6 +55,5 @@ public interface IPlayerRegistry
*
* @return PlayerEntity, or null if the player could not be found.
*/
@Nullable
EntityPlayer findPlayer( int playerID );
}
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2013 - 2015 AlgorithmX2
* 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
@@ -24,19 +24,11 @@
package appeng.api.features;
import javax.annotation.Nullable;
import appeng.api.recipes.ICraftHandler;
import appeng.api.recipes.IRecipeHandler;
import appeng.api.recipes.ISubItemResolver;
/**
* @author AlgorithmX2
* @author thatsIch
* @version rv3 - 10.08.2015
* @since rv0
*/
public interface IRecipeHandlerRegistry
{
@@ -45,7 +37,7 @@ public interface IRecipeHandlerRegistry
*
* MUST BE CALLED IN PRE-INIT
*
* @param name name of crafthandler
* @param name name of crafthandler
* @param handler class of crafthandler
*/
void addNewCraftHandler( String name, Class<? extends ICraftHandler> handler );
@@ -64,7 +56,6 @@ public interface IRecipeHandlerRegistry
*
* @return A recipe handler by name, returns null on failure.
*/
@Nullable
ICraftHandler getCraftHandlerFor( String name );
/**
@@ -76,10 +67,9 @@ public interface IRecipeHandlerRegistry
* resolve sub items by name.
*
* @param nameSpace namespace of item
* @param itemName full name of item
* @param itemName full name of item
*
* @return ResolverResult or ResolverResultSet or null if could not resolve
* @return ResolverResult or ResolverResultSet
*/
@Nullable
Object resolveItem( String nameSpace, String itemName );
}
@@ -33,7 +33,7 @@ public class TransitionResult
public final boolean success;
public final double energyUsage;
public TransitionResult( final boolean _success, final double power )
public TransitionResult( boolean _success, double power )
{
this.success = _success;
this.energyUsage = power;
@@ -36,7 +36,7 @@ public class MENetworkChannelChanged extends MENetworkEvent
public final IGridNode node;
public MENetworkChannelChanged( final IGridNode n )
public MENetworkChannelChanged( IGridNode n )
{
this.node = n;
}
@@ -32,7 +32,7 @@ public class MENetworkCraftingCpuChange extends MENetworkEvent
public final IGridNode node;
public MENetworkCraftingCpuChange( final IGridNode n )
public MENetworkCraftingCpuChange( IGridNode n )
{
this.node = n;
}
@@ -34,7 +34,7 @@ public class MENetworkCraftingPatternChange extends MENetworkEvent
public final ICraftingProvider provider;
public final IGridNode node;
public MENetworkCraftingPatternChange( final ICraftingProvider p, final IGridNode n )
public MENetworkCraftingPatternChange( ICraftingProvider p, IGridNode n )
{
this.provider = p;
this.node = n;
@@ -71,7 +71,7 @@ public class MENetworkEvent
*
* @param v current number of visitors
*/
public void setVisitedObjects( final int v )
public void setVisitedObjects( int v )
{
this.visited = v;
}
@@ -39,7 +39,7 @@ public class MENetworkPowerIdleChange extends MENetworkEvent
public final IGridNode node;
public MENetworkPowerIdleChange( final IGridNode nodeThatChanged )
public MENetworkPowerIdleChange( IGridNode nodeThatChanged )
{
this.node = nodeThatChanged;
}
@@ -42,7 +42,7 @@ public class MENetworkPowerStorage extends MENetworkEvent
public final IAEPowerStorage storage;
public final PowerEventType type;
public MENetworkPowerStorage( final IAEPowerStorage t, final PowerEventType y )
public MENetworkPowerStorage( IAEPowerStorage t, PowerEventType y )
{
this.storage = t;
this.type = y;
@@ -39,7 +39,7 @@ public class MENetworkSpatialEvent extends MENetworkEvent
* @param SpatialIO ( INSTANCE of the SpatialIO block )
* @param EnergyUsage ( the amount of energy that the SpatialIO uses)
*/
public MENetworkSpatialEvent( final IGridHost SpatialIO, final double EnergyUsage )
public MENetworkSpatialEvent( IGridHost SpatialIO, double EnergyUsage )
{
this.host = SpatialIO;
this.spatialEnergyUsage = EnergyUsage;
@@ -42,7 +42,7 @@ public class MENetworkStorageEvent extends MENetworkEvent
public final IMEMonitor monitor;
public final StorageChannel channel;
public MENetworkStorageEvent( final IMEMonitor o, final StorageChannel chan )
public MENetworkStorageEvent( IMEMonitor o, StorageChannel chan )
{
this.monitor = o;
this.channel = chan;
@@ -1,7 +1,7 @@
/*
* 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
* this software and associated documentation files (the "Software"), to deal in
@@ -38,8 +38,8 @@ public interface ISecurityRegistry
/**
* Submit Permissions into the register.
*
* @param playerID player id
* @param PlayerID player id
* @param permissions permissions of player
*/
void addPlayer( int playerID, EnumSet<SecurityPermissions> permissions );
void addPlayer( int PlayerID, EnumSet<SecurityPermissions> permissions );
}
@@ -29,7 +29,7 @@ public class MachineSource extends BaseActionSource
public final IActionHost via;
public MachineSource( final IActionHost v )
public MachineSource( IActionHost v )
{
this.via = v;
}
@@ -33,7 +33,7 @@ public class PlayerSource extends BaseActionSource
public final EntityPlayer player;
public final IActionHost via;
public PlayerSource( final EntityPlayer p, final IActionHost v )
public PlayerSource( EntityPlayer p, IActionHost v )
{
this.player = p;
this.via = v;
@@ -60,7 +60,7 @@ public class TickingRequest
*/
public final boolean canBeAlerted;
public TickingRequest( final int min, final int max, final boolean sleep, final boolean alertable )
public TickingRequest( int min, int max, boolean sleep, boolean alertable )
{
this.minTickRate = min;
this.maxTickRate = max;
@@ -33,7 +33,7 @@ public enum CableRenderMode
public final boolean transparentFacades;
public final boolean opaqueFacades;
CableRenderMode( final boolean hideFacades )
CableRenderMode( boolean hideFacades )
{
this.transparentFacades = hideFacades;
this.opaqueFacades = !hideFacades;
@@ -1,7 +1,7 @@
/*
* 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
* this software and associated documentation files (the "Software"), to deal in
@@ -94,7 +94,7 @@ public interface IFacadePart
int getItemDamage();
boolean notAEFacade();
boolean isBC();
void setThinFacades( boolean useThinFacades );
+1 -4
View File
@@ -1,7 +1,7 @@
/*
* 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
* this software and associated documentation files (the "Software"), to deal in
@@ -24,8 +24,6 @@
package appeng.api.parts;
import javax.annotation.Nullable;
import net.minecraft.item.ItemStack;
//@formatter:off
@@ -65,6 +63,5 @@ public interface IPartItem
*
* @return part from item
*/
@Nullable
IPart createPartFromItemStack( ItemStack is );
}
+1 -1
View File
@@ -46,7 +46,7 @@ public abstract class LayerBase extends TileEntity // implements IPartHost
*
* @return the part for the requested side.
*/
public IPart getPart( final ForgeDirection side )
public IPart getPart( ForgeDirection side )
{
return null; // place holder.
}
@@ -55,14 +55,14 @@ public class SelectedPart
this.side = ForgeDirection.UNKNOWN;
}
public SelectedPart( final IPart part, final ForgeDirection side )
public SelectedPart( IPart part, ForgeDirection side )
{
this.part = part;
this.facade = null;
this.side = side;
}
public SelectedPart( final IFacadePart facade, final ForgeDirection side )
public SelectedPart( IFacadePart facade, ForgeDirection side )
{
this.part = null;
this.facade = facade;
@@ -1,7 +1,7 @@
/*
* 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
* this software and associated documentation files (the "Software"), to deal in
@@ -25,17 +25,10 @@ package appeng.api.recipes;
import java.io.BufferedReader;
import javax.annotation.Nonnull;
public interface IRecipeLoader
{
/**
* @param filePath the path to the to be loaded file
*
* @return reader handler of the file
*
* @throws Exception if reading goes wrong
*/
BufferedReader getFile( @Nonnull String filePath ) throws Exception;
BufferedReader getFile( String s ) throws Exception;
}
@@ -34,14 +34,14 @@ public class ResolverResult
public final int damageValue;
public final NBTTagCompound compound;
public ResolverResult( final String name, final int damage )
public ResolverResult( String name, int damage )
{
this.itemName = name;
this.damageValue = damage;
this.compound = null;
}
public ResolverResult( final String name, final int damage, final NBTTagCompound data )
public ResolverResult( String name, int damage, NBTTagCompound data )
{
this.itemName = name;
this.damageValue = damage;
@@ -36,7 +36,7 @@ public class ResolverResultSet
public final String name;
public final List<ItemStack> results;
public ResolverResultSet( final String myName, final ItemStack... set )
public ResolverResultSet( String myName, ItemStack... set )
{
this.results = Arrays.asList( set );
this.name = myName;
@@ -52,32 +52,32 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
protected boolean hasChanged = true;
public MEMonitorHandler( final IMEInventoryHandler<StackType> t )
public MEMonitorHandler( IMEInventoryHandler<StackType> t )
{
this.internalHandler = t;
this.cachedList = (IItemList<StackType>) t.getChannel().createList();
}
public MEMonitorHandler( final IMEInventoryHandler<StackType> t, final StorageChannel chan )
public MEMonitorHandler( IMEInventoryHandler<StackType> t, StorageChannel chan )
{
this.internalHandler = t;
this.cachedList = (IItemList<StackType>) chan.createList();
}
@Override
public void addListener( final IMEMonitorHandlerReceiver<StackType> l, final Object verificationToken )
public void addListener( IMEMonitorHandlerReceiver<StackType> l, Object verificationToken )
{
this.listeners.put( l, verificationToken );
}
@Override
public void removeListener( final IMEMonitorHandlerReceiver<StackType> l )
public void removeListener( IMEMonitorHandlerReceiver<StackType> l )
{
this.listeners.remove( l );
}
@Override
public StackType injectItems( final StackType input, final Actionable mode, final BaseActionSource src )
public StackType injectItems( StackType input, Actionable mode, BaseActionSource src )
{
if( mode == Actionable.SIMULATE )
{
@@ -91,9 +91,9 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
return this.internalHandler;
}
private StackType monitorDifference( final IAEStack original, final StackType leftOvers, final boolean extraction, final BaseActionSource src )
private StackType monitorDifference( IAEStack original, StackType leftOvers, boolean extraction, BaseActionSource src )
{
final StackType diff = (StackType) original.copy();
StackType diff = (StackType) original.copy();
if( extraction )
{
@@ -112,19 +112,19 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
return leftOvers;
}
protected void postChangesToListeners( final Iterable<StackType> changes, final BaseActionSource src )
protected void postChangesToListeners( Iterable<StackType> changes, BaseActionSource src )
{
this.notifyListenersOfChange( changes, src );
}
protected void notifyListenersOfChange( final Iterable<StackType> diff, final BaseActionSource src )
protected void notifyListenersOfChange( Iterable<StackType> diff, BaseActionSource src )
{
this.hasChanged = true;// need to update the cache.
final Iterator<Entry<IMEMonitorHandlerReceiver<StackType>, Object>> i = this.getListeners();
Iterator<Entry<IMEMonitorHandlerReceiver<StackType>, Object>> i = this.getListeners();
while( i.hasNext() )
{
final Entry<IMEMonitorHandlerReceiver<StackType>, Object> o = i.next();
final IMEMonitorHandlerReceiver<StackType> receiver = o.getKey();
Entry<IMEMonitorHandlerReceiver<StackType>, Object> o = i.next();
IMEMonitorHandlerReceiver<StackType> receiver = o.getKey();
if( receiver.isValid( o.getValue() ) )
{
receiver.postChange( this, diff, src );
@@ -142,7 +142,7 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
}
@Override
public StackType extractItems( final StackType request, final Actionable mode, final BaseActionSource src )
public StackType extractItems( StackType request, Actionable mode, BaseActionSource src )
{
if( mode == Actionable.SIMULATE )
{
@@ -175,17 +175,17 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
}
@Override
public boolean isPrioritized( final StackType input )
public boolean isPrioritized( StackType input )
{
return this.getHandler().isPrioritized( input );
}
@Override
public boolean canAccept( final StackType input )
public boolean canAccept( StackType input )
{
return this.getHandler().canAccept( input );
} @Override
public IItemList<StackType> getAvailableItems( final IItemList out )
public IItemList<StackType> getAvailableItems( IItemList out )
{
return this.getHandler().getAvailableItems( out );
}
@@ -203,7 +203,7 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
}
@Override
public boolean validForPass( final int i )
public boolean validForPass( int i )
{
return this.getHandler().validForPass( i );
}
@@ -45,7 +45,7 @@ public enum StorageChannel
public final Class<? extends IAEStack> type;
StorageChannel( final Class<? extends IAEStack> t )
StorageChannel( Class<? extends IAEStack> t )
{
this.type = t;
}
+2 -2
View File
@@ -94,7 +94,7 @@ public enum AEColor
*/
public final int whiteVariant;
AEColor( final String unlocalizedName, final int blackHex, final int medHex, final int whiteHex )
AEColor( String unlocalizedName, int blackHex, int medHex, int whiteHex )
{
this.unlocalizedName = unlocalizedName;
this.blackVariant = blackHex;
@@ -105,7 +105,7 @@ public enum AEColor
/**
* Logic to see which colors match each other.. special handle for Transparent
*/
public boolean matches( final AEColor color )
public boolean matches( AEColor color )
{
return this == Transparent || color == Transparent || this == color;
}
@@ -37,21 +37,21 @@ public class DimensionalCoord extends WorldCoord
private final World w;
private final int dimId;
public DimensionalCoord( final DimensionalCoord s )
public DimensionalCoord( DimensionalCoord s )
{
super( s.x, s.y, s.z );
this.w = s.w;
this.dimId = s.dimId;
}
public DimensionalCoord( final TileEntity s )
public DimensionalCoord( TileEntity s )
{
super( s );
this.w = s.getWorldObj();
this.dimId = this.w.provider.dimensionId;
}
public DimensionalCoord( final World _w, final int _x, final int _y, final int _z )
public DimensionalCoord( World _w, int _x, int _y, int _z )
{
super( _x, _y, _z );
this.w = _w;
@@ -71,12 +71,12 @@ public class DimensionalCoord extends WorldCoord
}
@Override
public boolean equals( final Object obj )
public boolean equals( Object obj )
{
return obj instanceof DimensionalCoord && this.isEqual( (DimensionalCoord) obj );
}
public boolean isEqual( final DimensionalCoord c )
public boolean isEqual( DimensionalCoord c )
{
return this.x == c.x && this.y == c.y && this.z == c.z && c.w == this.w;
}
@@ -87,7 +87,7 @@ public class DimensionalCoord extends WorldCoord
return "dimension=" + this.dimId + ", " + super.toString();
}
public boolean isInWorld( final World world )
public boolean isInWorld( World world )
{
return this.w == world;
}
@@ -24,7 +24,7 @@
package appeng.api.util;
import java.util.List;
import java.util.ArrayList;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
@@ -43,5 +43,5 @@ public interface ICommonTile
* @param z z pos of tile entity
* @param drops drops of tile entity
*/
void getDrops( World world, int x, int y, int z, List<ItemStack> drops );
void getDrops( World world, int x, int y, int z, ArrayList<ItemStack> drops );
}
+17 -17
View File
@@ -39,19 +39,19 @@ public class WorldCoord
public int y;
public int z;
public WorldCoord( final TileEntity s )
public WorldCoord( TileEntity s )
{
this( s.xCoord, s.yCoord, s.zCoord );
}
public WorldCoord( final int _x, final int _y, final int _z )
public WorldCoord( int _x, int _y, int _z )
{
this.x = _x;
this.y = _y;
this.z = _z;
}
public WorldCoord subtract( final ForgeDirection direction, final int length )
public WorldCoord subtract( ForgeDirection direction, int length )
{
this.x -= direction.offsetX * length;
this.y -= direction.offsetY * length;
@@ -59,7 +59,7 @@ public class WorldCoord
return this;
}
public WorldCoord add( final int _x, final int _y, final int _z )
public WorldCoord add( int _x, int _y, int _z )
{
this.x += _x;
this.y += _y;
@@ -67,7 +67,7 @@ public class WorldCoord
return this;
}
public WorldCoord subtract( final int _x, final int _y, final int _z )
public WorldCoord subtract( int _x, int _y, int _z )
{
this.x -= _x;
this.y -= _y;
@@ -75,7 +75,7 @@ public class WorldCoord
return this;
}
public WorldCoord multiple( final int _x, final int _y, final int _z )
public WorldCoord multiple( int _x, int _y, int _z )
{
this.x *= _x;
this.y *= _y;
@@ -83,7 +83,7 @@ public class WorldCoord
return this;
}
public WorldCoord divide( final int _x, final int _y, final int _z )
public WorldCoord divide( int _x, int _y, int _z )
{
this.x /= _x;
this.y /= _y;
@@ -94,15 +94,15 @@ public class WorldCoord
/**
* Will Return NULL if it's at some diagonal!
*/
public ForgeDirection directionTo( final WorldCoord loc )
public ForgeDirection directionTo( WorldCoord loc )
{
final int ox = this.x - loc.x;
final int oy = this.y - loc.y;
final int oz = this.z - loc.z;
int ox = this.x - loc.x;
int oy = this.y - loc.y;
int oz = this.z - loc.z;
final int xlen = Math.abs( ox );
final int ylen = Math.abs( oy );
final int zlen = Math.abs( oz );
int xlen = Math.abs( ox );
int ylen = Math.abs( oy );
int zlen = Math.abs( oz );
if( loc.isEqual( this.copy().add( ForgeDirection.EAST, xlen ) ) )
{
@@ -137,12 +137,12 @@ public class WorldCoord
return null;
}
public boolean isEqual( final WorldCoord c )
public boolean isEqual( WorldCoord c )
{
return this.x == c.x && this.y == c.y && this.z == c.z;
}
public WorldCoord add( final ForgeDirection direction, final int length )
public WorldCoord add( ForgeDirection direction, int length )
{
this.x += direction.offsetX * length;
this.y += direction.offsetY * length;
@@ -162,7 +162,7 @@ public class WorldCoord
}
@Override
public boolean equals( final Object obj )
public boolean equals( Object obj )
{
return obj instanceof WorldCoord && this.isEqual( (WorldCoord) obj );
}
+441 -131
View File
@@ -1,6 +1,6 @@
/*
* 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
* 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.EnumSet;
import java.util.List;
import com.google.common.base.Optional;
import javax.annotation.Nullable;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.client.resources.IResource;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
import net.minecraft.util.MovingObjectPosition;
@@ -44,11 +49,21 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.ReflectionHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import com.google.common.base.Optional;
import com.google.common.collect.Lists;
import appeng.api.implementations.items.IMemoryCard;
import appeng.api.implementations.items.MemoryCardMessages;
import appeng.api.implementations.tiles.IColorableTile;
import appeng.api.util.AEColor;
import appeng.api.util.IOrientable;
import appeng.api.util.IOrientableBlock;
import appeng.block.networking.BlockCableBus;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.BlockRenderInfo;
import appeng.client.render.WorldRender;
@@ -59,35 +74,45 @@ import appeng.core.features.AEFeature;
import appeng.core.features.FeatureNameExtractor;
import appeng.core.features.IAEFeature;
import appeng.core.features.IFeatureHandler;
import appeng.core.features.ItemStackSrc;
import appeng.helpers.AEGlassMaterial;
import appeng.helpers.ICustomCollision;
import appeng.tile.AEBaseTile;
import appeng.tile.networking.TileCableBus;
import appeng.tile.storage.TileSkyChest;
import appeng.util.LookDirection;
import appeng.util.Platform;
import appeng.util.SettingsFrom;
public abstract class AEBaseBlock extends Block implements IAEFeature
public class AEBaseBlock extends BlockContainer implements IAEFeature
{
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 isFullSize = true;
protected boolean hasSubtypes = false;
protected boolean isInventory = false;
private IFeatureHandler handler;
@SideOnly( Side.CLIENT )
private BlockRenderInfo renderInfo;
BlockRenderInfo renderInfo;
private IFeatureHandler handler;
protected AEBaseBlock( final 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.setLightLevel( 0 );
this.setHardness( 2.2F );
this.setTileProvider( false );
this.setHarvestLevel( "pickaxe", 0 );
}
protected AEBaseBlock( final Material mat, final Optional<String> subName )
protected AEBaseBlock( Class<?> c, Material mat, Optional<String> subName )
{
super( mat );
@@ -108,10 +133,16 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
this.setStepSound( Block.soundTypeMetal );
}
this.featureFullName = new FeatureNameExtractor( this.getClass(), subName ).get();
this.featureFullName = new FeatureNameExtractor( c, subName ).get();
this.featureSubName = subName;
}
// update Block value.
private void setTileProvider( boolean b )
{
ReflectionHelper.setPrivateValue( Block.class, this, b, "isTileProvider" );
}
@Override
public String toString()
{
@@ -120,8 +151,8 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
public void registerNoIcons()
{
final BlockRenderInfo info = this.getRendererInstance();
final FlippableIcon i = new FlippableIcon( new MissingIcon( this ) );
BlockRenderInfo info = this.getRendererInstance();
FlippableIcon i = new FlippableIcon( new MissingIcon( this ) );
info.updateIcons( i, i, i, i, i, i );
}
@@ -133,32 +164,52 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
return this.renderInfo;
}
final BaseBlockRender<? extends AEBaseBlock, ? extends AEBaseTile> renderer = this.getRenderer();
this.renderInfo = new BlockRenderInfo( renderer );
try
{
final BaseBlockRender renderer = this.getRenderer().newInstance();
this.renderInfo = new BlockRenderInfo( renderer );
return this.renderInfo;
return this.renderInfo;
}
catch ( InstantiationException e )
{
throw new IllegalStateException( "Failed to create a new instance of an illegal class " + this.getRenderer(), e );
}
catch( IllegalAccessException e )
{
throw new IllegalStateException( "Failed to create a new instance of " + this.getRenderer() + " because of permissions.", e );
}
}
/**
* Factory method to create a new render instance.
*
* @return the newly created instance.
*/
@SideOnly( Side.CLIENT )
protected BaseBlockRender<? extends AEBaseBlock, ? extends AEBaseTile> getRenderer()
protected Class<? extends BaseBlockRender> getRenderer()
{
return new BaseBlockRender<AEBaseBlock, AEBaseTile>();
return BaseBlockRender.class;
}
IIcon unmappedGetIcon( final IBlockAccess w, final int x, final int y, final int z, final int s )
public IIcon unmappedGetIcon( IBlockAccess w, int x, int y, int z, int s )
{
return super.getIcon( w, x, y, z, s );
}
protected void setFeature( final EnumSet<AEFeature> f )
protected void setTileEntity( Class<? extends TileEntity> c )
{
final AEBlockFeatureHandler featureHandler = new AEBlockFeatureHandler( f, this, this.featureSubName );
this.setHandler( featureHandler );
this.tileEntityType = c;
AEBaseTile.registerTileItem( c, new ItemStackSrc( this, 0 ) );
GameRegistry.registerTileEntity( this.tileEntityType, this.featureFullName );
this.isInventory = IInventory.class.isAssignableFrom( c );
this.setTileProvider( this.hasBlockTileEntity() );
}
public boolean hasBlockTileEntity()
{
return this.tileEntityType != null;
}
protected void setFeature( EnumSet<AEFeature> f )
{
this.handler = new AEBlockFeatureHandler( f, this, this.featureSubName );
}
@Override
@@ -167,11 +218,6 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
return this.handler;
}
protected final void setHandler( final IFeatureHandler handler )
{
this.handler = handler;
}
@Override
public void postInit()
{
@@ -197,39 +243,48 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
}
@Override
public IIcon getIcon( final IBlockAccess w, final int x, final int y, final int z, final int s )
public IIcon getIcon( IBlockAccess w, int x, int y, int z, int s )
{
return this.getIcon( this.mapRotation( w, x, y, z, s ), w.getBlockMetadata( x, y, z ) );
}
@Override
@SideOnly( Side.CLIENT )
public IIcon getIcon( final int direction, final int metadata )
public IIcon getIcon( int direction, int metadata )
{
return this.getRendererInstance().getTexture( ForgeDirection.getOrientation( direction ) );
}
protected ICustomCollision getCustomCollision( final World w, final int x, final int y, final int z )
{
if( this instanceof ICustomCollision )
if( this.renderIcon != null )
{
return (ICustomCollision) this;
return this.renderIcon;
}
return null;
return this.getRendererInstance().getTexture( ForgeDirection.getOrientation( direction ) );
}
@Override
@SuppressWarnings( "unchecked" )
// NOTE: WAS FINAL, changed for Immibis
public void addCollisionBoxesToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List out, final 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 )
{
final List<AxisAlignedBB> tmp = new ArrayList<AxisAlignedBB>();
List<AxisAlignedBB> tmp = new ArrayList<AxisAlignedBB>();
collisionHandler.addCollidingBlockToList( w, x, y, z, bb, tmp, e );
for( final AxisAlignedBB b : tmp )
for( AxisAlignedBB b : tmp )
{
b.minX += x;
b.minY += y;
@@ -251,38 +306,51 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
@Override
@SideOnly( Side.CLIENT )
public final AxisAlignedBB getSelectedBoundingBoxFromPool( final World w, final int x, final int y, final 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( Platform.isClient() )
{
final EntityPlayer player = Minecraft.getMinecraft().thePlayer;
final LookDirection ld = Platform.getPlayerRay( player, Platform.getEyeOffset( player ) );
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
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;
double lastDist = 0;
for( final AxisAlignedBB bb : bbs )
for( AxisAlignedBB bb : bbs )
{
this.setBlockBounds( (float) bb.minX, (float) bb.minY, (float) bb.minZ, (float) bb.maxX, (float) bb.maxY, (float) bb.maxZ );
final MovingObjectPosition r = super.collisionRayTrace( w, x, y, z, ld.getA(), ld.getB() );
MovingObjectPosition r = super.collisionRayTrace( w, x, y, z, ld.a, ld.b );
this.setBlockBounds( 0, 0, 0, 1, 1, 1 );
if( r != null )
{
final double xLen = ( ld.getA().xCoord - r.hitVec.xCoord );
final double yLen = ( ld.getA().yCoord - r.hitVec.yCoord );
final double zLen = ( ld.getA().zCoord - r.hitVec.zCoord );
final double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
double xLen = ( ld.a.xCoord - r.hitVec.xCoord );
double yLen = ( ld.a.yCoord - r.hitVec.yCoord );
double zLen = ( ld.a.zCoord - r.hitVec.zCoord );
double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
if( br == null || lastDist > thisDist )
{
lastDist = thisDist;
@@ -298,26 +366,32 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
}
}
final AxisAlignedBB b = AxisAlignedBB.getBoundingBox( 16d, 16d, 16d, 0d, 0d, 0d );
for( final 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 );
final double minY = Math.min( b.minY, bx.minY );
final double minZ = Math.min( b.minZ, bx.minZ );
final double maxX = Math.max( b.maxX, bx.maxX );
final double maxY = Math.max( b.maxY, bx.maxY );
final double maxZ = Math.max( b.maxZ, bx.maxZ );
b.setBounds( minX, minY, minZ, maxX, maxY, maxZ );
if( b == null )
{
b = bx;
}
else
{
double minX = Math.min( b.minX, bx.minX );
double minY = Math.min( b.minY, bx.minY );
double minZ = Math.min( b.minZ, bx.minZ );
double maxX = Math.max( b.maxX, bx.maxX );
double maxY = Math.max( b.maxY, bx.maxY );
double maxZ = Math.max( b.maxZ, bx.maxZ );
b.setBounds( minX, minY, minZ, maxX, maxY, maxZ );
}
}
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
@@ -327,32 +401,45 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
}
@Override
public MovingObjectPosition collisionRayTrace( final World w, final int x, final int y, final int z, final Vec3 a, final 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 )
{
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;
double lastDist = 0;
for( final AxisAlignedBB bb : bbs )
for( AxisAlignedBB bb : bbs )
{
this.setBlockBounds( (float) bb.minX, (float) bb.minY, (float) bb.minZ, (float) bb.maxX, (float) bb.maxY, (float) bb.maxZ );
final MovingObjectPosition r = super.collisionRayTrace( w, x, y, z, a, b );
MovingObjectPosition r = super.collisionRayTrace( w, x, y, z, a, b );
this.setBlockBounds( 0, 0, 0, 1, 1, 1 );
if( r != null )
{
final double xLen = ( a.xCoord - r.hitVec.xCoord );
final double yLen = ( a.yCoord - r.hitVec.yCoord );
final double zLen = ( a.zCoord - r.hitVec.zCoord );
double xLen = ( a.xCoord - r.hitVec.xCoord );
double yLen = ( a.yCoord - r.hitVec.yCoord );
double zLen = ( a.zCoord - r.hitVec.zCoord );
final double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
if( br == null || lastDist > thisDist )
{
lastDist = thisDist;
@@ -365,7 +452,6 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
{
return br;
}
return null;
}
@@ -373,15 +459,118 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
return super.collisionRayTrace( w, x, y, z, a, b );
}
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ )
@Override
public final boolean onBlockActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
{
if( player != null )
{
ItemStack is = player.inventory.getCurrentItem();
if( is != null )
{
if( Platform.isWrench( player, is, x, y, z ) && player.isSneaking() )
{
Block id = w.getBlock( x, y, z );
if( id != null )
{
AEBaseTile tile = this.getTileEntity( w, x, y, z );
ItemStack[] drops = Platform.getBlockDrops( w, x, y, z );
if( tile == null )
{
return false;
}
if( tile instanceof TileCableBus || tile instanceof TileSkyChest )
{
return false;
}
ItemStack op = new ItemStack( this );
for( ItemStack ol : drops )
{
if( Platform.isSameItemType( ol, op ) )
{
NBTTagCompound tag = tile.downloadSettings( SettingsFrom.DISMANTLE_ITEM );
if( tag != null )
{
ol.setTagCompound( tag );
}
}
}
if( id.removedByPlayer( w, player, x, y, z, false ) )
{
List<ItemStack> l = Lists.newArrayList( drops );
Platform.spawnDrops( w, x, y, z, l );
w.setBlockToAir( x, y, z );
}
}
return false;
}
if( is.getItem() instanceof IMemoryCard && !( this instanceof BlockCableBus ) )
{
IMemoryCard memoryCard = (IMemoryCard) is.getItem();
if( player.isSneaking() )
{
AEBaseTile t = this.getTileEntity( w, x, y, z );
if( t != null )
{
String name = this.getUnlocalizedName();
NBTTagCompound data = t.downloadSettings( SettingsFrom.MEMORY_CARD );
if( data != null )
{
memoryCard.setMemoryCardContents( is, name, data );
memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_SAVED );
return true;
}
}
}
else
{
String name = memoryCard.getSettingsName( is );
NBTTagCompound data = memoryCard.getData( is );
if( this.getUnlocalizedName().equals( name ) )
{
AEBaseTile t = this.getTileEntity( w, x, y, z );
t.uploadSettings( SettingsFrom.MEMORY_CARD, data );
memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_LOADED );
}
else
{
memoryCard.notifyUser( player, MemoryCardMessages.INVALID_MACHINE );
}
return false;
}
}
}
}
return this.onActivated( w, x, y, z, player, side, hitX, hitY, hitZ );
}
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
{
return false;
}
@Override
public void onBlockPlacedBy( World w, int x, int y, int z, EntityLivingBase player, ItemStack is )
{
if( is.hasDisplayName() )
{
TileEntity te = this.getTileEntity( w, x, y, z );
if( te instanceof AEBaseTile )
{
( (AEBaseTile) w.getTileEntity( x, y, z ) ).setName( is.getDisplayName() );
}
}
}
@Override
@SideOnly( Side.CLIENT )
@SuppressWarnings( "unchecked" )
public final void getSubBlocks( final Item item, final CreativeTabs tabs, final List itemStacks )
public final void getSubBlocks( Item item, CreativeTabs tabs, List itemStacks )
{
this.getCheckedSubBlocks( item, tabs, itemStacks );
}
@@ -393,48 +582,59 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
}
@Override
public int getComparatorInputOverride( final World w, final int x, final int y, final int z, final 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;
}
@Override
@SideOnly( Side.CLIENT )
public void registerBlockIcons( final IIconRegister iconRegistry )
public void registerBlockIcons( IIconRegister iconRegistry )
{
final BlockRenderInfo info = this.getRendererInstance();
final FlippableIcon topIcon = this.optionalIcon( iconRegistry, this.getTextureName(), null );
final FlippableIcon bottomIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Bottom", topIcon );
final FlippableIcon sideIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Side", topIcon );
final FlippableIcon eastIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "East", sideIcon );
final FlippableIcon westIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "West", sideIcon );
final FlippableIcon southIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Front", sideIcon );
final FlippableIcon northIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Back", sideIcon );
BlockRenderInfo info = this.getRendererInstance();
FlippableIcon topIcon;
FlippableIcon bottomIcon;
FlippableIcon sideIcon;
FlippableIcon eastIcon;
FlippableIcon westIcon;
FlippableIcon southIcon;
FlippableIcon northIcon;
this.blockIcon = topIcon;
this.blockIcon = topIcon = this.optionalIcon( iconRegistry, this.getTextureName(), null );
bottomIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Bottom", topIcon );
sideIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Side", topIcon );
eastIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "East", sideIcon );
westIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "West", sideIcon );
southIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Front", sideIcon );
northIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Back", sideIcon );
info.updateIcons( bottomIcon, topIcon, northIcon, southIcon, eastIcon, westIcon );
}
@Override
public final boolean isNormalCube( final IBlockAccess world, final int x, final int y, final int z )
public final boolean isNormalCube( IBlockAccess world, int x, int y, int z )
{
return this.isFullSize;
}
public IOrientable getOrientable( final IBlockAccess w, final int x, final int y, final int z )
{
if( this instanceof IOrientableBlock )
{
return ( (IOrientableBlock) this ).getOrientable( w, x, y, z );
}
return null;
}
@Override
public final boolean rotateBlock( final World w, final int x, final int y, final int z, final 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() )
{
@@ -470,24 +670,55 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
return false;
}
protected void customRotateBlock( final IOrientable rotatable, final ForgeDirection axis )
protected void customRotateBlock( IOrientable rotatable, ForgeDirection axis )
{
}
public boolean isValidOrientation( final World w, final int x, final int y, final int z, final ForgeDirection forward, final ForgeDirection up )
public boolean isValidOrientation( World w, int x, int y, int z, ForgeDirection forward, ForgeDirection up )
{
return true;
}
@Override
public ForgeDirection[] getValidRotations( final World w, final int x, final int y, final 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];
}
@Override
public boolean recolourBlock( World world, int x, int y, int z, ForgeDirection side, int colour )
{
TileEntity te = this.getTileEntity( world, x, y, z );
if( te instanceof IColorableTile )
{
IColorableTile ct = (IColorableTile) te;
AEColor c = ct.getColor();
AEColor newColor = AEColor.values()[colour];
if( c != newColor )
{
ct.recolourBlock( side, newColor, null );
return true;
}
return false;
}
return super.recolourBlock( world, x, y, z, side, colour );
}
@SideOnly( Side.CLIENT )
private FlippableIcon optionalIcon( final IIconRegister ir, final String name, IIcon substitute )
private FlippableIcon optionalIcon( IIconRegister ir, String Name, IIcon substitute )
{
// if the input is an flippable IIcon find the original.
while( substitute instanceof FlippableIcon )
@@ -499,33 +730,42 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
{
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" ) );
final IResource res = Minecraft.getMinecraft().getResourceManager().getResource( resLoc );
IResource res = Minecraft.getMinecraft().getResourceManager().getResource( resLoc );
if( res != null )
{
return new FlippableIcon( ir.registerIcon( name ) );
return new FlippableIcon( ir.registerIcon( Name ) );
}
}
catch( final Throwable e )
catch( Throwable e )
{
return new FlippableIcon( substitute );
}
}
return new FlippableIcon( ir.registerIcon( name ) );
return new FlippableIcon( ir.registerIcon( Name ) );
}
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
{
super.getSubBlocks( item, tabs, itemStacks );
}
private int mapRotation( final IBlockAccess w, final int x, final int y, final int z, final 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() )
{
@@ -535,7 +775,24 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
return s;
}
public ForgeDirection mapRotation( final IOrientable ori, final ForgeDirection dir )
@Nullable
public <T extends TileEntity> T getTileEntity( IBlockAccess w, int x, int y, int z )
{
if( !this.hasBlockTileEntity() )
{
return null;
}
TileEntity te = w.getTileEntity( x, y, z );
if( this.tileEntityType.isInstance( te ) )
{
return (T) te;
}
return null;
}
public ForgeDirection mapRotation( IOrientable ori, ForgeDirection dir )
{
// case DOWN: return bottomIcon;
// case UP: return blockIcon;
@@ -544,20 +801,20 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
// case WEST: return sideIcon;
// case EAST: return sideIcon;
final ForgeDirection forward = ori.getForward();
final ForgeDirection up = ori.getUp();
ForgeDirection forward = ori.getForward();
ForgeDirection up = ori.getUp();
ForgeDirection west = ForgeDirection.UNKNOWN;
if( forward == null || up == null )
{
return dir;
}
final int west_x = forward.offsetY * up.offsetZ - forward.offsetZ * up.offsetY;
final int west_y = forward.offsetZ * up.offsetX - forward.offsetX * up.offsetZ;
final int west_z = forward.offsetX * up.offsetY - forward.offsetY * up.offsetX;
int west_x = forward.offsetY * up.offsetZ - forward.offsetZ * up.offsetY;
int west_y = forward.offsetZ * up.offsetX - forward.offsetX * up.offsetZ;
int west_z = forward.offsetX * up.offsetY - forward.offsetY * up.offsetX;
ForgeDirection west = ForgeDirection.UNKNOWN;
for( final ForgeDirection dx : ForgeDirection.VALID_DIRECTIONS )
for( ForgeDirection dx : ForgeDirection.VALID_DIRECTIONS )
{
if( dx.offsetX == west_x && dx.offsetY == west_y && dx.offsetZ == west_z )
{
@@ -595,18 +852,72 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
return ForgeDirection.UNKNOWN;
}
public Class<? extends TileEntity> getTileEntityClass()
{
return this.tileEntityType;
}
@SideOnly( Side.CLIENT )
public void setRenderStateByMeta( final int itemDamage )
public void setRenderStateByMeta( int itemDamage )
{
}
public String getUnlocalizedName( final ItemStack is )
@Override
public final TileEntity createNewTileEntity( World var1, int var2 )
{
if( this.hasBlockTileEntity() )
{
try
{
return this.tileEntityType.newInstance();
}
catch( InstantiationException e )
{
throw new IllegalStateException( "Failed to create a new instance of an illegal class " + this.tileEntityType , e );
}
catch( IllegalAccessException e )
{
throw new IllegalStateException( "Failed to create a new instance of " + this.tileEntityType + ", because lack of permissions", e );
}
}
return null;
}
@Override
public void breakBlock( World w, int x, int y, int z, Block a, int b )
{
AEBaseTile te = this.getTileEntity( w, x, y, z );
if( te != null )
{
ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
if( te.dropItems() )
{
te.getDrops( w, x, y, z, drops );
}
else
{
te.getNoDrops( w, x, y, z, drops );
}
// Cry ;_; ...
Platform.spawnDrops( w, x, y, z, drops );
}
super.breakBlock( w, x, y, z, a, b );
if( te != null )
{
w.setTileEntity( x, y, z, null );
}
}
public String getUnlocalizedName( ItemStack is )
{
return this.getUnlocalizedName();
}
void addInformation( final ItemStack is, final EntityPlayer player, final List<String> lines, final boolean advancedItemTooltips )
public void addInformation( ItemStack is, EntityPlayer player, List<String> lines, boolean advancedItemTooltips )
{
}
@@ -620,5 +931,4 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
{
return this.hasSubtypes;
}
}
+15 -14
View File
@@ -47,9 +47,9 @@ import appeng.util.Platform;
public class AEBaseItemBlock extends ItemBlock
{
private final AEBaseBlock blockType;
final AEBaseBlock blockType;
public AEBaseItemBlock( final Block id )
public AEBaseItemBlock( Block id )
{
super( id );
this.blockType = (AEBaseBlock) id;
@@ -62,7 +62,7 @@ public class AEBaseItemBlock extends ItemBlock
}
@Override
public int getMetadata( final int dmg )
public int getMetadata( int dmg )
{
if( this.hasSubtypes )
{
@@ -74,36 +74,38 @@ public class AEBaseItemBlock extends ItemBlock
@Override
@SideOnly( Side.CLIENT )
@SuppressWarnings( "unchecked" )
public final void addInformation( final ItemStack itemStack, final EntityPlayer player, final List toolTip, final boolean advancedTooltips )
public final void addInformation( ItemStack itemStack, EntityPlayer player, List toolTip, boolean advancedTooltips )
{
this.addCheckedInformation( itemStack, player, toolTip, advancedTooltips );
}
@SideOnly( Side.CLIENT )
public void addCheckedInformation( final ItemStack itemStack, final EntityPlayer player, final List<String> toolTip, final boolean advancedToolTips )
public void addCheckedInformation( ItemStack itemStack, EntityPlayer player, List<String> toolTip, boolean advancedToolTips )
{
this.blockType.addInformation( itemStack, player, toolTip, advancedToolTips );
}
@Override
public boolean isBookEnchantable( final ItemStack itemstack1, final ItemStack itemstack2 )
public boolean isBookEnchantable( ItemStack itemstack1, ItemStack itemstack2 )
{
return false;
}
@Override
public String getUnlocalizedName( final ItemStack is )
public String getUnlocalizedName( ItemStack is )
{
return this.blockType.getUnlocalizedName( is );
}
@Override
public boolean placeBlockAt( final ItemStack stack, final EntityPlayer player, final World w, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ, final int metadata )
public boolean placeBlockAt( ItemStack stack, EntityPlayer player, World w, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata )
{
ForgeDirection up = ForgeDirection.UNKNOWN;
ForgeDirection forward = ForgeDirection.UNKNOWN;
if( this.blockType instanceof AEBaseTileBlock )
IOrientable ori = null;
if( this.blockType.hasBlockTileEntity() )
{
if( this.blockType instanceof BlockLightDetector )
{
@@ -133,7 +135,7 @@ public class AEBaseItemBlock extends ItemBlock
{
up = ForgeDirection.UP;
final byte rotation = (byte) ( MathHelper.floor_double( ( player.rotationYaw * 4F ) / 360F + 2.5D ) & 3 );
byte rotation = (byte) ( MathHelper.floor_double( ( player.rotationYaw * 4F ) / 360F + 2.5D ) & 3 );
switch( rotation )
{
@@ -165,7 +167,6 @@ public class AEBaseItemBlock extends ItemBlock
}
}
IOrientable ori = null;
if( this.blockType instanceof IOrientableBlock )
{
ori = ( (IOrientableBlock) this.blockType ).getOrientable( w, x, y, z );
@@ -184,9 +185,9 @@ public class AEBaseItemBlock extends ItemBlock
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 ) )
{
final AEBaseTile tile = ( (AEBaseTileBlock) this.blockType ).getTileEntity( w, x, y, z );
AEBaseTile tile = this.blockType.getTileEntity( w, x, y, z );
ori = tile;
if( tile == null )
@@ -197,7 +198,7 @@ public class AEBaseItemBlock extends ItemBlock
if( ori.canBeRotated() && !this.blockType.hasCustomRotation() )
{
if( ori.getForward() == null || ori.getUp() == null || // null
tile.getForward() == ForgeDirection.UNKNOWN || ori.getUp() == ForgeDirection.UNKNOWN )
tile.getForward() == ForgeDirection.UNKNOWN || ori.getUp() == ForgeDirection.UNKNOWN )
{
ori.setOrientation( forward, up );
}
@@ -42,34 +42,34 @@ import appeng.util.Platform;
public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEItemPowerStorage
{
public AEBaseItemBlockChargeable( final Block id )
public AEBaseItemBlockChargeable( Block id )
{
super( id );
}
@Override
@SideOnly( Side.CLIENT )
public void addCheckedInformation( final ItemStack itemStack, final EntityPlayer player, final List<String> toolTip, final 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;
final double internalMaxPower = this.getMaxEnergyCapacity();
double internalMaxPower = this.getMaxEnergyCapacity();
if( tag != null )
{
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 ) );
}
private double getMaxEnergyCapacity()
{
final Block blockID = Block.getBlockFromItem( this );
Block blockID = Block.getBlockFromItem( this );
final IBlockDefinition energyCell = Api.INSTANCE.definitions().blocks().energyCell();
for( final Block block : energyCell.maybeBlock().asSet() )
for( Block block : energyCell.maybeBlock().asSet() )
{
if( blockID == block )
{
@@ -85,10 +85,10 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
}
@Override
public double injectAEPower( final ItemStack is, double amt )
public double injectAEPower( ItemStack is, double amt )
{
double internalCurrentPower = this.getInternal( is );
final double internalMaxPower = this.getMaxEnergyCapacity();
double internalMaxPower = this.getMaxEnergyCapacity();
internalCurrentPower += amt;
if( internalCurrentPower > internalMaxPower )
{
@@ -102,20 +102,20 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
return 0;
}
private double getInternal( final ItemStack is )
private double getInternal( ItemStack is )
{
final NBTTagCompound nbt = Platform.openNbtData( is );
NBTTagCompound nbt = Platform.openNbtData( is );
return nbt.getDouble( "internalCurrentPower" );
}
private void setInternal( final ItemStack is, final double amt )
private void setInternal( ItemStack is, double amt )
{
final NBTTagCompound nbt = Platform.openNbtData( is );
NBTTagCompound nbt = Platform.openNbtData( is );
nbt.setDouble( "internalCurrentPower", amt );
}
@Override
public double extractAEPower( final ItemStack is, double amt )
public double extractAEPower( ItemStack is, double amt )
{
double internalCurrentPower = this.getInternal( is );
if( internalCurrentPower > amt )
@@ -131,19 +131,19 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
}
@Override
public double getAEMaxPower( final ItemStack is )
public double getAEMaxPower( ItemStack is )
{
return this.getMaxEnergyCapacity();
}
@Override
public double getAECurrentPower( final ItemStack is )
public double getAECurrentPower( ItemStack is )
{
return this.getInternal( is );
}
@Override
public AccessRestriction getPowerFlow( final ItemStack is )
public AccessRestriction getPowerFlow( ItemStack is )
{
return AccessRestriction.WRITE;
}
@@ -1,16 +0,0 @@
package appeng.block;
import net.minecraft.block.Block;
import net.minecraft.item.ItemSlab;
public class AEBaseItemBlockSlab extends ItemSlab
{
public AEBaseItemBlockSlab( final Block block, final AEBaseSlabBlock singleSlab, final AEBaseSlabBlock doubleSlab, final Boolean isDoubleSlab )
{
super( block, singleSlab, doubleSlab, isDoubleSlab );
}
}
@@ -1,139 +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.BlockSlab;
import net.minecraft.client.renderer.texture.IIconRegister;
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( final AEBaseBlock block, final int meta, final EnumSet<AEFeature> features, final boolean isDoubleSlab, final 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( !this.field_150004_a )
{
this.doubleSlabs = new AEBaseSlabBlock( block, meta, features, true, name + ".double" ).setSlabs( this );
}
this.features = !this.field_150004_a ? new SlabBlockFeatureHandler( features, this ) : null;
}
private AEBaseSlabBlock setSlabs( final AEBaseSlabBlock slabs )
{
this.slabs = slabs;
return this;
}
public AEBaseSlabBlock slabs()
{
return this.slabs;
}
public AEBaseSlabBlock doubleSlabs()
{
return this.doubleSlabs;
}
@Override
public IFeatureHandler handler()
{
return this.features;
}
@Override
public void postInit()
{
// Override to do stuff
}
@Override
public IIcon getIcon( final int dir, final int meta )
{
return this.block.getIcon( dir, this.meta );
}
@Override
public String func_150002_b( final int p_150002_1_ )
{
return this.getUnlocalizedName();
}
@Override
public void registerBlockIcons( final IIconRegister reg )
{
}
@Override
public Item getItemDropped( final int meta, final Random rand, final int fortune )
{
return this.field_150004_a ? Item.getItemFromBlock( this.slabs ) : Item.getItemFromBlock( this );
}
@Override
public ItemStack getPickBlock( final MovingObjectPosition target, final World world, final int x, final int y, final int z )
{
AEBaseSlabBlock block = (AEBaseSlabBlock) world.getBlock( x, y, z );
if( block == null )
{
return null;
}
if( block.field_150004_a )
{
block = this.slabs;
}
final int meta = world.getBlockMetadata( x, y, z ) & 7;
return new ItemStack( block, 1, meta );
}
public String name()
{
return this.name;
}
}
@@ -21,11 +21,11 @@ package appeng.block;
import java.util.EnumSet;
import com.google.common.base.Optional;
import net.minecraft.block.Block;
import net.minecraft.block.BlockStairs;
import com.google.common.base.Optional;
import appeng.core.features.AEFeature;
import appeng.core.features.IAEFeature;
import appeng.core.features.IFeatureHandler;
@@ -36,7 +36,7 @@ public abstract class AEBaseStairBlock extends BlockStairs implements IAEFeature
{
private final IFeatureHandler features;
protected AEBaseStairBlock( final Block block, final int meta, final EnumSet<AEFeature> features )
protected AEBaseStairBlock( Block block, int meta, EnumSet<AEFeature> features )
{
super( block, meta );
@@ -1,348 +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.IAEFeature;
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( final Material mat )
{
super( mat );
}
protected AEBaseTileBlock( final Material mat, final Optional<String> subName )
{
super( mat, subName );
}
@Override
protected void setFeature( final EnumSet<AEFeature> f )
{
final AETileBlockFeatureHandler featureHandler = new AETileBlockFeatureHandler( f, this, this.featureSubName );
this.setHandler( featureHandler );
}
protected void setTileEntity( final Class<? extends TileEntity> c )
{
this.tileEntityType = c;
this.isInventory = IInventory.class.isAssignableFrom( c );
this.setTileProvider( this.hasBlockTileEntity() );
}
// update Block value.
private void setTileProvider( final boolean b )
{
ReflectionHelper.setPrivateValue( Block.class, this, b, "isTileProvider" );
}
private boolean hasBlockTileEntity()
{
return this.tileEntityType != null;
}
public Class<? extends TileEntity> getTileEntityClass()
{
return this.tileEntityType;
}
@Nullable
public <T extends AEBaseTile> T getTileEntity( final IBlockAccess w, final int x, final int y, final 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( final World var1, final int var2 )
{
if( this.hasBlockTileEntity() )
{
try
{
return this.tileEntityType.newInstance();
}
catch( final InstantiationException e )
{
throw new IllegalStateException( "Failed to create a new instance of an illegal class " + this.tileEntityType, e );
}
catch( final 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( final World w, final int x, final int y, final int z, final Block a, final int b )
{
final AEBaseTile te = this.getTileEntity( w, x, y, z );
if( te != null )
{
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( final World w, final int x, final int y, final int z )
{
final AEBaseTile obj = this.getTileEntity( w, x, y, z );
if( obj != null && obj.canBeRotated() )
{
return ForgeDirection.VALID_DIRECTIONS;
}
return super.getValidRotations( w, x, y, z );
}
@Override
public boolean recolourBlock( final World world, final int x, final int y, final int z, final ForgeDirection side, final int colour )
{
final TileEntity te = this.getTileEntity( world, x, y, z );
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( final World w, final int x, final int y, final int z, final int s )
{
final TileEntity te = this.getTileEntity( w, x, y, z );
if( te instanceof IInventory )
{
return Container.calcRedstoneFromInventory( (IInventory) te );
}
return 0;
}
@Override
public boolean onBlockEventReceived( final World p_149696_1_, final int p_149696_2_, final int p_149696_3_, final int p_149696_4_, final int p_149696_5_, final int p_149696_6_ )
{
super.onBlockEventReceived( p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, p_149696_5_, p_149696_6_ );
final TileEntity tileentity = p_149696_1_.getTileEntity( p_149696_2_, p_149696_3_, p_149696_4_ );
return tileentity != null ? tileentity.receiveClientEvent( p_149696_5_, p_149696_6_ ) : false;
}
@Override
public void onBlockPlacedBy( final World w, final int x, final int y, final int z, final EntityLivingBase player, final 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( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ )
{
if( player != null )
{
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( final 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( final IBlockAccess w, final int x, final int y, final int z )
{
return this.getTileEntity( w, x, y, z );
}
@Override
public ICustomCollision getCustomCollision( final World w, final int x, final int y, final int z )
{
final AEBaseTile te = this.getTileEntity( w, x, y, z );
if( te instanceof ICustomCollision )
{
return (ICustomCollision) te;
}
return super.getCustomCollision( w, x, y, z );
}
}
@@ -26,9 +26,9 @@ import net.minecraft.world.IBlockAccess;
public class AEDecorativeBlock extends AEBaseBlock
{
public AEDecorativeBlock( final Material mat )
public AEDecorativeBlock( Class<? extends AEBaseBlock> c, Material mat )
{
super( mat );
super( c, mat );
}
@Override
@@ -38,7 +38,7 @@ public class AEDecorativeBlock extends AEBaseBlock
}
@Override
public IIcon getIcon( final IBlockAccess w, final int x, final int y, final int z, final int s )
public IIcon getIcon( IBlockAccess w, int x, int y, int z, int s )
{
return super.unmappedGetIcon( w, x, y, z, s );
}
@@ -32,6 +32,7 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.api.AEApi;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockCraftingCPUMonitor;
import appeng.client.texture.ExtraBlockTextures;
import appeng.tile.crafting.TileCraftingMonitorTile;
@@ -39,24 +40,26 @@ import appeng.tile.crafting.TileCraftingMonitorTile;
public class BlockCraftingMonitor extends BlockCraftingUnit
{
public BlockCraftingMonitor()
{
super( BlockCraftingMonitor.class );
this.setTileEntity( TileCraftingMonitorTile.class );
}
@Override
@SideOnly( Side.CLIENT )
protected RenderBlockCraftingCPUMonitor getRenderer()
protected Class<? extends BaseBlockRender> getRenderer()
{
return new RenderBlockCraftingCPUMonitor();
return RenderBlockCraftingCPUMonitor.class;
}
@Override
public IIcon getIcon( final int direction, final int metadata )
public IIcon getIcon( int direction, int metadata )
{
if( direction != ForgeDirection.SOUTH.ordinal() )
{
for( final Block craftingUnitBlock : AEApi.instance().definitions().blocks().craftingUnit().maybeBlock().asSet() )
for( Block craftingUnitBlock : AEApi.instance().definitions().blocks().craftingUnit().maybeBlock().asSet() )
{
return craftingUnitBlock.getIcon( direction, metadata );
}
@@ -74,7 +77,7 @@ public class BlockCraftingMonitor extends BlockCraftingUnit
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
{
itemStacks.add( new ItemStack( this, 1, 0 ) );
}
@@ -37,6 +37,8 @@ public class BlockCraftingStorage extends BlockCraftingUnit
{
public BlockCraftingStorage()
{
super( BlockCraftingStorage.class );
this.setTileEntity( TileCraftingStorageTile.class );
}
@@ -47,7 +49,7 @@ public class BlockCraftingStorage extends BlockCraftingUnit
}
@Override
public IIcon getIcon( final int direction, final int metadata )
public IIcon getIcon( int direction, int metadata )
{
switch( metadata & ( ~4 ) )
{
@@ -75,7 +77,7 @@ public class BlockCraftingStorage extends BlockCraftingUnit
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
{
itemStacks.add( new ItemStack( this, 1, 0 ) );
itemStacks.add( new ItemStack( this, 1, 1 ) );
@@ -84,7 +86,7 @@ public class BlockCraftingStorage extends BlockCraftingUnit
}
@Override
public String getUnlocalizedName( final ItemStack is )
public String getUnlocalizedName( ItemStack is )
{
if( is.getItemDamage() == 1 )
{
@@ -35,7 +35,8 @@ import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseTileBlock;
import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockCraftingCPU;
import appeng.client.texture.ExtraBlockTextures;
import appeng.core.features.AEFeature;
@@ -44,28 +45,33 @@ import appeng.tile.crafting.TileCraftingTile;
import appeng.util.Platform;
public class BlockCraftingUnit extends AEBaseTileBlock
public class BlockCraftingUnit extends AEBaseBlock
{
static final int FLAG_FORMED = 8;
public static final int FLAG_FORMED = 8;
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.setTileEntity( TileCraftingTile.class );
this.setFeature( EnumSet.of( AEFeature.CraftingCPU ) );
}
@Override
@SideOnly( Side.CLIENT )
protected RenderBlockCraftingCPU<? extends BlockCraftingUnit, ? extends TileCraftingTile> getRenderer()
protected Class<? extends BaseBlockRender> getRenderer()
{
return new RenderBlockCraftingCPU<BlockCraftingUnit, TileCraftingTile>();
return RenderBlockCraftingCPU.class;
}
@Override
public IIcon getIcon( final int direction, final int metadata )
public IIcon getIcon( int direction, int metadata )
{
switch( metadata )
{
@@ -82,9 +88,9 @@ public class BlockCraftingUnit extends AEBaseTileBlock
}
@Override
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{
final TileCraftingTile tg = this.getTileEntity( w, x, y, z );
TileCraftingTile tg = this.getTileEntity( w, x, y, z );
if( tg != null && !p.isSneaking() && tg.isFormed() && tg.isActive() )
{
if( Platform.isClient() )
@@ -101,24 +107,24 @@ public class BlockCraftingUnit extends AEBaseTileBlock
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
{
itemStacks.add( new ItemStack( this, 1, 0 ) );
itemStacks.add( new ItemStack( this, 1, 1 ) );
}
@Override
public void setRenderStateByMeta( final int itemDamage )
public void setRenderStateByMeta( int itemDamage )
{
final IIcon front = this.getIcon( ForgeDirection.SOUTH.ordinal(), itemDamage );
final IIcon other = this.getIcon( ForgeDirection.NORTH.ordinal(), itemDamage );
IIcon front = this.getIcon( ForgeDirection.SOUTH.ordinal(), itemDamage );
IIcon other = this.getIcon( ForgeDirection.NORTH.ordinal(), itemDamage );
this.getRendererInstance().setTemporaryRenderIcons( other, other, front, other, other, other );
}
@Override
public void breakBlock( final World w, final int x, final int y, final int z, final Block a, final int b )
public void breakBlock( World w, int x, int y, int z, Block a, int b )
{
final TileCraftingTile cp = this.getTileEntity( w, x, y, z );
TileCraftingTile cp = this.getTileEntity( w, x, y, z );
if( cp != null )
{
cp.breakCluster();
@@ -128,7 +134,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock
}
@Override
public String getUnlocalizedName( final ItemStack is )
public String getUnlocalizedName( ItemStack is )
{
if( is.getItemDamage() == 1 )
{
@@ -138,15 +144,15 @@ public class BlockCraftingUnit extends AEBaseTileBlock
return this.getItemUnlocalizedName( is );
}
protected String getItemUnlocalizedName( final ItemStack is )
protected String getItemUnlocalizedName( ItemStack is )
{
return super.getUnlocalizedName( is );
}
@Override
public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block junk )
public void onNeighborBlockChange( World w, int x, int y, int z, Block junk )
{
final TileCraftingTile cp = this.getTileEntity( w, x, y, z );
TileCraftingTile cp = this.getTileEntity( w, x, y, z );
if( cp != null )
{
cp.updateMultiBlock();
@@ -154,15 +160,15 @@ public class BlockCraftingUnit extends AEBaseTileBlock
}
@Override
public int damageDropped( final int meta )
public int damageDropped( int meta )
{
return meta & 3;
}
@Override
public int getDamageValue( final World w, final int x, final int y, final int z )
public int getDamageValue( World w, int x, int y, int z )
{
final int meta = w.getBlockMetadata( x, y, z );
int meta = w.getBlockMetadata( x, y, z );
return this.damageDropped( meta );
}
}
@@ -29,7 +29,8 @@ import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseTileBlock;
import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockAssembler;
import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge;
@@ -37,15 +38,14 @@ import appeng.tile.crafting.TileMolecularAssembler;
import appeng.util.Platform;
public class BlockMolecularAssembler extends AEBaseTileBlock
public class BlockMolecularAssembler extends AEBaseBlock
{
private static boolean booleanAlphaPass = false;
public static boolean booleanAlphaPass = false;
public BlockMolecularAssembler()
{
super( Material.iron );
super( BlockMolecularAssembler.class, Material.iron );
this.setTileEntity( TileMolecularAssembler.class );
this.isOpaque = false;
this.lightOpacity = 1;
@@ -59,23 +59,23 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
}
@Override
public boolean canRenderInPass( final int pass )
public boolean canRenderInPass( int pass )
{
setBooleanAlphaPass( pass == 1 );
booleanAlphaPass = pass == 1;
return pass == 0 || pass == 1;
}
@Override
@SideOnly( Side.CLIENT )
public RenderBlockAssembler getRenderer()
public Class<? extends BaseBlockRender> getRenderer()
{
return new RenderBlockAssembler();
return RenderBlockAssembler.class;
}
@Override
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{
final TileMolecularAssembler tg = this.getTileEntity( w, x, y, z );
TileMolecularAssembler tg = this.getTileEntity( w, x, y, z );
if( tg != null && !p.isSneaking() )
{
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_MAC );
@@ -83,14 +83,4 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
}
return false;
}
public static boolean isBooleanAlphaPass()
{
return booleanAlphaPass;
}
private static void setBooleanAlphaPass( final boolean booleanAlphaPass )
{
BlockMolecularAssembler.booleanAlphaPass = booleanAlphaPass;
}
}
@@ -31,15 +31,15 @@ import appeng.core.features.AEFeature;
public class ItemCraftingStorage extends AEBaseItemBlock
{
public ItemCraftingStorage( final Block id )
public ItemCraftingStorage( Block id )
{
super( id );
}
@Override
public ItemStack getContainerItem( final ItemStack itemStack )
public ItemStack getContainerItem( ItemStack itemStack )
{
for( final ItemStack stack : AEApi.instance().definitions().blocks().craftingUnit().maybeStack( 1 ).asSet() )
for( ItemStack stack : AEApi.instance().definitions().blocks().craftingUnit().maybeStack( 1 ).asSet() )
{
return stack;
}
@@ -48,8 +48,8 @@ public class ItemCraftingStorage extends AEBaseItemBlock
}
@Override
public boolean hasContainerItem( final ItemStack stack )
public boolean hasContainerItem( ItemStack stack )
{
return AEConfig.instance.isFeatureEnabled( AEFeature.EnableDisassemblyCrafting );
return AEConfig.instance.isFeatureEnabled( AEFeature.enableDisassemblyCrafting );
}
}
@@ -31,11 +31,9 @@ import net.minecraft.world.World;
import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.api.implementations.tiles.ICrankable;
import appeng.block.AEBaseTileBlock;
import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockCrank;
import appeng.core.features.AEFeature;
import appeng.core.stats.Stats;
@@ -43,13 +41,12 @@ import appeng.tile.AEBaseTile;
import appeng.tile.grindstone.TileCrank;
public class BlockCrank extends AEBaseTileBlock
public class BlockCrank extends AEBaseBlock
{
public BlockCrank()
{
super( Material.wood );
super( BlockCrank.class, Material.wood );
this.setTileEntity( TileCrank.class );
this.setLightOpacity( 0 );
this.setHarvestLevel( "axe", 0 );
@@ -58,14 +55,13 @@ public class BlockCrank extends AEBaseTileBlock
}
@Override
@SideOnly( Side.CLIENT )
public RenderBlockCrank getRenderer()
public Class<? extends BaseBlockRender> getRenderer()
{
return new RenderBlockCrank();
return RenderBlockCrank.class;
}
@Override
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ )
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
{
if( player instanceof FakePlayer || player == null )
{
@@ -73,7 +69,7 @@ public class BlockCrank extends AEBaseTileBlock
return true;
}
final AEBaseTile tile = this.getTileEntity( w, x, y, z );
AEBaseTile tile = this.getTileEntity( w, x, y, z );
if( tile instanceof TileCrank )
{
if( ( (TileCrank) tile ).power() )
@@ -85,19 +81,19 @@ public class BlockCrank extends AEBaseTileBlock
return true;
}
private void dropCrank( final World world, final int x, final int y, final int z )
private void dropCrank( World world, int x, int y, int z )
{
world.func_147480_a( x, y, z, true ); // w.destroyBlock( x, y, z, true );
world.markBlockForUpdate( x, y, z );
}
@Override
public void onBlockPlacedBy( final World world, final int x, final int y, final int z, final EntityLivingBase placer, final ItemStack itemStack )
public void onBlockPlacedBy( World world, int x, int y, int z, EntityLivingBase placer, ItemStack itemStack )
{
final AEBaseTile tile = this.getTileEntity( world, x, y, z );
AEBaseTile tile = this.getTileEntity( world, x, y, z );
if( tile != null )
{
final ForgeDirection mnt = this.findCrankable( world, x, y, z );
ForgeDirection mnt = this.findCrankable( world, x, y, z );
ForgeDirection forward = ForgeDirection.UP;
if( mnt == ForgeDirection.UP || mnt == ForgeDirection.DOWN )
{
@@ -112,15 +108,15 @@ public class BlockCrank extends AEBaseTileBlock
}
@Override
public boolean isValidOrientation( final World world, final int x, final int y, final int z, final ForgeDirection forward, final ForgeDirection up )
public boolean isValidOrientation( World world, int x, int y, int z, ForgeDirection forward, ForgeDirection up )
{
final TileEntity te = world.getTileEntity( x, y, z );
TileEntity te = world.getTileEntity( x, y, z );
return !( te instanceof TileCrank ) || this.isCrankable( world, x, y, z, up.getOpposite() );
}
private ForgeDirection findCrankable( final World world, final int x, final int y, final int z )
private ForgeDirection findCrankable( World world, int x, int y, int z )
{
for( final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
{
if( this.isCrankable( world, x, y, z, dir ) )
{
@@ -130,17 +126,17 @@ public class BlockCrank extends AEBaseTileBlock
return ForgeDirection.UNKNOWN;
}
private boolean isCrankable( final World world, final int x, final int y, final int z, final ForgeDirection offset )
private boolean isCrankable( World world, int x, int y, int z, ForgeDirection offset )
{
final TileEntity te = world.getTileEntity( x + offset.offsetX, y + offset.offsetY, z + offset.offsetZ );
TileEntity te = world.getTileEntity( x + offset.offsetX, y + offset.offsetY, z + offset.offsetZ );
return te instanceof ICrankable && ( (ICrankable) te ).canCrankAttach( offset.getOpposite() );
}
@Override
public void onNeighborBlockChange( final World world, final int x, final int y, final int z, final Block block )
public void onNeighborBlockChange( World world, int x, int y, int z, Block block )
{
final AEBaseTile tile = this.getTileEntity( world, x, y, z );
AEBaseTile tile = this.getTileEntity( world, x, y, z );
if( tile != null )
{
if( !this.isCrankable( world, x, y, z, tile.getUp().getOpposite() ) )
@@ -155,7 +151,7 @@ public class BlockCrank extends AEBaseTileBlock
}
@Override
public boolean canPlaceBlockAt( final World world, final int x, final int y, final int z )
public boolean canPlaceBlockAt( World world, int x, int y, int z )
{
return this.findCrankable( world, x, y, z ) != ForgeDirection.UNKNOWN;
}
@@ -26,29 +26,28 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseTileBlock;
import appeng.block.AEBaseBlock;
import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge;
import appeng.tile.grindstone.TileGrinder;
import appeng.util.Platform;
public class BlockGrinder extends AEBaseTileBlock
public class BlockGrinder extends AEBaseBlock
{
public BlockGrinder()
{
super( Material.rock );
super( BlockGrinder.class, Material.rock );
this.setTileEntity( TileGrinder.class );
this.setHardness( 3.2F );
this.setFeature( EnumSet.of( AEFeature.GrindStone ) );
}
@Override
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{
final TileGrinder tg = this.getTileEntity( w, x, y, z );
TileGrinder tg = this.getTileEntity( w, x, y, z );
if( tg != null && !p.isSneaking() )
{
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_GRINDER );
@@ -26,33 +26,32 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseTileBlock;
import appeng.block.AEBaseBlock;
import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge;
import appeng.tile.misc.TileCellWorkbench;
import appeng.util.Platform;
public class BlockCellWorkbench extends AEBaseTileBlock
public class BlockCellWorkbench extends AEBaseBlock
{
public BlockCellWorkbench()
{
super( Material.iron );
super( BlockCellWorkbench.class, Material.iron );
this.setTileEntity( TileCellWorkbench.class );
this.setFeature( EnumSet.of( AEFeature.StorageCells ) );
}
@Override
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{
if( p.isSneaking() )
{
return false;
}
final TileCellWorkbench tg = this.getTileEntity( w, x, y, z );
TileCellWorkbench tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
@@ -36,7 +36,8 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.api.AEApi;
import appeng.block.AEBaseTileBlock;
import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockCharger;
import appeng.client.render.effects.LightningFX;
import appeng.core.AEConfig;
@@ -48,13 +49,12 @@ import appeng.tile.misc.TileCharger;
import appeng.util.Platform;
public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
public class BlockCharger extends AEBaseBlock implements ICustomCollision
{
public BlockCharger()
{
super( Material.iron );
super( BlockCharger.class, Material.iron );
this.setTileEntity( TileCharger.class );
this.setLightOpacity( 2 );
this.isFullSize = this.isOpaque = false;
@@ -62,14 +62,13 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
}
@Override
@SideOnly( Side.CLIENT )
protected RenderBlockCharger getRenderer()
protected Class<? extends BaseBlockRender> getRenderer()
{
return new RenderBlockCharger();
return RenderBlockCharger.class;
}
@Override
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ )
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
{
if( player.isSneaking() )
{
@@ -78,7 +77,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
if( Platform.isServer() )
{
final TileCharger tc = this.getTileEntity( w, x, y, z );
TileCharger tc = this.getTileEntity( w, x, y, z );
if( tc != null )
{
tc.activate( player );
@@ -90,7 +89,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
@Override
@SideOnly( Side.CLIENT )
public void randomDisplayTick( final World w, final int x, final int y, final int z, final Random r )
public void randomDisplayTick( World w, int x, int y, int z, Random r )
{
if( !AEConfig.instance.enableEffects )
{
@@ -102,22 +101,22 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
return;
}
final AEBaseTile tile = this.getTileEntity( w, x, y, z );
AEBaseTile tile = this.getTileEntity( w, x, y, z );
if( tile instanceof TileCharger )
{
final TileCharger tc = (TileCharger) tile;
TileCharger tc = (TileCharger) tile;
if( AEApi.instance().definitions().materials().certusQuartzCrystalCharged().isSameAs( tc.getStackInSlot( 0 ) ) )
{
final double xOff = 0.0;
final double yOff = 0.0;
final double zOff = 0.0;
double xOff = 0.0;
double yOff = 0.0;
double zOff = 0.0;
for( int bolts = 0; bolts < 3; bolts++ )
{
if( CommonHelper.proxy.shouldAddParticles( r ) )
{
final LightningFX fx = new LightningFX( w, xOff + 0.5 + x, yOff + 0.5 + y, zOff + 0.5 + z, 0.0D, 0.0D, 0.0D );
LightningFX fx = new LightningFX( w, xOff + 0.5 + x, yOff + 0.5 + y, zOff + 0.5 + z, 0.0D, 0.0D, 0.0D );
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
}
}
@@ -126,15 +125,15 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
}
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual )
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
{
final TileCharger tile = this.getTileEntity( w, x, y, z );
TileCharger tile = this.getTileEntity( w, x, y, z );
if( tile != null )
{
final double twoPixels = 2.0 / 16.0;
final ForgeDirection up = tile.getUp();
final ForgeDirection forward = tile.getForward();
final AxisAlignedBB bb = AxisAlignedBB.getBoundingBox( twoPixels, twoPixels, twoPixels, 1.0 - twoPixels, 1.0 - twoPixels, 1.0 - twoPixels );
double twoPixels = 2.0 / 16.0;
ForgeDirection up = tile.getUp();
ForgeDirection forward = tile.getForward();
AxisAlignedBB bb = AxisAlignedBB.getBoundingBox( twoPixels, twoPixels, twoPixels, 1.0 - twoPixels, 1.0 - twoPixels, 1.0 - twoPixels );
if( up.offsetX != 0 )
{
@@ -182,7 +181,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
}
@Override
public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e )
{
out.add( AxisAlignedBB.getBoundingBox( 0.0, 0.0, 0.0, 1.0, 1.0, 1.0 ) );
}
@@ -26,26 +26,25 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseTileBlock;
import appeng.block.AEBaseBlock;
import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge;
import appeng.tile.misc.TileCondenser;
import appeng.util.Platform;
public class BlockCondenser extends AEBaseTileBlock
public class BlockCondenser extends AEBaseBlock
{
public BlockCondenser()
{
super( Material.iron );
super( BlockCondenser.class, Material.iron );
this.setTileEntity( TileCondenser.class );
this.setFeature( EnumSet.of( AEFeature.Core ) );
}
@Override
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ )
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
{
if( player.isSneaking() )
{
@@ -54,7 +53,7 @@ public class BlockCondenser extends AEBaseTileBlock
if( Platform.isServer() )
{
final TileCondenser tc = this.getTileEntity( w, x, y, z );
TileCondenser tc = this.getTileEntity( w, x, y, z );
if( tc != null && !player.isSneaking() )
{
Platform.openGUI( player, tc, ForgeDirection.getOrientation( side ), GuiBridge.GUI_CONDENSER );
@@ -26,10 +26,8 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseTileBlock;
import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockInscriber;
import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge;
@@ -37,13 +35,12 @@ import appeng.tile.misc.TileInscriber;
import appeng.util.Platform;
public class BlockInscriber extends AEBaseTileBlock
public class BlockInscriber extends AEBaseBlock
{
public BlockInscriber()
{
super( Material.iron );
super( BlockInscriber.class, Material.iron );
this.setTileEntity( TileInscriber.class );
this.setLightOpacity( 2 );
this.isFullSize = this.isOpaque = false;
@@ -51,21 +48,20 @@ public class BlockInscriber extends AEBaseTileBlock
}
@Override
@SideOnly( Side.CLIENT )
protected RenderBlockInscriber getRenderer()
protected Class<? extends BaseBlockRender> getRenderer()
{
return new RenderBlockInscriber();
return RenderBlockInscriber.class;
}
@Override
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{
if( p.isSneaking() )
{
return false;
}
final TileInscriber tg = this.getTileEntity( w, x, y, z );
TileInscriber tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
@@ -26,11 +26,9 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.api.util.IOrientable;
import appeng.block.AEBaseTileBlock;
import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockInterface;
import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge;
@@ -38,33 +36,31 @@ import appeng.tile.misc.TileInterface;
import appeng.util.Platform;
public class BlockInterface extends AEBaseTileBlock
public class BlockInterface extends AEBaseBlock
{
public BlockInterface()
{
super( Material.iron );
super( BlockInterface.class, Material.iron );
this.setTileEntity( TileInterface.class );
this.setFeature( EnumSet.of( AEFeature.Core ) );
}
@Override
@SideOnly( Side.CLIENT )
protected RenderBlockInterface getRenderer()
protected Class<? extends BaseBlockRender> getRenderer()
{
return new RenderBlockInterface();
return RenderBlockInterface.class;
}
@Override
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{
if( p.isSneaking() )
{
return false;
}
final TileInterface tg = this.getTileEntity( w, x, y, z );
TileInterface tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
@@ -83,7 +79,7 @@ public class BlockInterface extends AEBaseTileBlock
}
@Override
protected void customRotateBlock( final IOrientable rotatable, final ForgeDirection axis )
protected void customRotateBlock( IOrientable rotatable, ForgeDirection axis )
{
if( rotatable instanceof TileInterface )
{
@@ -19,49 +19,31 @@
package appeng.block.misc;
import java.util.Collections;
import java.util.EnumSet;
import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.api.util.IOrientable;
import appeng.api.util.IOrientableBlock;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.blocks.RenderQuartzTorch;
import appeng.core.features.AEFeature;
import appeng.helpers.ICustomCollision;
import appeng.helpers.MetaRotation;
import appeng.tile.misc.TileLightDetector;
public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBlock, ICustomCollision
public class BlockLightDetector extends BlockQuartzTorch
{
public BlockLightDetector()
{
super( Material.circuits );
this.setLightOpacity( 0 );
this.isFullSize = false;
this.isOpaque = false;
super( BlockLightDetector.class );
this.setTileEntity( TileLightDetector.class );
this.setFeature( EnumSet.of( AEFeature.LightDetector ) );
}
@Override
public int isProvidingWeakPower( final IBlockAccess w, final int x, final int y, final int z, final int side )
public int isProvidingWeakPower( IBlockAccess w, int x, int y, int z, int side )
{
if( w instanceof World && ( (TileLightDetector) this.getTileEntity( w, x, y, z ) ).isReady() )
{
@@ -72,11 +54,11 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
}
@Override
public void onNeighborChange( final IBlockAccess world, final int x, final int y, final int z, final int tileX, final int tileY, final int tileZ )
public void onNeighborChange( IBlockAccess world, int x, int y, int z, int tileX, int tileY, int tileZ )
{
super.onNeighborChange( world, x, y, z, tileX, tileY, tileZ );
final TileLightDetector tld = this.getTileEntity( world, x, y, z );
TileLightDetector tld = this.getTileEntity( world, x, y, z );
if( tld != null )
{
tld.updateLight();
@@ -85,87 +67,8 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
@Override
@SideOnly( Side.CLIENT )
public void randomDisplayTick( final World w, final int x, final int y, final int z, final Random r )
public void randomDisplayTick( World w, int x, int y, int z, Random r )
{
// cancel out lightning
}
@Override
@SideOnly( Side.CLIENT )
protected RenderQuartzTorch getRenderer()
{
return new RenderQuartzTorch();
}
@Override
public boolean isValidOrientation( final World w, final int x, final int y, final int z, final ForgeDirection forward, final ForgeDirection up )
{
return this.canPlaceAt( w, x, y, z, up.getOpposite() );
}
private boolean canPlaceAt( final World w, final int x, final int y, final int z, final ForgeDirection dir )
{
return w.isSideSolid( x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, dir.getOpposite(), false );
}
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual )
{
final ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
final double xOff = -0.3 * up.offsetX;
final double yOff = -0.3 * up.offsetY;
final double zOff = -0.3 * up.offsetZ;
return Collections.singletonList( AxisAlignedBB.getBoundingBox( xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7 ) );
}
@Override
public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List out, final Entity e )
{/*
* double xOff = -0.15 * getUp().offsetX; double yOff = -0.15 * getUp().offsetY; double zOff = -0.15 *
* getUp().offsetZ; out.add( AxisAlignedBB.getBoundingBox( xOff + (double) x + 0.15, yOff + (double) y + 0.15, zOff
* + (double) z + 0.15,// ahh xOff + (double) x + 0.85, yOff + (double) y + 0.85, zOff + (double) z + 0.85 ) );
*/
}
@Override
public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block id )
{
final ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
if( !this.canPlaceAt( w, x, y, z, up.getOpposite() ) )
{
this.dropTorch( w, x, y, z );
}
}
private void dropTorch( final World w, final int x, final int y, final int z )
{
w.func_147480_a( x, y, z, true );
// w.destroyBlock( x, y, z, true );
w.markBlockForUpdate( x, y, z );
}
@Override
public boolean canPlaceBlockAt( final World w, final int x, final int y, final int z )
{
for( final 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 );
}
}
+19 -20
View File
@@ -36,20 +36,20 @@ import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseTileBlock;
import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockPaint;
import appeng.core.features.AEFeature;
import appeng.tile.misc.TilePaint;
import appeng.util.Platform;
public class BlockPaint extends AEBaseTileBlock
public class BlockPaint extends AEBaseBlock
{
public BlockPaint()
{
super( new MaterialLiquid( MapColor.airColor ) );
super( BlockPaint.class, new MaterialLiquid( MapColor.airColor ) );
this.setTileEntity( TilePaint.class );
this.setLightOpacity( 0 );
this.isFullSize = false;
@@ -58,35 +58,34 @@ public class BlockPaint extends AEBaseTileBlock
}
@Override
@SideOnly( Side.CLIENT )
protected RenderBlockPaint getRenderer()
protected Class<? extends BaseBlockRender> getRenderer()
{
return new RenderBlockPaint();
return RenderBlockPaint.class;
}
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
{
// do nothing
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool( final World world, final int x, final int y, final int z )
public AxisAlignedBB getCollisionBoundingBoxFromPool( World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_ )
{
return null;
}
@Override
public boolean canCollideCheck( final int metadata, final boolean isHoldingRightClick )
public boolean canCollideCheck( int p_149678_1_, boolean p_149678_2_ )
{
return false;
}
@Override
public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block junk )
public void onNeighborBlockChange( World w, int x, int y, int z, Block junk )
{
final TilePaint tp = this.getTileEntity( w, x, y, z );
TilePaint tp = this.getTileEntity( w, x, y, z );
if( tp != null )
{
@@ -95,30 +94,30 @@ public class BlockPaint extends AEBaseTileBlock
}
@Override
public Item getItemDropped( final int meta, final Random random, final int fortune )
public Item getItemDropped( int p_149650_1_, Random p_149650_2_, int p_149650_3_ )
{
return null;
}
@Override
public void dropBlockAsItemWithChance( final World world, final int x, final int y, final int z, final int meta, final float chance, final 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_ )
{
}
@Override
public void fillWithRain( final World w, final int x, final int y, final int z )
public void fillWithRain( World w, int x, int y, int z )
{
if( Platform.isServer() )
{
w.setBlock( x, y, z, Platform.AIR_BLOCK, 0, 3 );
w.setBlock( x, y, z, Platform.AIR, 0, 3 );
}
}
@Override
public int getLightValue( final IBlockAccess w, final int x, final int y, final int z )
public int getLightValue( IBlockAccess w, int x, int y, int z )
{
final TilePaint tp = this.getTileEntity( w, x, y, z );
TilePaint tp = this.getTileEntity( w, x, y, z );
if( tp != null )
{
@@ -129,13 +128,13 @@ public class BlockPaint extends AEBaseTileBlock
}
@Override
public boolean isReplaceable( final IBlockAccess world, final int x, final int y, final int z )
public boolean isReplaceable( IBlockAccess world, int x, int y, int z )
{
return true;
}
@Override
public boolean isAir( final IBlockAccess world, final int x, final int y, final int z )
public boolean isAir( IBlockAccess world, int x, int y, int z )
{
return true;
}
@@ -25,71 +25,75 @@ import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.api.util.IOrientable;
import appeng.api.util.IOrientableBlock;
import appeng.block.AEBaseTileBlock;
import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockQuartzAccelerator;
import appeng.client.render.effects.LightningFX;
import appeng.core.AEConfig;
import appeng.core.CommonHelper;
import appeng.core.features.AEFeature;
import appeng.helpers.MetaRotation;
import appeng.tile.misc.TileQuartzGrowthAccelerator;
import appeng.util.Platform;
public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOrientableBlock
public class BlockQuartzGrowthAccelerator extends AEBaseBlock implements IOrientableBlock
{
public BlockQuartzGrowthAccelerator()
{
super( Material.rock );
super( BlockQuartzGrowthAccelerator.class, Material.rock );
this.setStepSound( Block.soundTypeMetal );
this.setTileEntity( TileQuartzGrowthAccelerator.class );
this.setFeature( EnumSet.of( AEFeature.Core ) );
}
@Override
@SideOnly( Side.CLIENT )
protected RenderBlockQuartzAccelerator getRenderer()
protected Class<? extends BaseBlockRender> getRenderer()
{
return new RenderBlockQuartzAccelerator();
return RenderBlockQuartzAccelerator.class;
}
@Override
@SideOnly( Side.CLIENT )
public void randomDisplayTick( final World w, final int x, final int y, final int z, final Random r )
public void randomDisplayTick( World w, int x, int y, int z, Random r )
{
if( !AEConfig.instance.enableEffects )
{
return;
}
final TileQuartzGrowthAccelerator cga = this.getTileEntity( w, x, y, z );
TileQuartzGrowthAccelerator tileQuartzGrowthAccelerator = this.getTileEntity( w, x, y, z );
if( cga != null && cga.isPowered() && CommonHelper.proxy.shouldAddParticles( r ) )
if( tileQuartzGrowthAccelerator != null && tileQuartzGrowthAccelerator.hasPower && CommonHelper.proxy.shouldAddParticles( r ) )
{
final double d0 = r.nextFloat() - 0.5F;
final double d1 = r.nextFloat() - 0.5F;
double d0 = r.nextFloat() - 0.5F;
double d1 = r.nextFloat() - 0.5F;
final ForgeDirection up = cga.getUp();
final ForgeDirection forward = cga.getForward();
final ForgeDirection west = Platform.crossProduct( forward, up );
ForgeDirection up = tileQuartzGrowthAccelerator.getUp();
ForgeDirection forward = tileQuartzGrowthAccelerator.getForward();
ForgeDirection west = Platform.crossProduct( forward, up );
double rx = 0.5 + x;
double ry = 0.5 + y;
double rz = 0.5 + z;
double dx = 0;
double dz = 0;
rx += up.offsetX * d0;
ry += up.offsetY * d0;
rz += up.offsetZ * d0;
double dz = 0;
double dx = 0;
switch( r.nextInt( 4 ) )
{
case 0:
@@ -134,20 +138,20 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
ry += dz * forward.offsetY;
rz += dz * forward.offsetZ;
final LightningFX fx = new LightningFX( w, rx, ry, rz, 0.0D, 0.0D, 0.0D );
LightningFX fx = new LightningFX( w, rx, ry, rz, 0.0D, 0.0D, 0.0D );
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
}
}
@Override
/**
* TODO: remove with 1.8 or later
*
* @Deprecated no longer true, only kept to prevent missing blocks.
*/
@Deprecated
public boolean usesMetadata()
{
return true;
}
@Override
public IOrientable getOrientable( final IBlockAccess w, final int x, final int y, final int z )
{
return new MetaRotation( w, x, y, z );
}
}
@@ -39,6 +39,7 @@ import cpw.mods.fml.relauncher.SideOnly;
import appeng.api.util.IOrientable;
import appeng.api.util.IOrientableBlock;
import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderQuartzTorch;
import appeng.client.render.effects.LightningFX;
import appeng.core.AEConfig;
@@ -50,47 +51,50 @@ import appeng.helpers.MetaRotation;
public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, ICustomCollision
{
public BlockQuartzTorch()
{
super( Material.circuits );
this.setFeature( EnumSet.of( AEFeature.DecorativeLights ) );
this( BlockQuartzTorch.class );
this.setLightLevel( 0.9375F );
this.setLightOpacity( 0 );
this.isFullSize = false;
this.isOpaque = false;
this.setFeature( EnumSet.of( AEFeature.DecorativeLights ) );
}
@Override
@SideOnly( Side.CLIENT )
protected RenderQuartzTorch getRenderer()
protected BlockQuartzTorch( Class which )
{
return new RenderQuartzTorch();
super( which, Material.circuits );
this.setLightOpacity( 0 );
this.isFullSize = this.isOpaque = false;
}
@Override
public boolean isValidOrientation( final World w, final int x, final int y, final int z, final ForgeDirection forward, final ForgeDirection up )
protected Class<? extends BaseBlockRender> 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( final World w, final int x, final int y, final int z, final ForgeDirection dir )
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( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual )
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
{
final ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
final double xOff = -0.3 * up.offsetX;
final double yOff = -0.3 * up.offsetY;
final double zOff = -0.3 * up.offsetZ;
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( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List out, final Entity e )
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
@@ -100,7 +104,7 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
@Override
@SideOnly( Side.CLIENT )
public void randomDisplayTick( final World w, final int x, final int y, final int z, final Random r )
public void randomDisplayTick( World w, int x, int y, int z, Random r )
{
if( !AEConfig.instance.enableEffects )
{
@@ -112,15 +116,15 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
return;
}
final ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
final double xOff = -0.3 * up.offsetX;
final double yOff = -0.3 * up.offsetY;
final double zOff = -0.3 * up.offsetZ;
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;
for( int bolts = 0; bolts < 3; bolts++ )
{
if( CommonHelper.proxy.shouldAddParticles( r ) )
{
final LightningFX fx = new LightningFX( w, xOff + 0.5 + x, yOff + 0.5 + y, zOff + 0.5 + z, 0.0D, 0.0D, 0.0D );
LightningFX fx = new LightningFX( w, xOff + 0.5 + x, yOff + 0.5 + y, zOff + 0.5 + z, 0.0D, 0.0D, 0.0D );
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
}
@@ -128,16 +132,16 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
}
@Override
public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block id )
public void onNeighborBlockChange( World w, int x, int y, int z, Block id )
{
final ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
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( final World w, final int x, final int y, final int 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 );
@@ -145,9 +149,9 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
}
@Override
public boolean canPlaceBlockAt( final World w, final int x, final int y, final int z )
public boolean canPlaceBlockAt( World w, int x, int y, int z )
{
for( final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
{
if( this.canPlaceAt( w, x, y, z, dir ) )
{
@@ -26,10 +26,8 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseTileBlock;
import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RendererSecurity;
import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge;
@@ -37,33 +35,31 @@ import appeng.tile.misc.TileSecurity;
import appeng.util.Platform;
public class BlockSecurity extends AEBaseTileBlock
public class BlockSecurity extends AEBaseBlock
{
public BlockSecurity()
{
super( Material.iron );
super( BlockSecurity.class, Material.iron );
this.setTileEntity( TileSecurity.class );
this.setFeature( EnumSet.of( AEFeature.Security ) );
}
@Override
@SideOnly( Side.CLIENT )
protected RendererSecurity getRenderer()
protected Class<? extends BaseBlockRender> getRenderer()
{
return new RendererSecurity();
return RendererSecurity.class;
}
@Override
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer p, final int side, final float hitX, final float hitY, final float hitZ )
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{
if( p.isSneaking() )
{
return false;
}
final TileSecurity tg = this.getTileEntity( w, x, y, z );
TileSecurity tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isClient() )
@@ -36,19 +36,20 @@ import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseTileBlock;
import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockSkyCompass;
import appeng.core.features.AEFeature;
import appeng.helpers.ICustomCollision;
import appeng.tile.misc.TileSkyCompass;
public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
public class BlockSkyCompass extends AEBaseBlock implements ICustomCollision
{
public BlockSkyCompass()
{
super( Material.iron );
super( BlockSkyCompass.class, Material.iron );
this.setTileEntity( TileSkyCompass.class );
this.isOpaque = this.isFullSize = false;
this.lightOpacity = 0;
@@ -56,29 +57,28 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
}
@Override
@SideOnly( Side.CLIENT )
protected RenderBlockSkyCompass getRenderer()
protected Class<? extends BaseBlockRender> getRenderer()
{
return new RenderBlockSkyCompass();
return RenderBlockSkyCompass.class;
}
@Override
@SideOnly( Side.CLIENT )
public IIcon getIcon( final int direction, final int metadata )
public IIcon getIcon( int direction, int metadata )
{
return Blocks.iron_block.getIcon( direction, metadata );
}
@Override
public void registerBlockIcons( final IIconRegister iconRegistry )
public void registerBlockIcons( IIconRegister iconRegistry )
{
// :P
}
@Override
public boolean isValidOrientation( final World w, final int x, final int y, final int z, final ForgeDirection forward, final ForgeDirection up )
public boolean isValidOrientation( World w, int x, int y, int z, ForgeDirection forward, ForgeDirection up )
{
final TileSkyCompass sc = this.getTileEntity( w, x, y, z );
TileSkyCompass sc = this.getTileEntity( w, x, y, z );
if( sc != null )
{
return false;
@@ -86,23 +86,23 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
return this.canPlaceAt( w, x, y, z, forward.getOpposite() );
}
private boolean canPlaceAt( final World w, final int x, final int y, final int z, final ForgeDirection dir )
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 void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block id )
public void onNeighborBlockChange( World w, int x, int y, int z, Block id )
{
final TileSkyCompass sc = this.getTileEntity( w, x, y, z );
final ForgeDirection up = sc.getForward();
TileSkyCompass sc = this.getTileEntity( w, x, y, z );
ForgeDirection up = sc.getForward();
if( !this.canPlaceAt( w, x, y, z, up.getOpposite() ) )
{
this.dropTorch( w, x, y, z );
}
}
private void dropTorch( final World w, final int x, final int y, final int 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 );
@@ -110,9 +110,9 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
}
@Override
public boolean canPlaceBlockAt( final World w, final int x, final int y, final int z )
public boolean canPlaceBlockAt( World w, int x, int y, int z )
{
for( final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
{
if( this.canPlaceAt( w, x, y, z, dir ) )
{
@@ -123,12 +123,12 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
}
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual )
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
{
final TileSkyCompass tile = this.getTileEntity( w, x, y, z );
TileSkyCompass tile = this.getTileEntity( w, x, y, z );
if( tile != null )
{
final ForgeDirection forward = tile.getForward();
ForgeDirection forward = tile.getForward();
double minX = 0;
double minY = 0;
@@ -185,7 +185,7 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
}
@Override
public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List out, final Entity e )
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e )
{
}
@@ -1,6 +1,6 @@
/*
* 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
* it under the terms of the GNU Lesser General Public License as published by
@@ -40,10 +40,9 @@ import net.minecraft.world.Explosion;
import net.minecraft.world.World;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderTinyTNT;
import appeng.client.texture.FullIcon;
import appeng.core.AppEng;
@@ -59,7 +58,7 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
public BlockTinyTNT()
{
super( Material.tnt );
super( BlockTinyTNT.class, Material.tnt );
this.setLightOpacity( 1 );
this.setBlockBounds( 0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f );
this.isFullSize = this.isOpaque = false;
@@ -67,14 +66,13 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
this.setHardness( 0F );
this.setFeature( EnumSet.of( AEFeature.TinyTNT ) );
EntityRegistry.registerModEntity( EntityTinyTNTPrimed.class, "EntityTinyTNTPrimed", EntityIds.get( EntityTinyTNTPrimed.class ), AppEng.instance(), 16, 4, true );
EntityRegistry.registerModEntity( EntityTinyTNTPrimed.class, "EntityTinyTNTPrimed", EntityIds.TINY_TNT, AppEng.instance, 16, 4, true );
}
@Override
@SideOnly( Side.CLIENT )
protected RenderTinyTNT getRenderer()
protected Class<? extends BaseBlockRender> getRenderer()
{
return new RenderTinyTNT();
return RenderTinyTNT.class;
}
@Override
@@ -85,34 +83,45 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
}
@Override
public IIcon getIcon( final int direction, final int metadata )
public IIcon getIcon( int direction, int metadata )
{
return new FullIcon( Blocks.tnt.getIcon( direction, metadata ) );
}
@Override
public boolean onBlockActivated( 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 )
{
if( player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.flint_and_steel )
{
this.startFuse( w, x, y, z, player );
w.setBlockToAir( x, y, z );
player.getCurrentEquippedItem().damageItem( 1, player );
return true;
}
return super.onBlockActivated( w, x, y, z, player, side, hitX, hitY, hitZ );
else
{
return super.onActivated( w, x, y, z, player, side, hitX, hitY, hitZ );
}
}
@Override
public void registerBlockIcons( final IIconRegister iconRegistry )
public void registerBlockIcons( IIconRegister iconRegistry )
{
// no images required.
}
public void startFuse( World w, int x, int y, int z, EntityLivingBase igniter )
{
if( !w.isRemote )
{
EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, x + 0.5F, y + 0.5F, z + 0.5F, igniter );
w.spawnEntityInWorld( primedTinyTNTEntity );
w.playSoundAtEntity( primedTinyTNTEntity, "game.tnt.primed", 1.0F, 1.0F );
}
}
@Override
public void onBlockAdded( final World w, final int x, final int y, final int z )
public void onBlockAdded( World w, int x, int y, int z )
{
super.onBlockAdded( w, x, y, z );
@@ -124,7 +133,7 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
}
@Override
public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block id )
public void onNeighborBlockChange( World w, int x, int y, int z, Block id )
{
if( w.isBlockIndirectlyGettingPowered( x, y, z ) )
{
@@ -134,22 +143,22 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
}
@Override
public void onBlockDestroyedByExplosion( final World w, final int x, final int y, final int z, final Explosion exp )
public void onBlockDestroyedByExplosion( World w, int x, int y, int z, Explosion exp )
{
if( !w.isRemote )
{
final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, x + 0.5F, y + 0.5F, z + 0.5F, exp.getExplosivePlacedBy() );
EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, x + 0.5F, y + 0.5F, z + 0.5F, exp.getExplosivePlacedBy() );
primedTinyTNTEntity.fuse = w.rand.nextInt( primedTinyTNTEntity.fuse / 4 ) + primedTinyTNTEntity.fuse / 8;
w.spawnEntityInWorld( primedTinyTNTEntity );
}
}
@Override
public void onEntityCollidedWithBlock( final World w, final int x, final int y, final int z, final Entity entity )
public void onEntityCollidedWithBlock( World w, int x, int y, int z, Entity entity )
{
if( entity instanceof EntityArrow && !w.isRemote )
{
final EntityArrow entityarrow = (EntityArrow) entity;
EntityArrow entityarrow = (EntityArrow) entity;
if( entityarrow.isBurning() )
{
@@ -160,30 +169,20 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
}
@Override
public boolean canDropFromExplosion( final Explosion exp )
public boolean canDropFromExplosion( Explosion exp )
{
return false;
}
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual )
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
{
return Collections.singletonList( AxisAlignedBB.getBoundingBox( 0.25, 0, 0.25, 0.75, 0.5, 0.75 ) );
}
@Override
public void addCollidingBlockToList( final World w, final int x, final int y, final int z, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e )
{
out.add( AxisAlignedBB.getBoundingBox( 0.25, 0, 0.25, 0.75, 0.5, 0.75 ) );
}
public void startFuse( final World w, final int x, final int y, final int z, final EntityLivingBase igniter )
{
if( !w.isRemote )
{
final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, x + 0.5F, y + 0.5F, z + 0.5F, igniter );
w.spawnEntityInWorld( primedTinyTNTEntity );
w.playSoundAtEntity( primedTinyTNTEntity, "game.tnt.primed", 1.0F, 1.0F );
}
}
}
@@ -29,7 +29,7 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.block.AEBaseTileBlock;
import appeng.block.AEBaseBlock;
import appeng.client.texture.ExtraBlockTextures;
import appeng.core.AEConfig;
import appeng.core.features.AEFeature;
@@ -39,22 +39,22 @@ import appeng.tile.misc.TileVibrationChamber;
import appeng.util.Platform;
public final class BlockVibrationChamber extends AEBaseTileBlock
public final class BlockVibrationChamber extends AEBaseBlock
{
public BlockVibrationChamber()
{
super( Material.iron );
super( BlockVibrationChamber.class, Material.iron );
this.setTileEntity( TileVibrationChamber.class );
this.setHardness( 4.2F );
this.setFeature( EnumSet.of( AEFeature.PowerGen ) );
}
@Override
public IIcon getIcon( final IBlockAccess w, final int x, final int y, final int z, final int s )
public IIcon getIcon( IBlockAccess w, int x, int y, int z, int s )
{
final IIcon ico = super.getIcon( w, x, y, z, s );
final TileVibrationChamber tvc = this.getTileEntity( w, x, y, z );
IIcon ico = super.getIcon( w, x, y, z, s );
TileVibrationChamber tvc = this.getTileEntity( w, x, y, z );
if( tvc != null && tvc.isOn && ico == this.getRendererInstance().getTexture( ForgeDirection.SOUTH ) )
{
@@ -65,7 +65,7 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
}
@Override
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ )
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
{
if( player.isSneaking() )
{
@@ -74,7 +74,7 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
if( Platform.isServer() )
{
final TileVibrationChamber tc = this.getTileEntity( w, x, y, z );
TileVibrationChamber tc = this.getTileEntity( w, x, y, z );
if( tc != null && !player.isSneaking() )
{
Platform.openGUI( player, tc, ForgeDirection.getOrientation( side ), GuiBridge.GUI_VIBRATION_CHAMBER );
@@ -86,36 +86,36 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
}
@Override
public void randomDisplayTick( final World w, final int x, final int y, final int z, final Random r )
public void randomDisplayTick( World w, int x, int y, int z, Random r )
{
if( !AEConfig.instance.enableEffects )
{
return;
}
final AEBaseTile tile = this.getTileEntity( w, x, y, z );
AEBaseTile tile = this.getTileEntity( w, x, y, z );
if( tile instanceof TileVibrationChamber )
{
final TileVibrationChamber tc = (TileVibrationChamber) tile;
TileVibrationChamber tc = (TileVibrationChamber) tile;
if( tc.isOn )
{
float f1 = x + 0.5F;
float f2 = y + 0.5F;
float f3 = z + 0.5F;
final ForgeDirection forward = tc.getForward();
final ForgeDirection up = tc.getUp();
ForgeDirection forward = tc.getForward();
ForgeDirection up = tc.getUp();
final int west_x = forward.offsetY * up.offsetZ - forward.offsetZ * up.offsetY;
final int west_y = forward.offsetZ * up.offsetX - forward.offsetX * up.offsetZ;
final int west_z = forward.offsetX * up.offsetY - forward.offsetY * up.offsetX;
int west_x = forward.offsetY * up.offsetZ - forward.offsetZ * up.offsetY;
int west_y = forward.offsetZ * up.offsetX - forward.offsetX * up.offsetZ;
int west_z = forward.offsetX * up.offsetY - forward.offsetY * up.offsetX;
f1 += forward.offsetX * 0.6;
f2 += forward.offsetY * 0.6;
f3 += forward.offsetZ * 0.6;
final float ox = r.nextFloat();
final float oy = r.nextFloat() * 0.2f;
float ox = r.nextFloat();
float oy = r.nextFloat() * 0.2f;
f1 += up.offsetX * ( -0.3 + oy );
f2 += up.offsetY * ( -0.3 + oy );
@@ -1,6 +1,6 @@
/*
* 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
* 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.SelectedPart;
import appeng.api.util.AEColor;
import appeng.block.AEBaseTileBlock;
import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.BusRenderHelper;
import appeng.client.render.blocks.RendererCableBus;
import appeng.client.texture.ExtraBlockTextures;
import appeng.core.AEConfig;
import appeng.core.Api;
import appeng.core.AppEng;
import appeng.core.CommonHelper;
import appeng.core.features.AECableBusFeatureHandler;
import appeng.core.features.AEFeature;
import appeng.helpers.AEGlassMaterial;
import appeng.helpers.Reflected;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IFMP;
import appeng.parts.ICableBusContainer;
@@ -77,50 +76,41 @@ import appeng.transformer.annotations.Integration.Method;
import appeng.util.Platform;
@Interface( iface = "powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection", iname = IntegrationType.MFR )
public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
@Interface( iface = "powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection", iname = "MFR" )
public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
{
private static final ICableBusContainer NULL_CABLE_BUS = new NullCableBusContainer();
private static Class<? extends TileEntity> noTesrTile;
private static Class<? extends TileEntity> tesrTile;
public static Class<? extends TileEntity> noTesrTile;
public static Class<? extends TileEntity> tesrTile;
/**
* Immibis MB Support.
*
* It will look for a field named ImmibisMicroblocks_TransformableBlockMarker or
* ImmibisMicroblocks_TransformableTileEntityMarker, modifiers, type, etc can be ignored.
*/
@Reflected
private static final boolean ImmibisMicroblocks_TransformableBlockMarker = true;
private int myColorMultiplier = 0xffffff;
boolean ImmibisMicroblocks_TransformableBlockMarker = true;
int myColorMultiplier = 0xffffff;
public BlockCableBus()
{
super( AEGlassMaterial.INSTANCE );
super( BlockCableBus.class, AEGlassMaterial.INSTANCE );
this.setLightOpacity( 0 );
this.isFullSize = this.isOpaque = false;
// this will actually be overwritten later through setupTile and the combined layers
this.setTileEntity( TileCableBus.class );
this.setFeature( EnumSet.of( AEFeature.Core ) );
}
@Override
public void randomDisplayTick( final World world, final int x, final int y, final int z, final Random r )
public void randomDisplayTick( World world, int x, int y, int z, Random r )
{
this.cb( world, x, y, z ).randomDisplayTick( world, x, y, z, r );
}
@Override
public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block meh )
public void onNeighborBlockChange( World w, int x, int y, int z, Block meh )
{
this.cb( w, x, y, z ).onNeighborChanged();
}
@Override
public Item getItemDropped( final int i, final Random r, final int k )
public Item getItemDropped( int i, Random r, int k )
{
return null;
}
@@ -136,13 +126,13 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
public int colorMultiplier( final IBlockAccess world, final int x, final int y, final int z )
public int colorMultiplier( IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_ )
{
return this.myColorMultiplier;
}
@Override
public int isProvidingWeakPower( final IBlockAccess w, final int x, final int y, final int z, final int side )
public int isProvidingWeakPower( IBlockAccess w, int x, int y, int z, int side )
{
return this.cb( w, x, y, z ).isProvidingWeakPower( ForgeDirection.getOrientation( side ).getOpposite() );
}
@@ -154,21 +144,21 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
public void onEntityCollidedWithBlock( final World w, final int x, final int y, final int z, final Entity e )
public void onEntityCollidedWithBlock( World w, int x, int y, int z, Entity e )
{
this.cb( w, x, y, z ).onEntityCollision( e );
}
@Override
public int isProvidingStrongPower( final IBlockAccess w, final int x, final int y, final int z, final int side )
public int isProvidingStrongPower( IBlockAccess w, int x, int y, int z, int side )
{
return this.cb( w, x, y, z ).isProvidingStrongPower( ForgeDirection.getOrientation( side ).getOpposite() );
}
@Override
public int getLightValue( final IBlockAccess world, final int x, final int y, final int z )
public int getLightValue( IBlockAccess world, int x, int y, int z )
{
final Block block = world.getBlock( x, y, z );
Block block = world.getBlock( x, y, z );
if( block != null && block != this )
{
return block.getLightValue( world, x, y, z );
@@ -181,30 +171,30 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
public boolean isLadder( final IBlockAccess world, final int x, final int y, final int z, final EntityLivingBase entity )
public boolean isLadder( IBlockAccess world, int x, int y, int z, EntityLivingBase entity )
{
return this.cb( world, x, y, z ).isLadder( entity );
}
@Override
public boolean isSideSolid( final IBlockAccess w, final int x, final int y, final int z, final ForgeDirection side )
public boolean isSideSolid( IBlockAccess w, int x, int y, int z, ForgeDirection side )
{
return this.cb( w, x, y, z ).isSolidOnSide( side );
}
@Override
public boolean isReplaceable( final IBlockAccess world, final int x, final int y, final int z )
public boolean isReplaceable( IBlockAccess world, int x, int y, int z )
{
return this.cb( world, x, y, z ).isEmpty();
}
@SuppressWarnings( "deprecation" )
@Override
public boolean removedByPlayer( final World world, final EntityPlayer player, final int x, final int y, final int z )
public boolean removedByPlayer( World world, EntityPlayer player, int x, int y, int z )
{
if( player.capabilities.isCreativeMode )
{
final AEBaseTile tile = this.getTileEntity( world, x, y, z );
AEBaseTile tile = this.getTileEntity( world, x, y, z );
if( tile != null )
{
tile.disableDrops();
@@ -215,7 +205,7 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
public boolean canConnectRedstone( final IBlockAccess w, final int x, final int y, final int z, final int side )
public boolean canConnectRedstone( IBlockAccess w, int x, int y, int z, int side )
{
switch( side )
{
@@ -235,7 +225,7 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
public boolean canRenderInPass( final int pass )
public boolean canRenderInPass( int pass )
{
BusRenderHelper.INSTANCE.setPass( pass );
@@ -248,10 +238,10 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
public ItemStack getPickBlock( final MovingObjectPosition target, final World world, final int x, final int y, final int z, final EntityPlayer player )
public ItemStack getPickBlock( MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player )
{
final Vec3 v3 = target.hitVec.addVector( -x, -y, -z );
final SelectedPart sp = this.cb( world, x, y, z ).selectPart( v3 );
Vec3 v3 = target.hitVec.addVector( -x, -y, -z );
SelectedPart sp = this.cb( world, x, y, z ).selectPart( v3 );
if( sp.part != null )
{
@@ -267,24 +257,24 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
@Override
@SideOnly( Side.CLIENT )
public boolean addHitEffects( final World world, final MovingObjectPosition target, final EffectRenderer effectRenderer )
public boolean addHitEffects( World world, MovingObjectPosition target, EffectRenderer effectRenderer )
{
final Object object = this.cb( world, target.blockX, target.blockY, target.blockZ );
Object object = this.cb( world, target.blockX, target.blockY, target.blockZ );
if( object instanceof IPartHost )
{
final IPartHost host = (IPartHost) object;
IPartHost host = (IPartHost) object;
for( final ForgeDirection side : ForgeDirection.values() )
for( ForgeDirection side : ForgeDirection.values() )
{
final IPart p = host.getPart( side );
final IIcon ico = this.getIcon( p );
IPart p = host.getPart( side );
IIcon ico = this.getIcon( p );
if( ico == null )
{
continue;
}
final byte b0 = (byte) ( Platform.getRandomInt() % 2 == 0 ? 1 : 0 );
byte b0 = (byte) ( Platform.getRandomInt() % 2 == 0 ? 1 : 0 );
for( int i1 = 0; i1 < b0; ++i1 )
{
@@ -292,14 +282,14 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
{
for( int k1 = 0; k1 < b0; ++k1 )
{
final double d0 = target.blockX + ( i1 + 0.5D ) / b0;
final double d1 = target.blockY + ( j1 + 0.5D ) / b0;
final double d2 = target.blockZ + ( k1 + 0.5D ) / b0;
double d0 = target.blockX + ( i1 + 0.5D ) / b0;
double d1 = target.blockY + ( j1 + 0.5D ) / b0;
double d2 = target.blockZ + ( k1 + 0.5D ) / b0;
final double dd0 = target.hitVec.xCoord;
final double dd1 = target.hitVec.yCoord;
final double dd2 = target.hitVec.zCoord;
final EntityDiggingFX fx = ( new EntityDiggingFX( world, dd0, dd1, dd2, d0 - target.blockX - 0.5D, d1 - target.blockY - 0.5D, d2 - target.blockZ - 0.5D, this, 0 ) ).applyColourMultiplier( target.blockX, target.blockY, target.blockZ );
double dd0 = target.hitVec.xCoord;
double dd1 = target.hitVec.yCoord;
double dd2 = target.hitVec.zCoord;
EntityDiggingFX fx = ( new EntityDiggingFX( world, dd0, dd1, dd2, d0 - target.blockX - 0.5D, d1 - target.blockY - 0.5D, d2 - target.blockZ - 0.5D, this, 0 ) ).applyColourMultiplier( target.blockX, target.blockY, target.blockZ );
fx.setParticleIcon( ico );
@@ -315,24 +305,24 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
@Override
@SideOnly( Side.CLIENT )
public boolean addDestroyEffects( final World world, final int x, final int y, final int z, final int meta, final EffectRenderer effectRenderer )
public boolean addDestroyEffects( World world, int x, int y, int z, int meta, EffectRenderer effectRenderer )
{
final Object object = this.cb( world, x, y, z );
Object object = this.cb( world, x, y, z );
if( object instanceof IPartHost )
{
final IPartHost host = (IPartHost) object;
IPartHost host = (IPartHost) object;
for( final ForgeDirection side : ForgeDirection.values() )
for( ForgeDirection side : ForgeDirection.values() )
{
final IPart p = host.getPart( side );
final IIcon ico = this.getIcon( p );
IPart p = host.getPart( side );
IIcon ico = this.getIcon( p );
if( ico == null )
{
continue;
}
final byte b0 = 3;
byte b0 = 3;
for( int i1 = 0; i1 < b0; ++i1 )
{
@@ -340,10 +330,10 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
{
for( int k1 = 0; k1 < b0; ++k1 )
{
final double d0 = x + ( i1 + 0.5D ) / b0;
final double d1 = y + ( j1 + 0.5D ) / b0;
final double d2 = z + ( k1 + 0.5D ) / b0;
final EntityDiggingFX fx = ( new EntityDiggingFX( world, d0, d1, d2, d0 - x - 0.5D, d1 - y - 0.5D, d2 - z - 0.5D, this, meta ) ).applyColourMultiplier( x, y, z );
double d0 = x + ( i1 + 0.5D ) / b0;
double d1 = y + ( j1 + 0.5D ) / b0;
double d2 = z + ( k1 + 0.5D ) / b0;
EntityDiggingFX fx = ( new EntityDiggingFX( world, d0, d1, d2, d0 - x - 0.5D, d1 - y - 0.5D, d2 - z - 0.5D, this, meta ) ).applyColourMultiplier( x, y, z );
fx.setParticleIcon( ico );
@@ -358,7 +348,7 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
public void onNeighborChange( final IBlockAccess w, final int x, final int y, final int z, final int tileX, final int tileY, final int tileZ )
public void onNeighborChange( IBlockAccess w, int x, int y, int z, int tileX, int tileY, int tileZ )
{
if( Platform.isServer() )
{
@@ -366,7 +356,7 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
}
private IIcon getIcon( final IPart p )
private IIcon getIcon( IPart p )
{
if( p == null )
{
@@ -375,18 +365,18 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
try
{
final IIcon ico = p.getBreakingTexture();
IIcon ico = p.getBreakingTexture();
if( ico != null )
{
return ico;
}
}
catch( final Throwable t )
catch( Throwable t )
{
// nothing.
}
final ItemStack is = p.getItemStack( PartItemStack.Network );
ItemStack is = p.getItemStack( PartItemStack.Network );
if( is == null || is.getItem() == null )
{
return null;
@@ -395,40 +385,39 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
return is.getItem().getIcon( is, 0 );
}
private ICableBusContainer cb( final IBlockAccess w, final int x, final int y, final int z )
private ICableBusContainer cb( IBlockAccess w, int x, int y, int z )
{
final TileEntity te = w.getTileEntity( x, y, z );
TileEntity te = w.getTileEntity( x, y, z );
ICableBusContainer out = null;
if( te instanceof TileCableBus )
{
out = ( (TileCableBus) te ).getCableBus();
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;
}
@Override
@SideOnly( Side.CLIENT )
protected RendererCableBus getRenderer()
protected Class<? extends BaseBlockRender> getRenderer()
{
return new RendererCableBus();
return RendererCableBus.class;
}
@Override
public IIcon getIcon( final IBlockAccess w, final int x, final int y, final int z, final int s )
public IIcon getIcon( IBlockAccess w, int x, int y, int z, int s )
{
return this.getIcon( s, 0 );
}
@Override
public IIcon getIcon( final int direction, final int metadata )
public IIcon getIcon( int direction, int metadata )
{
final IIcon i = super.getIcon( direction, metadata );
IIcon i = super.getIcon( direction, metadata );
if( i != null )
{
return i;
@@ -438,30 +427,30 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ )
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
{
return this.cb( w, x, y, z ).activate( player, Vec3.createVectorHelper( hitX, hitY, hitZ ) );
}
@Override
public void registerBlockIcons( final IIconRegister iconRegistry )
public void registerBlockIcons( IIconRegister iconRegistry )
{
}
@Override
public boolean recolourBlock( final World world, final int x, final int y, final int z, final ForgeDirection side, final int colour )
public boolean recolourBlock( World world, int x, int y, int z, ForgeDirection side, int colour )
{
return this.recolourBlock( world, x, y, z, side, colour, null );
}
public boolean recolourBlock( final World world, final int x, final int y, final int z, final ForgeDirection side, final int colour, final EntityPlayer who )
public boolean recolourBlock( World world, int x, int y, int z, ForgeDirection side, int colour, EntityPlayer who )
{
try
{
return this.cb( world, x, y, z ).recolourBlock( side, AEColor.values()[colour], who );
}
catch( final Throwable ignored )
catch( Throwable ignored )
{
}
return false;
@@ -469,15 +458,15 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
{
// do nothing
}
@Override
public <T extends AEBaseTile> T getTileEntity( final IBlockAccess w, final int x, final int y, final int z )
public <T extends TileEntity> T getTileEntity( IBlockAccess w, int x, int y, int z )
{
final TileEntity te = w.getTileEntity( x, y, z );
TileEntity te = w.getTileEntity( x, y, z );
if( noTesrTile.isInstance( te ) )
{
@@ -492,18 +481,9 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
return null;
}
@Override
protected void setFeature( final EnumSet<AEFeature> f )
{
final AECableBusFeatureHandler featureHandler = new AECableBusFeatureHandler( f, this, this.featureSubName );
this.setHandler( featureHandler );
}
public void setupTile()
{
noTesrTile = Api.INSTANCE.partHelper().getCombinedInstance( TileCableBus.class.getName() );
this.setTileEntity( noTesrTile );
GameRegistry.registerTileEntity( noTesrTile, "BlockCableBus" );
this.setTileEntity( noTesrTile = Api.INSTANCE.partHelper().getCombinedInstance( TileCableBus.class.getName() ) );
if( Platform.isClient() )
{
tesrTile = Api.INSTANCE.partHelper().getCombinedInstance( TileCableBusTESR.class.getName() );
@@ -513,24 +493,14 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
}
@Override
@Method( iname = IntegrationType.MFR )
public RedNetConnectionType getConnectionType( final World world, final int x, final int y, final int z, final ForgeDirection side )
@Method( iname = "MFR" )
public RedNetConnectionType getConnectionType( World world, int x, int y, int z, ForgeDirection side )
{
return this.cb( world, x, y, z ).canConnectRedstone( EnumSet.allOf( ForgeDirection.class ) ) ? RedNetConnectionType.CableSingle : RedNetConnectionType.None;
}
public void setRenderColor( final int color )
public void setRenderColor( int color )
{
this.myColorMultiplier = color;
}
public static Class<? extends TileEntity> getTesrTile()
{
return BlockCableBus.tesrTile;
}
public static Class<? extends TileEntity> getNoTesrTile()
{
return BlockCableBus.noTesrTile;
}
}
@@ -25,30 +25,28 @@ import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.block.AEBaseTileBlock;
import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockController;
import appeng.core.features.AEFeature;
import appeng.tile.networking.TileController;
public class BlockController extends AEBaseTileBlock
public class BlockController extends AEBaseBlock
{
public BlockController()
{
super( Material.iron );
super( BlockController.class, Material.iron );
this.setTileEntity( TileController.class );
this.setHardness( 6 );
this.setFeature( EnumSet.of( AEFeature.Channels ) );
}
@Override
public void onNeighborBlockChange( final World w, final int x, final int y, final int z, final Block neighborBlock )
public void onNeighborBlockChange( World w, int x, int y, int z, Block id_junk )
{
final TileController tc = this.getTileEntity( w, x, y, z );
TileController tc = this.getTileEntity( w, x, y, z );
if( tc != null )
{
tc.onNeighborChange( false );
@@ -56,9 +54,8 @@ public class BlockController extends AEBaseTileBlock
}
@Override
@SideOnly( Side.CLIENT )
protected RenderBlockController getRenderer()
protected Class<? extends BaseBlockRender> getRenderer()
{
return new RenderBlockController();
return RenderBlockController.class;
}
}

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