Compare commits

..

11 Commits

Author SHA1 Message Date
yueh f44cddf8d5 Splitted coremod into a container and loading plugin. 2017-07-23 15:37:39 +02:00
thatsIch e3bf52ff7b Merge pull request #2846 from suttonwilliamd/fix-LR-badge
Fixed "Latest Release" badge in readme.md
2017-07-13 22:55:56 +02:00
William 07913af4f8 Fixed "Latest Release" badge in readme.md
Spaces translate to %20 in URLs
2017-03-23 21:16:59 -04:00
yueh 1760113cd4 Fixes #2768: Incorrect return value when charging items via Tesla. (#2771) 2017-01-31 12:17:32 +01:00
yueh 12b05275f2 Fixes #2750: Added missing RF Integration Modules. (#2770)
* Fixes #2750: Added missing RF Integration Modules.

Readded the integration modules for both RF integrations.
These are necessary to correctly enable RF support as well as act as
fallback to disable it automatically on missing interfaces.

* Unittests and improved logging for integration modules.

Added a unittest to ensure an integration types instaniates an integration
module without throwing any exception.
Improved the logging should this ever happen at runtime again.
2017-01-31 12:17:03 +01:00
yueh c720584e49 Fixes #2729: Fix transformer regression introduced during FG downtime. (#2730)
Added a unittest to verify the necessary string returns match the actual
existing classes, in case something screws up the refactoring.
2016-12-31 18:25:16 +01:00
yueh ab89278274 Replaces old fluid handlers with the new capability based ones. (#2727)
* Changed ME Chest and P2P tunnels to use fluid capabilities.
* Renamed all occurrences of liquid to fluids.
2016-12-31 16:01:29 +01:00
yueh 7c5f777e41 Fixes #2713: Call super#onBlockActivated() for wrench interaction. (#2728) 2016-12-31 16:00:45 +01:00
yueh 8b0637d05d Fixes IDE not correctly cleaning up the list of staged files. 2016-12-31 15:21:25 +01:00
yueh 497f1c9ace Fixes #2714: Use a concurrent list to back NetworkList (#2715) 2016-12-29 15:51:17 +01:00
yueh 2ab0528015 Fixes #2724: Use capitalized oredict name for dyes, not uppercase. 2016-12-29 15:50:02 +01:00
1238 changed files with 11734 additions and 17557 deletions
+6 -11
View File
@@ -12,18 +12,15 @@ 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.
* If it is already possible with vanilla and AE2 itself, the suggestion will be considered invalid.
* Asking for a smaller version, more compact version, or more efficient version of something will also be considered invalid.
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]`, `[Bug]`, or a version.
* Restrict it to a single bug or feature, it makes managing them way easier for us.
* The following details are required. Also refer to the issue template when creating one.
* 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/))
* Never post an excerpt of what you consider important
* Always post the full log
* 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
@@ -36,12 +33,10 @@ Applied Energistics 2 crashing, have a suggestion, found a bug? Create an issue
* 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
4. Click `Submit New Issue`, and wait for feedback!
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.
Please note that we might close any issue not matching these requirements.
### Submitting Changes
* Submit an issue to the github project, assuming one does not already exist.
@@ -113,7 +108,7 @@ 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. Please report any case of maintaining the correct formatting.
We try to keep them up to date, but in case you find them not formatting it correctly, then please report it
### Whitespace
+20 -16
View File
@@ -9,6 +9,7 @@
* [Contacts](#contacts)
* [License](#license)
* [Downloads](#downloads)
* [Nightly Builds](#nightly-builds)
* [Installation](#installation)
* [Issues](#issues)
* [Building](#building)
@@ -30,13 +31,13 @@ A Mod about Matter, Energy and using them to conquer the world..
## License
* Applied Energistics 2 API
- (c) 2013 - 2017 AlgorithmX2 et al
- (c) 2013 - 2015 AlgorithmX2 et al
- [![License](https://img.shields.io/badge/License-MIT-red.svg?style=flat-square)](http://opensource.org/licenses/MIT)
* Applied Energistics 2
- (c) 2013 - 2017 AlgorithmX2 et al
- (c) 2013 - 2015 AlgorithmX2 et al
- [![License](https://img.shields.io/badge/License-LGPLv3-blue.svg?style=flat-square)](https://raw.githubusercontent.com/AppliedEnergistics/Applied-Energistics-2/rv2/LICENSE)
* Textures and Models
- (c) 2013 - 2017 AlgorithmX2 et al
- (c) 2013 - 2015 AlgorithmX2 et al
- [![License](https://img.shields.io/badge/License-CC%20BY--NC--SA%203.0-yellow.svg?style=flat-square)](https://creativecommons.org/licenses/by-nc-sa/3.0/)
* Text and Translations
- [![License](https://img.shields.io/badge/License-No%20Restriction-green.svg?style=flat-square)](https://creativecommons.org/publicdomain/zero/1.0/)
@@ -45,6 +46,14 @@ A Mod about Matter, Energy and using them to conquer the world..
Downloads can be found on [CurseForge](http://www.curse.com/mc-mods/minecraft/223794-applied-energistics-2) or on the [official website](http://ae-mod.info/Downloads/).
## Nightly Builds
[![Build status](https://ci.appveyor.com/api/projects/status/w0sg7upakn0vj5gc?svg=true)](https://ci.appveyor.com/project/shartte/applied-energistics-2/history)
[Download Latest Nightly Build](https://ci.appveyor.com/api/projects/shartte/applied-energistics-2/artifacts/ae2-rv4-nightly.zip?branch=master)
Nightly builds for the Minecraft 1.10.2 branch of AE2 (rv4-alpha) are available from [AppVeyor](https://ci.appveyor.com/project/shartte/applied-energistics-2/history). These builds are only for testing purposes and might lead to loss of data, and will contain significant bugs. Please see below on how you can report bugs you find during testing.
## Installation
You install this mod by putting it into the `minecraft/mods/` folder. It has no additional hard dependencies.
@@ -54,18 +63,15 @@ 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.
* If it is already possible with vanilla and AE2 itself, the suggestion will be considered invalid.
* Asking for a smaller version, more compact version, or more efficient version of something will also be considered invalid.
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]`, `[Bug]`, or a version.
* Restrict it to a single bug or feature, it makes managing them way easier for us.
* The following details are required. Also refer to the issue template when creating one.
* 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/))
* Never post an excerpt of what you consider important
* Always post the full log
* 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
@@ -78,12 +84,10 @@ Applied Energistics 2 crashing, have a suggestion, found a bug? Create an issue
* 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
4. Click `Submit New Issue`, and wait for feedback!
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.
Please note that we might close any issue not matching these requirements.
## Building
1. Clone this repository via
@@ -106,7 +110,7 @@ Please note that we might close any issue not matching these requirements.
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/.github/CONTRIBUTING.md) contain more detailed information about topics like the used code style and should also be considered.
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.
@@ -118,7 +122,7 @@ Here are a few things to keep in mind that will help get your PR approved.
- Does your feature simplify another feature of AE2? These changes will not be accepted.
- If your feature can be done by any popular mod, discuss with us first.
**Getting Started**
Getting Started
1. Fork this repository
2. Clone the fork via
@@ -138,7 +142,7 @@ If you are only doing single file pull requests, GitHub supports using a quick w
The API for Applied Energistics 2. It is open source to discuss changes, improve documentation, and provide better add-on support in general.
Universal builds obtained [Here](http://ae2.ae-mod.info/Downloads/) should work in a development environment.
Development and standard builds can be obtained [Here](http://ae2.ae-mod.info/Downloads/).
### Maven
+15 -2
View File
@@ -27,7 +27,7 @@ buildscript {
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
@@ -68,7 +68,7 @@ jar {
}
minecraft {
coreMod = "appeng.coremod.AppEngCore"
coreMod = "appeng.coremod.AppEngLoadingPlugin"
version = minecraft_version + "-" + forge_version
@@ -86,8 +86,21 @@ minecraft {
}
sourceSets {
api
// This source set will contain third party API code that we need to compile, but which is not shipped with the jar
thirdparty {
// Third Party APIs often need access to Minecraft classes (i.e. EnumFacing), so set this up here
compileClasspath += configurations.forgeGradleMc + configurations.forgeGradleMcDeps
}
main
}
dependencies {
compile sourceSets.thirdparty.output
}
processResources
+8 -27
View File
@@ -1,28 +1,24 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="13">
<profile kind="CodeFormatterProfile" name="AE2" version="13">
<profiles version="12">
<profile kind="CodeFormatterProfile" name="AE2" version="12">
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration" value="common_lines"/>
<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"/>
@@ -30,19 +26,17 @@
<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"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="80"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="false"/>
<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.comment.count_line_length_from_starting_position" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
@@ -58,16 +52,14 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
@@ -90,7 +82,6 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
@@ -102,16 +93,15 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.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_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"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_parameters" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="0"/>
<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"/>
@@ -122,10 +112,9 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
@@ -164,18 +153,15 @@
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_conditional_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines" value="2147483647"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="80"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
<setting id="org.eclipse.jdt.core.compiler.source" value="1.8"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="insert"/>
@@ -197,7 +183,6 @@
<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.wrap_before_assignment_operator" value="false"/>
<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"/>
@@ -209,10 +194,8 @@
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_arguments" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
@@ -273,7 +256,6 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
@@ -289,7 +271,6 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
+9 -10
View File
@@ -1,4 +1,4 @@
aeversion=rv5
aeversion=rv4
aechannel=alpha
aebuild=0
aegroup=appeng
@@ -7,20 +7,19 @@ aebasename=appliedenergistics2
#########################################################
# Versions #
#########################################################
minecraft_version=1.12
mcp_mappings=snapshot_20170704
forge_version=14.21.1.2412
minecraft_version=1.10.2
mcp_mappings=snapshot_20161111
forge_version=12.18.3.2185
#########################################################
# Installable #
#########################################################
hwyla_version=1.8.19-B33_1.12
waila_version=1.7.0-B3_1.9.4
#########################################################
# Provided APIs #
#########################################################
jei_version=4.7.1.69
tesla_version=1.0.61
ic2_version=2.8.7-ex112
rf_version=2.0.0.1
top_version=1.12-1.4.8-2
jei_version=3.13.6.391
tesla_version=1.10.2-1.2.1.50
ic2_version=2.6.99-ex110
top_version=1.10-1.3.3-41
+5 -24
View File
@@ -39,25 +39,10 @@ repositories {
url = "http://maven.ic2.player.to"
}
maven {
name = "CoFH Maven"
url = "http://maven.covers1624.net"
}
maven { // TheOneProbe
name 'tterrag maven'
url "http://maven.tterrag.com/"
}
maven { // McJtyLib
name 'mcjty'
url "http://maven.k-4u.nl/"
}
maven { // Hwyla
name 'tehnut'
url "http://tehnut.info/maven"
}
}
configurations {
@@ -66,20 +51,16 @@ configurations {
dependencies {
// installable runtime dependencies
mods "mcp.mobius.waila:Hwyla:${hwyla_version}"
mods "mcp.mobius.waila:Waila:${waila_version}"
mods "net.industrial-craft:industrialcraft-2:${ic2_version}:dev"
mods "mcjty.theoneprobe:TheOneProbe-${minecraft_version}:${top_version}"
// mods "com.github.mcjty:compatlayer:${compatlayer_version}"
mods "mcjty.theoneprobe:TheOneProbe:${top_version}"
// compile against provided APIs
compileOnly "mezz.jei:jei_${minecraft_version}:${jei_version}:api"
compileOnly "mcp.mobius.waila:Hwyla:${hwyla_version}"
compileOnly "net.darkhax.tesla:Tesla-${minecraft_version}:${tesla_version}"
compileOnly "mcp.mobius.waila:Waila:${waila_version}"
compileOnly "net.darkhax.tesla:Tesla:${tesla_version}"
compileOnly "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
compileOnly "mcjty.theoneprobe:TheOneProbe-1.12:${top_version}:api"
// deobfCompile "mcp.mobius.waila:Hwyla:${hwyla_version}"
deobfCompile "cofh:RedstoneFlux:${minecraft_version}-${rf_version}:universal"
compileOnly "mcjty.theoneprobe:TheOneProbe:${top_version}:api"
// at runtime, use the full JEI jar
runtime "mezz.jei:jei_${minecraft_version}:${jei_version}"
+6 -6
View File
@@ -20,15 +20,15 @@ task wrapper(type: Wrapper) {
gradleVersion = "2.14"
}
// HWYLA
task installHwyla(type: Copy, dependsOn: "deinstallHwyla") {
// WAILA
task installWaila(type: Copy, dependsOn: "deinstallWaila") {
from { configurations.mods }
include "**/*Hwyla*.jar"
include "**/*Waila*.jar"
into file(minecraft.runDir + "/mods")
}
task deinstallHwyla(type: Delete) {
delete fileTree(dir: minecraft.runDir + "/mods", include: "*Hwyla*.jar")
task deinstallWaila(type: Delete) {
delete fileTree(dir: minecraft.runDir + "/mods", include: "*Waila*.jar")
}
// IC2
@@ -43,7 +43,7 @@ task deinstallIC2(type: Delete) {
}
// TOP
task installTop(type: Copy, dependsOn: ["deinstallTop"]) {
task installTop(type: Copy, dependsOn: "deinstallTop") {
from { configurations.mods }
include "**/*TheOneProbe*.jar"
into file(minecraft.runDir + "/mods")
+1 -1
View File
@@ -1,4 +1,4 @@
#Tue Jul 04 22:38:49 CEST 2017
#Fri Sep 16 14:56:32 CEST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
@@ -54,7 +54,7 @@ public class BakingPipeline<F, T> implements BakingPipelineElement<F, T>
@Override
public List pipe( List things, IBakedModel parent, IBlockState state, EnumFacing side, long rand )
{
for( BakingPipelineElement pipe : this.pipeline )
for( BakingPipelineElement pipe : pipeline )
{
things = pipe.pipe( things, parent, state, side, rand );
}
@@ -29,7 +29,6 @@ public enum TunnelType
ME, // Network Tunnel
IC2_POWER, // EU Tunnel
RF_POWER, // RF Tunnel
FE_POWER, // Forge Energy tunnel
REDSTONE, // Redstone Tunnel
FLUID, // Fluid Tunnel
ITEM, // Item Tunnel
@@ -111,6 +111,8 @@ public interface IMaterials
IItemDefinition matterBall();
IItemDefinition ironNugget();
IItemDefinition certusQuartzCrystal();
IItemDefinition certusQuartzCrystalCharged();
@@ -80,9 +80,7 @@ public interface IParts
IItemDefinition p2PTunnelEU();
IItemDefinition p2PTunnelRF();
IItemDefinition p2PTunnelFE();
// IItemDefinition p2PTunnelRF();
IItemDefinition p2PTunnelLight();
@@ -48,7 +48,7 @@ public interface IGrinderRegistry
/**
* Add a new recipe with a single input and output and how many turns it requires.
*
*
* Will ignore duplicate recipes with the same input item.
*
* @param in The {@link ItemStack} to grind.
@@ -59,7 +59,7 @@ public interface IGrinderRegistry
/**
* Add a new recipe with an input, output and a single optional output.
*
*
* Will ignore duplicate recipes with the same input item.
*
* @param in The {@link ItemStack} to grind.
@@ -72,7 +72,7 @@ public interface IGrinderRegistry
/**
* add a new recipe with optional outputs, duplicates will not be added.
*
*
* Will ignore duplicate recipes with the same input item.
*
* @param in The {@link ItemStack} to grind.
@@ -82,13 +82,13 @@ public interface IGrinderRegistry
* @param optional2 The second optional {@link ItemStack} to output of a certain chance.
* @param chance2 chance to get the second optional output within 0.0 - 1.0
* @param turns Amount of turns to turn the input into the output, with turns > 0.
*
*
*/
void addRecipe( @Nonnull ItemStack in, @Nonnull ItemStack out, @Nonnull ItemStack optional, float chance, @Nonnull ItemStack optional2, float chance2, int turns );
/**
* Remove the specific from the recipe list.
*
*
* @param recipe The recipe to be removed.
* @return true, if it was removed
*/
@@ -106,11 +106,11 @@ public interface IGrinderRegistry
/**
* Allows do add a custom ratio from an ore to dust when being grinded.
*
*
* The default ratio is 1 ore to 2 dusts.
*
*
* These have to be added before any recipe is registered. Otherwise it will use the default value.
*
*
* @param oredictName The name of the ore;
* @param ratio The amount, must be > 0;
*/
@@ -118,9 +118,9 @@ public interface IGrinderRegistry
/**
* Remove a custom ratio for a specific ore name.
*
*
* Will use the default of 2 value afterwards.
*
*
* @param oredictName The name of the ore;
*/
boolean removeDustRatio( @Nonnull String oredictName );
@@ -24,7 +24,6 @@
package appeng.api.features;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.minecraft.item.ItemStack;
@@ -45,8 +44,7 @@ public interface IP2PTunnelRegistry
* @param trigger - the item which triggers attunement. Nullable, but then ignored
* @param type - the type of tunnel. Nullable, but then ignored
*/
void addNewAttunement( @Nonnull ItemStack trigger, @Nullable TunnelType type );
void addNewAttunement( @Nonnull String ModId, @Nullable TunnelType type );
void addNewAttunement( @Nullable ItemStack trigger, @Nullable TunnelType type );
/**
* returns null if no attunement can be found.
@@ -55,6 +53,6 @@ public interface IP2PTunnelRegistry
*
* @return null if no attunement can be found or attunement
*/
@Nonnull
@Nullable
TunnelType getTunnelTypeByItem( ItemStack trigger );
}
@@ -24,7 +24,7 @@
package appeng.api.implementations.guiobjects;
import net.minecraftforge.items.IItemHandler;
import net.minecraft.inventory.IInventory;
import appeng.api.networking.IGridHost;
@@ -32,9 +32,8 @@ import appeng.api.networking.IGridHost;
/**
* Obtained via {@link IGuiItem} getGuiObject
*/
public interface INetworkTool extends IGuiItemObject
public interface INetworkTool extends IInventory, IGuiItemObject
{
IGridHost getGridHost(); // null for most purposes.
IItemHandler getInventory();
}
@@ -23,7 +23,8 @@
package appeng.api.implementations.tiles;
import net.minecraftforge.items.IItemHandler;
import net.minecraft.inventory.IInventory;
public interface ISegmentedInventory
@@ -37,5 +38,5 @@ public interface ISegmentedInventory
*
* @return inventory with inventory name
*/
IItemHandler getInventoryByName( String name );
IInventory getInventoryByName( String name );
}
@@ -23,7 +23,8 @@
package appeng.api.implementations.tiles;
import net.minecraftforge.items.IItemHandler;
import net.minecraft.inventory.IInventory;
public interface IViewCellStorage
@@ -34,5 +35,5 @@ public interface IViewCellStorage
*
* @return inventory with at least 5 slot
*/
IItemHandler getViewCellStorage();
IInventory getViewCellStorage();
}
@@ -29,16 +29,16 @@ import appeng.api.storage.data.IAEStack;
/**
* DO NOT IMPLEMENT.
*
*
* Will be injected when adding an {@link ICraftingWatcherHost} to a grid.
*/
public interface ICraftingWatcher
{
/**
* Add a specific {@link IAEStack} to watch.
*
*
* Supports multiple values, duplicate ones will not be added.
*
*
* @param stack
* @return true, if successfully added.
*/
@@ -46,7 +46,7 @@ public interface ICraftingWatcher
/**
* Remove a specific {@link IAEStack} from the watcher.
*
*
* @param stack
* @return true, if successfully removed.
*/
@@ -26,16 +26,16 @@ package appeng.api.networking.energy;
/**
* DO NOT IMPLEMENT.
*
*
* Will be injected when adding an {@link IEnergyWatcherHost} to a grid.
*/
public interface IEnergyWatcher
{
/**
* Add a specific threshold to watch.
*
*
* Supports multiple values, duplicate ones will not be added.
*
*
* @param amount
* @return true, if successfully added.
*/
@@ -43,7 +43,7 @@ public interface IEnergyWatcher
/**
* Remove a specific threshold from the watcher.
*
*
* @param amount
* @return true, if successfully removed.
*/
@@ -29,16 +29,16 @@ import appeng.api.storage.data.IAEStack;
/**
* DO NOT IMPLEMENT.
*
*
* Will be injected when adding an {@link IStackWatcherHost} to a grid.
*/
public interface IStackWatcher
{
/**
* Add a specific {@link IAEStack} to watch.
*
*
* Supports multiple values, duplicate ones will not be added.
*
*
* @param stack
* @return true, if successfully added.
*/
@@ -46,7 +46,7 @@ public interface IStackWatcher
/**
* Remove a specific {@link IAEStack} from the watcher.
*
*
* @param stack
* @return true, if successfully removed.
*/
@@ -29,5 +29,5 @@ public enum BusSupport
CABLE,
DENSE_CABLE
}
@@ -24,6 +24,8 @@
package appeng.api.parts;
import javax.annotation.Nullable;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.item.Item;
@@ -69,6 +71,7 @@ public interface IFacadePart
/**
* The item that this facade masquerades as.
*/
@Nullable
ItemStack getTextureItem();
/**
+1 -2
View File
@@ -42,7 +42,6 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.fml.relauncher.Side;
@@ -130,7 +129,7 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
/**
* a block around the bus's host has been changed.
*/
void onNeighborChanged( IBlockAccess w, BlockPos pos, BlockPos neighbor );
void onNeighborChanged();
/**
* @return output redstone on facing side
@@ -41,9 +41,9 @@ public interface IPartModel
/**
* A solid {@link IPartModel} indicates that the rendering requires a cable connection, which will also result in
* creating an intersection for the cable.
*
*
* This should be true for pretty much all parts.
*
*
* @return true for a solid part.
*/
default boolean requireCableConnection()
@@ -53,7 +53,7 @@ public interface IPartModel
/**
* A collection of {@link ResourceLocation} used as models for a part.
*
*
* @return a collection of models, never null.
*/
@Nonnull
@@ -24,8 +24,8 @@
package appeng.api.storage;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
import appeng.api.config.FuzzyMode;
import appeng.api.storage.data.IAEItemStack;
@@ -52,12 +52,12 @@ public interface ICellInventory extends IMEInventory<IAEItemStack>
/**
* @return access configured list
*/
IItemHandler getConfigInventory();
IInventory getConfigInventory();
/**
* @return access installed upgrades.
*/
IItemHandler getUpgradesInventory();
IInventory getUpgradesInventory();
/**
* @return How many bytes are used for each type?
@@ -24,8 +24,8 @@
package appeng.api.storage;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
import appeng.api.config.FuzzyMode;
@@ -48,7 +48,7 @@ public interface ICellWorkbenchItem
*
* onInventoryChange will be called when saving is needed.
*/
IItemHandler getUpgradesInventory( ItemStack is );
IInventory getUpgradesInventory( ItemStack is );
/**
* Used to extract, or mirror the contents of the work bench onto the cell.
@@ -57,7 +57,7 @@ public interface ICellWorkbenchItem
*
* onInventoryChange will be called when saving is needed.
*/
IItemHandler getConfigInventory( ItemStack is );
IInventory getConfigInventory( ItemStack is );
/**
* @return the current fuzzy status.
@@ -52,7 +52,7 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
private final IMEInventoryHandler<StackType> internalHandler;
private final IItemList<StackType> cachedList;
private final HashMap<IMEMonitorHandlerReceiver<StackType>, Object> listeners = new HashMap<>();
private final HashMap<IMEMonitorHandlerReceiver<StackType>, Object> listeners = new HashMap<IMEMonitorHandlerReceiver<StackType>, Object>();
protected boolean hasChanged = true;
@@ -203,15 +203,4 @@ public interface IAEStack<StackType extends IAEStack>
* @return ITEM or FLUID
*/
StorageChannel getChannel();
/**
* @return true if it should show the crafting label.
*/
boolean getShowCraftingLabel();
/**
* Used internally to show that it should show a Crafting label instead of a "1"
*/
void setShowCraftingLabel( boolean showCraftingLabel );
}
@@ -47,15 +47,15 @@ public enum AECableType
SMART,
/**
* Smart Dense Cable, represents a tier 2 block that can carry 32 channels.
* Dense Cable, represents a tier 2 block that can carry 32 channels.
*/
DENSE_SMART;
DENSE;
public static final AECableType[] VALIDCABLES = {
GLASS,
COVERED,
SMART,
DENSE_SMART
DENSE
};
}
+5 -5
View File
@@ -146,14 +146,14 @@ public enum AEColor
case 0:
return -1;
case TINTINDEX_DARK:
return this.blackVariant;
return blackVariant;
case TINTINDEX_MEDIUM:
return this.mediumVariant;
return mediumVariant;
case TINTINDEX_BRIGHT:
return this.whiteVariant;
return whiteVariant;
case TINTINDEX_MEDIUM_BRIGHT:
final int light = this.whiteVariant;
final int dark = this.mediumVariant;
final int light = whiteVariant;
final int dark = mediumVariant;
return ( ( ( ( ( light >> 16 ) & 0xff ) + ( ( dark >> 16 ) & 0xff ) ) / 2 ) << 16 ) | ( ( ( ( ( light >> 8 ) & 0xff ) + ( ( dark >> 8 ) & 0xff ) ) / 2 ) << 8 ) | ( ( ( ( light ) & 0xff ) + ( ( dark ) & 0xff ) ) / 2 );
default:
return -1;
+22 -26
View File
@@ -31,7 +31,6 @@ import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -94,40 +93,43 @@ public abstract class AEBaseBlock extends Block
this.fullBlock = this.isFullSize();
}
@Override
public final boolean isVisuallyOpaque()
{
return this.isOpaque() && this.isFullSize();
}
@Override
protected BlockStateContainer createBlockState()
{
return new BlockStateContainer( this, this.getAEStates() );
}
@SuppressWarnings( "deprecation" )
@Override
public final boolean isNormalCube( IBlockState state )
{
return this.isFullSize() && this.isOpaque();
}
@SuppressWarnings( "deprecation" )
@Override
public AxisAlignedBB getBoundingBox( IBlockState state, IBlockAccess source, BlockPos pos )
{
return this.boundingBox;
return boundingBox;
}
@SuppressWarnings( "deprecation" )
@Override
public void addCollisionBoxToList( final IBlockState state, final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, @Nullable final Entity e, boolean p_185477_7_ )
public void addCollisionBoxToList( final IBlockState state, final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
{
final ICustomCollision collisionHandler = this.getCustomCollision( w, pos );
if( collisionHandler != null && bb != null )
{
final List<AxisAlignedBB> tmp = new ArrayList<>();
final List<AxisAlignedBB> tmp = new ArrayList<AxisAlignedBB>();
collisionHandler.addCollidingBlockToList( w, pos, bb, tmp, e );
for( final AxisAlignedBB b : tmp )
{
final AxisAlignedBB offset = b.offset( pos.getX(), pos.getY(), pos.getZ() );
if( bb.intersects( offset ) )
if( bb.intersectsWith( offset ) )
{
out.add( offset );
}
@@ -135,11 +137,10 @@ public abstract class AEBaseBlock extends Block
}
else
{
super.addCollisionBoxToList( state, w, pos, bb, out, e, p_185477_7_ );
super.addCollisionBoxToList( state, w, pos, bb, out, e );
}
}
@SuppressWarnings( "deprecation" )
@Override
@SideOnly( Side.CLIENT )
public AxisAlignedBB getSelectedBoundingBox( IBlockState state, final World w, final BlockPos pos )
@@ -150,10 +151,10 @@ public abstract class AEBaseBlock extends Block
{
if( Platform.isClient() )
{
final EntityPlayer player = Minecraft.getMinecraft().player;
final EntityPlayer player = Minecraft.getMinecraft().thePlayer;
final LookDirection ld = Platform.getPlayerRay( player, Platform.getEyeOffset( player ) );
final Iterable<AxisAlignedBB> bbs = collisionHandler.getSelectedBoundingBoxesFromPool( w, pos, Minecraft.getMinecraft().player, true );
final Iterable<AxisAlignedBB> bbs = collisionHandler.getSelectedBoundingBoxesFromPool( w, pos, Minecraft.getMinecraft().thePlayer, true );
AxisAlignedBB br = null;
double lastDist = 0;
@@ -168,9 +169,9 @@ public abstract class AEBaseBlock extends Block
if( r != null )
{
final double xLen = ( ld.getA().x - r.hitVec.x );
final double yLen = ( ld.getA().y - r.hitVec.y );
final double zLen = ( ld.getA().z - r.hitVec.z );
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;
@@ -226,14 +227,12 @@ public abstract class AEBaseBlock extends Block
return super.getSelectedBoundingBox( state, w, pos );
}
@SuppressWarnings( "deprecation" )
@Override
public final boolean isOpaqueCube( IBlockState state )
{
return this.isOpaque();
}
@SuppressWarnings( "deprecation" )
@Override
public RayTraceResult collisionRayTrace( final IBlockState state, final World w, final BlockPos pos, final Vec3d a, final Vec3d b )
{
@@ -256,9 +255,9 @@ public abstract class AEBaseBlock extends Block
if( r != null )
{
final double xLen = ( a.x - r.hitVec.x );
final double yLen = ( a.y - r.hitVec.y );
final double zLen = ( a.z - r.hitVec.z );
final double xLen = ( a.xCoord - r.hitVec.xCoord );
final double yLen = ( a.yCoord - r.hitVec.yCoord );
final double zLen = ( a.zCoord - r.hitVec.zCoord );
final double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
if( br == null || lastDist > thisDist )
@@ -281,14 +280,12 @@ public abstract class AEBaseBlock extends Block
return super.collisionRayTrace( state, w, pos, a, b );
}
@SuppressWarnings( "deprecation" )
@Override
public boolean hasComparatorInputOverride( IBlockState state )
{
return this.isInventory();
}
@SuppressWarnings( "deprecation" )
@Override
public int getComparatorInputOverride( IBlockState state, final World worldIn, final BlockPos pos )
{
@@ -341,9 +338,8 @@ public abstract class AEBaseBlock extends Block
return new EnumFacing[0];
}
@SideOnly( Side.CLIENT )
@Override
public void addInformation( final ItemStack is, final World world, final List<String> lines, final ITooltipFlag advancedItemTooltips )
public void addInformation( final ItemStack is, final EntityPlayer player, final List<String> lines, final boolean advancedItemTooltips )
{
}
@@ -421,8 +417,8 @@ public abstract class AEBaseBlock extends Block
@Override
public String toString()
{
String regName = this.getRegistryName() != null ? this.getRegistryName().getResourcePath() : "unregistered";
return this.getClass().getSimpleName() + "[" + regName + "]";
String regName = getRegistryName() != null ? getRegistryName().getResourcePath() : "unregistered";
return getClass().getSimpleName() + "[" + regName + "]";
}
protected String getUnlocalizedName( final ItemStack is )
@@ -23,7 +23,6 @@ import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
@@ -68,15 +67,15 @@ public class AEBaseItemBlock extends ItemBlock
@Override
@SideOnly( Side.CLIENT )
@SuppressWarnings( "unchecked" )
public final void addInformation( final ItemStack itemStack, final World world, final List<String> toolTip, final ITooltipFlag advancedTooltips )
public final void addInformation( final ItemStack itemStack, final EntityPlayer player, final List toolTip, final boolean advancedTooltips )
{
this.addCheckedInformation( itemStack, world, toolTip, advancedTooltips );
this.addCheckedInformation( itemStack, player, toolTip, advancedTooltips );
}
@SideOnly( Side.CLIENT )
public void addCheckedInformation( final ItemStack itemStack, final World world, final List<String> toolTip, final ITooltipFlag advancedTooltips )
public void addCheckedInformation( final ItemStack itemStack, final EntityPlayer player, final List<String> toolTip, final boolean advancedToolTips )
{
this.blockType.addInformation( itemStack, world, toolTip, advancedTooltips );
this.blockType.addInformation( itemStack, player, toolTip, advancedToolTips );
}
@Override
@@ -127,7 +126,7 @@ public class AEBaseItemBlock extends ItemBlock
{
up = EnumFacing.UP;
final byte rotation = (byte) ( MathHelper.floor( ( player.rotationYaw * 4F ) / 360F + 2.5D ) & 3 );
final byte rotation = (byte) ( MathHelper.floor_double( ( player.rotationYaw * 4F ) / 360F + 2.5D ) & 3 );
switch( rotation )
{
@@ -23,10 +23,9 @@ import java.text.MessageFormat;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -49,9 +48,9 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
@Override
@SideOnly( Side.CLIENT )
public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
public void addCheckedInformation( final ItemStack itemStack, final EntityPlayer player, final List<String> toolTip, final boolean advancedTooltips )
{
final NBTTagCompound tag = stack.getTagCompound();
final NBTTagCompound tag = itemStack.getTagCompound();
double internalCurrentPower = 0;
final double internalMaxPower = this.getMaxEnergyCapacity();
@@ -62,25 +61,24 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
final double percent = internalCurrentPower / internalMaxPower;
lines.add( GuiText.StoredEnergy.getLocal() + ':' + MessageFormat.format( " {0,number,#} ", internalCurrentPower ) + Platform
.gui_localize( PowerUnits.AE.unlocalizedName ) + " - " + MessageFormat.format( " {0,number,#.##%} ", percent ) );
toolTip.add( GuiText.StoredEnergy.getLocal() + ':' + MessageFormat.format( " {0,number,#} ", internalCurrentPower ) + Platform.gui_localize( PowerUnits.AE.unlocalizedName ) + " - " + MessageFormat.format( " {0,number,#.##%} ", percent ) );
}
private double getMaxEnergyCapacity()
{
final Block blockID = Block.getBlockFromItem( this );
final IBlockDefinition energyCell = Api.INSTANCE.definitions().blocks().energyCell();
return energyCell.maybeBlock().map( block ->
{
if( blockID == block )
{
return 200000;
}
else
{
return 8 * 200000;
}
} ).orElse( 0 );
return energyCell.maybeBlock().map( block -> {
if( blockID == block )
{
return 200000;
}
else
{
return 8 * 200000;
}
}
).orElse( 0 );
}
@Override
@@ -43,8 +43,8 @@ public abstract class AEBaseStairBlock extends BlockStairs
@Override
public String toString()
{
String regName = this.getRegistryName() != null ? this.getRegistryName().getResourcePath() : "unregistered";
return this.getClass().getSimpleName() + "[" + regName + "]";
String regName = getRegistryName() != null ? getRegistryName().getResourcePath() : "unregistered";
return getClass().getSimpleName() + "[" + regName + "]";
}
}
+20 -28
View File
@@ -34,6 +34,8 @@ import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
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.EnumDyeColor;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -46,7 +48,6 @@ import net.minecraft.world.World;
import net.minecraftforge.common.property.ExtendedBlockState;
import net.minecraftforge.common.property.IExtendedBlockState;
import net.minecraftforge.common.property.IUnlistedProperty;
import net.minecraftforge.items.ItemHandlerHelper;
import appeng.api.implementations.items.IMemoryCard;
import appeng.api.implementations.items.MemoryCardMessages;
@@ -55,7 +56,6 @@ import appeng.api.util.AEColor;
import appeng.api.util.IOrientable;
import appeng.block.networking.BlockCableBus;
import appeng.helpers.ICustomCollision;
import appeng.tile.AEBaseInvTile;
import appeng.tile.AEBaseTile;
import appeng.tile.networking.TileCableBus;
import appeng.tile.storage.TileSkyChest;
@@ -86,7 +86,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
return state;
}
AEBaseTile tile = this.getTileEntity( world, pos );
AEBaseTile tile = getTileEntity( world, pos );
if( tile == null )
{
return state; // No info available
@@ -99,7 +99,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
@Override
protected BlockStateContainer createBlockState()
{
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] {
return new ExtendedBlockState( this, getAEStates(), new IUnlistedProperty[] {
FORWARD,
UP
} );
@@ -111,17 +111,16 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
return 0;
}
// TODO : Was this change needed?
public void setTileEntity( final Class<? extends AEBaseTile> c )
protected void setTileEntity( final Class<? extends AEBaseTile> c )
{
this.tileEntityType = c;
this.setInventory( AEBaseInvTile.class.isAssignableFrom( c ) );
this.setInventory( IInventory.class.isAssignableFrom( c ) );
}
@Override
public boolean hasTileEntity( IBlockState state )
{
return this.hasBlockTileEntity();
return hasBlockTileEntity();
}
private boolean hasBlockTileEntity()
@@ -185,7 +184,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
final AEBaseTile te = this.getTileEntity( w, pos );
if( te != null )
{
final ArrayList<ItemStack> drops = new ArrayList<>();
final ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
if( te.dropItems() )
{
te.getDrops( w, pos, drops );
@@ -241,13 +240,9 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
public int getComparatorInputOverride( IBlockState state, final World w, final BlockPos pos )
{
final TileEntity te = this.getTileEntity( w, pos );
if( te instanceof AEBaseInvTile )
if( te instanceof IInventory )
{
AEBaseInvTile invTile = (AEBaseInvTile) te;
if( invTile.getInternalInventory().getSlots() > 0 )
{
return ItemHandlerHelper.calcRedstoneFromInventory( invTile.getInternalInventory() );
}
return Container.calcRedstoneFromInventory( (IInventory) te );
}
return 0;
}
@@ -274,16 +269,13 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
}
@Override
public boolean onBlockActivated( World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ )
public boolean onBlockActivated( final World w, final BlockPos pos, final IBlockState state, final EntityPlayer player, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
{
ItemStack heldItem;
if( player != null && !player.getHeldItem( hand ).isEmpty() )
if( player != null && heldItem != null )
{
heldItem = player.getHeldItem( hand );
if( Platform.isWrench( player, heldItem, pos ) && player.isSneaking() )
{
final IBlockState blockState = world.getBlockState( pos );
final IBlockState blockState = w.getBlockState( pos );
final Block block = blockState.getBlock();
if( block == null )
@@ -291,7 +283,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
return false;
}
final AEBaseTile tile = this.getTileEntity( world, pos );
final AEBaseTile tile = this.getTileEntity( w, pos );
if( tile == null )
{
@@ -303,7 +295,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
return false;
}
final ItemStack[] itemDropCandidates = Platform.getBlockDrops( world, pos );
final ItemStack[] itemDropCandidates = Platform.getBlockDrops( w, pos );
final ItemStack op = new ItemStack( this );
for( final ItemStack ol : itemDropCandidates )
@@ -318,11 +310,11 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
}
}
if( block.removedByPlayer( blockState, world, pos, player, false ) )
if( block.removedByPlayer( blockState, w, pos, player, false ) )
{
final List<ItemStack> itemsToDrop = Lists.newArrayList( itemDropCandidates );
Platform.spawnDrops( world, pos, itemsToDrop );
world.setBlockToAir( pos );
Platform.spawnDrops( w, pos, itemsToDrop );
w.setBlockToAir( pos );
}
return false;
@@ -331,7 +323,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
if( heldItem.getItem() instanceof IMemoryCard && !( this instanceof BlockCableBus ) )
{
final IMemoryCard memoryCard = (IMemoryCard) heldItem.getItem();
final AEBaseTile tileEntity = this.getTileEntity( world, pos );
final AEBaseTile tileEntity = this.getTileEntity( w, pos );
if( tileEntity == null )
{
@@ -369,7 +361,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
}
}
return this.onActivated( world, pos, player, hand, player.getHeldItem( hand ), facing, hitX, hitY, hitZ );
return this.onActivated( w, pos, player, hand, heldItem, side, hitX, hitY, hitZ );
}
@Override
@@ -36,7 +36,7 @@ public class UnlistedDirection implements IUnlistedProperty<EnumFacing>
@Override
public String getName()
{
return this.name;
return name;
}
@Override
@@ -19,12 +19,14 @@
package appeng.block.crafting;
import java.util.List;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.common.property.ExtendedBlockState;
@@ -46,12 +48,13 @@ public class BlockCraftingMonitor extends BlockCraftingUnit
public BlockCraftingMonitor()
{
super( CraftingUnitType.MONITOR );
this.setTileEntity( TileCraftingMonitorTile.class );
}
@Override
protected BlockStateContainer createBlockState()
{
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] {
return new ExtendedBlockState( this, getAEStates(), new IUnlistedProperty[] {
STATE,
COLOR,
FORWARD,
@@ -66,7 +69,7 @@ public class BlockCraftingMonitor extends BlockCraftingUnit
EnumFacing forward = EnumFacing.NORTH;
EnumFacing up = EnumFacing.UP;
TileCraftingMonitorTile te = this.getTileEntity( world, pos );
TileCraftingMonitorTile te = getTileEntity( world, pos );
if( te != null )
{
color = te.getColor();
@@ -82,7 +85,7 @@ public class BlockCraftingMonitor extends BlockCraftingUnit
@Override
@SideOnly( Side.CLIENT )
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
public void getSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
itemStacks.add( new ItemStack( this, 1, 0 ) );
}
@@ -19,12 +19,16 @@
package appeng.block.crafting;
import appeng.tile.crafting.TileCraftingStorageTile;
public class BlockCraftingStorage extends BlockCraftingUnit
{
public BlockCraftingStorage( final CraftingUnitType type )
{
super( type );
this.setTileEntity( TileCraftingStorageTile.class );
}
}
@@ -21,6 +21,8 @@ package appeng.block.crafting;
import java.util.EnumSet;
import javax.annotation.Nullable;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
@@ -28,6 +30,7 @@ import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
@@ -60,6 +63,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock
super( Material.IRON );
this.type = type;
this.setTileEntity( TileCraftingTile.class );
}
@Override
@@ -76,7 +80,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock
for( EnumFacing facing : EnumFacing.values() )
{
if( this.isConnected( world, pos, facing ) )
if( isConnected( world, pos, facing ) )
{
connections.add( facing );
}
@@ -96,7 +100,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock
@Override
protected BlockStateContainer createBlockState()
{
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] { STATE } );
return new ExtendedBlockState( this, getAEStates(), new IUnlistedProperty[] { STATE } );
}
@Override
@@ -114,7 +118,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock
}
@Override
public void neighborChanged( final IBlockState state, final World worldIn, final BlockPos pos, final Block blockIn, final BlockPos fromPos )
public void neighborChanged( final IBlockState state, final World worldIn, final BlockPos pos, final Block neighborBlock )
{
final TileCraftingTile cp = this.getTileEntity( worldIn, pos );
if( cp != null )
@@ -142,7 +146,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock
}
@Override
public boolean onBlockActivated( final World w, final BlockPos pos, final IBlockState state, final EntityPlayer p, final EnumHand hand, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
public boolean onBlockActivated( final World w, final BlockPos pos, final IBlockState state, final EntityPlayer p, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
{
final TileCraftingTile tg = this.getTileEntity( w, pos );
@@ -157,7 +161,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock
return true;
}
return super.onBlockActivated( w, pos, state, p, hand, side, hitX, hitY, hitZ );
return super.onBlockActivated( w, pos, state, p, hand, heldItem, side, hitX, hitY, hitZ );
}
public enum CraftingUnitType
@@ -19,11 +19,14 @@
package appeng.block.crafting;
import javax.annotation.Nullable;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
@@ -39,7 +42,6 @@ import appeng.core.sync.GuiBridge;
import appeng.tile.crafting.TileMolecularAssembler;
import appeng.util.Platform;
public class BlockMolecularAssembler extends AEBaseTileBlock
{
@@ -49,6 +51,7 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
{
super( Material.IRON );
this.setTileEntity( TileMolecularAssembler.class );
this.setOpaque( false );
this.lightOpacity = 1;
}
@@ -63,7 +66,7 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
public IBlockState getActualState( IBlockState state, IBlockAccess worldIn, BlockPos pos )
{
boolean powered = false;
TileMolecularAssembler te = this.getTileEntity( worldIn, pos );
TileMolecularAssembler te = getTileEntity( worldIn, pos );
if( te != null )
{
powered = te.isPowered();
@@ -85,19 +88,18 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
@SideOnly( Side.CLIENT )
@Override
public boolean canRenderInLayer( IBlockState state, BlockRenderLayer layer )
public boolean canRenderInLayer( BlockRenderLayer layer )
{
return layer == BlockRenderLayer.TRANSLUCENT;
}
@Override
public boolean isFullCube( IBlockState state )
public boolean isFullCube(IBlockState state)
{
return false;
}
@Override
public boolean onBlockActivated( final World w, final BlockPos pos, final IBlockState state, final EntityPlayer p, final EnumHand hand, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
public boolean onBlockActivated( final World w, final BlockPos pos, final IBlockState state, final EntityPlayer p, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
{
final TileMolecularAssembler tg = this.getTileEntity( w, pos );
if( tg != null && !p.isSneaking() )
@@ -105,7 +107,7 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
Platform.openGUI( p, tg, AEPartLocation.fromFacing( side ), GuiBridge.GUI_MAC );
return true;
}
return super.onBlockActivated( w, pos, state, p, hand, side, hitX, hitY, hitZ );
return super.onBlockActivated( w, pos, state, p, hand, heldItem, side, hitX, hitY, hitZ );
}
}
@@ -39,7 +39,7 @@ public class ItemCraftingStorage extends AEBaseItemBlock
@Override
public ItemStack getContainerItem( final ItemStack itemStack )
{
return AEApi.instance().definitions().blocks().craftingUnit().maybeStack( 1 ).orElse( ItemStack.EMPTY );
return AEApi.instance().definitions().blocks().craftingUnit().maybeStack( 1 ).orElse( null );
}
@Override
@@ -41,7 +41,6 @@ import appeng.core.stats.Stats;
import appeng.tile.AEBaseTile;
import appeng.tile.grindstone.TileCrank;
public class BlockCrank extends AEBaseTileBlock
{
@@ -49,6 +48,7 @@ public class BlockCrank extends AEBaseTileBlock
{
super( Material.WOOD );
this.setTileEntity( TileCrank.class );
this.setLightOpacity( 0 );
this.setHarvestLevel( "axe", 0 );
this.setFullSize( this.setOpaque( false ) );
@@ -78,7 +78,7 @@ public class BlockCrank extends AEBaseTileBlock
private void dropCrank( final World world, final BlockPos pos )
{
world.destroyBlock( pos, true ); // w.destroyBlock( x, y, z, true );
world.notifyBlockUpdate( pos, this.getDefaultState(), world.getBlockState( pos ), 3 );
world.notifyBlockUpdate( pos, getDefaultState(), world.getBlockState( pos ), 3 );
}
@Override
@@ -135,7 +135,7 @@ public class BlockCrank extends AEBaseTileBlock
}
@Override
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
public void neighborChanged( final IBlockState state, final World world, final BlockPos pos, final Block neighborBlock )
{
final AEBaseTile tile = this.getTileEntity( world, pos );
@@ -35,7 +35,6 @@ import appeng.core.sync.GuiBridge;
import appeng.tile.grindstone.TileGrinder;
import appeng.util.Platform;
public class BlockGrinder extends AEBaseTileBlock
{
@@ -43,6 +42,7 @@ public class BlockGrinder extends AEBaseTileBlock
{
super( Material.ROCK );
this.setTileEntity( TileGrinder.class );
this.setHardness( 3.2F );
}
@@ -35,13 +35,14 @@ import appeng.core.sync.GuiBridge;
import appeng.tile.misc.TileCellWorkbench;
import appeng.util.Platform;
public class BlockCellWorkbench extends AEBaseTileBlock
{
public BlockCellWorkbench()
{
super( Material.IRON );
this.setTileEntity( TileCellWorkbench.class );
}
@Override
@@ -52,7 +52,7 @@ import appeng.client.render.effects.LightningFX;
import appeng.client.render.renderable.ItemRenderable;
import appeng.client.render.tesr.ModularTESR;
import appeng.core.AEConfig;
import appeng.core.AppEng;
import appeng.core.CommonHelper;
import appeng.helpers.ICustomCollision;
import appeng.tile.AEBaseTile;
import appeng.tile.misc.TileCharger;
@@ -66,6 +66,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
{
super( Material.IRON );
this.setTileEntity( TileCharger.class );
this.setLightOpacity( 2 );
this.setFullSize( this.setOpaque( false ) );
}
@@ -109,7 +110,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
{
final TileCharger tc = (TileCharger) tile;
if( AEApi.instance().definitions().materials().certusQuartzCrystalCharged().isSameAs( tc.getInternalInventory().getStackInSlot( 0 ) ) )
if( AEApi.instance().definitions().materials().certusQuartzCrystalCharged().isSameAs( tc.getStackInSlot( 0 ) ) )
{
final double xOff = 0.0;
final double yOff = 0.0;
@@ -117,10 +118,9 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
for( int bolts = 0; bolts < 3; bolts++ )
{
if( AppEng.proxy.shouldAddParticles( r ) )
if( CommonHelper.proxy.shouldAddParticles( r ) )
{
final LightningFX fx = new LightningFX( w, xOff + 0.5 + pos.getX(), yOff + 0.5 + pos.getY(), zOff + 0.5 + pos
.getZ(), 0.0D, 0.0D, 0.0D );
final LightningFX fx = new LightningFX( w, xOff + 0.5 + pos.getX(), yOff + 0.5 + pos.getY(), zOff + 0.5 + pos.getZ(), 0.0D, 0.0D, 0.0D );
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
}
}
@@ -201,7 +201,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
{
Matrix4f transform = new Matrix4f();
transform.translate( new Vector3f( 0.5f, 0.4f, 0.5f ) );
return new ImmutablePair<>( tile.getInternalInventory().getStackInSlot( 0 ), transform );
return new ImmutablePair<>( tile.getStackInSlot( 0 ), transform );
}
}
@@ -42,6 +42,8 @@ public class BlockCondenser extends AEBaseTileBlock
public BlockCondenser()
{
super( Material.IRON );
this.setTileEntity( TileCondenser.class );
}
@Override
@@ -37,7 +37,6 @@ import appeng.core.sync.GuiBridge;
import appeng.tile.misc.TileInscriber;
import appeng.util.Platform;
public class BlockInscriber extends AEBaseTileBlock
{
@@ -45,6 +44,7 @@ public class BlockInscriber extends AEBaseTileBlock
{
super( Material.IRON );
this.setTileEntity( TileInscriber.class );
this.setLightOpacity( 2 );
this.setFullSize( this.setOpaque( false ) );
}
@@ -49,6 +49,8 @@ public class BlockInterface extends AEBaseTileBlock
public BlockInterface()
{
super( Material.IRON );
this.setTileEntity( TileInterface.class );
}
@Override
@@ -61,7 +63,7 @@ public class BlockInterface extends AEBaseTileBlock
public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos )
{
// Determine whether the interface is omni-directional or not
TileInterface te = this.getTileEntity( world, pos );
TileInterface te = getTileEntity( world, pos );
boolean omniDirectional = true; // The default
if( te != null )
{
@@ -46,7 +46,6 @@ import appeng.helpers.ICustomCollision;
import appeng.helpers.MetaRotation;
import appeng.tile.misc.TileLightDetector;
public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBlock, ICustomCollision
{
@@ -64,6 +63,8 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
this.setLightOpacity( 0 );
this.setFullSize( false );
this.setOpaque( false );
this.setTileEntity( TileLightDetector.class );
}
@Override
@@ -76,7 +77,7 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
public IBlockState getStateFromMeta( final int meta )
{
EnumFacing facing = EnumFacing.values()[meta];
return this.getDefaultState().withProperty( FACING, facing );
return getDefaultState().withProperty(FACING, facing);
}
@Override
@@ -138,21 +139,21 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
@Override
public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> 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 ) );
*/
* 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 neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
public void neighborChanged( IBlockState state, World w, BlockPos pos, Block blockIn )
{
final EnumFacing up = this.getOrientable( world, pos ).getUp();
if( !this.canPlaceAt( (World) world, pos, up.getOpposite() ) )
final EnumFacing up = this.getOrientable( w, pos ).getUp();
if( !this.canPlaceAt( (World) w, pos, up.getOpposite() ) )
{
this.dropTorch( (World) world, pos );
this.dropTorch( (World) w, pos );
}
}
@@ -189,7 +190,7 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
}
@Override
@SideOnly( Side.CLIENT )
@SideOnly( Side.CLIENT)
public BlockRenderLayer getBlockLayer()
{
return BlockRenderLayer.CUTOUT;
@@ -45,11 +45,10 @@ import appeng.api.util.IOrientableBlock;
import appeng.block.AEBaseBlock;
import appeng.client.render.effects.LightningFX;
import appeng.core.AEConfig;
import appeng.core.AppEng;
import appeng.core.CommonHelper;
import appeng.helpers.ICustomCollision;
import appeng.helpers.MetaRotation;
public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock, ICustomCollision
{
@@ -76,7 +75,7 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
@Override
public IBlockState getActualState( IBlockState state, IBlockAccess worldIn, BlockPos pos )
{
boolean oddPlacement = ( ( pos.getX() + pos.getY() + pos.getZ() ) % 2 ) != 0;
boolean oddPlacement = ((pos.getX() + pos.getY() + pos.getZ()) % 2) != 0;
return super.getActualState( state, worldIn, pos )
.withProperty( ODD, oddPlacement );
@@ -92,7 +91,7 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
public IBlockState getStateFromMeta( final int meta )
{
EnumFacing facing = EnumFacing.values()[meta];
return this.getDefaultState().withProperty( FACING, facing );
return getDefaultState().withProperty(FACING, facing);
}
@Override
@@ -126,11 +125,10 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
@Override
public void addCollidingBlockToList( final World w, final BlockPos pos, 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 ) );
*/
* 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
@@ -153,7 +151,7 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
final double zOff = -0.3 * up.getFrontOffsetZ();
for( int bolts = 0; bolts < 3; bolts++ )
{
if( AppEng.proxy.shouldAddParticles( r ) )
if( CommonHelper.proxy.shouldAddParticles( r ) )
{
final LightningFX fx = new LightningFX( w, xOff + 0.5 + pos.getX(), yOff + 0.5 + pos.getY(), zOff + 0.5 + pos.getZ(), 0.0D, 0.0D, 0.0D );
@@ -163,12 +161,12 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
}
@Override
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos,final Block neighborBlock )
{
final EnumFacing up = this.getOrientable( world, pos ).getUp();
if( !this.canPlaceAt( world, pos, up.getOpposite() ) )
final EnumFacing up = this.getOrientable( w, pos ).getUp();
if( !this.canPlaceAt( w, pos, up.getOpposite() ) )
{
this.dropTorch( world, pos );
this.dropTorch( w, pos );
}
}
@@ -217,7 +215,7 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
}
@Override
@SideOnly( Side.CLIENT )
@SideOnly(Side.CLIENT)
public BlockRenderLayer getBlockLayer()
{
return BlockRenderLayer.CUTOUT;
@@ -38,7 +38,7 @@ import appeng.api.util.IOrientableBlock;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.effects.LightningFX;
import appeng.core.AEConfig;
import appeng.core.AppEng;
import appeng.core.CommonHelper;
import appeng.tile.misc.TileQuartzGrowthAccelerator;
import appeng.util.Platform;
@@ -52,13 +52,14 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
{
super( Material.ROCK );
this.setSoundType( SoundType.METAL );
this.setDefaultState( this.getDefaultState().withProperty( POWERED, false ) );
this.setTileEntity( TileQuartzGrowthAccelerator.class );
this.setDefaultState( getDefaultState().withProperty( POWERED, false ) );
}
@Override
public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos )
{
TileQuartzGrowthAccelerator te = this.getTileEntity( world, pos );
TileQuartzGrowthAccelerator te = getTileEntity( world, pos );
boolean powered = te != null && te.isPowered();
return super.getActualState( state, world, pos )
@@ -82,7 +83,7 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
final TileQuartzGrowthAccelerator cga = this.getTileEntity( w, pos );
if( cga != null && cga.isPowered() && AppEng.proxy.shouldAddParticles( r ) )
if( cga != null && cga.isPowered() && CommonHelper.proxy.shouldAddParticles( r ) )
{
final double d0 = r.nextFloat() - 0.5F;
final double d1 = r.nextFloat() - 0.5F;
@@ -40,7 +40,6 @@ import appeng.core.sync.GuiBridge;
import appeng.tile.misc.TileSecurityStation;
import appeng.util.Platform;
public class BlockSecurityStation extends AEBaseTileBlock
{
@@ -50,7 +49,8 @@ public class BlockSecurityStation extends AEBaseTileBlock
{
super( Material.IRON );
this.setDefaultState( this.getDefaultState().withProperty( POWERED, false ) );
this.setTileEntity( TileSecurityStation.class );
this.setDefaultState( getDefaultState().withProperty( POWERED, false ) );
}
@Override
@@ -69,7 +69,7 @@ public class BlockSecurityStation extends AEBaseTileBlock
public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos )
{
boolean powered = false;
TileSecurityStation te = this.getTileEntity( world, pos );
TileSecurityStation te = getTileEntity( world, pos );
if( te != null )
{
powered = te.isActive();
@@ -40,7 +40,6 @@ import appeng.block.AEBaseTileBlock;
import appeng.helpers.ICustomCollision;
import appeng.tile.misc.TileSkyCompass;
public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
{
@@ -50,6 +49,7 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
public BlockSkyCompass()
{
super( Material.CIRCUITS );
this.setTileEntity( TileSkyCompass.class );
this.setLightOpacity( 0 );
this.setFullSize( false );
this.setOpaque( false );
@@ -58,7 +58,7 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
@Override
protected BlockStateContainer createBlockState()
{
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] { FORWARD, UP, ROTATION } );
return new ExtendedBlockState( this, getAEStates(), new IUnlistedProperty[] { FORWARD, UP, ROTATION } );
}
@Override
@@ -78,13 +78,13 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
}
@Override
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
{
final TileSkyCompass sc = this.getTileEntity( world, pos );
final TileSkyCompass sc = this.getTileEntity( w, pos );
final EnumFacing forward = sc.getForward();
if( !this.canPlaceAt( world, pos, forward.getOpposite() ) )
if( !this.canPlaceAt( w, pos, forward.getOpposite() ) )
{
this.dropTorch( world, pos );
this.dropTorch( w, pos );
}
}
@@ -42,12 +42,14 @@ import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.EntityRegistry;
import appeng.block.AEBaseBlock;
import appeng.core.AppEng;
import appeng.entity.EntityIds;
import appeng.entity.EntityTinyTNTPrimed;
import appeng.helpers.ICustomCollision;
public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
{
@@ -60,9 +62,7 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
this.setSoundType( SoundType.GROUND );
this.setHardness( 0F );
// TODO: 1.11
// EntityRegistry.registerModEntity( EntityTinyTNTPrimed.class, "EntityTinyTNTPrimed", EntityIds.get(
// EntityTinyTNTPrimed.class ), AppEng.instance(), 16, 4, true );
EntityRegistry.registerModEntity( EntityTinyTNTPrimed.class, "EntityTinyTNTPrimed", EntityIds.get( EntityTinyTNTPrimed.class ), AppEng.instance(), 16, 4, true );
}
@Override
@@ -86,19 +86,18 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
if( !w.isRemote )
{
final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, igniter );
w.spawnEntity( primedTinyTNTEntity );
w.playSound( null, primedTinyTNTEntity.posX, primedTinyTNTEntity.posY, primedTinyTNTEntity.posZ, SoundEvents.ENTITY_TNT_PRIMED,
SoundCategory.BLOCKS, 1, 1 );
w.spawnEntityInWorld( primedTinyTNTEntity );
w.playSound( null, primedTinyTNTEntity.posX, primedTinyTNTEntity.posY, primedTinyTNTEntity.posZ, SoundEvents.ENTITY_TNT_PRIMED, SoundCategory.BLOCKS, 1, 1 );
}
}
@Override
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
{
if( world.isBlockIndirectlyGettingPowered( pos ) > 0 )
if( w.isBlockIndirectlyGettingPowered( pos ) > 0 )
{
this.startFuse( world, pos, null );
world.setBlockToAir( pos );
this.startFuse( w, pos, null );
w.setBlockToAir( pos );
}
}
@@ -141,10 +140,9 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
super.onBlockExploded( w, pos, exp );
if( !w.isRemote )
{
final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, exp
.getExplosivePlacedBy() );
final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, exp.getExplosivePlacedBy() );
primedTinyTNTEntity.setFuse( w.rand.nextInt( primedTinyTNTEntity.getFuse() / 4 ) + primedTinyTNTEntity.getFuse() / 8 );
w.spawnEntity( primedTinyTNTEntity );
w.spawnEntityInWorld( primedTinyTNTEntity );
}
}
@@ -44,7 +44,6 @@ import appeng.tile.AEBaseTile;
import appeng.tile.misc.TileVibrationChamber;
import appeng.util.Platform;
public final class BlockVibrationChamber extends AEBaseTileBlock
{
@@ -54,8 +53,9 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
public BlockVibrationChamber()
{
super( Material.IRON );
this.setTileEntity( TileVibrationChamber.class );
this.setHardness( 4.2F );
this.setDefaultState( this.getDefaultState().withProperty( ACTIVE, false ) );
this.setDefaultState( getDefaultState().withProperty( ACTIVE, false ) );
}
@Override
@@ -71,7 +71,7 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
@Override
protected IProperty[] getAEStates()
{
return new IProperty[] { ACTIVE };
return new IProperty[]{ ACTIVE };
}
@Override
@@ -94,7 +94,7 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
return true;
}
@Override
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
{
@@ -1,4 +1,3 @@
package appeng.block.misc;
@@ -46,7 +46,6 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.Vec3d;
@@ -118,7 +117,7 @@ public class BlockCableBus extends AEBaseTileBlock
@Override
public IBlockState getExtendedState( IBlockState state, IBlockAccess world, BlockPos pos )
{
CableBusRenderState renderState = this.cb( world, pos ).getRenderState();
CableBusRenderState renderState = cb( world, pos ).getRenderState();
return ( (IExtendedBlockState) state ).withProperty( RENDER_STATE_PROPERTY, renderState );
}
@@ -131,7 +130,7 @@ public class BlockCableBus extends AEBaseTileBlock
@Override
public void onNeighborChange( final IBlockAccess w, final BlockPos pos, final BlockPos neighbor )
{
this.cb( w, pos ).onNeighborChanged( w, pos, neighbor );
this.cb( w, pos ).onNeighborChanged();
}
@Override
@@ -237,7 +236,7 @@ public class BlockCableBus extends AEBaseTileBlock
return sp.facade.getItemStack();
}
return ItemStack.EMPTY;
return null;
}
@Override
@@ -255,9 +254,9 @@ public class BlockCableBus extends AEBaseTileBlock
ICableBusContainer cb = this.cb( world, target.getBlockPos() );
// Our built-in model has the actual baked sprites we need
IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState( this.getDefaultState() );
IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState( getDefaultState() );
// We cannot add the effect if we don't have the model
// We cannot add the effect if we dont have the model
if( !( model instanceof CableBusBakedModel ) )
{
return true;
@@ -271,9 +270,9 @@ public class BlockCableBus extends AEBaseTileBlock
TextureAtlasSprite texture = Platform.pickRandom( cableBusModel.getParticleTextures( renderState ) );
if( texture != null )
{
double x = target.hitVec.x;
double y = target.hitVec.y;
double z = target.hitVec.z;
double x = target.hitVec.xCoord;
double y = target.hitVec.yCoord;
double z = target.hitVec.zCoord;
Particle fx = new DestroyFX( world, x, y, z, 0.0D, 0.0D, 0.0D, state ).setBlockPos( target.getBlockPos() ).multipleParticleScaleBy( 0.8F );
fx.setParticleTexture( texture );
@@ -290,7 +289,7 @@ public class BlockCableBus extends AEBaseTileBlock
ICableBusContainer cb = this.cb( world, pos );
// Our built-in model has the actual baked sprites we need
IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState( this.getDefaultState() );
IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState( getDefaultState() );
// We cannot add the effect if we dont have the model
if( !( model instanceof CableBusBakedModel ) )
@@ -319,8 +318,7 @@ public class BlockCableBus extends AEBaseTileBlock
double d0 = (double) pos.getX() + ( (double) j + 0.5D ) / 4.0D;
double d1 = (double) pos.getY() + ( (double) k + 0.5D ) / 4.0D;
double d2 = (double) pos.getZ() + ( (double) l + 0.5D ) / 4.0D;
ParticleDigging particle = new DestroyFX( world, d0, d1, d2, d0 - (double) pos.getX() - 0.5D, d1 - (double) pos
.getY() - 0.5D, d2 - (double) pos.getZ() - 0.5D, this.getDefaultState() ).setBlockPos( pos );
ParticleDigging particle = new DestroyFX( world, d0, d1, d2, d0 - (double) pos.getX() - 0.5D, d1 - (double) pos.getY() - 0.5D, d2 - (double) pos.getZ() - 0.5D, getDefaultState() ).setBlockPos( pos );
particle.setParticleTexture( texture );
effectRenderer.addEffect( particle );
}
@@ -332,11 +330,11 @@ public class BlockCableBus extends AEBaseTileBlock
}
@Override
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
{
if( Platform.isServer() )
{
this.cb( world, pos ).onNeighborChanged( world, pos, fromPos );
this.cb( w, pos ).onNeighborChanged();
}
}
@@ -379,7 +377,7 @@ public class BlockCableBus extends AEBaseTileBlock
@Override
@SideOnly( Side.CLIENT )
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
public void getSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
// do nothing
}
@@ -388,9 +386,8 @@ public class BlockCableBus extends AEBaseTileBlock
{
noTesrTile = Api.INSTANCE.partHelper().getCombinedInstance( TileCableBus.class );
this.setTileEntity( noTesrTile );
GameRegistry.registerTileEntity( noTesrTile, AppEng.MOD_ID.toLowerCase() + ":" + "BlockCableBus" );
// TODO: Change after transition phase
GameRegistry.registerTileEntityWithAlternatives( noTesrTile, AppEng.MOD_ID.toLowerCase() + ":" + "BlockCableBus", "BlockCableBus" );
if( Platform.isClient() )
{
setupTesr();
@@ -401,7 +398,8 @@ public class BlockCableBus extends AEBaseTileBlock
private static void setupTesr()
{
tesrTile = Api.INSTANCE.partHelper().getCombinedInstance( TileCableBusTESR.class );
GameRegistry.registerTileEntity( tesrTile, AppEng.MOD_ID.toLowerCase() + ":" + "ClientOnly_TESR_CableBus" );
// TODO: Change after transition phase
GameRegistry.registerTileEntityWithAlternatives( tesrTile, AppEng.MOD_ID.toLowerCase() + ":" + "ClientOnly_TESR_CableBus", "ClientOnly_TESR_CableBus" );
ClientRegistry.bindTileEntitySpecialRenderer( BlockCableBus.getTesrTile(), new CableBusTESR() );
}
@@ -34,7 +34,6 @@ import net.minecraft.world.World;
import appeng.block.AEBaseTileBlock;
import appeng.tile.networking.TileController;
public class BlockController extends AEBaseTileBlock
{
@@ -50,11 +49,11 @@ public class BlockController extends AEBaseTileBlock
}
/**
* Controls the rendering of the controller block (connected texture style).
* inside_a and inside_b are alternating patterns for a controller that is enclosed by other controllers,
* and since they are always offline, they do not have the usual sub-states.
*/
/**
* Controls the rendering of the controller block (connected texture style).
* inside_a and inside_b are alternating patterns for a controller that is enclosed by other controllers,
* and since they are always offline, they do not have the usual sub-states.
*/
public enum ControllerRenderType implements IStringSerializable
{
block, column_x, column_y, column_z, inside_a, inside_b;
@@ -74,8 +73,9 @@ public class BlockController extends AEBaseTileBlock
public BlockController()
{
super( Material.IRON );
this.setTileEntity( TileController.class );
this.setHardness( 6 );
this.setDefaultState( this.getDefaultState()
this.setDefaultState( getDefaultState()
.withProperty( CONTROLLER_STATE, ControllerBlockState.offline )
.withProperty( CONTROLLER_TYPE, ControllerRenderType.block ) );
}
@@ -89,7 +89,7 @@ public class BlockController extends AEBaseTileBlock
@Override
protected BlockStateContainer createBlockState()
{
return new BlockStateContainer( this, this.getAEStates() );
return new BlockStateContainer( this, getAEStates() );
}
/**
@@ -97,7 +97,6 @@ public class BlockController extends AEBaseTileBlock
* controllers and the network state of this controller (offline, online, conflicted). This is used to
* get a rudimentary connected texture feel for the controller based on how it is placed.
*/
@SuppressWarnings( "deprecation" )
@Override
public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos )
{
@@ -110,12 +109,9 @@ public class BlockController extends AEBaseTileBlock
int z = pos.getZ();
// Detect whether controllers are on both sides of the x, y, and z axes
final boolean xx = this.getTileEntity( world, x - 1, y, z ) instanceof TileController && this.getTileEntity( world, x + 1, y,
z ) instanceof TileController;
final boolean yy = this.getTileEntity( world, x, y - 1, z ) instanceof TileController && this.getTileEntity( world, x, y + 1,
z ) instanceof TileController;
final boolean zz = this.getTileEntity( world, x, y, z - 1 ) instanceof TileController && this.getTileEntity( world, x, y,
z + 1 ) instanceof TileController;
final boolean xx = this.getTileEntity( world, x - 1, y, z ) instanceof TileController && this.getTileEntity( world, x + 1, y, z ) instanceof TileController;
final boolean yy = this.getTileEntity( world, x, y - 1, z ) instanceof TileController && this.getTileEntity( world, x, y + 1, z ) instanceof TileController;
final boolean zz = this.getTileEntity( world, x, y, z - 1 ) instanceof TileController && this.getTileEntity( world, x, y, z + 1 ) instanceof TileController;
if( xx && !yy && !zz )
{
@@ -160,7 +156,6 @@ public class BlockController extends AEBaseTileBlock
return state.getValue( CONTROLLER_STATE ).ordinal();
}
@SuppressWarnings( "deprecation" )
@Override
public IBlockState getStateFromMeta( final int meta )
{
@@ -174,11 +169,10 @@ public class BlockController extends AEBaseTileBlock
return BlockRenderLayer.CUTOUT;
}
@SuppressWarnings( "deprecation" )
@Override
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
{
final TileController tc = this.getTileEntity( world, pos );
final TileController tc = this.getTileEntity( w, pos );
if( tc != null )
{
tc.onNeighborChange( false );
@@ -21,7 +21,7 @@ package appeng.block.networking;
import appeng.block.AEBaseTileBlock;
import appeng.helpers.AEGlassMaterial;
import appeng.tile.networking.TileCreativeEnergyCell;
public class BlockCreativeEnergyCell extends AEBaseTileBlock
{
@@ -29,5 +29,6 @@ public class BlockCreativeEnergyCell extends AEBaseTileBlock
public BlockCreativeEnergyCell()
{
super( AEGlassMaterial.INSTANCE );
this.setTileEntity( TileCreativeEnergyCell.class );
}
}
@@ -19,12 +19,14 @@
package appeng.block.networking;
import appeng.tile.networking.TileDenseEnergyCell;
public class BlockDenseEnergyCell extends BlockEnergyCell
{
public BlockDenseEnergyCell()
{
this.setTileEntity( TileDenseEnergyCell.class );
}
@Override
@@ -22,6 +22,7 @@ package appeng.block.networking;
import net.minecraft.block.material.Material;
import appeng.block.AEBaseTileBlock;
import appeng.tile.networking.TileEnergyAcceptor;
public class BlockEnergyAcceptor extends AEBaseTileBlock
@@ -30,5 +31,6 @@ public class BlockEnergyAcceptor extends AEBaseTileBlock
public BlockEnergyAcceptor()
{
super( Material.IRON );
this.setTileEntity( TileEnergyAcceptor.class );
}
}
@@ -19,18 +19,21 @@
package appeng.block.networking;
import java.util.List;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.NonNullList;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import appeng.block.AEBaseTileBlock;
import appeng.helpers.AEGlassMaterial;
import appeng.tile.networking.TileEnergyCell;
import appeng.util.Platform;
@@ -54,13 +57,15 @@ public class BlockEnergyCell extends AEBaseTileBlock
public BlockEnergyCell()
{
super( AEGlassMaterial.INSTANCE );
this.setTileEntity( TileEnergyCell.class );
}
@Override
@SideOnly( Side.CLIENT )
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
public void getSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
super.getSubBlocks( tabs, itemStacks );
super.getSubBlocks( item, tabs, itemStacks );
final ItemStack charged = new ItemStack( this, 1 );
final NBTTagCompound tag = Platform.openNbtData( charged );
@@ -57,7 +57,7 @@ public class BlockEnergyCellRendering extends BlockRenderingCustomizer
double fillFactor = getFillFactor( is );
int storageLevel = TileEnergyCell.getStorageLevelFromFillFactor( fillFactor );
return new ModelResourceLocation( this.baseModel, "fullness=" + storageLevel );
return new ModelResourceLocation( baseModel, "fullness=" + storageLevel );
}
/**
@@ -22,11 +22,14 @@ package appeng.block.networking;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nullable;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
@@ -57,7 +60,7 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
@Override
public String getName()
{
return this.name().toLowerCase();
return name().toLowerCase();
}
}
@@ -66,10 +69,11 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
public BlockWireless()
{
super( AEGlassMaterial.INSTANCE );
this.setTileEntity( TileWireless.class );
this.setLightOpacity( 0 );
this.setFullSize( false );
this.setOpaque( false );
this.setDefaultState( this.getDefaultState().withProperty( STATE, State.OFF ) );
this.setDefaultState( getDefaultState().withProperty( STATE, State.OFF ) );
}
@Override
@@ -83,7 +87,7 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
{
State teState = State.OFF;
TileWireless te = this.getTileEntity( worldIn, pos );
TileWireless te = getTileEntity( worldIn, pos );
if( te != null )
{
if( te.isActive() )
@@ -107,7 +111,7 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
}
@Override
public boolean onBlockActivated( final World w, final BlockPos pos, final IBlockState state, final EntityPlayer player, final EnumHand hand, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
public boolean onBlockActivated( final World w, final BlockPos pos, final IBlockState state, final EntityPlayer player, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
{
final TileWireless tg = this.getTileEntity( w, pos );
@@ -120,7 +124,7 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
return true;
}
return super.onBlockActivated( w, pos, state, player, hand, side, hitX, hitY, hitZ );
return super.onBlockActivated( w, pos, state, player, hand, heldItem, side, hitX, hitY, hitZ );
}
@Override
@@ -45,7 +45,7 @@ public class CableBusRendering extends BlockRenderingCustomizer
@SideOnly( Side.CLIENT )
public void customize( IBlockRendering rendering, IItemRendering itemRendering )
{
rendering.builtInModel( "models/block/builtin/cable_bus", new CableBusModel( this.partModels ) );
rendering.builtInModel( "models/block/builtin/cable_bus", new CableBusModel( partModels ) );
rendering.blockColor( new CableBusColor() );
rendering.modelCustomizer( ( loc, model ) -> model );
}
@@ -1,4 +1,3 @@
package appeng.block.networking;
@@ -21,6 +21,7 @@ package appeng.block.paint;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
@@ -33,7 +34,6 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
@@ -49,7 +49,6 @@ import appeng.helpers.Splotch;
import appeng.tile.misc.TilePaint;
import appeng.util.Platform;
public class BlockPaint extends AEBaseTileBlock
{
@@ -59,6 +58,7 @@ public class BlockPaint extends AEBaseTileBlock
{
super( new MaterialLiquid( MapColor.AIR ) );
this.setTileEntity( TilePaint.class );
this.setLightOpacity( 0 );
this.setFullSize( false );
this.setOpaque( false );
@@ -75,7 +75,7 @@ public class BlockPaint extends AEBaseTileBlock
{
IExtendedBlockState extState = (IExtendedBlockState) state;
TilePaint te = this.getTileEntity( world, pos );
TilePaint te = getTileEntity( world, pos );
Collection<Splotch> splotches = Collections.emptyList();
if( te != null )
@@ -94,13 +94,13 @@ public class BlockPaint extends AEBaseTileBlock
@Override
@SideOnly( Side.CLIENT )
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
public void getSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
// do nothing
}
@Override
public AxisAlignedBB getCollisionBoundingBox( IBlockState blockState, IBlockAccess worldIn, BlockPos pos )
public AxisAlignedBB getCollisionBoundingBox( final IBlockState state, final World worldIn, final BlockPos pos )
{
return null;
}
@@ -112,9 +112,9 @@ public class BlockPaint extends AEBaseTileBlock
}
@Override
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
{
final TilePaint tp = this.getTileEntity( world, pos );
final TilePaint tp = this.getTileEntity( w, pos );
if( tp != null )
{
@@ -1,14 +1,13 @@
package appeng.block.paint;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.function.Function;
import javax.annotation.Nullable;
import com.google.common.base.Function;
import com.google.common.collect.ImmutableList;
import net.minecraft.block.state.IBlockState;
@@ -28,8 +27,7 @@ import appeng.helpers.Splotch;
/**
* Renders paint blocks, which render multiple "splotches" that have been applied to the sides of adjacent blocks using
* a
* Renders paint blocks, which render multiple "splotches" that have been applied to the sides of adjacent blocks using a
* matter cannon with paint balls.
*/
class PaintBakedModel implements IBakedModel
@@ -66,7 +64,7 @@ class PaintBakedModel implements IBakedModel
// This is the inventory model which should usually not be used other than in special cases
List<BakedQuad> quads = new ArrayList<>( 1 );
CubeBuilder builder = new CubeBuilder( this.vertexFormat, quads );
builder.setTexture( this.textures[0] );
builder.setTexture( textures[0] );
builder.addCube( 0, 0, 0, 16, 16, 16 );
return quads;
}
@@ -81,11 +79,10 @@ class PaintBakedModel implements IBakedModel
List<Splotch> splotches = splotchesState.getSplotches();
CubeBuilder builder = new CubeBuilder( this.vertexFormat );
CubeBuilder builder = new CubeBuilder( vertexFormat );
float offsetConstant = 0.001f;
for( final Splotch s : splotches )
{
for( final Splotch s : splotches) {
if( s.isLumen() )
{
@@ -109,7 +106,7 @@ class PaintBakedModel implements IBakedModel
pos_x = Math.max( buffer, Math.min( 1.0f - buffer, pos_x ) );
pos_y = Math.max( buffer, Math.min( 1.0f - buffer, pos_y ) );
TextureAtlasSprite ico = this.textures[s.getSeed() % this.textures.length];
TextureAtlasSprite ico = textures[s.getSeed() % textures.length];
builder.setTexture( ico );
builder.setCustomUv( s.getSide().getOpposite(), 0, 0, 16, 16 );
@@ -176,7 +173,7 @@ class PaintBakedModel implements IBakedModel
@Override
public TextureAtlasSprite getParticleTexture()
{
return this.textures[0];
return textures[0];
}
@Override
@@ -194,6 +191,7 @@ class PaintBakedModel implements IBakedModel
static List<ResourceLocation> getRequiredTextures()
{
return ImmutableList.of(
TEXTURE_PAINT1, TEXTURE_PAINT2, TEXTURE_PAINT3 );
TEXTURE_PAINT1, TEXTURE_PAINT2, TEXTURE_PAINT3
);
}
}
@@ -1,10 +1,10 @@
package appeng.block.paint;
import java.util.Collection;
import java.util.Collections;
import java.util.function.Function;
import com.google.common.base.Function;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
@@ -1,4 +1,3 @@
package appeng.block.paint;
@@ -1,4 +1,3 @@
package appeng.block.paint;
@@ -25,7 +24,7 @@ class PaintSplotches
List<Splotch> getSplotches()
{
return this.splotches;
return splotches;
}
}
@@ -1,4 +1,3 @@
package appeng.block.paint;
@@ -38,7 +38,6 @@ import appeng.block.AEBaseTileBlock;
import appeng.helpers.ICustomCollision;
import appeng.tile.qnb.TileQuantumBridge;
public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICustomCollision
{
@@ -49,11 +48,12 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto
public BlockQuantumBase( final Material mat )
{
super( mat );
this.setTileEntity( TileQuantumBridge.class );
final float shave = 2.0f / 16.0f;
this.boundingBox = new AxisAlignedBB( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave );
this.setLightOpacity( 0 );
this.setFullSize( this.setOpaque( false ) );
this.setDefaultState( this.getDefaultState().withProperty( FORMED, false ) );
this.setDefaultState( getDefaultState().withProperty( FORMED, false ) );
}
@Override
@@ -65,7 +65,7 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto
@Override
protected BlockStateContainer createBlockState()
{
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] { FORMED_STATE } );
return new ExtendedBlockState( this, getAEStates(), new IUnlistedProperty[] { FORMED_STATE } );
}
@Override
@@ -73,7 +73,7 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto
{
IExtendedBlockState extState = (IExtendedBlockState) state;
TileQuantumBridge bridge = this.getTileEntity( world, pos );
TileQuantumBridge bridge = getTileEntity( world, pos );
if( bridge != null )
{
QnbFormedState formedState = new QnbFormedState( bridge.getAdjacentQuantumBridges(), bridge.isCorner(), bridge.isPowered() );
@@ -86,7 +86,7 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto
@Override
public IBlockState getActualState( IBlockState state, IBlockAccess worldIn, BlockPos pos )
{
TileQuantumBridge bridge = this.getTileEntity( worldIn, pos );
TileQuantumBridge bridge = getTileEntity( worldIn, pos );
if( bridge != null )
{
state = state.withProperty( FORMED, bridge.isFormed() );
@@ -101,9 +101,9 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto
}
@Override
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
{
final TileQuantumBridge bridge = this.getTileEntity( world, pos );
final TileQuantumBridge bridge = this.getTileEntity( w, pos );
if( bridge != null )
{
bridge.neighborUpdate();
@@ -37,7 +37,7 @@ import net.minecraft.world.World;
import appeng.api.util.AEPartLocation;
import appeng.client.EffectType;
import appeng.core.AppEng;
import appeng.core.CommonHelper;
import appeng.core.sync.GuiBridge;
import appeng.helpers.AEGlassMaterial;
import appeng.tile.qnb.TileQuantumBridge;
@@ -60,9 +60,9 @@ public class BlockQuantumLinkChamber extends BlockQuantumBase
{
if( bridge.hasQES() )
{
if( AppEng.proxy.shouldAddParticles( rand ) )
if( CommonHelper.proxy.shouldAddParticles( rand ) )
{
AppEng.proxy.spawnEffect( EffectType.Energy, w, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, null );
CommonHelper.proxy.spawnEffect( EffectType.Energy, w, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, null );
}
}
}
@@ -1,14 +1,13 @@
package appeng.block.qnb;
import java.util.EnumSet;
import java.util.List;
import java.util.Set;
import java.util.function.Function;
import javax.annotation.Nullable;
import com.google.common.base.Function;
import com.google.common.collect.ImmutableList;
import net.minecraft.block.Block;
@@ -79,47 +78,46 @@ class QnbFormedBakedModel implements IBakedModel
// Get the correct base model
if( !( state instanceof IExtendedBlockState ) )
{
return this.baseModel.getQuads( state, side, rand );
return baseModel.getQuads( state, side, rand );
}
IExtendedBlockState extendedBlockState = (IExtendedBlockState) state;
QnbFormedState formedState = extendedBlockState.getValue( BlockQuantumBase.FORMED_STATE );
return this.getQuads( formedState, state, side, rand );
return getQuads( formedState, state, side, rand );
}
private List<BakedQuad> getQuads( QnbFormedState formedState, IBlockState state, EnumFacing side, long rand )
{
CubeBuilder builder = new CubeBuilder( this.vertexFormat );
CubeBuilder builder = new CubeBuilder( vertexFormat );
if( state.getBlock() == this.linkBlock )
if( state.getBlock() == linkBlock )
{
Set<EnumFacing> sides = formedState.getAdjacentQuantumBridges();
this.renderCableAt( builder, 0.11f * 16, this.glassCableTexture, 0.141f * 16, sides );
this.renderCableAt( builder, 0.11f * 16, glassCableTexture, 0.141f * 16, sides );
this.renderCableAt( builder, 0.188f * 16, this.coveredCableTexture, 0.1875f * 16, sides );
this.renderCableAt( builder, 0.188f * 16, coveredCableTexture, 0.1875f * 16, sides );
builder.setTexture( this.linkTexture );
builder.setTexture( linkTexture );
builder.addCube( DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX );
}
else
{
if( formedState.isCorner() )
{
this.renderCableAt( builder, 0.188f * 16, this.coveredCableTexture, 0.05f * 16, formedState.getAdjacentQuantumBridges() );
this.renderCableAt( builder, 0.188f * 16, coveredCableTexture, 0.05f * 16, formedState.getAdjacentQuantumBridges() );
builder.setTexture( this.ringTexture );
builder.setTexture( ringTexture );
builder.addCube( DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX );
if( formedState.isPowered() )
{
builder.setTexture( this.lightCornerTexture );
builder.setTexture( lightCornerTexture );
builder.setRenderFullBright( true );
for( EnumFacing facing : EnumFacing.values() )
{
// Offset the face by a slight amount so that it is drawn over the already drawn ring texture
// (avoids z-fighting)
// Offset the face by a slight amount so that it is drawn over the already drawn ring texture (avoids z-fighting)
float xOffset = Math.abs( facing.getFrontOffsetX() * 0.01f );
float yOffset = Math.abs( facing.getFrontOffsetY() * 0.01f );
float zOffset = Math.abs( facing.getFrontOffsetZ() * 0.01f );
@@ -127,13 +125,14 @@ class QnbFormedBakedModel implements IBakedModel
builder.setDrawFaces( EnumSet.of( facing ) );
builder.addCube(
DEFAULT_RENDER_MIN - xOffset, DEFAULT_RENDER_MIN - yOffset, DEFAULT_RENDER_MIN - zOffset,
DEFAULT_RENDER_MAX + xOffset, DEFAULT_RENDER_MAX + yOffset, DEFAULT_RENDER_MAX + zOffset );
DEFAULT_RENDER_MAX + xOffset, DEFAULT_RENDER_MAX + yOffset, DEFAULT_RENDER_MAX + zOffset
);
}
}
}
else
{
builder.setTexture( this.ringTexture );
builder.setTexture( ringTexture );
builder.addCube( 0, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, 16, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX );
@@ -143,12 +142,11 @@ class QnbFormedBakedModel implements IBakedModel
if( formedState.isPowered() )
{
builder.setTexture( this.lightTexture );
builder.setTexture( lightTexture );
builder.setRenderFullBright( true );
for( EnumFacing facing : EnumFacing.values() )
{
// Offset the face by a slight amount so that it is drawn over the already drawn ring texture
// (avoids z-fighting)
// Offset the face by a slight amount so that it is drawn over the already drawn ring texture (avoids z-fighting)
float xOffset = Math.abs( facing.getFrontOffsetX() * 0.01f );
float yOffset = Math.abs( facing.getFrontOffsetY() * 0.01f );
float zOffset = Math.abs( facing.getFrontOffsetZ() * 0.01f );
@@ -156,7 +154,8 @@ class QnbFormedBakedModel implements IBakedModel
builder.setDrawFaces( EnumSet.of( facing ) );
builder.addCube(
-xOffset, -yOffset, -zOffset,
16 + xOffset, 16 + yOffset, 16 + zOffset );
16 + xOffset, 16 + yOffset, 16 + zOffset
);
}
}
}
@@ -203,7 +202,7 @@ class QnbFormedBakedModel implements IBakedModel
@Override
public boolean isAmbientOcclusion()
{
return this.baseModel.isAmbientOcclusion();
return baseModel.isAmbientOcclusion();
}
@Override
@@ -221,24 +220,25 @@ class QnbFormedBakedModel implements IBakedModel
@Override
public TextureAtlasSprite getParticleTexture()
{
return this.baseModel.getParticleTexture();
return baseModel.getParticleTexture();
}
@Override
public ItemCameraTransforms getItemCameraTransforms()
{
return this.baseModel.getItemCameraTransforms();
return baseModel.getItemCameraTransforms();
}
@Override
public ItemOverrideList getOverrides()
{
return this.baseModel.getOverrides();
return baseModel.getOverrides();
}
public static List<ResourceLocation> getRequiredTextures()
{
return ImmutableList.of(
TEXTURE_LINK, TEXTURE_RING, TEXTURE_CABLE_GLASS, TEXTURE_COVERED_CABLE, TEXTURE_RING_LIGHT, TEXTURE_RING_LIGHT_CORNER );
TEXTURE_LINK, TEXTURE_RING, TEXTURE_CABLE_GLASS, TEXTURE_COVERED_CABLE, TEXTURE_RING_LIGHT, TEXTURE_RING_LIGHT_CORNER
);
}
}
@@ -1,10 +1,9 @@
package appeng.block.qnb;
import java.util.Collection;
import java.util.function.Function;
import com.google.common.base.Function;
import com.google.common.collect.ImmutableList;
import net.minecraft.client.renderer.block.model.IBakedModel;
@@ -39,7 +38,7 @@ public class QnbFormedModel implements IModel
@Override
public IBakedModel bake( IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter )
{
IBakedModel ringModel = this.getBaseModel( MODEL_RING, state, format, bakedTextureGetter );
IBakedModel ringModel = getBaseModel( MODEL_RING, state, format, bakedTextureGetter );
return new QnbFormedBakedModel( format, ringModel, bakedTextureGetter );
}
@@ -1,4 +1,3 @@
package appeng.block.qnb;
@@ -25,17 +24,17 @@ public class QnbFormedState
public Set<EnumFacing> getAdjacentQuantumBridges()
{
return this.adjacentQuantumBridges;
return adjacentQuantumBridges;
}
public boolean isCorner()
{
return this.corner;
return corner;
}
public boolean isPowered()
{
return this.powered;
return powered;
}
}
@@ -1,4 +1,3 @@
package appeng.block.qnb;
@@ -1,4 +1,3 @@
package appeng.block.qnb;
@@ -19,6 +18,6 @@ public class QuantumBridgeRendering extends BlockRenderingCustomizer
{
rendering.builtInModel( "models/block/qnb/qnb_formed", new QnbFormedModel() );
// Disable auto rotation
rendering.modelCustomizer( ( location, model ) -> model );
rendering.modelCustomizer( (location, model) -> model );
}
}
@@ -26,8 +26,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.Explosion;
@@ -39,7 +39,6 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import appeng.block.AEBaseBlock;
import appeng.helpers.ICustomCollision;
public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision
{
@@ -54,7 +53,7 @@ public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision
@Override
@SideOnly( Side.CLIENT )
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
public void getSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
// do nothing
}
@@ -37,19 +37,19 @@ import appeng.core.sync.GuiBridge;
import appeng.tile.spatial.TileSpatialIOPort;
import appeng.util.Platform;
public class BlockSpatialIOPort extends AEBaseTileBlock
{
public BlockSpatialIOPort()
{
super( Material.IRON );
this.setTileEntity( TileSpatialIOPort.class );
}
@Override
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
{
final TileSpatialIOPort te = this.getTileEntity( world, pos );
final TileSpatialIOPort te = this.getTileEntity( w, pos );
if( te != null )
{
te.updateRedstoneState();
@@ -44,12 +44,13 @@ public class BlockSpatialPylon extends AEBaseTileBlock
public BlockSpatialPylon()
{
super( AEGlassMaterial.INSTANCE );
this.setTileEntity( TileSpatialPylon.class );
}
@Override
protected BlockStateContainer createBlockState()
{
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] { STATE } );
return new ExtendedBlockState( this, getAEStates(), new IUnlistedProperty[] { STATE } );
}
@Override
@@ -57,13 +58,13 @@ public class BlockSpatialPylon extends AEBaseTileBlock
{
IExtendedBlockState extState = (IExtendedBlockState) state;
return extState.withProperty( STATE, this.getDisplayState( world, pos ) );
return extState.withProperty( STATE, getDisplayState( world, pos ) );
}
@Override
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
{
final TileSpatialPylon tsp = this.getTileEntity( world, pos );
final TileSpatialPylon tsp = this.getTileEntity( w, pos );
if( tsp != null )
{
tsp.neighborChanged();
@@ -83,7 +84,7 @@ public class BlockSpatialPylon extends AEBaseTileBlock
private int getDisplayState( IBlockAccess world, BlockPos pos )
{
TileSpatialPylon te = this.getTileEntity( world, pos );
TileSpatialPylon te = getTileEntity( world, pos );
if( te == null )
{
@@ -52,7 +52,8 @@ public class BlockChest extends AEBaseTileBlock
public BlockChest()
{
super( Material.IRON );
this.setDefaultState( this.getDefaultState().withProperty( SLOT_STATE, DriveSlotState.EMPTY ) );
this.setTileEntity( TileChest.class );
this.setDefaultState( getDefaultState().withProperty( SLOT_STATE, DriveSlotState.EMPTY ) );
}
@Override
@@ -72,7 +73,7 @@ public class BlockChest extends AEBaseTileBlock
{
DriveSlotState slotState = DriveSlotState.EMPTY;
TileChest te = this.getTileEntity( worldIn, pos );
TileChest te = getTileEntity( worldIn, pos );
if( te != null )
{
@@ -108,8 +109,8 @@ public class BlockChest extends AEBaseTileBlock
}
else
{
final ItemStack cell = tg.getCell();
if( !cell.isEmpty() )
final ItemStack cell = tg.getStackInSlot( 1 );
if( cell != null )
{
final ICellHandler ch = AEApi.instance().registries().cell().getHandler( cell );
@@ -117,7 +118,7 @@ public class BlockChest extends AEBaseTileBlock
}
else
{
p.sendMessage( PlayerMessages.ChestCannotReadStorageCell.get() );
p.addChatMessage( PlayerMessages.ChestCannotReadStorageCell.get() );
}
}
@@ -47,11 +47,12 @@ import appeng.util.Platform;
public class BlockDrive extends AEBaseTileBlock
{
public static final UnlistedProperty<DriveSlotsState> SLOTS_STATE = new UnlistedProperty<>( "drive_slots_state", DriveSlotsState.class );
public static final UnlistedProperty<DriveSlotsState> SLOTS_STATE = new UnlistedProperty<>("drive_slots_state", DriveSlotsState.class);
public BlockDrive()
{
super( Material.IRON );
this.setTileEntity( TileDrive.class );
}
@Override
@@ -63,7 +64,7 @@ public class BlockDrive extends AEBaseTileBlock
@Override
protected BlockStateContainer createBlockState()
{
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] {
return new ExtendedBlockState( this, getAEStates(), new IUnlistedProperty[] {
SLOTS_STATE,
FORWARD,
UP
@@ -73,7 +74,7 @@ public class BlockDrive extends AEBaseTileBlock
@Override
public IBlockState getExtendedState( IBlockState state, IBlockAccess world, BlockPos pos )
{
TileDrive te = this.getTileEntity( world, pos );
TileDrive te = getTileEntity( world, pos );
if( te == null )
{
return super.getExtendedState( state, world, pos );
@@ -44,12 +44,13 @@ public class BlockIOPort extends AEBaseTileBlock
public BlockIOPort()
{
super( Material.IRON );
this.setTileEntity( TileIOPort.class );
}
@Override
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
{
final TileIOPort te = this.getTileEntity( world, pos );
final TileIOPort te = this.getTileEntity( w, pos );
if( te != null )
{
te.updateRedstoneState();
@@ -61,6 +61,7 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
public BlockSkyChest( final SkyChestType type )
{
super( Material.ROCK );
this.setTileEntity( TileSkyChest.class );
this.setOpaque( this.setFullSize( false ) );
this.lightOpacity = 0;
this.setHardness( 50 );
@@ -88,7 +89,7 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final BlockPos pos, final Entity thePlayer, final boolean b )
{
final AxisAlignedBB aabb = this.computeAABB( w, pos );
final AxisAlignedBB aabb = computeAABB( w, pos );
return Collections.singletonList( aabb );
}
@@ -96,7 +97,7 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
@Override
public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
{
final AxisAlignedBB aabb = this.computeAABB( w, pos );
final AxisAlignedBB aabb = computeAABB( w, pos );
out.add( aabb );
}
@@ -53,7 +53,7 @@ public enum DriveSlotState implements IStringSerializable
@Override
public String getName()
{
return this.name;
return name;
}
public static DriveSlotState fromCellStatus( int cellStatus )
@@ -37,16 +37,16 @@ public class DriveSlotsState
public DriveSlotState getState( int index )
{
if( index >= this.slots.length )
if( index >= slots.length )
{
return DriveSlotState.EMPTY;
}
return this.slots[index];
return slots[index];
}
public int getSlotCount()
{
return this.slots.length;
return slots.length;
}
/**
@@ -46,7 +46,7 @@ public class SkyChestRenderingCustomizer extends BlockRenderingCustomizer
rendering.tesr( new SkyChestTESR() );
// Register a custom non-tesr item model
String modelName = this.getModelFromType();
String modelName = getModelFromType();
ModelResourceLocation model = new ModelResourceLocation( "appliedenergistics2:" + modelName, "inventory" );
itemRendering.model( model ).variants( model );
}
@@ -54,7 +54,7 @@ public class SkyChestRenderingCustomizer extends BlockRenderingCustomizer
private String getModelFromType()
{
final String modelName;
switch( this.type )
switch( type )
{
default:
case STONE:
@@ -35,6 +35,7 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -42,11 +43,9 @@ import appeng.api.definitions.IBlockDefinition;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseItemBlock;
import appeng.block.AEBaseTileBlock;
import appeng.bootstrap.definitions.TileEntityDefinition;
import appeng.core.AEConfig;
import appeng.core.AppEng;
import appeng.core.CreativeTab;
import appeng.core.Registration;
import appeng.core.features.AEFeature;
import appeng.core.features.ActivityState;
import appeng.core.features.BlockDefinition;
@@ -69,16 +68,12 @@ class BlockDefinitionBuilder implements IBlockBuilder
private final List<BiConsumer<Block, Item>> initCallbacks = new ArrayList<>();
private final List<BiConsumer<Block, Item>> modelRegCallbacks = new ArrayList<>();
private final List<BiConsumer<Block, Item>> postInitCallbacks = new ArrayList<>();
private final EnumSet<AEFeature> features = EnumSet.noneOf( AEFeature.class );
private CreativeTabs creativeTab = CreativeTab.instance;
private TileEntityDefinition tileEntityDefinition;
private boolean disableItem = false;
private Function<Block, ItemBlock> itemFactory;
@@ -97,36 +92,29 @@ class BlockDefinitionBuilder implements IBlockBuilder
if( Platform.isClient() )
{
this.blockRendering = new BlockRendering();
this.itemRendering = new ItemRendering();
blockRendering = new BlockRendering();
itemRendering = new ItemRendering();
}
}
@Override
public BlockDefinitionBuilder preInit( BiConsumer<Block, Item> callback )
{
this.preInitCallbacks.add( callback );
preInitCallbacks.add( callback );
return this;
}
@Override
public BlockDefinitionBuilder init( BiConsumer<Block, Item> callback )
{
this.initCallbacks.add( callback );
return this;
}
@Override
public BlockDefinitionBuilder modelRegInit( BiConsumer<Block, Item> callback )
{
this.modelRegCallbacks.add( callback );
initCallbacks.add( callback );
return this;
}
@Override
public BlockDefinitionBuilder postInit( BiConsumer<Block, Item> callback )
{
this.postInitCallbacks.add( callback );
postInitCallbacks.add( callback );
return this;
}
@@ -134,7 +122,7 @@ class BlockDefinitionBuilder implements IBlockBuilder
public IBlockBuilder features( AEFeature... features )
{
this.features.clear();
this.addFeatures( features );
addFeatures( features );
return this;
}
@@ -150,29 +138,22 @@ class BlockDefinitionBuilder implements IBlockBuilder
{
if( Platform.isClient() )
{
this.customizeForClient( callback );
customizeForClient( callback );
}
return this;
}
@Override
public IBlockBuilder tileEntity( TileEntityDefinition tileEntityDefinition )
{
this.tileEntityDefinition = tileEntityDefinition;
return this;
}
@Override
public IBlockBuilder useCustomItemModel()
{
this.rendering( new BlockRenderingCustomizer()
rendering( new BlockRenderingCustomizer()
{
@Override
@SideOnly( Side.CLIENT )
public void customize( IBlockRendering rendering, IItemRendering itemRendering )
{
ModelResourceLocation model = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, BlockDefinitionBuilder.this.registryName ), "inventory" );
ModelResourceLocation model = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, registryName ), "inventory" );
itemRendering.model( model ).variants( model );
}
} );
@@ -197,108 +178,94 @@ class BlockDefinitionBuilder implements IBlockBuilder
@SideOnly( Side.CLIENT )
private void customizeForClient( BlockRenderingCustomizer callback )
{
callback.customize( this.blockRendering, this.itemRendering );
callback.customize( blockRendering, itemRendering );
}
@SuppressWarnings( "unchecked" )
@Override
public <T extends IBlockDefinition> T build()
{
if( !AEConfig.instance().areFeaturesEnabled( this.features ) )
if( !AEConfig.instance().areFeaturesEnabled( features ) )
{
return (T) new TileDefinition( this.registryName, null, null );
return (T) new TileDefinition( registryName, null, null );
}
// Create block and matching item, and set factory name of both
Block block = this.blockSupplier.get();
block.setRegistryName( AppEng.MOD_ID, this.registryName );
block.setUnlocalizedName( "appliedenergistics2." + this.registryName );
Block block = blockSupplier.get();
block.setRegistryName( AppEng.MOD_ID, registryName );
ItemBlock item = this.constructItemFromBlock( block );
ItemBlock item = constructItemFromBlock( block );
if( item != null )
{
item.setRegistryName( AppEng.MOD_ID, this.registryName );
item.setRegistryName( AppEng.MOD_ID, registryName );
}
// Register the item and block with the game
this.factory.addPreInit( side ->
{
Registration.addBlockToRegister( block );
factory.addPreInit( side -> {
GameRegistry.register( block );
if( item != null )
{
Registration.addItemToRegister( item );
GameRegistry.register( item );
}
} );
block.setCreativeTab( this.creativeTab );
block.setCreativeTab( creativeTab );
block.setUnlocalizedName( "appliedenergistics2." + registryName );
// Register all extra handlers
this.preInitCallbacks.forEach( consumer -> this.factory.addPreInit( side -> consumer.accept( block, item ) ) );
this.initCallbacks.forEach( consumer -> this.factory.addInit( side -> consumer.accept( block, item ) ) );
this.modelRegCallbacks.forEach( consumer -> this.factory.addModelReg( ( side, reg ) -> consumer.accept( block, item ) ) );
this.postInitCallbacks.forEach( consumer -> this.factory.addPostInit( side -> consumer.accept( block, item ) ) );
if( this.tileEntityDefinition != null && block instanceof AEBaseTileBlock )
{
( (AEBaseTileBlock) block ).setTileEntity( this.tileEntityDefinition.getTileEntityClass() );
if( this.tileEntityDefinition.getName() == null )
{
this.tileEntityDefinition.setName( this.registryName );
}
}
preInitCallbacks.forEach( consumer -> factory.addPreInit( side -> consumer.accept( block, item ) ) );
initCallbacks.forEach( consumer -> factory.addInit( side -> consumer.accept( block, item ) ) );
postInitCallbacks.forEach( consumer -> factory.addPostInit( side -> consumer.accept( block, item ) ) );
if( Platform.isClient() )
{
if( block instanceof AEBaseTileBlock )
{
AEBaseTileBlock tileBlock = (AEBaseTileBlock) block;
this.blockRendering.apply( this.factory, block, tileBlock.getTileEntityClass() );
blockRendering.apply( factory, block, tileBlock.getTileEntityClass() );
}
else
{
this.blockRendering.apply( this.factory, block, null );
blockRendering.apply( factory, block, null );
}
if( item != null )
{
this.itemRendering.apply( this.factory, item );
itemRendering.apply( factory, item );
}
}
if( block instanceof AEBaseTileBlock )
{
this.factory.addPreInit( side ->
{
AEBaseTile.registerTileItem(
this.tileEntityDefinition == null ? ( (AEBaseTileBlock) block ).getTileEntityClass() : this.tileEntityDefinition.getTileEntityClass(),
new BlockStackSrc( block, 0, ActivityState.Enabled ) );
AEBaseTileBlock tileBlock = (AEBaseTileBlock) block;
factory.addPreInit( side -> {
Class<? extends AEBaseTile> tileEntityClass = tileBlock.getTileEntityClass();
AEBaseTile.registerTileItem( tileEntityClass, new BlockStackSrc( block, 0, ActivityState.Enabled ) );
// TODO: Change after transition phase
GameRegistry.registerTileEntityWithAlternatives( tileEntityClass, AppEng.MOD_ID.toLowerCase() + ":" + registryName, registryName );
} );
if( this.tileEntityDefinition != null )
{
this.factory.tileEntityComponent.addTileEntity( this.tileEntityDefinition );
}
return (T) new TileDefinition( this.registryName, (AEBaseTileBlock) block, item );
return (T) new TileDefinition( registryName, (AEBaseTileBlock) block, item );
}
else
{
return (T) new BlockDefinition( this.registryName, block, item );
return (T) new BlockDefinition( registryName, block, item );
}
}
@Nullable
private ItemBlock constructItemFromBlock( Block block )
{
if( this.disableItem )
if( disableItem )
{
return null;
}
if( this.itemFactory != null )
if( itemFactory != null )
{
return this.itemFactory.apply( block );
return itemFactory.apply( block );
}
else if( block instanceof AEBaseBlock )
{
@@ -62,7 +62,7 @@ class BlockRendering implements IBlockRendering
@SideOnly( Side.CLIENT )
public IBlockRendering modelCustomizer( BiFunction<ModelResourceLocation, IBakedModel, IBakedModel> customizer )
{
this.modelCustomizer = customizer;
modelCustomizer = customizer;
return this;
}
@@ -99,18 +99,18 @@ class BlockRendering implements IBlockRendering
void apply( FeatureFactory factory, Block block, Class<?> tileEntityClass )
{
if( this.tesr != null )
if( tesr != null )
{
if( tileEntityClass == null )
{
throw new IllegalStateException( "Tried to register a TESR for " + block + " even though no tile entity has been specified." );
}
factory.addBootstrapComponent( new TesrComponent( tileEntityClass, this.tesr ) );
factory.addBootstrapComponent( new TesrComponent( tileEntityClass, tesr ) );
}
if( this.modelCustomizer != null )
if( modelCustomizer != null )
{
factory.modelOverrideComponent.addOverride( block.getRegistryName().getResourcePath(), this.modelCustomizer );
factory.modelOverrideComponent.addOverride( block.getRegistryName().getResourcePath(), modelCustomizer );
}
else if( block instanceof AEBaseTileBlock )
{
@@ -119,17 +119,16 @@ class BlockRendering implements IBlockRendering
factory.modelOverrideComponent.addOverride( block.getRegistryName().getResourcePath(), ( l, m ) -> new AutoRotatingModel( m ) );
}
// TODO : 1.12
this.builtInModels.forEach( factory::addBuiltInModel );
builtInModels.forEach( factory::addBuiltInModel );
if( this.blockColor != null )
if( blockColor != null )
{
factory.addBootstrapComponent( new BlockColorComponent( block, this.blockColor ) );
factory.addBootstrapComponent( new BlockColorComponent( block, blockColor ) );
}
if( this.stateMapper != null )
if( stateMapper != null )
{
factory.addBootstrapComponent( new StateMapperComponent( block, this.stateMapper ) );
factory.addBootstrapComponent( new StateMapperComponent( block, stateMapper ) );
}
}
}
@@ -33,12 +33,10 @@ import appeng.api.definitions.IItemDefinition;
import appeng.api.util.AEColor;
import appeng.api.util.AEColoredItemDefinition;
import appeng.bootstrap.components.BuiltInModelComponent;
import appeng.bootstrap.components.IInitComponent;
import appeng.bootstrap.components.IModelRegistrationComponent;
import appeng.bootstrap.components.IPostInitComponent;
import appeng.bootstrap.components.IPreInitComponent;
import appeng.bootstrap.components.InitComponent;
import appeng.bootstrap.components.ModelOverrideComponent;
import appeng.bootstrap.components.TileEntityComponent;
import appeng.bootstrap.components.PostInitComponent;
import appeng.bootstrap.components.PreInitComponent;
import appeng.core.features.AEFeature;
import appeng.core.features.ActivityState;
import appeng.core.features.ColoredItemDefinition;
@@ -59,23 +57,18 @@ public class FeatureFactory
@SideOnly( Side.CLIENT )
private BuiltInModelComponent builtInModelComponent;
public final TileEntityComponent tileEntityComponent;
public FeatureFactory()
{
this.defaultFeatures = new AEFeature[] { AEFeature.CORE };
this.bootstrapComponents = new ArrayList<>();
this.tileEntityComponent = new TileEntityComponent();
this.bootstrapComponents.add( this.tileEntityComponent );
if( Platform.isClient() )
{
this.modelOverrideComponent = new ModelOverrideComponent();
this.bootstrapComponents.add( this.modelOverrideComponent );
modelOverrideComponent = new ModelOverrideComponent();
bootstrapComponents.add( modelOverrideComponent );
this.builtInModelComponent = new BuiltInModelComponent();
this.bootstrapComponents.add( this.builtInModelComponent );
builtInModelComponent = new BuiltInModelComponent();
bootstrapComponents.add( builtInModelComponent );
}
}
@@ -83,7 +76,6 @@ public class FeatureFactory
{
this.defaultFeatures = defaultFeatures.clone();
this.bootstrapComponents = parent.bootstrapComponents;
this.tileEntityComponent = parent.tileEntityComponent;
if( Platform.isClient() )
{
this.modelOverrideComponent = parent.modelOverrideComponent;
@@ -93,20 +85,19 @@ public class FeatureFactory
public IBlockBuilder block( String id, Supplier<Block> block )
{
return new BlockDefinitionBuilder( this, id, block ).features( this.defaultFeatures );
return new BlockDefinitionBuilder( this, id, block ).features( defaultFeatures );
}
public IItemBuilder item( String id, Supplier<Item> item )
{
return new ItemDefinitionBuilder( this, id, item ).features( this.defaultFeatures );
return new ItemDefinitionBuilder( this, id, item ).features( defaultFeatures );
}
public AEColoredItemDefinition colored( IItemDefinition target, int offset )
{
ColoredItemDefinition definition = new ColoredItemDefinition();
target.maybeItem().ifPresent( targetItem ->
{
target.maybeItem().ifPresent( targetItem -> {
for( final AEColor color : AEColor.VALID_COLORS )
{
final ActivityState state = ActivityState.from( target.isEnabled() );
@@ -128,22 +119,17 @@ public class FeatureFactory
this.bootstrapComponents.add( component );
}
void addPreInit( IPreInitComponent component )
void addPreInit( PreInitComponent component )
{
this.bootstrapComponents.add( component );
}
void addInit( IInitComponent component )
void addInit( InitComponent component )
{
this.bootstrapComponents.add( component );
}
void addModelReg( IModelRegistrationComponent component )
{
this.bootstrapComponents.add( component );
}
void addPostInit( IPostInitComponent component )
void addPostInit( PostInitComponent component )
{
this.bootstrapComponents.add( component );
}
@@ -151,11 +137,11 @@ public class FeatureFactory
@SideOnly( Side.CLIENT )
void addBuiltInModel( String path, IModel model )
{
this.builtInModelComponent.addModel( path, model );
builtInModelComponent.addModel( path, model );
}
public List<IBootstrapComponent> getBootstrapComponents()
{
return this.bootstrapComponents;
return bootstrapComponents;
}
}
@@ -27,7 +27,6 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import appeng.api.definitions.IBlockDefinition;
import appeng.bootstrap.definitions.TileEntityDefinition;
import appeng.core.features.AEFeature;
@@ -38,8 +37,6 @@ public interface IBlockBuilder
IBlockBuilder init( BiConsumer<Block, Item> callback );
IBlockBuilder modelRegInit( BiConsumer<Block, Item> callback );
IBlockBuilder postInit( BiConsumer<Block, Item> callback );
IBlockBuilder features( AEFeature... features );
@@ -48,8 +45,6 @@ public interface IBlockBuilder
IBlockBuilder rendering( BlockRenderingCustomizer callback );
IBlockBuilder tileEntity( TileEntityDefinition tileEntityDefinition );
/**
* Don't register an item for this block.
*/
@@ -32,10 +32,6 @@ public interface IBootstrapComponent
{
}
default void modelRegistration( Side side, IModelRegistry registry )
{
}
default void initialize( Side side )
{
}
@@ -1,39 +0,0 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2017, 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.bootstrap;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.ItemMeshDefinition;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.renderer.block.statemap.IStateMapper;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
public interface IModelRegistry
{
void registerItemVariants( Item item, ResourceLocation... names );
void setCustomModelResourceLocation( Item item, int metadata, ModelResourceLocation model );
void setCustomMeshDefinition( Item item, ItemMeshDefinition meshDefinition );
void setCustomStateMapper( Block block, IStateMapper mapper );
}
@@ -30,13 +30,13 @@ import net.minecraft.block.BlockDispenser;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.dispenser.IBehaviorDispenseItem;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import appeng.core.AEConfig;
import appeng.core.AppEng;
import appeng.core.CreativeTab;
import appeng.core.Registration;
import appeng.core.features.AEFeature;
import appeng.core.features.ItemDefinition;
import appeng.util.Platform;
@@ -57,8 +57,6 @@ class ItemDefinitionBuilder implements IItemBuilder
private final List<Consumer<Item>> initCallbacks = new ArrayList<>();
private final List<Consumer<Item>> modelRegCallbacks = new ArrayList<>();
private final List<Consumer<Item>> postInitCallbacks = new ArrayList<>();
private Supplier<IBehaviorDispenseItem> dispenserBehaviorSupplier;
@@ -75,28 +73,28 @@ class ItemDefinitionBuilder implements IItemBuilder
this.itemSupplier = itemSupplier;
if( Platform.isClient() )
{
this.itemRendering = new ItemRendering();
itemRendering = new ItemRendering();
}
}
@Override
public ItemDefinitionBuilder preInit( Consumer<Item> callback )
{
this.preInitCallbacks.add( callback );
preInitCallbacks.add( callback );
return this;
}
@Override
public ItemDefinitionBuilder init( Consumer<Item> callback )
{
this.initCallbacks.add( callback );
initCallbacks.add( callback );
return this;
}
@Override
public ItemDefinitionBuilder postInit( Consumer<Item> callback )
{
this.postInitCallbacks.add( callback );
postInitCallbacks.add( callback );
return this;
}
@@ -104,7 +102,7 @@ class ItemDefinitionBuilder implements IItemBuilder
public IItemBuilder features( AEFeature... features )
{
this.features.clear();
this.addFeatures( features );
addFeatures( features );
return this;
}
@@ -127,7 +125,7 @@ class ItemDefinitionBuilder implements IItemBuilder
{
if( Platform.isClient() )
{
this.customizeForClient( callback );
customizeForClient( callback );
}
return this;
@@ -143,46 +141,44 @@ class ItemDefinitionBuilder implements IItemBuilder
@SideOnly( Side.CLIENT )
private void customizeForClient( ItemRenderingCustomizer callback )
{
callback.customize( this.itemRendering );
callback.customize( itemRendering );
}
@Override
public ItemDefinition build()
{
if( !AEConfig.instance().areFeaturesEnabled( this.features ) )
if( !AEConfig.instance().areFeaturesEnabled( features ) )
{
return new ItemDefinition( this.registryName, null );
return new ItemDefinition( registryName, null );
}
Item item = this.itemSupplier.get();
item.setRegistryName( AppEng.MOD_ID, this.registryName );
Item item = itemSupplier.get();
item.setRegistryName( AppEng.MOD_ID, registryName );
ItemDefinition definition = new ItemDefinition( this.registryName, item );
ItemDefinition definition = new ItemDefinition( registryName, item );
item.setUnlocalizedName( "appliedenergistics2." + this.registryName );
item.setCreativeTab( this.creativeTab );
item.setUnlocalizedName( "appliedenergistics2." + registryName );
item.setCreativeTab( creativeTab );
// Register all extra handlers
this.preInitCallbacks.forEach( consumer -> this.factory.addPreInit( side -> consumer.accept( item ) ) );
this.initCallbacks.forEach( consumer -> this.factory.addInit( side -> consumer.accept( item ) ) );
this.modelRegCallbacks.forEach( consumer -> this.factory.addModelReg( ( side, reg ) -> consumer.accept( item ) ) );
this.postInitCallbacks.forEach( consumer -> this.factory.addPostInit( side -> consumer.accept( item ) ) );
preInitCallbacks.forEach( consumer -> factory.addPreInit( side -> consumer.accept( item ) ) );
initCallbacks.forEach( consumer -> factory.addInit( side -> consumer.accept( item ) ) );
postInitCallbacks.forEach( consumer -> factory.addPostInit( side -> consumer.accept( item ) ) );
// Register custom dispenser behavior if requested
if( this.dispenserBehaviorSupplier != null )
if( dispenserBehaviorSupplier != null )
{
this.factory.addPostInit( side ->
{
IBehaviorDispenseItem behavior = this.dispenserBehaviorSupplier.get();
factory.addPostInit( side -> {
IBehaviorDispenseItem behavior = dispenserBehaviorSupplier.get();
BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject( item, behavior );
} );
}
this.factory.addPreInit( side -> Registration.addItemToRegister( item ) );
factory.addPreInit( side -> GameRegistry.register( item ) );
if( Platform.isClient() )
{
this.itemRendering.apply( this.factory, item );
itemRendering.apply( factory, item );
}
return definition;
@@ -107,7 +107,7 @@ class ItemRendering implements IItemRendering
{
if( this.itemMeshDefinition != null )
{
factory.addBootstrapComponent( new ItemMeshDefinitionComponent( item, this.itemMeshDefinition ) );
factory.addBootstrapComponent( new ItemMeshDefinitionComponent( item, itemMeshDefinition ) );
}
if( !this.itemModels.isEmpty() )
@@ -115,7 +115,7 @@ class ItemRendering implements IItemRendering
factory.addBootstrapComponent( new ItemModelComponent( item, this.itemModels ) );
}
Set<ResourceLocation> resources = new HashSet<>( this.variants );
Set<ResourceLocation> resources = new HashSet<>( variants );
// Register a default item model if neither items by meta nor an item mesh definition exist
if( this.itemMeshDefinition == null && this.itemModels.isEmpty() )
@@ -140,14 +140,13 @@ class ItemRendering implements IItemRendering
factory.addBootstrapComponent( new ItemModelComponent( item, ImmutableMap.of( 0, model ) ) );
}
// TODO : 1.12
this.builtInModels.forEach( factory::addBuiltInModel );
builtInModels.forEach( factory::addBuiltInModel );
if( !resources.isEmpty() )
{
factory.addBootstrapComponent( new ItemVariantsComponent( item, resources ) );
}
else if( !this.itemModels.isEmpty() || this.itemMeshDefinition != null )
else if( !this.itemModels.isEmpty() || itemMeshDefinition != null )
{
// Adding an empty variant list here will prevent Vanilla from trying to load the default item model in this
// case
@@ -159,9 +158,9 @@ class ItemRendering implements IItemRendering
factory.addBootstrapComponent( new ItemVariantsComponent( item, Collections.emptyList() ) );
}
if( this.itemColor != null )
if( itemColor != null )
{
factory.addBootstrapComponent( new ItemColorComponent( item, this.itemColor ) );
factory.addBootstrapComponent( new ItemColorComponent( item, itemColor ) );
}
}
@@ -178,7 +177,7 @@ class ItemRendering implements IItemRendering
@Override
protected ModelResourceLocation getModelResourceLocation( IBlockState state )
{
return new ModelResourceLocation( this.registryName, this.getPropertyString( state.getProperties() ) );
return new ModelResourceLocation( registryName, getPropertyString( state.getProperties() ) );
}
}
}
@@ -25,7 +25,7 @@ import net.minecraft.client.renderer.color.IBlockColor;
import net.minecraftforge.fml.relauncher.Side;
public class BlockColorComponent implements IInitComponent
public class BlockColorComponent implements InitComponent
{
private final Block block;
@@ -41,7 +41,7 @@ public class BlockColorComponent implements IInitComponent
@Override
public void initialize( Side side )
{
Minecraft.getMinecraft().getBlockColors().registerBlockColorHandler( this.blockColor, this.block );
Minecraft.getMinecraft().getBlockColors().registerBlockColorHandler( blockColor, block );
}
}
@@ -33,7 +33,7 @@ import appeng.client.render.model.BuiltInModelLoader;
@SideOnly( Side.CLIENT )
public class BuiltInModelComponent implements IPreInitComponent
public class BuiltInModelComponent implements PreInitComponent
{
private final Map<String, IModel> builtInModels = new HashMap<>();
@@ -42,16 +42,16 @@ public class BuiltInModelComponent implements IPreInitComponent
public void addModel( String path, IModel model )
{
Preconditions.checkState( !this.hasInitialized );
this.builtInModels.put( path, model );
Preconditions.checkState( !hasInitialized );
builtInModels.put( path, model );
}
@Override
public void preInitialize( Side side )
{
this.hasInitialized = true;
hasInitialized = true;
BuiltInModelLoader loader = new BuiltInModelLoader( this.builtInModels );
BuiltInModelLoader loader = new BuiltInModelLoader( builtInModels );
ModelLoaderRegistry.registerLoader( loader );
}
}
@@ -25,7 +25,7 @@ import appeng.bootstrap.IBootstrapComponent;
@FunctionalInterface
public interface IInitComponent extends IBootstrapComponent
public interface InitComponent extends IBootstrapComponent
{
@Override

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