Compare commits
273 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5dfca5eb93 | |||
| 26daaf2232 | |||
| c2022a7208 | |||
| 74c2e1fab9 | |||
| 0de7a2d83a | |||
| 517a832ac1 | |||
| 1ecc811559 | |||
| 7dd283cf9f | |||
| a12ef1e534 | |||
| a567dcc026 | |||
| 7f72ba97f0 | |||
| c3db5ef9e4 | |||
| f955febb5d | |||
| 3115147edf | |||
| 1cec5922a0 | |||
| 322b296639 | |||
| d1244f59ed | |||
| 6a18102ea0 | |||
| 300a9618b6 | |||
| dfb435ae7d | |||
| 1728f683c3 | |||
| c0b62fd519 | |||
| 67c901966e | |||
| a5287f6779 | |||
| 8234c6dbb5 | |||
| 9c8deac9de | |||
| c21a44d8c0 | |||
| 3c62734c87 | |||
| 5b6b14cde7 | |||
| 51c92d3dfb | |||
| 37295745cf | |||
| c3ce9d9542 | |||
| 15993eb3c7 | |||
| 48d1a5aa88 | |||
| 3826b3b51f | |||
| 7833ff5eab | |||
| 6f5a2888c0 | |||
| 6d42032738 | |||
| 1a38e5ba94 | |||
| ff3e51018f | |||
| 65c47d4c4e | |||
| d7486fec3c | |||
| 796b6dc7a2 | |||
| 67b261cc7c | |||
| 3fb3f70392 | |||
| 49321d72c1 | |||
| 62fb0dc7f7 | |||
| e9e9535f2a | |||
| ab9f4e7fd7 | |||
| 1080b65404 | |||
| c823e1464b | |||
| 4ba722cb51 | |||
| 91b8d30a15 | |||
| 3e6231492e | |||
| 1c2df4f380 | |||
| 3f013c8d1d | |||
| 4e46dc08af | |||
| f5e3ae8949 | |||
| b2c31e20b2 | |||
| cd0aec123d | |||
| 3844f3af87 | |||
| 1cc118c927 | |||
| afd1d4e21e | |||
| 77597973e7 | |||
| 4acec30a66 | |||
| ab32b2b357 | |||
| 8b7aea9f14 | |||
| db4a6c6cc0 | |||
| c6383f21c5 | |||
| 85de600d16 | |||
| 944f434993 | |||
| 6b47bf3ce8 | |||
| 60aa74d19f | |||
| e5f59e0a00 | |||
| 2ba4f312d4 | |||
| 2274ca79e4 | |||
| a75dee0d08 | |||
| 349ac7e0a0 | |||
| b5d0db493b | |||
| 256c0258bb | |||
| 73ffbb268a | |||
| 69299a6b1d | |||
| d1e4ea6579 | |||
| f0bf72bc34 | |||
| 7fc538fc99 | |||
| acc3bb6a29 | |||
| 71ce42f26a | |||
| cb013cf55b | |||
| 57836848ae | |||
| 53c4529d7a | |||
| e3a0b34767 | |||
| 5aaaeb6d42 | |||
| e1ff0fe5ef | |||
| 86e5d6f5da | |||
| 05f90760f2 | |||
| 17465e68e8 | |||
| b0348fb888 | |||
| 7a731ec658 | |||
| 3a9296f453 | |||
| 4ac8a0add0 | |||
| 6e76690835 | |||
| 776d68bb03 | |||
| e2b870f1f1 | |||
| 4befdecd25 | |||
| 98fe4680c1 | |||
| 2d7917de14 | |||
| 6e881fac2d | |||
| 0076f2ea51 | |||
| 523548373d | |||
| 58bdeb134c | |||
| 2722057c81 | |||
| d6f29464c6 | |||
| 5105a2b1fb | |||
| c00962b044 | |||
| 858f73c439 | |||
| ade5e23458 | |||
| 61dfc05ae0 | |||
| 25fd03cb88 | |||
| e7fe8b60de | |||
| f16ae9c80b | |||
| ed1f327c57 | |||
| 4a19ea4c68 | |||
| 0ec1d728e5 | |||
| 57eb4c0a71 | |||
| ecf2f3fdaf | |||
| f3db010303 | |||
| 1a1316072a | |||
| 020740bf43 | |||
| 682c674696 | |||
| 7fa7502770 | |||
| 962c7c0a92 | |||
| 12e0efa3e1 | |||
| a349e1a277 | |||
| b72c766c16 | |||
| 72eab029ab | |||
| 3613c235be | |||
| 880ea762e5 | |||
| 83c9c0efcb | |||
| 733a53ec6d | |||
| 8c500c4016 | |||
| abdd6e1915 | |||
| 209333989e | |||
| 2803a671d1 | |||
| 1cf2e8d43e | |||
| e7746dc037 | |||
| 72195ea784 | |||
| f102c3b468 | |||
| f0215ca56a | |||
| 0f9ca7885a | |||
| 124d14d3c3 | |||
| f9e25b5a33 | |||
| 72d85aecc9 | |||
| 0bfb7b7ed3 | |||
| e82e8a039b | |||
| e626355aef | |||
| 192848e383 | |||
| 6339be5a06 | |||
| 4b5fd35056 | |||
| 1137b11550 | |||
| 6636718ef7 | |||
| e40f68d3fa | |||
| 96e79e9d9c | |||
| 3f5ed8ed7f | |||
| fdd44f4633 | |||
| 0085909914 | |||
| 5c301238cd | |||
| 30ba43e672 | |||
| afb9bb4379 | |||
| 3863e2c900 | |||
| b0249244cc | |||
| 77873e135f | |||
| 35997d58bb | |||
| 82efa151cc | |||
| 71569cadb5 | |||
| 1d737c3167 | |||
| 168038c595 | |||
| e99680d59b | |||
| 18503ac526 | |||
| 22f7345147 | |||
| b6b76d145b | |||
| 7c9b734948 | |||
| 16c0fbe3c1 | |||
| b8f22202d4 | |||
| 513292cd08 | |||
| d8ac614a17 | |||
| 8dd0991a7d | |||
| 5832e2d828 | |||
| c451a25c7f | |||
| 9d4fd64c58 | |||
| 42c7cca64f | |||
| 7f61ebebc8 | |||
| 7f14faeaa3 | |||
| f193c2adc4 | |||
| b748a1982f | |||
| a44369a272 | |||
| 25a3573a76 | |||
| 9845e2a463 | |||
| 3d5fd2c5e8 | |||
| dbacb566bb | |||
| 96576a7fc5 | |||
| 81464d7de1 | |||
| dd8e1d1faf | |||
| 00248f574a | |||
| e6e1771349 | |||
| 0a0a788c1c | |||
| 74c0fd92ae | |||
| 34665d94df | |||
| 7e681dc1d9 | |||
| c158519f37 | |||
| de069980ce | |||
| 1710894edc | |||
| 65d0ae9290 | |||
| 1baed48b0a | |||
| da6b31cdb1 | |||
| 013c8d882c | |||
| 503d325021 | |||
| 875214c166 | |||
| 2eec5309ac | |||
| a9ec31d72f | |||
| e392ecd08d | |||
| 03f9436ef9 | |||
| 8917a331eb | |||
| 8fbb317f6e | |||
| f15561c4dc | |||
| ee431b3269 | |||
| ba97dacfdd | |||
| ce6a2e8487 | |||
| 64ed05a1b4 | |||
| 23aa8fd72d | |||
| 332ea089e3 | |||
| 106003ebf9 | |||
| 8271597394 | |||
| 9210069d9b | |||
| f364359905 | |||
| fb618b939f | |||
| 43a47f8971 | |||
| e85acf2bee | |||
| bbde2443e1 | |||
| ad2f63ba0d | |||
| ee977720ca | |||
| ca953f4596 | |||
| 2adc055536 | |||
| 399934ac2b | |||
| 9451106c81 | |||
| 8e75de8fb9 | |||
| eca598516e | |||
| 2c5a54c210 | |||
| 1ac2ab0c10 | |||
| 199b17b9c6 | |||
| f582c8081b | |||
| 77d66b1817 | |||
| df370396b1 | |||
| ceeb84a439 | |||
| 9af6b50347 | |||
| d151313253 | |||
| 6d935cc8ae | |||
| 1396dbf600 | |||
| 8087a43df5 | |||
| c2cd395ca1 | |||
| a6e2975677 | |||
| 3783ae8619 | |||
| be17616836 | |||
| 36c72d641f | |||
| f878a7598d | |||
| 071ae6d680 | |||
| cc29230ce5 | |||
| b282e5d968 | |||
| 3410db7b45 | |||
| 800c30e91c | |||
| 817163dbf6 | |||
| d164e279ef | |||
| 4f9b8db6fc | |||
| b58c92ebb6 |
+3
-2
@@ -7,11 +7,12 @@
|
||||
!gradlew
|
||||
!gradlew.bat
|
||||
!build.gradle
|
||||
!build.properties
|
||||
!gradle.properties
|
||||
|
||||
# include markdowns
|
||||
!README.md
|
||||
!License.md
|
||||
!LICENSE
|
||||
!CONTRIBUTING.md
|
||||
|
||||
# include sourcecode
|
||||
!src/
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
[](http://ci.tsr.me/viewType.html?buildTypeId=AppliedEnergistics_AutoHeadBuild&tab=buildTypeStatusDiv)
|
||||
[](https://github.com/AppliedEnergistics/Applied-Energistics-2/tags)
|
||||
[](https://github.com/AppliedEnergistics/Applied-Energistics-2/releases)
|
||||
|
||||
# Applied Energistics 2
|
||||
|
||||
## Table of Contents
|
||||
@@ -26,12 +30,17 @@ A Mod about Matter, Energy and using them to conquer the world..
|
||||
|
||||
## License
|
||||
|
||||
Applied Energistics 2 API is (c) 2013 - 2014 AlgorithmX2 and licensed under MIT.
|
||||
|
||||
Applied Energistics 2 is (c) 2013 - 2014 AlgorithmX2 and licensed under LGPL v3.
|
||||
See the LICENSE.txt for details or go to http://www.gnu.org/licenses/lgpl-3.0.txt for more information.
|
||||
|
||||
Textures and Models are licensed under [Creative Commons, Attribution-NonCommercial-ShareAlike 3.0]( https://creativecommons.org/licenses/by-nc-sa/3.0/).
|
||||
* Applied Energistics 2 API
|
||||
- (c) 2013 - 2015 AlgorithmX2 et al
|
||||
- [](http://opensource.org/licenses/MIT)
|
||||
* Applied Energistics 2
|
||||
- (c) 2013 - 2015 AlgorithmX2 et al
|
||||
- [](https://raw.githubusercontent.com/AppliedEnergistics/Applied-Energistics-2/rv2/LICENSE)
|
||||
* Textures and Models
|
||||
- (c) 2013 - 2015 AlgorithmX2 et al
|
||||
- [](https://creativecommons.org/licenses/by-nc-sa/3.0/)
|
||||
* Text and Translations
|
||||
- [](https://creativecommons.org/publicdomain/zero/1.0/)
|
||||
|
||||
## Downloads
|
||||
|
||||
@@ -103,7 +112,7 @@ Getting Started
|
||||
6. Push to your fork `git push`
|
||||
7. Create a Pull-Request on GitHub
|
||||
8. Wait for review
|
||||
9. Suqash commits for cleaner history
|
||||
9. Squash commits for cleaner history
|
||||
|
||||
If you are only doing single file pull requests, GitHub supports using a quick way without the need of cloning your fork. Also read up about [synching](https://help.github.com/articles/syncing-a-fork) if you plan to contribute on regular basis.
|
||||
|
||||
@@ -137,10 +146,6 @@ An example string would be `appeng:appliedenergistics2:rv2-alpha-30:dev`
|
||||
|
||||
Files must be encoded as UTF-8.
|
||||
|
||||
### License
|
||||
|
||||
All Text and Translations submitted here can be used for any purpose, and may be re-distributed or used without any limitations.
|
||||
|
||||
### New Translations
|
||||
|
||||
You can provide any additional languages by creating a new file with the [appropriate language code](http://download1.parallels.com/SiteBuilder/Windows/docs/3.2/en_US/sitebulder-3.2-win-sdk-localization-pack-creation-guide/30801.htm).
|
||||
|
||||
+14
-9
@@ -18,14 +18,15 @@
|
||||
|
||||
apply plugin: 'forge'
|
||||
|
||||
apply from: 'gradle/scripts/propertyloader.gradle'
|
||||
apply from: 'gradle/scripts/dependencies.gradle'
|
||||
apply from: 'gradle/scripts/artifacts.gradle'
|
||||
apply from: 'gradle/scripts/autoinstallruntime.gradle'
|
||||
apply from: 'gradle/scripts/integration.gradle'
|
||||
apply from: 'gradle/scripts/optional.gradle'
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
|
||||
maven {
|
||||
@@ -51,9 +52,9 @@ configurations.all {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_6
|
||||
targetCompatibility = JavaVersion.VERSION_1_6
|
||||
|
||||
version = config.version + "-" + config.aechannel + "-" + config.build
|
||||
group = config.group
|
||||
archivesBaseName = config.archivesBaseName
|
||||
version = aeversion + "-" + aechannel + "-" + aebuild
|
||||
group = aegroup
|
||||
archivesBaseName = aebasename
|
||||
|
||||
// If TeamCity is running this build, lets set the version info
|
||||
if (hasProperty("teamcity")) {
|
||||
@@ -78,11 +79,11 @@ jar {
|
||||
}
|
||||
|
||||
minecraft {
|
||||
version = config.minecraft_version + "-" + config.forge_version
|
||||
version = minecraft_version + "-" + forge_version
|
||||
|
||||
replaceIn "AEConfig.java"
|
||||
replace "@version@", project.version
|
||||
replace "@aechannel@", config.aechannel
|
||||
replace "@aechannel@", aechannel
|
||||
|
||||
// used when launching minecraft in dev env
|
||||
runDir = "run"
|
||||
@@ -97,12 +98,16 @@ sourceSets {
|
||||
|
||||
resources {
|
||||
srcDir "src/main/resources/"
|
||||
include "assets/appliedenergistics2/recipes/*.recipe",
|
||||
include "assets/appliedenergistics2/recipes/**/*.recipe",
|
||||
"assets/appliedenergistics2/recipes/README.html",
|
||||
"assets/appliedenergistics2/lang/*.lang",
|
||||
"assets/appliedenergistics2/textures/blocks/*",
|
||||
"assets/appliedenergistics2/textures/guis/*",
|
||||
"assets/appliedenergistics2/textures/models/*",
|
||||
"assets/appliedenergistics2/textures/items/*"
|
||||
"assets/appliedenergistics2/textures/items/*",
|
||||
"assets/appliedenergistics2/meta/*",
|
||||
"mcmod.info",
|
||||
"pack.mcmeta"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -111,6 +116,6 @@ processResources {
|
||||
// replace stuff in mcmod.info, nothing else
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
include 'mcmod.info'
|
||||
expand 'version': project.version, 'mcversion': config.minecraft_version
|
||||
expand 'version': project.version, 'mcversion': minecraft_version
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
version=rv2
|
||||
aechannel=beta
|
||||
build=0
|
||||
group=appeng
|
||||
archivesBaseName=appliedenergistics2
|
||||
|
||||
#########################################################
|
||||
# Versions #
|
||||
#########################################################
|
||||
minecraft_version=1.7.10
|
||||
forge_version=10.13.2.1291
|
||||
|
||||
#########################################################
|
||||
# APIs used for development #
|
||||
#########################################################
|
||||
cb_minecraft_version=1.7.10
|
||||
fmp_version=1.1.1.324
|
||||
code_chicken_lib_version=1.1.3.127
|
||||
code_chicken_core_version=1.0.4.35
|
||||
nei_version=1.0.4.90
|
||||
bc_version=6.4.6
|
||||
|
||||
#########################################################
|
||||
# API Stubs #
|
||||
# Note: Do not edit these version numbers as they are #
|
||||
# not the version of the mod, but stub code for AE2 to #
|
||||
# compile #
|
||||
#########################################################
|
||||
api_betterstorage_version=1
|
||||
api_coloredlightscore_version=1
|
||||
api_craftguide_version=1
|
||||
api_ic2_version=1
|
||||
api_immibis_version=1
|
||||
api_invtweaks_version=1
|
||||
api_mekansim_version=1.7.10-8.0.1.198
|
||||
api_mfr_version=1
|
||||
api_railcraft_version=1
|
||||
api_rblocks_version=1
|
||||
api_rf_version=2
|
||||
api_rotarycraft_version=V5c
|
||||
api_waila_version=1.5.10_1.7.10
|
||||
Binary file not shown.
@@ -1,10 +0,0 @@
|
||||
#Organize Import Order
|
||||
#Thu Oct 09 12:52:21 CEST 2014
|
||||
6=
|
||||
5=cpw
|
||||
4=net
|
||||
3=io
|
||||
2=org
|
||||
1=com
|
||||
0=java
|
||||
7=appeng
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<profiles version="12">
|
||||
<profile kind="CodeFormatterProfile" name="Algo" version="12">
|
||||
<profile kind="CodeFormatterProfile" name="AE2" version="12">
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="do not insert"/>
|
||||
@@ -22,7 +22,7 @@
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
|
||||
@@ -37,13 +37,13 @@
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
|
||||
@@ -72,14 +72,14 @@
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
|
||||
@@ -96,7 +96,7 @@
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="0"/>
|
||||
@@ -106,7 +106,7 @@
|
||||
<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
|
||||
@@ -122,13 +122,13 @@
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="insert"/>
|
||||
@@ -138,7 +138,7 @@
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="next_line"/>
|
||||
@@ -147,7 +147,7 @@
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
|
||||
@@ -182,7 +182,7 @@
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.8"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="next_line"/>
|
||||
@@ -215,7 +215,7 @@
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="insert"/>
|
||||
@@ -231,7 +231,7 @@
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="insert"/>
|
||||
@@ -267,8 +267,8 @@
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="insert"/>
|
||||
@@ -283,13 +283,13 @@
|
||||
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="tab"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="160"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="do not insert"/>
|
||||
</profile>
|
||||
</profiles>
|
||||
@@ -0,0 +1,11 @@
|
||||
#Organize Import Order
|
||||
#Sat Jun 13 15:22:41 CEST 2015
|
||||
8=appeng
|
||||
7=
|
||||
6=cpw
|
||||
5=net
|
||||
4=io
|
||||
3=org
|
||||
2=com
|
||||
1=javax
|
||||
0=java
|
||||
@@ -0,0 +1,58 @@
|
||||
aeversion=rv3
|
||||
aechannel=alpha
|
||||
aebuild=0
|
||||
aegroup=appeng
|
||||
aebasename=appliedenergistics2
|
||||
|
||||
#########################################################
|
||||
# Versions #
|
||||
#########################################################
|
||||
minecraft_version=1.7.10
|
||||
forge_version=10.13.4.1448-1.7.10
|
||||
|
||||
#########################################################
|
||||
# Installable #
|
||||
#########################################################
|
||||
waila_version=1.5.10
|
||||
jabba_version=1.2.1a
|
||||
enderstorage_version=1.4.7.36
|
||||
translocator_version=1.1.2.15
|
||||
ic2_version=2.2.717
|
||||
enderio_version=2.3.0.375_beta
|
||||
#cofhlib_version=1.0.1-157
|
||||
#cofhcore_version=3.0.2-270
|
||||
#texpansion_version=4.0.0-176
|
||||
#tfoundation_version=1.0.0-82
|
||||
betterstorage_version=0.11.3.123.20
|
||||
invtweaks_version=1.58
|
||||
|
||||
#########################################################
|
||||
# Provided APIs #
|
||||
#########################################################
|
||||
fmp_version=1.2.0.345
|
||||
code_chicken_lib_version=1.1.3.138
|
||||
code_chicken_core_version=1.0.7.46
|
||||
nei_version=1.0.5.111
|
||||
bc_version=7.0.9
|
||||
opencomputers_version=1.5.12.26
|
||||
pneumaticcraft_version=1.9.15-105
|
||||
|
||||
#########################################################
|
||||
# Self Compiled APIs #
|
||||
#########################################################
|
||||
mekansim_version=8.0.1.198
|
||||
rotarycraft_version=V6e
|
||||
|
||||
|
||||
#########################################################
|
||||
# Self Compiled API Stubs #
|
||||
# Note: Do not edit these version numbers as they are #
|
||||
# not the version of the mod, but stub code for AE2 to #
|
||||
# compile #
|
||||
#########################################################
|
||||
api_coloredlightscore_version=1
|
||||
api_craftguide_version=1
|
||||
api_immibis_version=1
|
||||
api_mfr_version=1
|
||||
api_railcraft_version=1
|
||||
api_rf_version=2
|
||||
@@ -10,6 +10,11 @@ task javadocJar(type: Jar, dependsOn: myJavadocs) {
|
||||
from 'build/docs/javadoc/'
|
||||
}
|
||||
|
||||
task sourceJar(type: Jar, dependsOn: classes) {
|
||||
classifier = 'sources'
|
||||
from sourceSets.main.allSource
|
||||
}
|
||||
|
||||
task devJar(type: Jar) {
|
||||
|
||||
manifest {
|
||||
@@ -40,4 +45,5 @@ artifacts {
|
||||
archives devJar
|
||||
archives apiJar
|
||||
archives javadocJar
|
||||
archives sourceJar
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
@@ -19,14 +20,14 @@
|
||||
|
||||
|
||||
repositories {
|
||||
|
||||
mavenLocal()
|
||||
maven {
|
||||
name 'CB Maven FS'
|
||||
name "ChickenBones"
|
||||
url "http://chickenbones.net/maven/"
|
||||
}
|
||||
|
||||
maven {
|
||||
name "Waila Mobius Repo"
|
||||
name "Mobius"
|
||||
url "http://mobiusstrip.eu/maven"
|
||||
}
|
||||
|
||||
@@ -34,31 +35,105 @@ repositories {
|
||||
name "FireBall API Depot"
|
||||
url "http://dl.tsr.me/artifactory/libs-release-local"
|
||||
}
|
||||
|
||||
maven {
|
||||
name = "Player"
|
||||
url = "http://maven.ic2.player.to/"
|
||||
}
|
||||
|
||||
maven {
|
||||
name = "Tterrag"
|
||||
url = "http://maven.tterrag.com/"
|
||||
}
|
||||
|
||||
maven {
|
||||
name = "RX14 Proxy"
|
||||
url = "http://mvn.rx14.co.uk/repo/"
|
||||
}
|
||||
|
||||
maven {
|
||||
name "OpenComputers Repo"
|
||||
url = "http://maven.cil.li/"
|
||||
}
|
||||
|
||||
maven {
|
||||
name = "MM repo"
|
||||
url = "http://maven.k-4u.nl/"
|
||||
}
|
||||
|
||||
ivy {
|
||||
name "BuildCraft"
|
||||
artifactPattern "http://www.mod-buildcraft.com/releases/BuildCraft/[revision]/[module]-[revision]-[classifier].[ext]"
|
||||
}
|
||||
|
||||
// CurseForge DNS for TE is not available or I am just being unlucky, code part can stay since this is applicable to any other curseforge mod though
|
||||
// ivy {
|
||||
// name = "CoFHLib"
|
||||
// artifactPattern "http://addons.cursecdn.com/files/2212/893/[module]-[revision].[ext]"
|
||||
// }
|
||||
//
|
||||
// ivy {
|
||||
// name = "CoFHCore"
|
||||
// artifactPattern "http://addons.cursecdn.com/files/2212/895/[module]-[revision].[ext]"
|
||||
// }
|
||||
|
||||
// ivy {
|
||||
// name = "ThermalExpansion"
|
||||
// artifactPattern "http://addons.curse.cursecdn.com/files/2212/446/[module]-[revision].[ext]"
|
||||
// }
|
||||
|
||||
// ivy {
|
||||
// name = "ThermalFoundation"
|
||||
// artifactPattern "http://addons.curse.cursecdn.com/files/2212/444/[module]-[revision].[ext]"
|
||||
// }
|
||||
}
|
||||
|
||||
configurations {
|
||||
mods
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// installable
|
||||
mods "mcp.mobius.waila:Waila:${waila_version}_${minecraft_version}:dev"
|
||||
mods "mcp.mobius.jabba:Jabba:${jabba_version}_${minecraft_version}:dev"
|
||||
mods "codechicken:EnderStorage:${minecraft_version}-${enderstorage_version}:dev"
|
||||
mods "codechicken:Translocator:${minecraft_version}-${translocator_version}:dev"
|
||||
mods "net.industrial-craft:industrialcraft-2:${ic2_version}-experimental:dev"
|
||||
mods "com.enderio:EnderIO:${minecraft_version}-${enderio_version}:dev"
|
||||
mods "net.mcft.copy.betterstorage:BetterStorage:${minecraft_version}-${betterstorage_version}:deobf"
|
||||
mods "inventorytweaks:InventoryTweaks:${invtweaks_version}:deobf"
|
||||
mods "li.cil.oc:OpenComputers:MC${minecraft_version}-${opencomputers_version}:dev"
|
||||
|
||||
compile "codechicken:ForgeMultipart:${config.cb_minecraft_version}-${config.fmp_version}:dev"
|
||||
compile "codechicken:CodeChickenLib:${config.cb_minecraft_version}-${config.code_chicken_lib_version}:dev"
|
||||
compile "codechicken:CodeChickenCore:${config.cb_minecraft_version}-${config.code_chicken_core_version}:dev"
|
||||
compile "codechicken:NotEnoughItems:${config.cb_minecraft_version}-${config.nei_version}:dev"
|
||||
// mods name: 'CoFHLib', version: "[${minecraft_version}]${cofhlib_version}-dev", ext: 'jar'
|
||||
// mods name: 'CoFHCore', version: "[${minecraft_version}]${cofhcore_version}-dev", ext: 'jar'
|
||||
// mods name: 'ThermalExpansion', version: "[${minecraft_version}]${texpansion_version}-dev", ext: 'jar'
|
||||
// mods name: 'ThermalFoundation', version: "[${minecraft_version}]${tfoundation_version}-dev", ext: 'jar'
|
||||
|
||||
compile "com.mod-buildcraft:buildcraft:${config.bc_version}:dev"
|
||||
compile "codechicken:ForgeMultipart:${minecraft_version}-${fmp_version}:dev"
|
||||
compile "codechicken:CodeChickenLib:${minecraft_version}-${code_chicken_lib_version}:dev"
|
||||
compile "codechicken:CodeChickenCore:${minecraft_version}-${code_chicken_core_version}:dev"
|
||||
compile "codechicken:NotEnoughItems:${minecraft_version}-${nei_version}:dev"
|
||||
compile "com.mod-buildcraft:buildcraft:${bc_version}:dev"
|
||||
compile "pneumaticCraft:PneumaticCraft-${minecraft_version}:${pneumaticcraft_version}:api"
|
||||
|
||||
// provided APIs
|
||||
compile "li.cil.oc:OpenComputers:MC${minecraft_version}-${opencomputers_version}:api"
|
||||
compile "net.industrial-craft:industrialcraft-2:${ic2_version}-experimental:api"
|
||||
compile "net.mcft.copy.betterstorage:BetterStorage:${minecraft_version}-${betterstorage_version}:api"
|
||||
|
||||
// self compiled APIs
|
||||
compile(group: 'api', name: 'betterstorage', version: "${config.api_betterstorage_version}")
|
||||
compile(group: 'api', name: 'coloredlightscore', version: "${config.api_coloredlightscore_version}")
|
||||
compile(group: 'api', name: 'craftguide', version: "${config.api_craftguide_version}")
|
||||
compile(group: 'api', name: 'ic2', version: "${config.api_ic2_version}")
|
||||
compile(group: 'api', name: 'immibis', version: "${config.api_immibis_version}")
|
||||
compile(group: 'api', name: 'invtweaks', version: "${config.api_invtweaks_version}")
|
||||
compile(group: 'api', name: 'mfr', version: "${config.api_mfr_version}")
|
||||
compile(group: 'api', name: 'railcraft', version: "${config.api_railcraft_version}")
|
||||
compile(group: 'api', name: 'rblocks', version: "${config.api_rblocks_version}")
|
||||
compile(group: 'api', name: 'rf', version: "${config.api_rf_version}")
|
||||
compile "appeng:Waila:${config.api_waila_version}:api"
|
||||
compile "appeng:RotaryCraft:${config.api_rotarycraft_version}:api"
|
||||
compile "appeng:mekanism:${config.api_mekansim_version}:api"
|
||||
compile "appeng:Waila:${waila_version}_${minecraft_version}:api"
|
||||
compile "appeng:RotaryCraft:${rotarycraft_version}:api"
|
||||
compile "appeng:mekanism:${minecraft_version}-${mekansim_version}:api"
|
||||
compile "appeng:InventoryTweaks:${invtweaks_version}:api"
|
||||
|
||||
// self compiled stubs
|
||||
compile(group: 'api', name: 'coloredlightscore', version: "${api_coloredlightscore_version}")
|
||||
compile(group: 'api', name: 'craftguide', version: "${api_craftguide_version}")
|
||||
compile(group: 'api', name: 'immibis', version: "${api_immibis_version}")
|
||||
compile(group: 'api', name: 'mfr', version: "${api_mfr_version}")
|
||||
compile(group: 'api', name: 'railcraft', version: "${api_railcraft_version}")
|
||||
compile(group: 'api', name: 'rf', version: "${api_rf_version}")
|
||||
|
||||
testCompile "junit:junit:4.11"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
task wrapper(type: Wrapper) {
|
||||
gradleVersion = "2.4"
|
||||
}
|
||||
|
||||
// WAILA
|
||||
task installWaila(type: Copy, dependsOn: "deinstallWaila") {
|
||||
from { configurations.mods }
|
||||
include "**/*Waila*dev.jar"
|
||||
into file(minecraft.runDir + "/mods")
|
||||
}
|
||||
|
||||
task deinstallWaila(type: Delete) {
|
||||
delete fileTree(dir: minecraft.runDir + "/mods", include: "*Waila*.jar")
|
||||
}
|
||||
|
||||
// JABBA
|
||||
task installJabba(type: Copy, dependsOn: "deinstallJabba") {
|
||||
from { configurations.mods }
|
||||
include "**/*Jabba*dev.jar"
|
||||
into file(minecraft.runDir + "/mods")
|
||||
}
|
||||
|
||||
task deinstallJabba(type: Delete) {
|
||||
delete fileTree(dir: minecraft.runDir + "/mods", include: "*Jabba*.jar")
|
||||
}
|
||||
|
||||
// ENDER STORAGE
|
||||
task installEnderStorage(type: Copy, dependsOn: "deinstallEnderStorage") {
|
||||
from { configurations.mods }
|
||||
include "**/*EnderStorage*dev.jar"
|
||||
into file(minecraft.runDir + "/mods")
|
||||
}
|
||||
|
||||
task deinstallEnderStorage(type: Delete) {
|
||||
delete fileTree(dir: minecraft.runDir + "/mods", include: "*EnderStorage*.jar")
|
||||
}
|
||||
|
||||
// TRANSLOCATOR
|
||||
task installTranslocator(type: Copy, dependsOn: "deinstallTranslocator") {
|
||||
from { configurations.mods }
|
||||
include "**/*Translocator*dev.jar"
|
||||
into file(minecraft.runDir + "/mods")
|
||||
}
|
||||
|
||||
task deinstallTranslocator(type: Delete) {
|
||||
delete fileTree(dir: minecraft.runDir + "/mods", include: "*Translocator*.jar")
|
||||
}
|
||||
|
||||
// INDUSTRIALCRAFT
|
||||
task installIC2(type: Copy, dependsOn: "deinstallIC2") {
|
||||
from { configurations.mods }
|
||||
include "**/*industrialcraft*dev.jar"
|
||||
into file(minecraft.runDir + "/mods")
|
||||
}
|
||||
|
||||
task deinstallIC2(type: Delete) {
|
||||
delete fileTree(dir: minecraft.runDir + "/mods", include: "*industrialcraft*.jar")
|
||||
}
|
||||
|
||||
// ENDER IO
|
||||
task installEnderIO(type: Copy, dependsOn: "deinstallEnderIO") {
|
||||
from { configurations.mods }
|
||||
include "**/*EnderIO*dev.jar"
|
||||
into file(minecraft.runDir + "/mods")
|
||||
}
|
||||
|
||||
task deinstallEnderIO(type: Delete) {
|
||||
delete fileTree(dir: minecraft.runDir + "/mods", include: "*EnderIO*.jar")
|
||||
}
|
||||
|
||||
// TE
|
||||
//task installTE(type: Copy, dependsOn: "deinstallTE") {
|
||||
// from { configurations.mods }
|
||||
// include "**/*CoFHLib*.jar"
|
||||
// include "**/*CoFHCore*.jar"
|
||||
// include "**/*ThermalFoundation*.jar"
|
||||
// include "**/*ThermalExpansion*.jar"
|
||||
//
|
||||
// into file(minecraft.runDir + "/mods")
|
||||
//}
|
||||
//
|
||||
//task deinstallTE(type: Delete) {
|
||||
// delete fileTree(dir: minecraft.runDir + "/mods", includes: ["*CoFHLib*.jar", "*CoFHCore*.jar", "*ThermalFoundation*.jar", "*ThermalExpansion*.jar"])
|
||||
//}
|
||||
|
||||
// INV TWEAKS
|
||||
task installInvTweaks(type: Copy, dependsOn: "deinstallInvTweaks") {
|
||||
from { configurations.mods }
|
||||
include "**/*InventoryTweaks*dev*.jar"
|
||||
into file(minecraft.runDir + "/mods")
|
||||
}
|
||||
|
||||
task deinstallInvTweaks(type: Delete) {
|
||||
delete fileTree(dir: minecraft.runDir + "/mods", include: "*InventoryTweaks*.jar")
|
||||
}
|
||||
|
||||
// BETTER STORAGE
|
||||
task installBetterStorage(type: Copy, dependsOn: "deinstallBetterStorage") {
|
||||
from { configurations.mods }
|
||||
include "**/*BetterStorage*deobf*.jar"
|
||||
into file(minecraft.runDir + "/mods")
|
||||
}
|
||||
|
||||
task deinstallBetterStorage(type: Delete) {
|
||||
delete fileTree(dir: minecraft.runDir + "/mods", include: "*BetterStorage*.jar")
|
||||
}
|
||||
|
||||
task installOpenComputers(type: Copy, dependsOn: "deinstallOpenComputers") {
|
||||
from { configurations.mods }
|
||||
include "**/*OpenComputer*dev*.jar"
|
||||
into file(minecraft.runDir + "/mods")
|
||||
}
|
||||
|
||||
task deinstallOpenComputers(type: Delete) {
|
||||
delete fileTree(dir: minecraft.runDir + "/mods", include: "*OpenComputers*.jar")
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
// define the properties file
|
||||
ext.configFile = file "build.properties"
|
||||
|
||||
configFile.withReader {
|
||||
// read config. it shall from now on be referenced as simply config or as project.config
|
||||
def prop = new Properties()
|
||||
prop.load(it)
|
||||
project.ext.config = new ConfigSlurper().parse prop
|
||||
}
|
||||
Vendored
BIN
Binary file not shown.
+2
-2
@@ -1,6 +1,6 @@
|
||||
#Sat Sep 13 21:58:22 CEST 2014
|
||||
#Sat May 16 13:19:14 CEST 2015
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.1-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-bin.zip
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2013 AlgorithmX2
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package appeng.api.config;
|
||||
|
||||
|
||||
public enum SchedulingMode
|
||||
{
|
||||
DEFAULT, ROUNDROBIN, RANDOM
|
||||
}
|
||||
@@ -25,6 +25,7 @@ package appeng.api.config;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
|
||||
public enum Settings
|
||||
@@ -53,18 +54,23 @@ public enum Settings
|
||||
|
||||
INTERFACE_TERMINAL( EnumSet.of( YesNo.YES, YesNo.NO ) ), CRAFT_VIA_REDSTONE( EnumSet.of( YesNo.YES, YesNo.NO ) ),
|
||||
|
||||
STORAGE_FILTER( EnumSet.allOf( StorageFilter.class ) ), PLACE_BLOCK( EnumSet.of( YesNo.YES, YesNo.NO ) );
|
||||
STORAGE_FILTER( EnumSet.allOf( StorageFilter.class ) ), PLACE_BLOCK( EnumSet.of( YesNo.YES, YesNo.NO ) ),
|
||||
|
||||
private final EnumSet values;
|
||||
SCHEDULING_MODE( EnumSet.allOf( SchedulingMode.class ) );
|
||||
|
||||
Settings( EnumSet set )
|
||||
private final EnumSet<? extends Enum<?>> values;
|
||||
|
||||
Settings( @Nonnull EnumSet<? extends Enum<?>> possibleOptions )
|
||||
{
|
||||
if( set == null || set.isEmpty() )
|
||||
throw new RuntimeException( "Invalid configuration." );
|
||||
this.values = set;
|
||||
if( possibleOptions.isEmpty() )
|
||||
{
|
||||
throw new IllegalArgumentException( "Tried to instantiate an empty setting." );
|
||||
}
|
||||
|
||||
this.values = possibleOptions;
|
||||
}
|
||||
|
||||
public EnumSet getPossibleValues()
|
||||
public EnumSet<? extends Enum<?>> getPossibleValues()
|
||||
{
|
||||
return this.values;
|
||||
}
|
||||
|
||||
@@ -34,5 +34,6 @@ public enum TunnelType
|
||||
ITEM, // Item Tunnel
|
||||
LIGHT, // Light Tunnel
|
||||
BUNDLED_REDSTONE, // Bundled Redstone Tunnel
|
||||
COMPUTER_MESSAGE // Computer Message Tunnel
|
||||
COMPUTER_MESSAGE, // Computer Message Tunnel
|
||||
PRESSURE // PneumaticCraft Tunnel
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package appeng.api.definitions;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
@@ -18,4 +19,16 @@ public interface IBlockDefinition extends IItemDefinition
|
||||
* @return the {@link ItemBlock} implementation if applicable
|
||||
*/
|
||||
Optional<ItemBlock> maybeItemBlock();
|
||||
|
||||
/**
|
||||
* Compare Block with world.
|
||||
*
|
||||
* @param world world of block
|
||||
* @param x x pos of block
|
||||
* @param y y pos of block
|
||||
* @param z z pos of block
|
||||
*
|
||||
* @return if the block is placed in the world at the specific location.
|
||||
*/
|
||||
boolean isSameAs( IBlockAccess world, int x, int y, int z );
|
||||
}
|
||||
|
||||
@@ -77,6 +77,22 @@ public interface IBlocks
|
||||
|
||||
IBlockDefinition quartzPillarStair();
|
||||
|
||||
IBlockDefinition skyStoneSlab();
|
||||
|
||||
IBlockDefinition skyStoneBlockSlab();
|
||||
|
||||
IBlockDefinition skyStoneBrickSlab();
|
||||
|
||||
IBlockDefinition skyStoneSmallBrickSlab();
|
||||
|
||||
IBlockDefinition fluixSlab();
|
||||
|
||||
IBlockDefinition quartzSlab();
|
||||
|
||||
IBlockDefinition chiseledQuartzSlab();
|
||||
|
||||
IBlockDefinition quartzPillarSlab();
|
||||
|
||||
/*
|
||||
* misc
|
||||
*/
|
||||
@@ -90,7 +106,7 @@ public interface IBlocks
|
||||
|
||||
ITileDefinition charger();
|
||||
|
||||
ITileDefinition tinyTNT();
|
||||
IBlockDefinition tinyTNT();
|
||||
|
||||
ITileDefinition security();
|
||||
|
||||
|
||||
@@ -7,6 +7,10 @@ import net.minecraft.world.IBlockAccess;
|
||||
|
||||
/**
|
||||
* Interface to compare a definition with an itemstack or a block
|
||||
*
|
||||
* @author thatsIch
|
||||
* @version rv2
|
||||
* @since rv2
|
||||
*/
|
||||
public interface IComparableDefinition
|
||||
{
|
||||
@@ -28,6 +32,9 @@ public interface IComparableDefinition
|
||||
* @param z z pos of block
|
||||
*
|
||||
* @return if the block is placed in the world at the specific location.
|
||||
*
|
||||
* @deprecated moved to {@link IBlockDefinition}. Is removed in the next major release rv3
|
||||
*/
|
||||
@Deprecated
|
||||
boolean isSameAs( IBlockAccess world, int x, int y, int z );
|
||||
}
|
||||
|
||||
@@ -1,11 +1,34 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2013 - 2015 AlgorithmX2
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package appeng.api.definitions;
|
||||
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
|
||||
public interface IItemDefinition extends IComparableDefinition
|
||||
{
|
||||
@@ -18,4 +41,9 @@ public interface IItemDefinition extends IComparableDefinition
|
||||
* @return an {@link ItemStack} with specified quantity of this item.
|
||||
*/
|
||||
Optional<ItemStack> maybeStack( int stackSize );
|
||||
|
||||
/**
|
||||
* @return <tt>true</tt> if definition is enabled
|
||||
*/
|
||||
boolean isEnabled();
|
||||
}
|
||||
|
||||
@@ -66,6 +66,8 @@ public interface IParts
|
||||
|
||||
IItemDefinition annihilationPlane();
|
||||
|
||||
IItemDefinition identityAnnihilationPlane();
|
||||
|
||||
IItemDefinition formationPlane();
|
||||
|
||||
IItemDefinition p2PTunnelME();
|
||||
@@ -82,6 +84,10 @@ public interface IParts
|
||||
|
||||
IItemDefinition p2PTunnelLight();
|
||||
|
||||
IItemDefinition p2PTunnelOpenComputers();
|
||||
|
||||
IItemDefinition p2PTunnelPneumaticCraft();
|
||||
|
||||
IItemDefinition cableAnchor();
|
||||
|
||||
IItemDefinition monitor();
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
|
||||
package appeng.api.features;
|
||||
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
|
||||
@@ -12,22 +17,26 @@ import net.minecraft.item.ItemStack;
|
||||
* Lets you manipulate Inscriber Recipes, by adding or editing existing ones.
|
||||
*
|
||||
* @author thatsIch
|
||||
* @version rv2
|
||||
* @version rv3
|
||||
* @since rv2
|
||||
*/
|
||||
public interface IInscriberRegistry
|
||||
{
|
||||
/**
|
||||
* Current list of registered recipes, you can modify this if you want too.
|
||||
* Will never contain a null recipe
|
||||
* An immutable copy of currently registered recipes.
|
||||
*
|
||||
* Use the provided methods to actually modify the inscriber recipes.
|
||||
*
|
||||
* @see IInscriberRegistry#addRecipe(IInscriberRecipe)
|
||||
* @see IInscriberRegistry#removeRecipe(IInscriberRecipe)
|
||||
*
|
||||
* @return currentlyRegisteredRecipes
|
||||
*/
|
||||
@Nonnull
|
||||
List<IInscriberRecipe> getRecipes();
|
||||
Collection<IInscriberRecipe> getRecipes();
|
||||
|
||||
/**
|
||||
* Optional items which are used in the top or bottom slot
|
||||
* Optional items which are used in the top or bottom slot.
|
||||
*
|
||||
* @return set of all optional items
|
||||
*/
|
||||
@@ -35,7 +44,7 @@ public interface IInscriberRegistry
|
||||
Set<ItemStack> getOptionals();
|
||||
|
||||
/**
|
||||
* Get all registered items which are valid inputs
|
||||
* Get all registered items which are valid inputs.
|
||||
*
|
||||
* @return set of all input items
|
||||
*/
|
||||
@@ -43,7 +52,7 @@ public interface IInscriberRegistry
|
||||
Set<ItemStack> getInputs();
|
||||
|
||||
/**
|
||||
* Extensible way to create an inscriber recipe
|
||||
* Extensible way to create an inscriber recipe.
|
||||
*
|
||||
* @return builder for inscriber recipes
|
||||
*/
|
||||
@@ -61,9 +70,10 @@ public interface IInscriberRegistry
|
||||
void addRecipe( IInscriberRecipe recipe );
|
||||
|
||||
/**
|
||||
* Removes a recipe from the registry
|
||||
* Removes all equal recipes from the registry.
|
||||
*
|
||||
* @param toBeRemovedRecipe to be removed recipe, can be null, makes just no sense
|
||||
* @param toBeRemovedRecipe to be removed recipe, can be null, makes just no sense.
|
||||
*/
|
||||
void removeRecipe( IInscriberRecipe toBeRemovedRecipe );
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2013 AlgorithmX2
|
||||
* Copyright (c) 2013 - 2015 AlgorithmX2
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
@@ -24,6 +24,8 @@
|
||||
package appeng.api.features;
|
||||
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.config.TunnelType;
|
||||
@@ -39,10 +41,10 @@ public interface IP2PTunnelRegistry
|
||||
* Allows third parties to register items from their mod as potential
|
||||
* attunements for AE's P2P Tunnels
|
||||
*
|
||||
* @param trigger - the item which triggers attunement
|
||||
* @param type - the type of tunnel
|
||||
* @param trigger - the item which triggers attunement. Nullable, but then ignored
|
||||
* @param type - the type of tunnel. Nullable, but then ignored
|
||||
*/
|
||||
void addNewAttunement( ItemStack trigger, TunnelType type );
|
||||
void addNewAttunement( @Nullable ItemStack trigger, @Nullable TunnelType type );
|
||||
|
||||
/**
|
||||
* returns null if no attunement can be found.
|
||||
@@ -51,5 +53,6 @@ public interface IP2PTunnelRegistry
|
||||
*
|
||||
* @return null if no attunement can be found or attunement
|
||||
*/
|
||||
@Nullable
|
||||
TunnelType getTunnelTypeByItem( ItemStack trigger );
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2013 AlgorithmX2
|
||||
* Copyright (c) 2013 - 2015 AlgorithmX2
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
@@ -24,10 +24,12 @@
|
||||
package appeng.api.features;
|
||||
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
|
||||
/**
|
||||
* Maintains a save specific list of userids and username combinations this greatly simplifies storage internally and
|
||||
@@ -55,5 +57,6 @@ public interface IPlayerRegistry
|
||||
*
|
||||
* @return PlayerEntity, or null if the player could not be found.
|
||||
*/
|
||||
@Nullable
|
||||
EntityPlayer findPlayer( int playerID );
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2013 AlgorithmX2
|
||||
* Copyright (c) 2013 - 2015 AlgorithmX2
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
@@ -24,11 +24,19 @@
|
||||
package appeng.api.features;
|
||||
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import appeng.api.recipes.ICraftHandler;
|
||||
import appeng.api.recipes.IRecipeHandler;
|
||||
import appeng.api.recipes.ISubItemResolver;
|
||||
|
||||
|
||||
/**
|
||||
* @author AlgorithmX2
|
||||
* @author thatsIch
|
||||
* @version rv3 - 10.08.2015
|
||||
* @since rv0
|
||||
*/
|
||||
public interface IRecipeHandlerRegistry
|
||||
{
|
||||
|
||||
@@ -37,7 +45,7 @@ public interface IRecipeHandlerRegistry
|
||||
*
|
||||
* MUST BE CALLED IN PRE-INIT
|
||||
*
|
||||
* @param name name of crafthandler
|
||||
* @param name name of crafthandler
|
||||
* @param handler class of crafthandler
|
||||
*/
|
||||
void addNewCraftHandler( String name, Class<? extends ICraftHandler> handler );
|
||||
@@ -56,6 +64,7 @@ public interface IRecipeHandlerRegistry
|
||||
*
|
||||
* @return A recipe handler by name, returns null on failure.
|
||||
*/
|
||||
@Nullable
|
||||
ICraftHandler getCraftHandlerFor( String name );
|
||||
|
||||
/**
|
||||
@@ -67,9 +76,10 @@ public interface IRecipeHandlerRegistry
|
||||
* resolve sub items by name.
|
||||
*
|
||||
* @param nameSpace namespace of item
|
||||
* @param itemName full name of item
|
||||
* @param itemName full name of item
|
||||
*
|
||||
* @return ResolverResult or ResolverResultSet
|
||||
* @return ResolverResult or ResolverResultSet or null if could not resolve
|
||||
*/
|
||||
@Nullable
|
||||
Object resolveItem( String nameSpace, String itemName );
|
||||
}
|
||||
|
||||
@@ -59,9 +59,21 @@ public interface IStorageCell extends ICellWorkbenchItem
|
||||
* @param cellItem item
|
||||
*
|
||||
* @return number of bytes
|
||||
*
|
||||
* @deprecated use {@link IStorageCell#getBytesPerType(ItemStack)}
|
||||
*/
|
||||
@Deprecated
|
||||
int BytePerType( ItemStack cellItem );
|
||||
|
||||
/**
|
||||
* Determines the number of bytes used for any type included on the cell.
|
||||
*
|
||||
* @param cellItem item
|
||||
*
|
||||
* @return number of bytes
|
||||
*/
|
||||
int getBytesPerType( ItemStack cellItem );
|
||||
|
||||
/**
|
||||
* Must be between 1 and 63, indicates how many types you want to store on
|
||||
* the item.
|
||||
|
||||
@@ -94,4 +94,4 @@ public interface IGrid
|
||||
* @return the node considered the pivot point of the grid.
|
||||
*/
|
||||
IGridNode getPivot();
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2013 AlgorithmX2
|
||||
* Copyright (c) 2013 - 2015 AlgorithmX2
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
@@ -38,8 +38,8 @@ public interface ISecurityRegistry
|
||||
/**
|
||||
* Submit Permissions into the register.
|
||||
*
|
||||
* @param PlayerID player id
|
||||
* @param playerID player id
|
||||
* @param permissions permissions of player
|
||||
*/
|
||||
void addPlayer( int PlayerID, EnumSet<SecurityPermissions> permissions );
|
||||
void addPlayer( int playerID, EnumSet<SecurityPermissions> permissions );
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2013 AlgorithmX2
|
||||
* Copyright (c) 2013 - 2015 AlgorithmX2
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
@@ -94,7 +94,7 @@ public interface IFacadePart
|
||||
|
||||
int getItemDamage();
|
||||
|
||||
boolean isBC();
|
||||
boolean notAEFacade();
|
||||
|
||||
void setThinFacades( boolean useThinFacades );
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2013 AlgorithmX2
|
||||
* Copyright (c) 2013 - 2015 AlgorithmX2
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
@@ -24,6 +24,8 @@
|
||||
package appeng.api.parts;
|
||||
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
//@formatter:off
|
||||
@@ -63,5 +65,6 @@ public interface IPartItem
|
||||
*
|
||||
* @return part from item
|
||||
*/
|
||||
@Nullable
|
||||
IPart createPartFromItemStack( ItemStack is );
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2013 AlgorithmX2
|
||||
* Copyright (c) 2013 - 2015 AlgorithmX2
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
@@ -25,10 +25,17 @@ package appeng.api.recipes;
|
||||
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
|
||||
public interface IRecipeLoader
|
||||
{
|
||||
|
||||
BufferedReader getFile( String s ) throws Exception;
|
||||
/**
|
||||
* @param filePath the path to the to be loaded file
|
||||
*
|
||||
* @return reader handler of the file
|
||||
*
|
||||
* @throws Exception if reading goes wrong
|
||||
*/
|
||||
BufferedReader getFile( @Nonnull String filePath ) throws Exception;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,9 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
|
||||
public StackType injectItems( StackType input, Actionable mode, BaseActionSource src )
|
||||
{
|
||||
if( mode == Actionable.SIMULATE )
|
||||
{
|
||||
return this.getHandler().injectItems( input, mode, src );
|
||||
}
|
||||
return this.monitorDifference( input.copy(), this.getHandler().injectItems( input, mode, src ), false, src );
|
||||
}
|
||||
|
||||
@@ -94,12 +96,18 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
|
||||
StackType diff = (StackType) original.copy();
|
||||
|
||||
if( extraction )
|
||||
{
|
||||
diff.setStackSize( leftOvers == null ? 0 : -leftOvers.getStackSize() );
|
||||
}
|
||||
else if( leftOvers != null )
|
||||
{
|
||||
diff.decStackSize( leftOvers.getStackSize() );
|
||||
}
|
||||
|
||||
if( diff.getStackSize() != 0 )
|
||||
{
|
||||
this.postChangesToListeners( ImmutableList.of( diff ), src );
|
||||
}
|
||||
|
||||
return leftOvers;
|
||||
}
|
||||
@@ -118,9 +126,13 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
|
||||
Entry<IMEMonitorHandlerReceiver<StackType>, Object> o = i.next();
|
||||
IMEMonitorHandlerReceiver<StackType> receiver = o.getKey();
|
||||
if( receiver.isValid( o.getValue() ) )
|
||||
{
|
||||
receiver.postChange( this, diff, src );
|
||||
}
|
||||
else
|
||||
{
|
||||
i.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,7 +145,9 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
|
||||
public StackType extractItems( StackType request, Actionable mode, BaseActionSource src )
|
||||
{
|
||||
if( mode == Actionable.SIMULATE )
|
||||
{
|
||||
return this.getHandler().extractItems( request, mode, src );
|
||||
}
|
||||
return this.monitorDifference( request.copy(), this.getHandler().extractItems( request, mode, src ), true, src );
|
||||
}
|
||||
|
||||
|
||||
@@ -53,8 +53,12 @@ public enum StorageChannel
|
||||
public IItemList createList()
|
||||
{
|
||||
if( this == ITEMS )
|
||||
{
|
||||
return AEApi.instance().storage().createItemList();
|
||||
}
|
||||
else
|
||||
{
|
||||
return AEApi.instance().storage().createFluidList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
package appeng.api.util;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
@@ -43,5 +43,5 @@ public interface ICommonTile
|
||||
* @param z z pos of tile entity
|
||||
* @param drops drops of tile entity
|
||||
*/
|
||||
void getDrops( World world, int x, int y, int z, ArrayList<ItemStack> drops );
|
||||
void getDrops( World world, int x, int y, int z, List<ItemStack> drops );
|
||||
}
|
||||
@@ -105,22 +105,34 @@ public class WorldCoord
|
||||
int zlen = Math.abs( oz );
|
||||
|
||||
if( loc.isEqual( this.copy().add( ForgeDirection.EAST, xlen ) ) )
|
||||
{
|
||||
return ForgeDirection.EAST;
|
||||
}
|
||||
|
||||
if( loc.isEqual( this.copy().add( ForgeDirection.WEST, xlen ) ) )
|
||||
{
|
||||
return ForgeDirection.WEST;
|
||||
}
|
||||
|
||||
if( loc.isEqual( this.copy().add( ForgeDirection.NORTH, zlen ) ) )
|
||||
{
|
||||
return ForgeDirection.NORTH;
|
||||
}
|
||||
|
||||
if( loc.isEqual( this.copy().add( ForgeDirection.SOUTH, zlen ) ) )
|
||||
{
|
||||
return ForgeDirection.SOUTH;
|
||||
}
|
||||
|
||||
if( loc.isEqual( this.copy().add( ForgeDirection.UP, ylen ) ) )
|
||||
{
|
||||
return ForgeDirection.UP;
|
||||
}
|
||||
|
||||
if( loc.isEqual( this.copy().add( ForgeDirection.DOWN, ylen ) ) )
|
||||
{
|
||||
return ForgeDirection.DOWN;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
@@ -22,24 +22,19 @@ package appeng.block;
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.client.resources.IResource;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
@@ -49,21 +44,11 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import appeng.api.implementations.items.IMemoryCard;
|
||||
import appeng.api.implementations.items.MemoryCardMessages;
|
||||
import appeng.api.implementations.tiles.IColorableTile;
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
import appeng.block.networking.BlockCableBus;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.BlockRenderInfo;
|
||||
import appeng.client.render.WorldRender;
|
||||
@@ -74,67 +59,58 @@ import appeng.core.features.AEFeature;
|
||||
import appeng.core.features.FeatureNameExtractor;
|
||||
import appeng.core.features.IAEFeature;
|
||||
import appeng.core.features.IFeatureHandler;
|
||||
import appeng.core.features.ItemStackSrc;
|
||||
import appeng.helpers.AEGlassMaterial;
|
||||
import appeng.helpers.ICustomCollision;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.networking.TileCableBus;
|
||||
import appeng.tile.storage.TileSkyChest;
|
||||
import appeng.util.LookDirection;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.SettingsFrom;
|
||||
|
||||
|
||||
public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
public abstract class AEBaseBlock extends Block implements IAEFeature
|
||||
{
|
||||
private final String featureFullName;
|
||||
private final Optional<String> featureSubName;
|
||||
@SideOnly( Side.CLIENT )
|
||||
public IIcon renderIcon;
|
||||
protected final Optional<String> featureSubName;
|
||||
protected boolean isOpaque = true;
|
||||
protected boolean isFullSize = true;
|
||||
protected boolean hasSubtypes = false;
|
||||
protected boolean isInventory = false;
|
||||
private IFeatureHandler handler;
|
||||
@SideOnly( Side.CLIENT )
|
||||
BlockRenderInfo renderInfo;
|
||||
private IFeatureHandler handler;
|
||||
|
||||
@Nullable
|
||||
private Class<? extends TileEntity> tileEntityType = null;
|
||||
|
||||
protected AEBaseBlock( Class<? extends AEBaseBlock> c, Material mat )
|
||||
protected AEBaseBlock( Material mat )
|
||||
{
|
||||
this( c, mat, Optional.<String>absent() );
|
||||
this( mat, Optional.<String>absent() );
|
||||
this.setLightOpacity( 255 );
|
||||
this.setLightLevel( 0 );
|
||||
this.setHardness( 2.2F );
|
||||
this.setTileProvider( false );
|
||||
this.setHarvestLevel( "pickaxe", 0 );
|
||||
}
|
||||
|
||||
protected AEBaseBlock( Class<?> c, Material mat, Optional<String> subName )
|
||||
protected AEBaseBlock( Material mat, Optional<String> subName )
|
||||
{
|
||||
super( mat );
|
||||
|
||||
if( mat == AEGlassMaterial.INSTANCE || mat == Material.glass )
|
||||
{
|
||||
this.setStepSound( Block.soundTypeGlass );
|
||||
}
|
||||
else if( mat == Material.rock )
|
||||
{
|
||||
this.setStepSound( Block.soundTypeStone );
|
||||
}
|
||||
else if( mat == Material.wood )
|
||||
{
|
||||
this.setStepSound( Block.soundTypeWood );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.setStepSound( Block.soundTypeMetal );
|
||||
}
|
||||
|
||||
this.featureFullName = new FeatureNameExtractor( c, subName ).get();
|
||||
this.featureFullName = new FeatureNameExtractor( this.getClass(), subName ).get();
|
||||
this.featureSubName = subName;
|
||||
}
|
||||
|
||||
// update Block value.
|
||||
private void setTileProvider( boolean b )
|
||||
{
|
||||
ReflectionHelper.setPrivateValue( Block.class, this, b, "isTileProvider" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
@@ -143,8 +119,8 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
|
||||
public void registerNoIcons()
|
||||
{
|
||||
BlockRenderInfo info = this.getRendererInstance();
|
||||
FlippableIcon i = new FlippableIcon( new MissingIcon( this ) );
|
||||
final BlockRenderInfo info = this.getRendererInstance();
|
||||
final FlippableIcon i = new FlippableIcon( new MissingIcon( this ) );
|
||||
info.updateIcons( i, i, i, i, i, i );
|
||||
}
|
||||
|
||||
@@ -152,15 +128,24 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
public BlockRenderInfo getRendererInstance()
|
||||
{
|
||||
if( this.renderInfo != null )
|
||||
{
|
||||
return this.renderInfo;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return this.renderInfo = new BlockRenderInfo( this.getRenderer().newInstance() );
|
||||
final BaseBlockRender renderer = this.getRenderer().newInstance();
|
||||
this.renderInfo = new BlockRenderInfo( renderer );
|
||||
|
||||
return this.renderInfo;
|
||||
}
|
||||
catch( Throwable t )
|
||||
catch( InstantiationException e )
|
||||
{
|
||||
throw new RuntimeException( t );
|
||||
throw new IllegalStateException( "Failed to create a new instance of an illegal class " + this.getRenderer(), e );
|
||||
}
|
||||
catch( IllegalAccessException e )
|
||||
{
|
||||
throw new IllegalStateException( "Failed to create a new instance of " + this.getRenderer() + " because of permissions.", e );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,24 +160,10 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
return super.getIcon( w, x, y, z, s );
|
||||
}
|
||||
|
||||
protected void setTileEntity( Class<? extends TileEntity> c )
|
||||
{
|
||||
this.tileEntityType = c;
|
||||
|
||||
AEBaseTile.registerTileItem( c, new ItemStackSrc( this, 0 ) );
|
||||
GameRegistry.registerTileEntity( this.tileEntityType, this.featureFullName );
|
||||
this.isInventory = IInventory.class.isAssignableFrom( c );
|
||||
this.setTileProvider( this.hasBlockTileEntity() );
|
||||
}
|
||||
|
||||
public boolean hasBlockTileEntity()
|
||||
{
|
||||
return this.tileEntityType != null;
|
||||
}
|
||||
|
||||
protected void setFeature( EnumSet<AEFeature> f )
|
||||
{
|
||||
this.handler = new AEBlockFeatureHandler( f, this, this.featureSubName );
|
||||
final AEBlockFeatureHandler featureHandler = new AEBlockFeatureHandler( f, this, this.featureSubName );
|
||||
this.setHandler( featureHandler );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -201,6 +172,11 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
return this.handler;
|
||||
}
|
||||
|
||||
protected final void setHandler( IFeatureHandler handler )
|
||||
{
|
||||
this.handler = handler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit()
|
||||
{
|
||||
@@ -235,27 +211,24 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
@SideOnly( Side.CLIENT )
|
||||
public IIcon getIcon( int direction, int metadata )
|
||||
{
|
||||
if( this.renderIcon != null )
|
||||
return this.renderIcon;
|
||||
|
||||
return this.getRendererInstance().getTexture( ForgeDirection.getOrientation( direction ) );
|
||||
}
|
||||
|
||||
protected ICustomCollision getCustomCollision( World w, int x, int y, int z )
|
||||
{
|
||||
if( this instanceof ICustomCollision )
|
||||
{
|
||||
return (ICustomCollision) this;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings( "unchecked" )
|
||||
// NOTE: WAS FINAL, changed for Immibis
|
||||
public void addCollisionBoxesToList( World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e )
|
||||
{
|
||||
ICustomCollision collisionHandler = null;
|
||||
|
||||
if( this instanceof ICustomCollision )
|
||||
collisionHandler = (ICustomCollision) this;
|
||||
else
|
||||
{
|
||||
AEBaseTile te = this.getTileEntity( w, x, y, z );
|
||||
if( te instanceof ICustomCollision )
|
||||
collisionHandler = (ICustomCollision) te;
|
||||
}
|
||||
final ICustomCollision collisionHandler = this.getCustomCollision( w, x, y, z );
|
||||
|
||||
if( collisionHandler != null && bb != null )
|
||||
{
|
||||
@@ -270,37 +243,31 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
b.maxY += y;
|
||||
b.maxZ += z;
|
||||
if( bb.intersectsWith( b ) )
|
||||
{
|
||||
out.add( b );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
super.addCollisionBoxesToList( w, x, y, z, bb, out, e );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public final AxisAlignedBB getSelectedBoundingBoxFromPool( World w, int x, int y, int z )
|
||||
{
|
||||
ICustomCollision collisionHandler = null;
|
||||
AxisAlignedBB b = null;
|
||||
|
||||
if( this instanceof ICustomCollision )
|
||||
collisionHandler = (ICustomCollision) this;
|
||||
else
|
||||
{
|
||||
AEBaseTile te = this.getTileEntity( w, x, y, z );
|
||||
if( te instanceof ICustomCollision )
|
||||
collisionHandler = (ICustomCollision) te;
|
||||
}
|
||||
final ICustomCollision collisionHandler = this.getCustomCollision( w, x, y, z );
|
||||
|
||||
if( collisionHandler != null )
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
LookDirection ld = Platform.getPlayerRay( player, Platform.getEyeOffset( player ) );
|
||||
final EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
final LookDirection ld = Platform.getPlayerRay( player, Platform.getEyeOffset( player ) );
|
||||
|
||||
Iterable<AxisAlignedBB> bbs = collisionHandler.getSelectedBoundingBoxesFromPool( w, x, y, z, Minecraft.getMinecraft().thePlayer, true );
|
||||
final Iterable<AxisAlignedBB> bbs = collisionHandler.getSelectedBoundingBoxesFromPool( w, x, y, z, Minecraft.getMinecraft().thePlayer, true );
|
||||
AxisAlignedBB br = null;
|
||||
|
||||
double lastDist = 0;
|
||||
@@ -315,11 +282,12 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
|
||||
if( r != null )
|
||||
{
|
||||
double xLen = ( ld.a.xCoord - r.hitVec.xCoord );
|
||||
double yLen = ( ld.a.yCoord - r.hitVec.yCoord );
|
||||
double zLen = ( ld.a.zCoord - r.hitVec.zCoord );
|
||||
final double xLen = ( ld.a.xCoord - r.hitVec.xCoord );
|
||||
final double yLen = ( ld.a.yCoord - r.hitVec.yCoord );
|
||||
final double zLen = ( ld.a.zCoord - r.hitVec.zCoord );
|
||||
|
||||
final double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
|
||||
|
||||
double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
|
||||
if( br == null || lastDist > thisDist )
|
||||
{
|
||||
lastDist = thisDist;
|
||||
@@ -335,28 +303,26 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
}
|
||||
}
|
||||
|
||||
final AxisAlignedBB b = AxisAlignedBB.getBoundingBox( 16d, 16d, 16d, 0d, 0d, 0d );
|
||||
|
||||
for( AxisAlignedBB bx : collisionHandler.getSelectedBoundingBoxesFromPool( w, x, y, z, null, false ) )
|
||||
{
|
||||
if( b == null )
|
||||
b = bx;
|
||||
else
|
||||
{
|
||||
double minX = Math.min( b.minX, bx.minX );
|
||||
double minY = Math.min( b.minY, bx.minY );
|
||||
double minZ = Math.min( b.minZ, bx.minZ );
|
||||
double maxX = Math.max( b.maxX, bx.maxX );
|
||||
double maxY = Math.max( b.maxY, bx.maxY );
|
||||
double maxZ = Math.max( b.maxZ, bx.maxZ );
|
||||
b.setBounds( minX, minY, minZ, maxX, maxY, maxZ );
|
||||
}
|
||||
final double minX = Math.min( b.minX, bx.minX );
|
||||
final double minY = Math.min( b.minY, bx.minY );
|
||||
final double minZ = Math.min( b.minZ, bx.minZ );
|
||||
final double maxX = Math.max( b.maxX, bx.maxX );
|
||||
final double maxY = Math.max( b.maxY, bx.maxY );
|
||||
final double maxZ = Math.max( b.maxZ, bx.maxZ );
|
||||
|
||||
b.setBounds( minX, minY, minZ, maxX, maxY, maxZ );
|
||||
}
|
||||
|
||||
b.setBounds( b.minX + x, b.minY + y, b.minZ + z, b.maxX + x, b.maxY + y, b.maxZ + z );
|
||||
}
|
||||
else
|
||||
b = super.getSelectedBoundingBoxFromPool( w, x, y, z );
|
||||
|
||||
return b;
|
||||
return b;
|
||||
}
|
||||
|
||||
return super.getSelectedBoundingBoxFromPool( w, x, y, z );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -368,20 +334,11 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
@Override
|
||||
public MovingObjectPosition collisionRayTrace( World w, int x, int y, int z, Vec3 a, Vec3 b )
|
||||
{
|
||||
ICustomCollision collisionHandler = null;
|
||||
|
||||
if( this instanceof ICustomCollision )
|
||||
collisionHandler = (ICustomCollision) this;
|
||||
else
|
||||
{
|
||||
AEBaseTile te = this.getTileEntity( w, x, y, z );
|
||||
if( te instanceof ICustomCollision )
|
||||
collisionHandler = (ICustomCollision) te;
|
||||
}
|
||||
final ICustomCollision collisionHandler = this.getCustomCollision( w, x, y, z );
|
||||
|
||||
if( collisionHandler != null )
|
||||
{
|
||||
Iterable<AxisAlignedBB> bbs = collisionHandler.getSelectedBoundingBoxesFromPool( w, x, y, z, null, true );
|
||||
final Iterable<AxisAlignedBB> bbs = collisionHandler.getSelectedBoundingBoxesFromPool( w, x, y, z, null, true );
|
||||
MovingObjectPosition br = null;
|
||||
|
||||
double lastDist = 0;
|
||||
@@ -413,6 +370,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
{
|
||||
return br;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -420,104 +378,11 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
return super.collisionRayTrace( w, x, y, z, a, b );
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean onBlockActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
if( player != null )
|
||||
{
|
||||
ItemStack is = player.inventory.getCurrentItem();
|
||||
if( is != null )
|
||||
{
|
||||
if( Platform.isWrench( player, is, x, y, z ) && player.isSneaking() )
|
||||
{
|
||||
Block id = w.getBlock( x, y, z );
|
||||
if( id != null )
|
||||
{
|
||||
AEBaseTile tile = this.getTileEntity( w, x, y, z );
|
||||
ItemStack[] drops = Platform.getBlockDrops( w, x, y, z );
|
||||
|
||||
if( tile == null )
|
||||
return false;
|
||||
|
||||
if( tile instanceof TileCableBus || tile instanceof TileSkyChest )
|
||||
return false;
|
||||
|
||||
ItemStack op = new ItemStack( this );
|
||||
for( ItemStack ol : drops )
|
||||
{
|
||||
if( Platform.isSameItemType( ol, op ) )
|
||||
{
|
||||
NBTTagCompound tag = tile.downloadSettings( SettingsFrom.DISMANTLE_ITEM );
|
||||
if( tag != null )
|
||||
ol.setTagCompound( tag );
|
||||
}
|
||||
}
|
||||
|
||||
if( id.removedByPlayer( w, player, x, y, z, false ) )
|
||||
{
|
||||
List<ItemStack> l = Lists.newArrayList( drops );
|
||||
Platform.spawnDrops( w, x, y, z, l );
|
||||
w.setBlockToAir( x, y, z );
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if( is.getItem() instanceof IMemoryCard && !( this instanceof BlockCableBus ) )
|
||||
{
|
||||
IMemoryCard memoryCard = (IMemoryCard) is.getItem();
|
||||
if( player.isSneaking() )
|
||||
{
|
||||
AEBaseTile t = this.getTileEntity( w, x, y, z );
|
||||
if( t != null )
|
||||
{
|
||||
String name = this.getUnlocalizedName();
|
||||
NBTTagCompound data = t.downloadSettings( SettingsFrom.MEMORY_CARD );
|
||||
if( data != null )
|
||||
{
|
||||
memoryCard.setMemoryCardContents( is, name, data );
|
||||
memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_SAVED );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
String name = memoryCard.getSettingsName( is );
|
||||
NBTTagCompound data = memoryCard.getData( is );
|
||||
if( this.getUnlocalizedName().equals( name ) )
|
||||
{
|
||||
AEBaseTile t = this.getTileEntity( w, x, y, z );
|
||||
t.uploadSettings( SettingsFrom.MEMORY_CARD, data );
|
||||
memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_LOADED );
|
||||
}
|
||||
else
|
||||
memoryCard.notifyUser( player, MemoryCardMessages.INVALID_MACHINE );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return this.onActivated( w, x, y, z, player, side, hitX, hitY, hitZ );
|
||||
}
|
||||
|
||||
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy( World w, int x, int y, int z, EntityLivingBase player, ItemStack is )
|
||||
{
|
||||
if( is.hasDisplayName() )
|
||||
{
|
||||
TileEntity te = this.getTileEntity( w, x, y, z );
|
||||
if( te instanceof AEBaseTile )
|
||||
( (AEBaseTile) w.getTileEntity( x, y, z ) ).setName( is.getDisplayName() );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
@SuppressWarnings( "unchecked" )
|
||||
@@ -535,9 +400,6 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
@Override
|
||||
public int getComparatorInputOverride( World w, int x, int y, int z, int s )
|
||||
{
|
||||
TileEntity te = this.getTileEntity( w, x, y, z );
|
||||
if( te instanceof IInventory )
|
||||
return Container.calcRedstoneFromInventory( (IInventory) te );
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -545,14 +407,14 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void registerBlockIcons( IIconRegister iconRegistry )
|
||||
{
|
||||
BlockRenderInfo info = this.getRendererInstance();
|
||||
FlippableIcon topIcon;
|
||||
FlippableIcon bottomIcon;
|
||||
FlippableIcon sideIcon;
|
||||
FlippableIcon eastIcon;
|
||||
FlippableIcon westIcon;
|
||||
FlippableIcon southIcon;
|
||||
FlippableIcon northIcon;
|
||||
final BlockRenderInfo info = this.getRendererInstance();
|
||||
final FlippableIcon topIcon;
|
||||
final FlippableIcon bottomIcon;
|
||||
final FlippableIcon sideIcon;
|
||||
final FlippableIcon eastIcon;
|
||||
final FlippableIcon westIcon;
|
||||
final FlippableIcon southIcon;
|
||||
final FlippableIcon northIcon;
|
||||
|
||||
this.blockIcon = topIcon = this.optionalIcon( iconRegistry, this.getTextureName(), null );
|
||||
bottomIcon = this.optionalIcon( iconRegistry, this.getTextureName() + "Bottom", topIcon );
|
||||
@@ -571,19 +433,19 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
return this.isFullSize;
|
||||
}
|
||||
|
||||
public IOrientable getOrientable( IBlockAccess w, int x, int y, int z )
|
||||
{
|
||||
if( this instanceof IOrientableBlock )
|
||||
{
|
||||
return ( (IOrientableBlock) this ).getOrientable( w, x, y, z );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean rotateBlock( World w, int x, int y, int z, ForgeDirection axis )
|
||||
{
|
||||
IOrientable rotatable = null;
|
||||
|
||||
if( this.hasBlockTileEntity() )
|
||||
{
|
||||
rotatable = (AEBaseTile) this.getTileEntity( w, x, y, z );
|
||||
}
|
||||
else if( this instanceof IOrientableBlock )
|
||||
{
|
||||
rotatable = ( (IOrientableBlock) this ).getOrientable( w, x, y, z );
|
||||
}
|
||||
final IOrientable rotatable = this.getOrientable( w, x, y, z );
|
||||
|
||||
if( rotatable != null && rotatable.canBeRotated() )
|
||||
{
|
||||
@@ -630,59 +492,32 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
}
|
||||
|
||||
@Override
|
||||
public final ForgeDirection[] getValidRotations( World w, int x, int y, int z )
|
||||
public ForgeDirection[] getValidRotations( World w, int x, int y, int z )
|
||||
{
|
||||
if( this.hasBlockTileEntity() )
|
||||
{
|
||||
AEBaseTile obj = this.getTileEntity( w, x, y, z );
|
||||
if( obj != null && obj.canBeRotated() )
|
||||
{
|
||||
return ForgeDirection.VALID_DIRECTIONS;
|
||||
}
|
||||
}
|
||||
|
||||
return new ForgeDirection[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean recolourBlock( World world, int x, int y, int z, ForgeDirection side, int colour )
|
||||
{
|
||||
TileEntity te = this.getTileEntity( world, x, y, z );
|
||||
|
||||
if( te instanceof IColorableTile )
|
||||
{
|
||||
IColorableTile ct = (IColorableTile) te;
|
||||
AEColor c = ct.getColor();
|
||||
AEColor newColor = AEColor.values()[colour];
|
||||
|
||||
if( c != newColor )
|
||||
{
|
||||
ct.recolourBlock( side, newColor, null );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return super.recolourBlock( world, x, y, z, side, colour );
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
private FlippableIcon optionalIcon( IIconRegister ir, String Name, IIcon substitute )
|
||||
private FlippableIcon optionalIcon( IIconRegister ir, String name, IIcon substitute )
|
||||
{
|
||||
// if the input is an flippable IIcon find the original.
|
||||
while( substitute instanceof FlippableIcon )
|
||||
{
|
||||
substitute = ( (FlippableIcon) substitute ).getOriginal();
|
||||
}
|
||||
|
||||
if( substitute != null )
|
||||
{
|
||||
try
|
||||
{
|
||||
ResourceLocation resLoc = new ResourceLocation( Name );
|
||||
ResourceLocation resLoc = new ResourceLocation( name );
|
||||
resLoc = new ResourceLocation( resLoc.getResourceDomain(), String.format( "%s/%s%s", "textures/blocks", resLoc.getResourcePath(), ".png" ) );
|
||||
|
||||
IResource res = Minecraft.getMinecraft().getResourceManager().getResource( resLoc );
|
||||
if( res != null )
|
||||
return new FlippableIcon( ir.registerIcon( Name ) );
|
||||
{
|
||||
return new FlippableIcon( ir.registerIcon( name ) );
|
||||
}
|
||||
}
|
||||
catch( Throwable e )
|
||||
{
|
||||
@@ -690,7 +525,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
}
|
||||
}
|
||||
|
||||
return new FlippableIcon( ir.registerIcon( Name ) );
|
||||
return new FlippableIcon( ir.registerIcon( name ) );
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@@ -701,16 +536,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
|
||||
int mapRotation( IBlockAccess w, int x, int y, int z, int s )
|
||||
{
|
||||
IOrientable ori = null;
|
||||
|
||||
if( this.hasBlockTileEntity() )
|
||||
{
|
||||
ori = (AEBaseTile) this.getTileEntity( w, x, y, z );
|
||||
}
|
||||
else if( this instanceof IOrientableBlock )
|
||||
{
|
||||
ori = ( (IOrientableBlock) this ).getOrientable( w, x, y, z );
|
||||
}
|
||||
final IOrientable ori = this.getOrientable( w, x, y, z );
|
||||
|
||||
if( ori != null && ori.canBeRotated() )
|
||||
{
|
||||
@@ -720,19 +546,6 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
return s;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public <T extends TileEntity> T getTileEntity( IBlockAccess w, int x, int y, int z )
|
||||
{
|
||||
if( !this.hasBlockTileEntity() )
|
||||
return null;
|
||||
|
||||
TileEntity te = w.getTileEntity( x, y, z );
|
||||
if( this.tileEntityType.isInstance( te ) )
|
||||
return (T) te;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public ForgeDirection mapRotation( IOrientable ori, ForgeDirection dir )
|
||||
{
|
||||
// case DOWN: return bottomIcon;
|
||||
@@ -742,95 +555,63 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
// case WEST: return sideIcon;
|
||||
// case EAST: return sideIcon;
|
||||
|
||||
ForgeDirection forward = ori.getForward();
|
||||
ForgeDirection up = ori.getUp();
|
||||
final ForgeDirection forward = ori.getForward();
|
||||
final ForgeDirection up = ori.getUp();
|
||||
ForgeDirection west = ForgeDirection.UNKNOWN;
|
||||
|
||||
if( forward == null || up == null )
|
||||
{
|
||||
return dir;
|
||||
}
|
||||
|
||||
int west_x = forward.offsetY * up.offsetZ - forward.offsetZ * up.offsetY;
|
||||
int west_y = forward.offsetZ * up.offsetX - forward.offsetX * up.offsetZ;
|
||||
int west_z = forward.offsetX * up.offsetY - forward.offsetY * up.offsetX;
|
||||
|
||||
for( ForgeDirection dx : ForgeDirection.VALID_DIRECTIONS )
|
||||
{
|
||||
if( dx.offsetX == west_x && dx.offsetY == west_y && dx.offsetZ == west_z )
|
||||
{
|
||||
west = dx;
|
||||
}
|
||||
}
|
||||
|
||||
if( dir == forward )
|
||||
{
|
||||
return ForgeDirection.SOUTH;
|
||||
}
|
||||
if( dir == forward.getOpposite() )
|
||||
{
|
||||
return ForgeDirection.NORTH;
|
||||
}
|
||||
|
||||
if( dir == up )
|
||||
{
|
||||
return ForgeDirection.UP;
|
||||
}
|
||||
if( dir == up.getOpposite() )
|
||||
{
|
||||
return ForgeDirection.DOWN;
|
||||
}
|
||||
|
||||
if( dir == west )
|
||||
{
|
||||
return ForgeDirection.WEST;
|
||||
}
|
||||
if( dir == west.getOpposite() )
|
||||
{
|
||||
return ForgeDirection.EAST;
|
||||
}
|
||||
|
||||
return ForgeDirection.UNKNOWN;
|
||||
}
|
||||
|
||||
public Class<? extends TileEntity> getTileEntityClass()
|
||||
{
|
||||
return this.tileEntityType;
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void setRenderStateByMeta( int itemDamage )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public final TileEntity createNewTileEntity( World var1, int var2 )
|
||||
{
|
||||
if( this.hasBlockTileEntity() )
|
||||
{
|
||||
try
|
||||
{
|
||||
return this.tileEntityType.newInstance();
|
||||
}
|
||||
catch( InstantiationException e )
|
||||
{
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException( e );
|
||||
}
|
||||
catch( IllegalAccessException e )
|
||||
{
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException( e );
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock( World w, int x, int y, int z, Block a, int b )
|
||||
{
|
||||
AEBaseTile te = this.getTileEntity( w, x, y, z );
|
||||
if( te != null )
|
||||
{
|
||||
ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
|
||||
if( te.dropItems() )
|
||||
te.getDrops( w, x, y, z, drops );
|
||||
else
|
||||
te.getNoDrops( w, x, y, z, drops );
|
||||
|
||||
// Cry ;_; ...
|
||||
Platform.spawnDrops( w, x, y, z, drops );
|
||||
}
|
||||
|
||||
super.breakBlock( w, x, y, z, a, b );
|
||||
if( te != null )
|
||||
w.setTileEntity( x, y, z, null );
|
||||
}
|
||||
|
||||
public String getUnlocalizedName( ItemStack is )
|
||||
{
|
||||
return this.getUnlocalizedName();
|
||||
@@ -850,4 +631,5 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
{
|
||||
return this.hasSubtypes;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ import appeng.util.Platform;
|
||||
public class AEBaseItemBlock extends ItemBlock
|
||||
{
|
||||
|
||||
final AEBaseBlock blockType;
|
||||
private final AEBaseBlock blockType;
|
||||
|
||||
public AEBaseItemBlock( Block id )
|
||||
{
|
||||
@@ -56,14 +56,18 @@ public class AEBaseItemBlock extends ItemBlock
|
||||
this.hasSubtypes = this.blockType.hasSubtypes;
|
||||
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
MinecraftForgeClient.registerItemRenderer( this, ItemRenderer.INSTANCE );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata( int dmg )
|
||||
{
|
||||
if( this.hasSubtypes )
|
||||
{
|
||||
return dmg;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -101,23 +105,31 @@ public class AEBaseItemBlock extends ItemBlock
|
||||
|
||||
IOrientable ori = null;
|
||||
|
||||
if( this.blockType.hasBlockTileEntity() )
|
||||
if( this.blockType instanceof AEBaseTileBlock )
|
||||
{
|
||||
if( this.blockType instanceof BlockLightDetector )
|
||||
{
|
||||
up = ForgeDirection.getOrientation( side );
|
||||
if( up == ForgeDirection.UP || up == ForgeDirection.DOWN )
|
||||
{
|
||||
forward = ForgeDirection.SOUTH;
|
||||
}
|
||||
else
|
||||
{
|
||||
forward = ForgeDirection.UP;
|
||||
}
|
||||
}
|
||||
else if( this.blockType instanceof BlockWireless || this.blockType instanceof BlockSkyCompass )
|
||||
{
|
||||
forward = ForgeDirection.getOrientation( side );
|
||||
if( forward == ForgeDirection.UP || forward == ForgeDirection.DOWN )
|
||||
{
|
||||
up = ForgeDirection.SOUTH;
|
||||
}
|
||||
else
|
||||
{
|
||||
up = ForgeDirection.UP;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -161,27 +173,35 @@ public class AEBaseItemBlock extends ItemBlock
|
||||
up = ForgeDirection.getOrientation( side );
|
||||
forward = ForgeDirection.SOUTH;
|
||||
if( up.offsetY == 0 )
|
||||
{
|
||||
forward = ForgeDirection.UP;
|
||||
}
|
||||
}
|
||||
|
||||
if( !this.blockType.isValidOrientation( w, x, y, z, forward, up ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if( super.placeBlockAt( stack, player, w, x, y, z, side, hitX, hitY, hitZ, metadata ) )
|
||||
{
|
||||
if( this.blockType.hasBlockTileEntity() && !( this.blockType instanceof BlockLightDetector ) )
|
||||
if( this.blockType instanceof AEBaseTileBlock && !( this.blockType instanceof BlockLightDetector ) )
|
||||
{
|
||||
AEBaseTile tile = this.blockType.getTileEntity( w, x, y, z );
|
||||
AEBaseTile tile = ( (AEBaseTileBlock) this.blockType ).getTileEntity( w, x, y, z );
|
||||
ori = tile;
|
||||
|
||||
if( tile == null )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if( ori.canBeRotated() && !this.blockType.hasCustomRotation() )
|
||||
{
|
||||
if( ori.getForward() == null || ori.getUp() == null || // null
|
||||
tile.getForward() == ForgeDirection.UNKNOWN || ori.getUp() == ForgeDirection.UNKNOWN )
|
||||
tile.getForward() == ForgeDirection.UNKNOWN || ori.getUp() == ForgeDirection.UNKNOWN )
|
||||
{
|
||||
ori.setOrientation( forward, up );
|
||||
}
|
||||
}
|
||||
|
||||
if( tile instanceof IGridProxyable )
|
||||
|
||||
@@ -51,7 +51,7 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void addCheckedInformation( ItemStack itemStack, EntityPlayer player, List<String> toolTip, boolean advancedTooltips )
|
||||
{
|
||||
NBTTagCompound tag = itemStack.getTagCompound();
|
||||
final NBTTagCompound tag = itemStack.getTagCompound();
|
||||
double internalCurrentPower = 0;
|
||||
double internalMaxPower = this.getMaxEnergyCapacity();
|
||||
|
||||
@@ -60,14 +60,14 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
|
||||
internalCurrentPower = tag.getDouble( "internalCurrentPower" );
|
||||
}
|
||||
|
||||
double percent = internalCurrentPower / internalMaxPower;
|
||||
final double percent = internalCurrentPower / internalMaxPower;
|
||||
|
||||
toolTip.add( GuiText.StoredEnergy.getLocal() + ':' + MessageFormat.format( " {0,number,#} ", internalCurrentPower ) + Platform.gui_localize( PowerUnits.AE.unlocalizedName ) + " - " + MessageFormat.format( " {0,number,#.##%} ", percent ) );
|
||||
}
|
||||
|
||||
private double getMaxEnergyCapacity()
|
||||
{
|
||||
Block blockID = Block.getBlockFromItem( this );
|
||||
final Block blockID = Block.getBlockFromItem( this );
|
||||
final IBlockDefinition energyCell = Api.INSTANCE.definitions().blocks().energyCell();
|
||||
for( Block block : energyCell.maybeBlock().asSet() )
|
||||
{
|
||||
@@ -104,13 +104,13 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
|
||||
|
||||
private double getInternal( ItemStack is )
|
||||
{
|
||||
NBTTagCompound nbt = Platform.openNbtData( is );
|
||||
final NBTTagCompound nbt = Platform.openNbtData( is );
|
||||
return nbt.getDouble( "internalCurrentPower" );
|
||||
}
|
||||
|
||||
private void setInternal( ItemStack is, double amt )
|
||||
{
|
||||
NBTTagCompound nbt = Platform.openNbtData( is );
|
||||
final NBTTagCompound nbt = Platform.openNbtData( is );
|
||||
nbt.setDouble( "internalCurrentPower", amt );
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
package appeng.block;
|
||||
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemSlab;
|
||||
|
||||
|
||||
public class AEBaseItemBlockSlab extends ItemSlab
|
||||
{
|
||||
|
||||
public AEBaseItemBlockSlab( Block block, AEBaseSlabBlock singleSlab, AEBaseSlabBlock doubleSlab, Boolean isDoubleSlab )
|
||||
{
|
||||
super( block, singleSlab, doubleSlab, isDoubleSlab );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.block;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.features.IAEFeature;
|
||||
import appeng.core.features.IFeatureHandler;
|
||||
import appeng.core.features.SlabBlockFeatureHandler;
|
||||
|
||||
|
||||
public class AEBaseSlabBlock extends BlockSlab implements IAEFeature
|
||||
{
|
||||
private final IFeatureHandler features;
|
||||
private final AEBaseBlock block;
|
||||
private final int meta;
|
||||
private AEBaseSlabBlock slabs;
|
||||
private AEBaseSlabBlock doubleSlabs;
|
||||
private final String name;
|
||||
|
||||
public AEBaseSlabBlock( AEBaseBlock block, int meta, EnumSet<AEFeature> features, boolean isDoubleSlab, String name )
|
||||
{
|
||||
super( isDoubleSlab, block.getMaterial() );
|
||||
this.block = block;
|
||||
this.meta = meta;
|
||||
this.name = name;
|
||||
this.setBlockName( "appliedenergistics2." + name );
|
||||
this.setHardness( block.getBlockHardness( null, 0, 0, 0 ) );
|
||||
this.setResistance( block.getExplosionResistance( null ) * 5.0F / 3.0F );
|
||||
this.setStepSound( block.stepSound );
|
||||
this.useNeighborBrightness = true;
|
||||
if( !this.field_150004_a )
|
||||
{
|
||||
this.doubleSlabs = new AEBaseSlabBlock( block, meta, features, true, name + ".double" ).setSlabs( this );
|
||||
}
|
||||
this.features = !this.field_150004_a ? new SlabBlockFeatureHandler( features, this ) : null;
|
||||
}
|
||||
|
||||
public AEBaseSlabBlock setSlabs( AEBaseSlabBlock slabs )
|
||||
{
|
||||
this.slabs = slabs;
|
||||
return this;
|
||||
}
|
||||
|
||||
public AEBaseSlabBlock slabs()
|
||||
{
|
||||
return this.slabs;
|
||||
}
|
||||
|
||||
public AEBaseSlabBlock doubleSlabs()
|
||||
{
|
||||
return this.doubleSlabs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFeatureHandler handler()
|
||||
{
|
||||
return this.features;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit()
|
||||
{
|
||||
// Override to do stuff
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon( int dir, int meta )
|
||||
{
|
||||
return this.block.getIcon( dir, this.meta );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String func_150002_b( int p_150002_1_ )
|
||||
{
|
||||
return this.getUnlocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons( IIconRegister reg )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped( int meta, Random rand, int fortune )
|
||||
{
|
||||
return this.field_150004_a ? Item.getItemFromBlock( this.slabs ) : Item.getItemFromBlock( this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock( MovingObjectPosition target, World world, int x, int y, int z )
|
||||
{
|
||||
AEBaseSlabBlock block = (AEBaseSlabBlock) world.getBlock( x, y, z );
|
||||
|
||||
if( block == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if( block.field_150004_a )
|
||||
{
|
||||
block = this.slabs;
|
||||
}
|
||||
|
||||
int meta = world.getBlockMetadata( x, y, z ) & 7;
|
||||
return new ItemStack( block, 1, meta );
|
||||
}
|
||||
|
||||
public String name()
|
||||
{
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
@@ -21,11 +21,11 @@ package appeng.block;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockStairs;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.features.IAEFeature;
|
||||
import appeng.core.features.IFeatureHandler;
|
||||
|
||||
@@ -0,0 +1,348 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.block;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
|
||||
import appeng.api.implementations.items.IMemoryCard;
|
||||
import appeng.api.implementations.items.MemoryCardMessages;
|
||||
import appeng.api.implementations.tiles.IColorableTile;
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.block.networking.BlockCableBus;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.features.AETileBlockFeatureHandler;
|
||||
import appeng.core.features.IAEFeature;
|
||||
import appeng.helpers.ICustomCollision;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.networking.TileCableBus;
|
||||
import appeng.tile.storage.TileSkyChest;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.SettingsFrom;
|
||||
|
||||
|
||||
public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, ITileEntityProvider
|
||||
{
|
||||
|
||||
@Nonnull
|
||||
private Class<? extends TileEntity> tileEntityType;
|
||||
|
||||
public AEBaseTileBlock( Material mat )
|
||||
{
|
||||
super( mat );
|
||||
}
|
||||
|
||||
protected AEBaseTileBlock( Material mat, Optional<String> subName )
|
||||
{
|
||||
super( mat, subName );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setFeature( EnumSet<AEFeature> f )
|
||||
{
|
||||
final AETileBlockFeatureHandler featureHandler = new AETileBlockFeatureHandler( f, this, this.featureSubName );
|
||||
this.setHandler( featureHandler );
|
||||
}
|
||||
|
||||
protected void setTileEntity( Class<? extends TileEntity> c )
|
||||
{
|
||||
this.tileEntityType = c;
|
||||
this.isInventory = IInventory.class.isAssignableFrom( c );
|
||||
this.setTileProvider( this.hasBlockTileEntity() );
|
||||
}
|
||||
|
||||
// update Block value.
|
||||
private void setTileProvider( boolean b )
|
||||
{
|
||||
ReflectionHelper.setPrivateValue( Block.class, this, b, "isTileProvider" );
|
||||
}
|
||||
|
||||
public boolean hasBlockTileEntity()
|
||||
{
|
||||
return this.tileEntityType != null;
|
||||
}
|
||||
|
||||
public Class<? extends TileEntity> getTileEntityClass()
|
||||
{
|
||||
return this.tileEntityType;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public <T extends AEBaseTile> T getTileEntity( IBlockAccess w, int x, int y, int z )
|
||||
{
|
||||
if( !this.hasBlockTileEntity() )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
final TileEntity te = w.getTileEntity( x, y, z );
|
||||
if( this.tileEntityType.isInstance( te ) )
|
||||
{
|
||||
return (T) te;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final TileEntity createNewTileEntity( World var1, int var2 )
|
||||
{
|
||||
if( this.hasBlockTileEntity() )
|
||||
{
|
||||
try
|
||||
{
|
||||
return this.tileEntityType.newInstance();
|
||||
}
|
||||
catch( InstantiationException e )
|
||||
{
|
||||
throw new IllegalStateException( "Failed to create a new instance of an illegal class " + this.tileEntityType, e );
|
||||
}
|
||||
catch( IllegalAccessException e )
|
||||
{
|
||||
throw new IllegalStateException( "Failed to create a new instance of " + this.tileEntityType + ", because lack of permissions", e );
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock( World w, int x, int y, int z, Block a, int b )
|
||||
{
|
||||
final AEBaseTile te = this.getTileEntity( w, x, y, z );
|
||||
if( te != null )
|
||||
{
|
||||
final ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
|
||||
if( te.dropItems() )
|
||||
{
|
||||
te.getDrops( w, x, y, z, drops );
|
||||
}
|
||||
else
|
||||
{
|
||||
te.getNoDrops( w, x, y, z, drops );
|
||||
}
|
||||
|
||||
// Cry ;_; ...
|
||||
Platform.spawnDrops( w, x, y, z, drops );
|
||||
}
|
||||
|
||||
// super will remove the TE, as it is not an instance of BlockContainer
|
||||
super.breakBlock( w, x, y, z, a, b );
|
||||
}
|
||||
|
||||
@Override
|
||||
public final ForgeDirection[] getValidRotations( World w, int x, int y, int z )
|
||||
{
|
||||
final AEBaseTile obj = this.getTileEntity( w, x, y, z );
|
||||
if( obj != null && obj.canBeRotated() )
|
||||
{
|
||||
return ForgeDirection.VALID_DIRECTIONS;
|
||||
}
|
||||
|
||||
return super.getValidRotations( w, x, y, z );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean recolourBlock( World world, int x, int y, int z, ForgeDirection side, int colour )
|
||||
{
|
||||
final TileEntity te = this.getTileEntity( world, x, y, z );
|
||||
|
||||
if( te instanceof IColorableTile )
|
||||
{
|
||||
final IColorableTile ct = (IColorableTile) te;
|
||||
final AEColor c = ct.getColor();
|
||||
final AEColor newColor = AEColor.values()[colour];
|
||||
|
||||
if( c != newColor )
|
||||
{
|
||||
ct.recolourBlock( side, newColor, null );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return super.recolourBlock( world, x, y, z, side, colour );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride( World w, int x, int y, int z, int s )
|
||||
{
|
||||
final TileEntity te = this.getTileEntity( w, x, y, z );
|
||||
if( te instanceof IInventory )
|
||||
{
|
||||
return Container.calcRedstoneFromInventory( (IInventory) te );
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockEventReceived( World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, int p_149696_5_, int p_149696_6_ )
|
||||
{
|
||||
super.onBlockEventReceived( p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, p_149696_5_, p_149696_6_ );
|
||||
final TileEntity tileentity = p_149696_1_.getTileEntity( p_149696_2_, p_149696_3_, p_149696_4_ );
|
||||
return tileentity != null ? tileentity.receiveClientEvent( p_149696_5_, p_149696_6_ ) : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy( World w, int x, int y, int z, EntityLivingBase player, ItemStack is )
|
||||
{
|
||||
if( is.hasDisplayName() )
|
||||
{
|
||||
final TileEntity te = this.getTileEntity( w, x, y, z );
|
||||
if( te instanceof AEBaseTile )
|
||||
{
|
||||
( (AEBaseTile) w.getTileEntity( x, y, z ) ).setName( is.getDisplayName() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean onBlockActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
if( player != null )
|
||||
{
|
||||
final ItemStack is = player.inventory.getCurrentItem();
|
||||
if( is != null )
|
||||
{
|
||||
if( Platform.isWrench( player, is, x, y, z ) && player.isSneaking() )
|
||||
{
|
||||
final Block id = w.getBlock( x, y, z );
|
||||
if( id != null )
|
||||
{
|
||||
final AEBaseTile tile = this.getTileEntity( w, x, y, z );
|
||||
final ItemStack[] drops = Platform.getBlockDrops( w, x, y, z );
|
||||
|
||||
if( tile == null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if( tile instanceof TileCableBus || tile instanceof TileSkyChest )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
final ItemStack op = new ItemStack( this );
|
||||
for( ItemStack ol : drops )
|
||||
{
|
||||
if( Platform.isSameItemType( ol, op ) )
|
||||
{
|
||||
final NBTTagCompound tag = tile.downloadSettings( SettingsFrom.DISMANTLE_ITEM );
|
||||
if( tag != null )
|
||||
{
|
||||
ol.setTagCompound( tag );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( id.removedByPlayer( w, player, x, y, z, false ) )
|
||||
{
|
||||
final List<ItemStack> l = Lists.newArrayList( drops );
|
||||
Platform.spawnDrops( w, x, y, z, l );
|
||||
w.setBlockToAir( x, y, z );
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if( is.getItem() instanceof IMemoryCard && !( this instanceof BlockCableBus ) )
|
||||
{
|
||||
final IMemoryCard memoryCard = (IMemoryCard) is.getItem();
|
||||
if( player.isSneaking() )
|
||||
{
|
||||
final AEBaseTile t = this.getTileEntity( w, x, y, z );
|
||||
if( t != null )
|
||||
{
|
||||
final String name = this.getUnlocalizedName();
|
||||
final NBTTagCompound data = t.downloadSettings( SettingsFrom.MEMORY_CARD );
|
||||
if( data != null )
|
||||
{
|
||||
memoryCard.setMemoryCardContents( is, name, data );
|
||||
memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_SAVED );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
final String name = memoryCard.getSettingsName( is );
|
||||
final NBTTagCompound data = memoryCard.getData( is );
|
||||
if( this.getUnlocalizedName().equals( name ) )
|
||||
{
|
||||
final AEBaseTile t = this.getTileEntity( w, x, y, z );
|
||||
t.uploadSettings( SettingsFrom.MEMORY_CARD, data );
|
||||
memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_LOADED );
|
||||
}
|
||||
else
|
||||
{
|
||||
memoryCard.notifyUser( player, MemoryCardMessages.INVALID_MACHINE );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return this.onActivated( w, x, y, z, player, side, hitX, hitY, hitZ );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IOrientable getOrientable( IBlockAccess w, int x, int y, int z )
|
||||
{
|
||||
return this.getTileEntity( w, x, y, z );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICustomCollision getCustomCollision( World w, int x, int y, int z )
|
||||
{
|
||||
final AEBaseTile te = this.getTileEntity( w, x, y, z );
|
||||
if( te instanceof ICustomCollision )
|
||||
{
|
||||
return (ICustomCollision) te;
|
||||
}
|
||||
|
||||
return super.getCustomCollision( w, x, y, z );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -26,9 +26,9 @@ import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class AEDecorativeBlock extends AEBaseBlock
|
||||
{
|
||||
public AEDecorativeBlock( Class<? extends AEBaseBlock> c, Material mat )
|
||||
public AEDecorativeBlock( Material mat )
|
||||
{
|
||||
super( c, mat );
|
||||
super( mat );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -40,11 +40,8 @@ import appeng.tile.crafting.TileCraftingMonitorTile;
|
||||
|
||||
public class BlockCraftingMonitor extends BlockCraftingUnit
|
||||
{
|
||||
|
||||
public BlockCraftingMonitor()
|
||||
{
|
||||
super( BlockCraftingMonitor.class );
|
||||
|
||||
this.setTileEntity( TileCraftingMonitorTile.class );
|
||||
}
|
||||
|
||||
|
||||
@@ -37,8 +37,6 @@ public class BlockCraftingStorage extends BlockCraftingUnit
|
||||
{
|
||||
public BlockCraftingStorage()
|
||||
{
|
||||
super( BlockCraftingStorage.class );
|
||||
|
||||
this.setTileEntity( TileCraftingStorageTile.class );
|
||||
}
|
||||
|
||||
@@ -89,13 +87,19 @@ public class BlockCraftingStorage extends BlockCraftingUnit
|
||||
public String getUnlocalizedName( ItemStack is )
|
||||
{
|
||||
if( is.getItemDamage() == 1 )
|
||||
{
|
||||
return "tile.appliedenergistics2.BlockCraftingStorage4k";
|
||||
}
|
||||
|
||||
if( is.getItemDamage() == 2 )
|
||||
{
|
||||
return "tile.appliedenergistics2.BlockCraftingStorage16k";
|
||||
}
|
||||
|
||||
if( is.getItemDamage() == 3 )
|
||||
{
|
||||
return "tile.appliedenergistics2.BlockCraftingStorage64k";
|
||||
}
|
||||
|
||||
return this.getItemUnlocalizedName( is );
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.blocks.RenderBlockCraftingCPU;
|
||||
import appeng.client.texture.ExtraBlockTextures;
|
||||
@@ -45,22 +45,16 @@ import appeng.tile.crafting.TileCraftingTile;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockCraftingUnit extends AEBaseBlock
|
||||
public class BlockCraftingUnit extends AEBaseTileBlock
|
||||
{
|
||||
public static final int FLAG_FORMED = 8;
|
||||
|
||||
public BlockCraftingUnit()
|
||||
{
|
||||
this( BlockCraftingUnit.class );
|
||||
|
||||
this.setTileEntity( TileCraftingTile.class );
|
||||
}
|
||||
|
||||
public BlockCraftingUnit( Class<? extends BlockCraftingUnit> childClass )
|
||||
{
|
||||
super( childClass, Material.iron );
|
||||
super( Material.iron );
|
||||
|
||||
this.hasSubtypes = true;
|
||||
this.setTileEntity( TileCraftingTile.class );
|
||||
this.setFeature( EnumSet.of( AEFeature.CraftingCPU ) );
|
||||
}
|
||||
|
||||
@@ -94,7 +88,9 @@ public class BlockCraftingUnit extends AEBaseBlock
|
||||
if( tg != null && !p.isSneaking() && tg.isFormed() && tg.isActive() )
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_CRAFTING_CPU );
|
||||
return true;
|
||||
@@ -124,7 +120,9 @@ public class BlockCraftingUnit extends AEBaseBlock
|
||||
{
|
||||
TileCraftingTile cp = this.getTileEntity( w, x, y, z );
|
||||
if( cp != null )
|
||||
{
|
||||
cp.breakCluster();
|
||||
}
|
||||
|
||||
super.breakBlock( w, x, y, z, a, b );
|
||||
}
|
||||
@@ -133,7 +131,9 @@ public class BlockCraftingUnit extends AEBaseBlock
|
||||
public String getUnlocalizedName( ItemStack is )
|
||||
{
|
||||
if( is.getItemDamage() == 1 )
|
||||
{
|
||||
return "tile.appliedenergistics2.BlockCraftingAccelerator";
|
||||
}
|
||||
|
||||
return this.getItemUnlocalizedName( is );
|
||||
}
|
||||
@@ -148,7 +148,9 @@ public class BlockCraftingUnit extends AEBaseBlock
|
||||
{
|
||||
TileCraftingTile cp = this.getTileEntity( w, x, y, z );
|
||||
if( cp != null )
|
||||
{
|
||||
cp.updateMultiBlock();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -29,7 +29,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.blocks.RenderBlockAssembler;
|
||||
import appeng.core.features.AEFeature;
|
||||
@@ -38,14 +38,15 @@ import appeng.tile.crafting.TileMolecularAssembler;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockMolecularAssembler extends AEBaseBlock
|
||||
public class BlockMolecularAssembler extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
public static boolean booleanAlphaPass = false;
|
||||
|
||||
public BlockMolecularAssembler()
|
||||
{
|
||||
super( BlockMolecularAssembler.class, Material.iron );
|
||||
super( Material.iron );
|
||||
|
||||
this.setTileEntity( TileMolecularAssembler.class );
|
||||
this.isOpaque = false;
|
||||
this.lightOpacity = 1;
|
||||
|
||||
@@ -32,7 +32,7 @@ import net.minecraftforge.common.util.FakePlayer;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.implementations.tiles.ICrankable;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.blocks.RenderBlockCrank;
|
||||
import appeng.core.features.AEFeature;
|
||||
@@ -41,12 +41,13 @@ import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.grindstone.TileCrank;
|
||||
|
||||
|
||||
public class BlockCrank extends AEBaseBlock
|
||||
public class BlockCrank extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
public BlockCrank()
|
||||
{
|
||||
super( BlockCrank.class, Material.wood );
|
||||
super( Material.wood );
|
||||
|
||||
this.setTileEntity( TileCrank.class );
|
||||
this.setLightOpacity( 0 );
|
||||
this.setHarvestLevel( "axe", 0 );
|
||||
@@ -117,10 +118,12 @@ public class BlockCrank extends AEBaseBlock
|
||||
private ForgeDirection findCrankable( World world, int x, int y, int z )
|
||||
{
|
||||
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
|
||||
{
|
||||
if( this.isCrankable( world, x, y, z, dir ) )
|
||||
{
|
||||
return dir;
|
||||
}
|
||||
}
|
||||
return ForgeDirection.UNKNOWN;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,19 +26,20 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.tile.grindstone.TileGrinder;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockGrinder extends AEBaseBlock
|
||||
public class BlockGrinder extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
public BlockGrinder()
|
||||
{
|
||||
super( BlockGrinder.class, Material.rock );
|
||||
super( Material.rock );
|
||||
|
||||
this.setTileEntity( TileGrinder.class );
|
||||
this.setHardness( 3.2F );
|
||||
this.setFeature( EnumSet.of( AEFeature.GrindStone ) );
|
||||
|
||||
@@ -26,19 +26,20 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.tile.misc.TileCellWorkbench;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockCellWorkbench extends AEBaseBlock
|
||||
public class BlockCellWorkbench extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
public BlockCellWorkbench()
|
||||
{
|
||||
super( BlockCellWorkbench.class, Material.iron );
|
||||
super( Material.iron );
|
||||
|
||||
this.setTileEntity( TileCellWorkbench.class );
|
||||
this.setFeature( EnumSet.of( AEFeature.StorageCells ) );
|
||||
}
|
||||
@@ -47,13 +48,17 @@ public class BlockCellWorkbench extends AEBaseBlock
|
||||
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
if( p.isSneaking() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TileCellWorkbench tg = this.getTileEntity( w, x, y, z );
|
||||
if( tg != null )
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_CELL_WORKBENCH );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -36,7 +36,7 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.blocks.RenderBlockCharger;
|
||||
import appeng.client.render.effects.LightningFX;
|
||||
@@ -49,12 +49,13 @@ import appeng.tile.misc.TileCharger;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockCharger extends AEBaseBlock implements ICustomCollision
|
||||
public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
|
||||
{
|
||||
|
||||
public BlockCharger()
|
||||
{
|
||||
super( BlockCharger.class, Material.iron );
|
||||
super( Material.iron );
|
||||
|
||||
this.setTileEntity( TileCharger.class );
|
||||
this.setLightOpacity( 2 );
|
||||
this.isFullSize = this.isOpaque = false;
|
||||
@@ -71,7 +72,9 @@ public class BlockCharger extends AEBaseBlock implements ICustomCollision
|
||||
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
if( player.isSneaking() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
@@ -90,10 +93,14 @@ public class BlockCharger extends AEBaseBlock implements ICustomCollision
|
||||
public void randomDisplayTick( World w, int x, int y, int z, Random r )
|
||||
{
|
||||
if( !AEConfig.instance.enableEffects )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if( r.nextFloat() < 0.98 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
AEBaseTile tile = this.getTileEntity( w, x, y, z );
|
||||
if( tile instanceof TileCharger )
|
||||
|
||||
@@ -26,19 +26,20 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.tile.misc.TileCondenser;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockCondenser extends AEBaseBlock
|
||||
public class BlockCondenser extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
public BlockCondenser()
|
||||
{
|
||||
super( BlockCondenser.class, Material.iron );
|
||||
super( Material.iron );
|
||||
|
||||
this.setTileEntity( TileCondenser.class );
|
||||
this.setFeature( EnumSet.of( AEFeature.Core ) );
|
||||
}
|
||||
@@ -47,7 +48,9 @@ public class BlockCondenser extends AEBaseBlock
|
||||
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
if( player.isSneaking() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.blocks.RenderBlockInscriber;
|
||||
import appeng.core.features.AEFeature;
|
||||
@@ -35,12 +35,13 @@ import appeng.tile.misc.TileInscriber;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockInscriber extends AEBaseBlock
|
||||
public class BlockInscriber extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
public BlockInscriber()
|
||||
{
|
||||
super( BlockInscriber.class, Material.iron );
|
||||
super( Material.iron );
|
||||
|
||||
this.setTileEntity( TileInscriber.class );
|
||||
this.setLightOpacity( 2 );
|
||||
this.isFullSize = this.isOpaque = false;
|
||||
@@ -57,13 +58,17 @@ public class BlockInscriber extends AEBaseBlock
|
||||
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
if( p.isSneaking() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TileInscriber tg = this.getTileEntity( w, x, y, z );
|
||||
if( tg != null )
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_INSCRIBER );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -27,7 +27,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.blocks.RenderBlockInterface;
|
||||
import appeng.core.features.AEFeature;
|
||||
@@ -36,12 +36,13 @@ import appeng.tile.misc.TileInterface;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockInterface extends AEBaseBlock
|
||||
public class BlockInterface extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
public BlockInterface()
|
||||
{
|
||||
super( BlockInterface.class, Material.iron );
|
||||
super( Material.iron );
|
||||
|
||||
this.setTileEntity( TileInterface.class );
|
||||
this.setFeature( EnumSet.of( AEFeature.Core ) );
|
||||
}
|
||||
@@ -56,13 +57,17 @@ public class BlockInterface extends AEBaseBlock
|
||||
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
if( p.isSneaking() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TileInterface tg = this.getTileEntity( w, x, y, z );
|
||||
if( tg != null )
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_INTERFACE );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -19,25 +19,43 @@
|
||||
package appeng.block.misc;
|
||||
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.client.render.blocks.RenderQuartzTorch;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.helpers.ICustomCollision;
|
||||
import appeng.helpers.MetaRotation;
|
||||
import appeng.tile.misc.TileLightDetector;
|
||||
|
||||
|
||||
public class BlockLightDetector extends BlockQuartzTorch
|
||||
public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBlock, ICustomCollision
|
||||
{
|
||||
|
||||
public BlockLightDetector()
|
||||
{
|
||||
super( BlockLightDetector.class );
|
||||
super( Material.circuits );
|
||||
|
||||
this.setLightOpacity( 0 );
|
||||
this.isFullSize = false;
|
||||
this.isOpaque = false;
|
||||
|
||||
this.setTileEntity( TileLightDetector.class );
|
||||
this.setFeature( EnumSet.of( AEFeature.LightDetector ) );
|
||||
}
|
||||
@@ -46,7 +64,9 @@ public class BlockLightDetector extends BlockQuartzTorch
|
||||
public int isProvidingWeakPower( IBlockAccess w, int x, int y, int z, int side )
|
||||
{
|
||||
if( w instanceof World && ( (TileLightDetector) this.getTileEntity( w, x, y, z ) ).isReady() )
|
||||
{
|
||||
return ( (World) w ).getBlockLightValue( x, y, z ) - 6;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -58,7 +78,9 @@ public class BlockLightDetector extends BlockQuartzTorch
|
||||
|
||||
TileLightDetector tld = this.getTileEntity( world, x, y, z );
|
||||
if( tld != null )
|
||||
{
|
||||
tld.updateLight();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -67,4 +89,82 @@ public class BlockLightDetector extends BlockQuartzTorch
|
||||
{
|
||||
// cancel out lightning
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<? extends RenderQuartzTorch> getRenderer()
|
||||
{
|
||||
return RenderQuartzTorch.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidOrientation( World w, int x, int y, int z, ForgeDirection forward, ForgeDirection up )
|
||||
{
|
||||
return this.canPlaceAt( w, x, y, z, up.getOpposite() );
|
||||
}
|
||||
|
||||
private boolean canPlaceAt( World w, int x, int y, int z, ForgeDirection dir )
|
||||
{
|
||||
return w.isSideSolid( x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, dir.getOpposite(), false );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
|
||||
{
|
||||
ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
|
||||
double xOff = -0.3 * up.offsetX;
|
||||
double yOff = -0.3 * up.offsetY;
|
||||
double zOff = -0.3 * up.offsetZ;
|
||||
return Collections.singletonList( AxisAlignedBB.getBoundingBox( xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7 ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e )
|
||||
{/*
|
||||
* double xOff = -0.15 * getUp().offsetX; double yOff = -0.15 * getUp().offsetY; double zOff = -0.15 *
|
||||
* getUp().offsetZ; out.add( AxisAlignedBB.getBoundingBox( xOff + (double) x + 0.15, yOff + (double) y + 0.15, zOff
|
||||
* + (double) z + 0.15,// ahh xOff + (double) x + 0.85, yOff + (double) y + 0.85, zOff + (double) z + 0.85 ) );
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange( World w, int x, int y, int z, Block id )
|
||||
{
|
||||
ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
|
||||
if( !this.canPlaceAt( w, x, y, z, up.getOpposite() ) )
|
||||
{
|
||||
this.dropTorch( w, x, y, z );
|
||||
}
|
||||
}
|
||||
|
||||
private void dropTorch( World w, int x, int y, int z )
|
||||
{
|
||||
w.func_147480_a( x, y, z, true );
|
||||
// w.destroyBlock( x, y, z, true );
|
||||
w.markBlockForUpdate( x, y, z );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt( World w, int x, int y, int z )
|
||||
{
|
||||
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
|
||||
{
|
||||
if( this.canPlaceAt( w, x, y, z, dir ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean usesMetadata()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IOrientable getOrientable( final IBlockAccess w, final int x, final int y, final int z )
|
||||
{
|
||||
return new MetaRotation( w, x, y, z );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.blocks.RenderBlockPaint;
|
||||
import appeng.core.features.AEFeature;
|
||||
@@ -44,12 +44,13 @@ import appeng.tile.misc.TilePaint;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockPaint extends AEBaseBlock
|
||||
public class BlockPaint extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
public BlockPaint()
|
||||
{
|
||||
super( BlockPaint.class, new MaterialLiquid( MapColor.airColor ) );
|
||||
super( new MaterialLiquid( MapColor.airColor ) );
|
||||
|
||||
this.setTileEntity( TilePaint.class );
|
||||
this.setLightOpacity( 0 );
|
||||
this.isFullSize = false;
|
||||
@@ -71,13 +72,13 @@ public class BlockPaint extends AEBaseBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool( World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_ )
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool( World world, int x, int y, int z )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCollideCheck( int p_149678_1_, boolean p_149678_2_ )
|
||||
public boolean canCollideCheck( int metadata, boolean isHoldingRightClick )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -88,17 +89,19 @@ public class BlockPaint extends AEBaseBlock
|
||||
TilePaint tp = this.getTileEntity( w, x, y, z );
|
||||
|
||||
if( tp != null )
|
||||
{
|
||||
tp.onNeighborBlockChange();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped( int p_149650_1_, Random p_149650_2_, int p_149650_3_ )
|
||||
public Item getItemDropped( int meta, Random random, int fortune )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropBlockAsItemWithChance( World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_ )
|
||||
public void dropBlockAsItemWithChance( World world, int x, int y, int z, int meta, float chance, int fortune )
|
||||
{
|
||||
|
||||
}
|
||||
@@ -107,7 +110,9 @@ public class BlockPaint extends AEBaseBlock
|
||||
public void fillWithRain( World w, int x, int y, int z )
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
w.setBlock( x, y, z, Platform.AIR, 0, 3 );
|
||||
{
|
||||
w.setBlock( x, y, z, Platform.AIR_BLOCK, 0, 3 );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -25,33 +25,30 @@ import java.util.Random;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.blocks.RenderBlockQuartzAccelerator;
|
||||
import appeng.client.render.effects.LightningFX;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.helpers.MetaRotation;
|
||||
import appeng.tile.misc.TileQuartzGrowthAccelerator;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockQuartzGrowthAccelerator extends AEBaseBlock implements IOrientableBlock
|
||||
public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOrientableBlock
|
||||
{
|
||||
|
||||
public BlockQuartzGrowthAccelerator()
|
||||
{
|
||||
super( BlockQuartzGrowthAccelerator.class, Material.rock );
|
||||
super( Material.rock );
|
||||
this.setStepSound( Block.soundTypeMetal );
|
||||
this.setTileEntity( TileQuartzGrowthAccelerator.class );
|
||||
this.setFeature( EnumSet.of( AEFeature.Core ) );
|
||||
@@ -68,17 +65,19 @@ public class BlockQuartzGrowthAccelerator extends AEBaseBlock implements IOrient
|
||||
public void randomDisplayTick( World w, int x, int y, int z, Random r )
|
||||
{
|
||||
if( !AEConfig.instance.enableEffects )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
TileQuartzGrowthAccelerator tileQuartzGrowthAccelerator = this.getTileEntity( w, x, y, z );
|
||||
TileQuartzGrowthAccelerator cga = this.getTileEntity( w, x, y, z );
|
||||
|
||||
if( tileQuartzGrowthAccelerator != null && tileQuartzGrowthAccelerator.hasPower && CommonHelper.proxy.shouldAddParticles( r ) )
|
||||
if( cga != null && cga.hasPower && CommonHelper.proxy.shouldAddParticles( r ) )
|
||||
{
|
||||
double d0 = r.nextFloat() - 0.5F;
|
||||
double d1 = r.nextFloat() - 0.5F;
|
||||
|
||||
ForgeDirection up = tileQuartzGrowthAccelerator.getUp();
|
||||
ForgeDirection forward = tileQuartzGrowthAccelerator.getForward();
|
||||
ForgeDirection up = cga.getUp();
|
||||
ForgeDirection forward = cga.getForward();
|
||||
ForgeDirection west = Platform.crossProduct( forward, up );
|
||||
|
||||
double rx = 0.5 + x;
|
||||
@@ -98,25 +97,33 @@ public class BlockQuartzGrowthAccelerator extends AEBaseBlock implements IOrient
|
||||
dx = 0.6;
|
||||
dz = d1;
|
||||
if( !w.getBlock( x + west.offsetX, y + west.offsetY, z + west.offsetZ ).isAir( w, x + west.offsetX, y + west.offsetY, z + west.offsetZ ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
dx = d1;
|
||||
dz += 0.6;
|
||||
if( !w.getBlock( x + forward.offsetX, y + forward.offsetY, z + forward.offsetZ ).isAir( w, x + forward.offsetX, y + forward.offsetY, z + forward.offsetZ ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
dx = d1;
|
||||
dz = -0.6;
|
||||
if( !w.getBlock( x - forward.offsetX, y - forward.offsetY, z - forward.offsetZ ).isAir( w, x - forward.offsetX, y - forward.offsetY, z - forward.offsetZ ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
dx = -0.6;
|
||||
dz = d1;
|
||||
if( !w.getBlock( x - west.offsetX, y - west.offsetY, z - west.offsetZ ).isAir( w, x - west.offsetX, y - west.offsetY, z - west.offsetZ ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -134,14 +141,14 @@ public class BlockQuartzGrowthAccelerator extends AEBaseBlock implements IOrient
|
||||
}
|
||||
|
||||
@Override
|
||||
/**
|
||||
* TODO: remove with 1.8 or later
|
||||
*
|
||||
* @Deprecated no longer true, only kept to prevent missing blocks.
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean usesMetadata()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IOrientable getOrientable( final IBlockAccess w, final int x, final int y, final int z )
|
||||
{
|
||||
return new MetaRotation( w, x, y, z );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,19 +51,15 @@ import appeng.helpers.MetaRotation;
|
||||
|
||||
public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, ICustomCollision
|
||||
{
|
||||
|
||||
public BlockQuartzTorch()
|
||||
{
|
||||
this( BlockQuartzTorch.class );
|
||||
this.setLightLevel( 0.9375F );
|
||||
this.setFeature( EnumSet.of( AEFeature.DecorativeLights ) );
|
||||
}
|
||||
super( Material.circuits );
|
||||
|
||||
protected BlockQuartzTorch( Class which )
|
||||
{
|
||||
super( which, Material.circuits );
|
||||
this.setFeature( EnumSet.of( AEFeature.DecorativeLights ) );
|
||||
this.setLightLevel( 0.9375F );
|
||||
this.setLightOpacity( 0 );
|
||||
this.isFullSize = this.isOpaque = false;
|
||||
this.isFullSize = false;
|
||||
this.isOpaque = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -107,10 +103,14 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
|
||||
public void randomDisplayTick( World w, int x, int y, int z, Random r )
|
||||
{
|
||||
if( !AEConfig.instance.enableEffects )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if( r.nextFloat() < 0.98 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
|
||||
double xOff = -0.3 * up.offsetX;
|
||||
@@ -132,7 +132,9 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
|
||||
{
|
||||
ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
|
||||
if( !this.canPlaceAt( w, x, y, z, up.getOpposite() ) )
|
||||
{
|
||||
this.dropTorch( w, x, y, z );
|
||||
}
|
||||
}
|
||||
|
||||
private void dropTorch( World w, int x, int y, int z )
|
||||
@@ -146,8 +148,12 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
|
||||
public boolean canPlaceBlockAt( World w, int x, int y, int z )
|
||||
{
|
||||
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
|
||||
{
|
||||
if( this.canPlaceAt( w, x, y, z, dir ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.blocks.RendererSecurity;
|
||||
import appeng.core.features.AEFeature;
|
||||
@@ -35,12 +35,13 @@ import appeng.tile.misc.TileSecurity;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockSecurity extends AEBaseBlock
|
||||
public class BlockSecurity extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
public BlockSecurity()
|
||||
{
|
||||
super( BlockSecurity.class, Material.iron );
|
||||
super( Material.iron );
|
||||
|
||||
this.setTileEntity( TileSecurity.class );
|
||||
this.setFeature( EnumSet.of( AEFeature.Security ) );
|
||||
}
|
||||
@@ -55,13 +56,17 @@ public class BlockSecurity extends AEBaseBlock
|
||||
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
if( p.isSneaking() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TileSecurity tg = this.getTileEntity( w, x, y, z );
|
||||
if( tg != null )
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_SECURITY );
|
||||
return true;
|
||||
|
||||
@@ -36,7 +36,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.blocks.RenderBlockSkyCompass;
|
||||
import appeng.core.features.AEFeature;
|
||||
@@ -44,12 +44,12 @@ import appeng.helpers.ICustomCollision;
|
||||
import appeng.tile.misc.TileSkyCompass;
|
||||
|
||||
|
||||
public class BlockSkyCompass extends AEBaseBlock implements ICustomCollision
|
||||
public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
|
||||
{
|
||||
|
||||
public BlockSkyCompass()
|
||||
{
|
||||
super( BlockSkyCompass.class, Material.iron );
|
||||
super( Material.iron );
|
||||
this.setTileEntity( TileSkyCompass.class );
|
||||
this.isOpaque = this.isFullSize = false;
|
||||
this.lightOpacity = 0;
|
||||
@@ -80,7 +80,9 @@ public class BlockSkyCompass extends AEBaseBlock implements ICustomCollision
|
||||
{
|
||||
TileSkyCompass sc = this.getTileEntity( w, x, y, z );
|
||||
if( sc != null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return this.canPlaceAt( w, x, y, z, forward.getOpposite() );
|
||||
}
|
||||
|
||||
@@ -95,7 +97,9 @@ public class BlockSkyCompass extends AEBaseBlock implements ICustomCollision
|
||||
TileSkyCompass sc = this.getTileEntity( w, x, y, z );
|
||||
ForgeDirection up = sc.getForward();
|
||||
if( !this.canPlaceAt( w, x, y, z, up.getOpposite() ) )
|
||||
{
|
||||
this.dropTorch( w, x, y, z );
|
||||
}
|
||||
}
|
||||
|
||||
private void dropTorch( World w, int x, int y, int z )
|
||||
@@ -109,8 +113,12 @@ public class BlockSkyCompass extends AEBaseBlock implements ICustomCollision
|
||||
public boolean canPlaceBlockAt( World w, int x, int y, int z )
|
||||
{
|
||||
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
|
||||
{
|
||||
if( this.canPlaceAt( w, x, y, z, dir ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
@@ -58,7 +58,7 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
|
||||
|
||||
public BlockTinyTNT()
|
||||
{
|
||||
super( BlockTinyTNT.class, Material.tnt );
|
||||
super( Material.tnt );
|
||||
this.setLightOpacity( 1 );
|
||||
this.setBlockBounds( 0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f );
|
||||
this.isFullSize = this.isOpaque = false;
|
||||
@@ -66,7 +66,7 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
|
||||
this.setHardness( 0F );
|
||||
this.setFeature( EnumSet.of( AEFeature.TinyTNT ) );
|
||||
|
||||
EntityRegistry.registerModEntity( EntityTinyTNTPrimed.class, "EntityTinyTNTPrimed", EntityIds.TINY_TNT, AppEng.instance, 16, 4, true );
|
||||
EntityRegistry.registerModEntity( EntityTinyTNTPrimed.class, "EntityTinyTNTPrimed", EntityIds.TINY_TNT, AppEng.instance(), 16, 4, true );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -29,7 +29,7 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.client.texture.ExtraBlockTextures;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.features.AEFeature;
|
||||
@@ -39,12 +39,12 @@ import appeng.tile.misc.TileVibrationChamber;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockVibrationChamber extends AEBaseBlock
|
||||
public final class BlockVibrationChamber extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
public BlockVibrationChamber()
|
||||
{
|
||||
super( BlockVibrationChamber.class, Material.iron );
|
||||
super( Material.iron );
|
||||
this.setTileEntity( TileVibrationChamber.class );
|
||||
this.setHardness( 4.2F );
|
||||
this.setFeature( EnumSet.of( AEFeature.PowerGen ) );
|
||||
@@ -68,7 +68,9 @@ public class BlockVibrationChamber extends AEBaseBlock
|
||||
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
if( player.isSneaking() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
@@ -87,7 +89,9 @@ public class BlockVibrationChamber extends AEBaseBlock
|
||||
public void randomDisplayTick( World w, int x, int y, int z, Random r )
|
||||
{
|
||||
if( !AEConfig.instance.enableEffects )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
AEBaseTile tile = this.getTileEntity( w, x, y, z );
|
||||
if( tile instanceof TileVibrationChamber )
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
@@ -53,17 +53,18 @@ import appeng.api.parts.IPartHost;
|
||||
import appeng.api.parts.PartItemStack;
|
||||
import appeng.api.parts.SelectedPart;
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.BusRenderHelper;
|
||||
import appeng.client.render.blocks.RendererCableBus;
|
||||
import appeng.client.texture.ExtraBlockTextures;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.Api;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.features.AECableBusFeatureHandler;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.helpers.AEGlassMaterial;
|
||||
import appeng.integration.IntegrationRegistry;
|
||||
import appeng.integration.IntegrationType;
|
||||
import appeng.integration.abstraction.IFMP;
|
||||
import appeng.parts.ICableBusContainer;
|
||||
@@ -77,7 +78,7 @@ import appeng.util.Platform;
|
||||
|
||||
|
||||
@Interface( iface = "powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection", iname = "MFR" )
|
||||
public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
||||
public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
|
||||
{
|
||||
|
||||
private static final ICableBusContainer NULL_CABLE_BUS = new NullCableBusContainer();
|
||||
@@ -91,9 +92,12 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
||||
|
||||
public BlockCableBus()
|
||||
{
|
||||
super( BlockCableBus.class, AEGlassMaterial.INSTANCE );
|
||||
super( AEGlassMaterial.INSTANCE );
|
||||
this.setLightOpacity( 0 );
|
||||
this.isFullSize = this.isOpaque = false;
|
||||
|
||||
// this will actually be overwritten later through setupTile and the combined layers
|
||||
this.setTileEntity( TileCableBus.class );
|
||||
this.setFeature( EnumSet.of( AEFeature.Core ) );
|
||||
}
|
||||
|
||||
@@ -119,12 +123,14 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
||||
public int getRenderBlockPass()
|
||||
{
|
||||
if( AEConfig.instance.isFeatureEnabled( AEFeature.AlphaPass ) )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int colorMultiplier( IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_ )
|
||||
public int colorMultiplier( IBlockAccess world, int x, int y, int z )
|
||||
{
|
||||
return this.myColorMultiplier;
|
||||
}
|
||||
@@ -162,7 +168,9 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
||||
return block.getLightValue( world, x, y, z );
|
||||
}
|
||||
if( block == null )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return this.cb( world, x, y, z ).getLightValue();
|
||||
}
|
||||
|
||||
@@ -192,7 +200,9 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
||||
{
|
||||
AEBaseTile tile = this.getTileEntity( world, x, y, z );
|
||||
if( tile != null )
|
||||
{
|
||||
tile.disableDrops();
|
||||
}
|
||||
// maybe ray trace?
|
||||
}
|
||||
return super.removedByPlayer( world, player, x, y, z );
|
||||
@@ -224,21 +234,27 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
||||
BusRenderHelper.INSTANCE.setPass( pass );
|
||||
|
||||
if( AEConfig.instance.isFeatureEnabled( AEFeature.AlphaPass ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return pass == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock( MovingObjectPosition target, World world, int x, int y, int z )
|
||||
public ItemStack getPickBlock( MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player )
|
||||
{
|
||||
Vec3 v3 = target.hitVec.addVector( -x, -y, -z );
|
||||
SelectedPart sp = this.cb( world, x, y, z ).selectPart( v3 );
|
||||
|
||||
if( sp.part != null )
|
||||
{
|
||||
return sp.part.getItemStack( PartItemStack.Pick );
|
||||
}
|
||||
else if( sp.facade != null )
|
||||
{
|
||||
return sp.facade.getItemStack();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -258,7 +274,9 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
||||
IIcon ico = this.getIcon( p );
|
||||
|
||||
if( ico == null )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
byte b0 = (byte) ( Platform.getRandomInt() % 2 == 0 ? 1 : 0 );
|
||||
|
||||
@@ -304,7 +322,9 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
||||
IIcon ico = this.getIcon( p );
|
||||
|
||||
if( ico == null )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
byte b0 = 3;
|
||||
|
||||
@@ -335,19 +355,25 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
||||
public void onNeighborChange( IBlockAccess w, int x, int y, int z, int tileX, int tileY, int tileZ )
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
this.cb( w, x, y, z ).onNeighborChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private IIcon getIcon( IPart p )
|
||||
{
|
||||
if( p == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
IIcon ico = p.getBreakingTexture();
|
||||
if( ico != null )
|
||||
{
|
||||
return ico;
|
||||
}
|
||||
}
|
||||
catch( Throwable t )
|
||||
{
|
||||
@@ -356,7 +382,9 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
||||
|
||||
ItemStack is = p.getItemStack( PartItemStack.Network );
|
||||
if( is == null || is.getItem() == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return is.getItem().getIcon( is, 0 );
|
||||
}
|
||||
@@ -367,10 +395,13 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
||||
ICableBusContainer out = null;
|
||||
|
||||
if( te instanceof TileCableBus )
|
||||
{
|
||||
out = ( (TileCableBus) te ).cb;
|
||||
|
||||
else if( AppEng.instance.isIntegrationEnabled( IntegrationType.FMP ) )
|
||||
out = ( (IFMP) AppEng.instance.getIntegration( IntegrationType.FMP ) ).getCableContainer( te );
|
||||
}
|
||||
else if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FMP ) )
|
||||
{
|
||||
out = ( (IFMP) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FMP ) ).getCableContainer( te );
|
||||
}
|
||||
|
||||
return out == null ? NULL_CABLE_BUS : out;
|
||||
}
|
||||
@@ -392,7 +423,9 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
||||
{
|
||||
IIcon i = super.getIcon( direction, metadata );
|
||||
if( i != null )
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
return ExtraBlockTextures.BlockQuartzGlassB.getIcon();
|
||||
}
|
||||
@@ -435,25 +468,38 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends TileEntity> T getTileEntity( IBlockAccess w, int x, int y, int z )
|
||||
public <T extends AEBaseTile> T getTileEntity( IBlockAccess w, int x, int y, int z )
|
||||
{
|
||||
TileEntity te = w.getTileEntity( x, y, z );
|
||||
|
||||
if( noTesrTile.isInstance( te ) )
|
||||
{
|
||||
return (T) te;
|
||||
}
|
||||
|
||||
if( tesrTile != null && tesrTile.isInstance( te ) )
|
||||
{
|
||||
return (T) te;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setFeature( EnumSet<AEFeature> f )
|
||||
{
|
||||
final AECableBusFeatureHandler featureHandler = new AECableBusFeatureHandler( f, this, this.featureSubName );
|
||||
this.setHandler( featureHandler );
|
||||
}
|
||||
|
||||
public void setupTile()
|
||||
{
|
||||
this.setTileEntity( noTesrTile = Api.INSTANCE.getPartHelper().getCombinedInstance( TileCableBus.class.getName() ) );
|
||||
noTesrTile = Api.INSTANCE.partHelper().getCombinedInstance( TileCableBus.class.getName() );
|
||||
this.setTileEntity( noTesrTile );
|
||||
GameRegistry.registerTileEntity( noTesrTile, "BlockCableBus" );
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
tesrTile = Api.INSTANCE.getPartHelper().getCombinedInstance( TileCableBusTESR.class.getName() );
|
||||
tesrTile = Api.INSTANCE.partHelper().getCombinedInstance( TileCableBusTESR.class.getName() );
|
||||
GameRegistry.registerTileEntity( tesrTile, "ClientOnly_TESR_CableBus" );
|
||||
CommonHelper.proxy.bindTileEntitySpecialRenderer( tesrTile, this );
|
||||
}
|
||||
|
||||
@@ -25,30 +25,32 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.blocks.RenderBlockController;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.tile.networking.TileController;
|
||||
|
||||
|
||||
public class BlockController extends AEBaseBlock
|
||||
public class BlockController extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
public BlockController()
|
||||
{
|
||||
super( BlockController.class, Material.iron );
|
||||
super( Material.iron );
|
||||
this.setTileEntity( TileController.class );
|
||||
this.setHardness( 6 );
|
||||
this.setFeature( EnumSet.of( AEFeature.Channels ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange( World w, int x, int y, int z, Block id_junk )
|
||||
public void onNeighborBlockChange( World w, int x, int y, int z, Block neighborBlock )
|
||||
{
|
||||
TileController tc = this.getTileEntity( w, x, y, z );
|
||||
if( tc != null )
|
||||
{
|
||||
tc.onNeighborChange( false );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,18 +21,18 @@ package appeng.block.networking;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.helpers.AEGlassMaterial;
|
||||
import appeng.tile.networking.TileCreativeEnergyCell;
|
||||
|
||||
|
||||
public class BlockCreativeEnergyCell extends AEBaseBlock
|
||||
public class BlockCreativeEnergyCell extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
public BlockCreativeEnergyCell()
|
||||
{
|
||||
super( BlockCreativeEnergyCell.class, AEGlassMaterial.INSTANCE );
|
||||
super( AEGlassMaterial.INSTANCE );
|
||||
this.setTileEntity( TileCreativeEnergyCell.class );
|
||||
this.setFeature( EnumSet.of( AEFeature.Creative ) );
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ public class BlockDenseEnergyCell extends BlockEnergyCell
|
||||
|
||||
public BlockDenseEnergyCell()
|
||||
{
|
||||
super( BlockDenseEnergyCell.class );
|
||||
this.setTileEntity( TileDenseEnergyCell.class );
|
||||
this.setFeature( EnumSet.of( AEFeature.DenseEnergyCells ) );
|
||||
}
|
||||
|
||||
@@ -23,17 +23,17 @@ import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.tile.networking.TileEnergyAcceptor;
|
||||
|
||||
|
||||
public class BlockEnergyAcceptor extends AEBaseBlock
|
||||
public class BlockEnergyAcceptor extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
public BlockEnergyAcceptor()
|
||||
{
|
||||
super( BlockEnergyAcceptor.class, Material.iron );
|
||||
super( Material.iron );
|
||||
this.setTileEntity( TileEnergyAcceptor.class );
|
||||
this.setFeature( EnumSet.of( AEFeature.Core ) );
|
||||
}
|
||||
|
||||
@@ -31,9 +31,9 @@ import net.minecraft.util.IIcon;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEBaseItemBlock;
|
||||
import appeng.block.AEBaseItemBlockChargeable;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.blocks.RenderBlockEnergyCube;
|
||||
import appeng.client.texture.ExtraBlockTextures;
|
||||
@@ -43,21 +43,17 @@ import appeng.tile.networking.TileEnergyCell;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockEnergyCell extends AEBaseBlock
|
||||
public class BlockEnergyCell extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
public BlockEnergyCell()
|
||||
{
|
||||
this( BlockEnergyCell.class );
|
||||
super( AEGlassMaterial.INSTANCE );
|
||||
|
||||
this.setTileEntity( TileEnergyCell.class );
|
||||
this.setFeature( EnumSet.of( AEFeature.Core ) );
|
||||
}
|
||||
|
||||
public BlockEnergyCell( Class c )
|
||||
{
|
||||
super( c, AEGlassMaterial.INSTANCE );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<? extends BaseBlockRender> getRenderer()
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.blocks.RenderBlockWireless;
|
||||
import appeng.core.features.AEFeature;
|
||||
@@ -40,12 +40,12 @@ import appeng.tile.networking.TileWireless;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockWireless extends AEBaseBlock implements ICustomCollision
|
||||
public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
|
||||
{
|
||||
|
||||
public BlockWireless()
|
||||
{
|
||||
super( BlockWireless.class, AEGlassMaterial.INSTANCE );
|
||||
super( AEGlassMaterial.INSTANCE );
|
||||
this.setTileEntity( TileWireless.class );
|
||||
this.setLightOpacity( 0 );
|
||||
this.isFullSize = false;
|
||||
@@ -63,13 +63,17 @@ public class BlockWireless extends AEBaseBlock implements ICustomCollision
|
||||
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
if( p.isSneaking() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TileWireless tg = this.getTileEntity( w, x, y, z );
|
||||
if( tg != null )
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_WIRELESS );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -197,6 +201,8 @@ public class BlockWireless extends AEBaseBlock implements ICustomCollision
|
||||
out.add( AxisAlignedBB.getBoundingBox( minX, minY, minZ, maxX, maxY, maxZ ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
out.add( AxisAlignedBB.getBoundingBox( 0.0, 0.0, 0.0, 1.0, 1.0, 1.0 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.block.qnb;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.client.render.blocks.RenderQNB;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.helpers.ICustomCollision;
|
||||
import appeng.tile.qnb.TileQuantumBridge;
|
||||
|
||||
|
||||
public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICustomCollision
|
||||
{
|
||||
|
||||
public BlockQuantumBase( Material mat )
|
||||
{
|
||||
super( mat );
|
||||
this.setTileEntity( TileQuantumBridge.class );
|
||||
float shave = 2.0f / 16.0f;
|
||||
this.setBlockBounds( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave );
|
||||
this.setLightOpacity( 0 );
|
||||
this.isFullSize = this.isOpaque = false;
|
||||
this.setFeature( EnumSet.of( AEFeature.QuantumNetworkBridge ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange( World w, int x, int y, int z, Block pointlessNumber )
|
||||
{
|
||||
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
|
||||
if( bridge != null )
|
||||
{
|
||||
bridge.neighborUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock( World w, int x, int y, int z, Block a, int b )
|
||||
{
|
||||
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
|
||||
if( bridge != null )
|
||||
{
|
||||
bridge.breakCluster();
|
||||
}
|
||||
|
||||
super.breakBlock( w, x, y, z, a, b );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<? extends RenderQNB> getRenderer()
|
||||
{
|
||||
return RenderQNB.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,11 +20,9 @@ package appeng.block.qnb;
|
||||
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
@@ -34,31 +32,20 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.client.EffectType;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.blocks.RenderQNB;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.helpers.AEGlassMaterial;
|
||||
import appeng.helpers.ICustomCollision;
|
||||
import appeng.tile.qnb.TileQuantumBridge;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockQuantumLinkChamber extends AEBaseBlock implements ICustomCollision
|
||||
public class BlockQuantumLinkChamber extends BlockQuantumBase
|
||||
{
|
||||
|
||||
public BlockQuantumLinkChamber()
|
||||
{
|
||||
super( BlockQuantumLinkChamber.class, AEGlassMaterial.INSTANCE );
|
||||
this.setTileEntity( TileQuantumBridge.class );
|
||||
float shave = 2.0f / 16.0f;
|
||||
this.setBlockBounds( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave );
|
||||
this.setLightOpacity( 0 );
|
||||
this.isFullSize = this.isOpaque = false;
|
||||
this.setFeature( EnumSet.of( AEFeature.QuantumNetworkBridge ) );
|
||||
super( AEGlassMaterial.INSTANCE );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -71,62 +58,44 @@ public class BlockQuantumLinkChamber extends AEBaseBlock implements ICustomColli
|
||||
if( bridge.hasQES() )
|
||||
{
|
||||
if( CommonHelper.proxy.shouldAddParticles( r ) )
|
||||
{
|
||||
CommonHelper.proxy.spawnEffect( EffectType.Energy, w, bx + 0.5, by + 0.5, bz + 0.5, null );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange( World w, int x, int y, int z, Block pointlessNumber )
|
||||
{
|
||||
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
|
||||
if( bridge != null )
|
||||
bridge.neighborUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<? extends BaseBlockRender> getRenderer()
|
||||
{
|
||||
return RenderQNB.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
if( p.isSneaking() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TileQuantumBridge tg = this.getTileEntity( w, x, y, z );
|
||||
if( tg != null )
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_QNB );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock( World w, int x, int y, int z, Block a, int b )
|
||||
{
|
||||
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
|
||||
if( bridge != null )
|
||||
bridge.breakCluster();
|
||||
|
||||
super.breakBlock( w, x, y, z, a, b );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
|
||||
{
|
||||
double OnePx = 2.0 / 16.0;
|
||||
return Collections.singletonList( AxisAlignedBB.getBoundingBox( OnePx, OnePx, OnePx, 1.0 - OnePx, 1.0 - OnePx, 1.0 - OnePx ) );
|
||||
double onePixel = 2.0 / 16.0;
|
||||
return Collections.singletonList( AxisAlignedBB.getBoundingBox( onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e )
|
||||
{
|
||||
double OnePx = 2.0 / 16.0;
|
||||
out.add( AxisAlignedBB.getBoundingBox( OnePx, OnePx, OnePx, 1.0 - OnePx, 1.0 - OnePx, 1.0 - OnePx ) );
|
||||
double onePixel = 2.0 / 16.0;
|
||||
out.add( AxisAlignedBB.getBoundingBox( onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,90 +20,53 @@ package appeng.block.qnb;
|
||||
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.blocks.RenderQNB;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.helpers.ICustomCollision;
|
||||
import appeng.tile.qnb.TileQuantumBridge;
|
||||
|
||||
|
||||
public class BlockQuantumRing extends AEBaseBlock implements ICustomCollision
|
||||
public class BlockQuantumRing extends BlockQuantumBase
|
||||
{
|
||||
|
||||
public BlockQuantumRing()
|
||||
{
|
||||
super( BlockQuantumRing.class, Material.iron );
|
||||
this.setTileEntity( TileQuantumBridge.class );
|
||||
float shave = 2.0f / 16.0f;
|
||||
this.setBlockBounds( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave );
|
||||
this.setLightOpacity( 1 );
|
||||
this.isFullSize = this.isOpaque = false;
|
||||
this.setFeature( EnumSet.of( AEFeature.QuantumNetworkBridge ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange( World w, int x, int y, int z, Block pointlessNumber )
|
||||
{
|
||||
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
|
||||
if( bridge != null )
|
||||
bridge.neighborUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<? extends BaseBlockRender> getRenderer()
|
||||
{
|
||||
return RenderQNB.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock( World w, int x, int y, int z, Block a, int b )
|
||||
{
|
||||
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
|
||||
if( bridge != null )
|
||||
bridge.breakCluster();
|
||||
|
||||
super.breakBlock( w, x, y, z, a, b );
|
||||
super( Material.iron );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, int x, int y, int z, Entity e, boolean isVisual )
|
||||
{
|
||||
double OnePx = 2.0 / 16.0;
|
||||
double onePixel = 2.0 / 16.0;
|
||||
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
|
||||
if( bridge != null && bridge.isCorner() )
|
||||
{
|
||||
OnePx = 4.0 / 16.0;
|
||||
onePixel = 4.0 / 16.0;
|
||||
}
|
||||
else if( bridge != null && bridge.isFormed() )
|
||||
{
|
||||
OnePx = 1.0 / 16.0;
|
||||
onePixel = 1.0 / 16.0;
|
||||
}
|
||||
return Collections.singletonList( AxisAlignedBB.getBoundingBox( OnePx, OnePx, OnePx, 1.0 - OnePx, 1.0 - OnePx, 1.0 - OnePx ) );
|
||||
return Collections.singletonList( AxisAlignedBB.getBoundingBox( onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollidingBlockToList( World w, int x, int y, int z, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e )
|
||||
{
|
||||
double OnePx = 2.0 / 16.0;
|
||||
double onePixel = 2.0 / 16.0;
|
||||
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
|
||||
if( bridge != null && bridge.isCorner() )
|
||||
{
|
||||
OnePx = 4.0 / 16.0;
|
||||
onePixel = 4.0 / 16.0;
|
||||
}
|
||||
else if( bridge != null && bridge.isFormed() )
|
||||
{
|
||||
OnePx = 1.0 / 16.0;
|
||||
onePixel = 1.0 / 16.0;
|
||||
}
|
||||
out.add( AxisAlignedBB.getBoundingBox( OnePx, OnePx, OnePx, 1.0 - OnePx, 1.0 - OnePx, 1.0 - OnePx ) );
|
||||
out.add( AxisAlignedBB.getBoundingBox( onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class BlockFluix extends AEDecorativeBlock
|
||||
{
|
||||
public BlockFluix()
|
||||
{
|
||||
super( BlockFluix.class, Material.rock );
|
||||
super( Material.rock );
|
||||
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class BlockQuartz extends AEDecorativeBlock
|
||||
|
||||
public BlockQuartz()
|
||||
{
|
||||
super( BlockQuartz.class, Material.rock );
|
||||
super( Material.rock );
|
||||
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class BlockQuartzChiseled extends AEDecorativeBlock
|
||||
|
||||
public BlockQuartzChiseled()
|
||||
{
|
||||
super( BlockQuartzChiseled.class, Material.rock );
|
||||
super( Material.rock );
|
||||
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,15 +36,9 @@ import appeng.helpers.AEGlassMaterial;
|
||||
|
||||
public class BlockQuartzGlass extends AEBaseBlock
|
||||
{
|
||||
|
||||
public BlockQuartzGlass()
|
||||
{
|
||||
this( BlockQuartzGlass.class );
|
||||
}
|
||||
|
||||
public BlockQuartzGlass( Class c )
|
||||
{
|
||||
super( c, Material.glass );
|
||||
super( Material.glass );
|
||||
this.setLightOpacity( 0 );
|
||||
this.isOpaque = false;
|
||||
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
||||
@@ -64,7 +58,9 @@ public class BlockQuartzGlass extends AEBaseBlock
|
||||
if( mat == Material.glass || mat == AEGlassMaterial.INSTANCE )
|
||||
{
|
||||
if( w.getBlock( x, y, z ).getRenderType() == this.getRenderType() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return super.shouldSideBeRendered( w, x, y, z, side );
|
||||
}
|
||||
|
||||
@@ -39,7 +39,6 @@ public class BlockQuartzLamp extends BlockQuartzGlass
|
||||
|
||||
public BlockQuartzLamp()
|
||||
{
|
||||
super( BlockQuartzLamp.class );
|
||||
this.setLightLevel( 1.0f );
|
||||
this.setBlockTextureName( "BlockQuartzGlass" );
|
||||
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks, AEFeature.DecorativeLights ) );
|
||||
@@ -50,7 +49,9 @@ public class BlockQuartzLamp extends BlockQuartzGlass
|
||||
public void randomDisplayTick( World w, int x, int y, int z, Random r )
|
||||
{
|
||||
if( !AEConfig.instance.enableEffects )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if( CommonHelper.proxy.shouldAddParticles( r ) )
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ public class BlockQuartzPillar extends AEBaseBlock implements IOrientableBlock
|
||||
|
||||
public BlockQuartzPillar()
|
||||
{
|
||||
super( BlockQuartzPillar.class, Material.rock );
|
||||
super( Material.rock );
|
||||
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
@@ -29,7 +29,6 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -41,40 +40,37 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import rblocks.api.RotatableBlockEnable;
|
||||
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.WorldSettings;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.worlddata.WorldData;
|
||||
import appeng.helpers.LocationRotation;
|
||||
import appeng.helpers.NullRotation;
|
||||
import appeng.integration.IntegrationType;
|
||||
import appeng.integration.abstraction.IRB;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
@RotatableBlockEnable
|
||||
public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
|
||||
{
|
||||
private static final float BLOCK_RESISTANCE = 150.0f;
|
||||
private static final double BREAK_SPEAK_SCALAR = 0.1;
|
||||
private static final double BREAK_SPEAK_THRESHOLD = 7.0;
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
IIcon Block;
|
||||
private IIcon block;
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
IIcon Brick;
|
||||
private IIcon brick;
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
IIcon SmallBrick;
|
||||
private IIcon smallBrick;
|
||||
|
||||
public BlockSkyStone()
|
||||
{
|
||||
super( BlockSkyStone.class, Material.rock );
|
||||
super( Material.rock );
|
||||
this.setHardness( 50 );
|
||||
this.hasSubtypes = true;
|
||||
this.blockResistance = 150.0f;
|
||||
this.blockResistance = BLOCK_RESISTANCE;
|
||||
this.setHarvestLevel( "pickaxe", 3, 0 );
|
||||
this.setFeature( EnumSet.of( AEFeature.Core ) );
|
||||
|
||||
@@ -82,18 +78,22 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void breakFaster( PlayerEvent.BreakSpeed Ev )
|
||||
public void breakFaster( PlayerEvent.BreakSpeed event )
|
||||
{
|
||||
if( Ev.block == this && Ev.entityPlayer != null )
|
||||
if( event.block == this && event.entityPlayer != null )
|
||||
{
|
||||
ItemStack is = Ev.entityPlayer.inventory.getCurrentItem();
|
||||
ItemStack is = event.entityPlayer.inventory.getCurrentItem();
|
||||
int level = -1;
|
||||
|
||||
if( is != null )
|
||||
if( is != null && is.getItem() != null )
|
||||
{
|
||||
level = is.getItem().getHarvestLevel( is, "pickaxe" );
|
||||
}
|
||||
|
||||
if( Ev.metadata > 0 || level >= 3 || Ev.originalSpeed > 7.0 )
|
||||
Ev.newSpeed /= 0.1;
|
||||
if( event.metadata > 0 || level >= 3 || event.originalSpeed > BREAK_SPEAK_THRESHOLD )
|
||||
{
|
||||
event.newSpeed /= BREAK_SPEAK_SCALAR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,13 +117,9 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
|
||||
{
|
||||
super.onBlockAdded( w, x, y, z );
|
||||
if( Platform.isServer() )
|
||||
WorldSettings.getInstance().getCompass().updateArea( w, x, y, z );
|
||||
}
|
||||
|
||||
// use AE2's renderer, no rotatable blocks.
|
||||
int getRealRenderType()
|
||||
{
|
||||
return this.getRenderType();
|
||||
{
|
||||
WorldData.instance().compassData().service().updateArea( w, x, y, z );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -135,19 +131,10 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
|
||||
@Override
|
||||
public IOrientable getOrientable( final IBlockAccess w, final int x, final int y, final int z )
|
||||
{
|
||||
if( AppEng.instance.isIntegrationEnabled( IntegrationType.RB ) )
|
||||
{
|
||||
TileEntity te = w.getTileEntity( x, y, z );
|
||||
if( te != null )
|
||||
{
|
||||
IOrientable out = ( (IRB) AppEng.instance.getIntegration( IntegrationType.RB ) ).getOrientable( te );
|
||||
if( out != null )
|
||||
return out;
|
||||
}
|
||||
}
|
||||
|
||||
if( w.getBlockMetadata( x, y, z ) == 0 )
|
||||
{
|
||||
return new LocationRotation( w, x, y, z );
|
||||
}
|
||||
|
||||
return new NullRotation();
|
||||
}
|
||||
@@ -156,13 +143,19 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
|
||||
public String getUnlocalizedName( ItemStack is )
|
||||
{
|
||||
if( is.getItemDamage() == 1 )
|
||||
{
|
||||
return this.getUnlocalizedName() + ".Block";
|
||||
}
|
||||
|
||||
if( is.getItemDamage() == 2 )
|
||||
{
|
||||
return this.getUnlocalizedName() + ".Brick";
|
||||
}
|
||||
|
||||
if( is.getItemDamage() == 3 )
|
||||
{
|
||||
return this.getUnlocalizedName() + ".SmallBrick";
|
||||
}
|
||||
|
||||
return this.getUnlocalizedName();
|
||||
}
|
||||
@@ -172,9 +165,9 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
|
||||
public void registerBlockIcons( IIconRegister ir )
|
||||
{
|
||||
super.registerBlockIcons( ir );
|
||||
this.Block = ir.registerIcon( this.getTextureName() + ".Block" );
|
||||
this.Brick = ir.registerIcon( this.getTextureName() + ".Brick" );
|
||||
this.SmallBrick = ir.registerIcon( this.getTextureName() + ".SmallBrick" );
|
||||
this.block = ir.registerIcon( this.getTextureName() + ".Block" );
|
||||
this.brick = ir.registerIcon( this.getTextureName() + ".Brick" );
|
||||
this.smallBrick = ir.registerIcon( this.getTextureName() + ".SmallBrick" );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -182,11 +175,17 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
|
||||
public IIcon getIcon( int direction, int metadata )
|
||||
{
|
||||
if( metadata == 1 )
|
||||
return this.Block;
|
||||
{
|
||||
return this.block;
|
||||
}
|
||||
if( metadata == 2 )
|
||||
return this.Brick;
|
||||
{
|
||||
return this.brick;
|
||||
}
|
||||
if( metadata == 3 )
|
||||
return this.SmallBrick;
|
||||
{
|
||||
return this.smallBrick;
|
||||
}
|
||||
return super.getIcon( direction, metadata );
|
||||
}
|
||||
|
||||
@@ -208,10 +207,12 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock( World w, int x, int y, int z, Block b, int WTF )
|
||||
public void breakBlock( World w, int x, int y, int z, Block b, int metadata )
|
||||
{
|
||||
super.breakBlock( w, x, y, z, b, WTF );
|
||||
super.breakBlock( w, x, y, z, b, metadata );
|
||||
if( Platform.isServer() )
|
||||
WorldSettings.getInstance().getCompass().updateArea( w, x, y, z );
|
||||
{
|
||||
WorldData.instance().compassData().service().updateArea( w, x, y, z );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
@@ -21,6 +21,7 @@ package appeng.block.solids;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.Random;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -29,7 +30,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.exceptions.MissingDefinition;
|
||||
@@ -47,12 +47,7 @@ public class OreQuartz extends AEBaseBlock
|
||||
|
||||
public OreQuartz()
|
||||
{
|
||||
this( OreQuartz.class );
|
||||
}
|
||||
|
||||
public OreQuartz( Class<? extends OreQuartz> self )
|
||||
{
|
||||
super( self, Material.rock );
|
||||
super( Material.rock );
|
||||
this.setHardness( 3.0F );
|
||||
this.setResistance( 5.0F );
|
||||
this.boostBrightnessLow = 0;
|
||||
@@ -67,12 +62,6 @@ public class OreQuartz extends AEBaseBlock
|
||||
return RenderQuartzOre.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit()
|
||||
{
|
||||
OreDictionary.registerOre( "oreCertusQuartz", new ItemStack( this ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMixedBrightnessForBlock( IBlockAccess par1iBlockAccess, int par2, int par3, int par4 )
|
||||
{
|
||||
@@ -91,7 +80,9 @@ public class OreQuartz extends AEBaseBlock
|
||||
}
|
||||
|
||||
if( j1 > 15 )
|
||||
{
|
||||
j1 = 15;
|
||||
}
|
||||
return j1 << 20 | j1 << 4;
|
||||
}
|
||||
return j1;
|
||||
|
||||
@@ -43,7 +43,6 @@ public class OreQuartzCharged extends OreQuartz
|
||||
|
||||
public OreQuartzCharged()
|
||||
{
|
||||
super( OreQuartzCharged.class );
|
||||
this.setBoostBrightnessLow( 2 );
|
||||
this.setBoostBrightnessHigh( 5 );
|
||||
}
|
||||
@@ -63,7 +62,7 @@ public class OreQuartzCharged extends OreQuartz
|
||||
@Override
|
||||
public int damageDropped( int id )
|
||||
{
|
||||
for ( ItemStack crystalStack : AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeStack( 1 ).asSet() )
|
||||
for( ItemStack crystalStack : AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
return crystalStack.getItemDamage();
|
||||
}
|
||||
@@ -75,8 +74,10 @@ public class OreQuartzCharged extends OreQuartz
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void randomDisplayTick( World w, int x, int y, int z, Random r )
|
||||
{
|
||||
if ( !AEConfig.instance.enableEffects )
|
||||
if( !AEConfig.instance.enableEffects )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
double xOff = ( r.nextFloat() );
|
||||
double yOff = ( r.nextFloat() );
|
||||
|
||||
@@ -49,7 +49,7 @@ public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision
|
||||
|
||||
public BlockMatrixFrame()
|
||||
{
|
||||
super( BlockMatrixFrame.class, Material.anvil );
|
||||
super( Material.anvil );
|
||||
this.setResistance( 6000000.0F );
|
||||
this.setBlockUnbreakable();
|
||||
this.setLightOpacity( 0 );
|
||||
|
||||
@@ -27,19 +27,19 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.tile.spatial.TileSpatialIOPort;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockSpatialIOPort extends AEBaseBlock
|
||||
public class BlockSpatialIOPort extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
public BlockSpatialIOPort()
|
||||
{
|
||||
super( BlockSpatialIOPort.class, Material.iron );
|
||||
super( Material.iron );
|
||||
this.setTileEntity( TileSpatialIOPort.class );
|
||||
this.setFeature( EnumSet.of( AEFeature.SpatialIO ) );
|
||||
}
|
||||
@@ -49,20 +49,26 @@ public class BlockSpatialIOPort extends AEBaseBlock
|
||||
{
|
||||
TileSpatialIOPort te = this.getTileEntity( w, x, y, z );
|
||||
if( te != null )
|
||||
{
|
||||
te.updateRedstoneState();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
if( p.isSneaking() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TileSpatialIOPort tg = this.getTileEntity( w, x, y, z );
|
||||
if( tg != null )
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_SPATIAL_IO_PORT );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -25,7 +25,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.blocks.RenderSpatialPylon;
|
||||
import appeng.core.features.AEFeature;
|
||||
@@ -33,12 +33,12 @@ import appeng.helpers.AEGlassMaterial;
|
||||
import appeng.tile.spatial.TileSpatialPylon;
|
||||
|
||||
|
||||
public class BlockSpatialPylon extends AEBaseBlock
|
||||
public class BlockSpatialPylon extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
public BlockSpatialPylon()
|
||||
{
|
||||
super( BlockSpatialPylon.class, AEGlassMaterial.INSTANCE );
|
||||
super( AEGlassMaterial.INSTANCE );
|
||||
this.setTileEntity( TileSpatialPylon.class );
|
||||
this.setFeature( EnumSet.of( AEFeature.SpatialIO ) );
|
||||
}
|
||||
@@ -48,7 +48,9 @@ public class BlockSpatialPylon extends AEBaseBlock
|
||||
{
|
||||
TileSpatialPylon tsp = this.getTileEntity( w, x, y, z );
|
||||
if( tsp != null )
|
||||
{
|
||||
tsp.onNeighborBlockChange();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -56,7 +58,9 @@ public class BlockSpatialPylon extends AEBaseBlock
|
||||
{
|
||||
TileSpatialPylon tsp = this.getTileEntity( w, x, y, z );
|
||||
if( tsp != null )
|
||||
{
|
||||
return tsp.getLightValue();
|
||||
}
|
||||
return super.getLightValue( w, x, y, z );
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.storage.ICellHandler;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.blocks.RenderMEChest;
|
||||
import appeng.core.features.AEFeature;
|
||||
@@ -39,12 +39,12 @@ import appeng.tile.storage.TileChest;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockChest extends AEBaseBlock
|
||||
public class BlockChest extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
public BlockChest()
|
||||
{
|
||||
super( BlockChest.class, Material.iron );
|
||||
super( Material.iron );
|
||||
this.setTileEntity( TileChest.class );
|
||||
this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.MEChest ) );
|
||||
}
|
||||
@@ -62,7 +62,9 @@ public class BlockChest extends AEBaseBlock
|
||||
if( tg != null && !p.isSneaking() )
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if( side != tg.getUp().ordinal() )
|
||||
{
|
||||
@@ -78,7 +80,9 @@ public class BlockChest extends AEBaseBlock
|
||||
tg.openGui( p, ch, cell, side );
|
||||
}
|
||||
else
|
||||
{
|
||||
p.addChatMessage( PlayerMessages.ChestCannotReadStorageCell.get() );
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -26,7 +26,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.blocks.RenderDrive;
|
||||
import appeng.core.features.AEFeature;
|
||||
@@ -35,12 +35,12 @@ import appeng.tile.storage.TileDrive;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockDrive extends AEBaseBlock
|
||||
public class BlockDrive extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
public BlockDrive()
|
||||
{
|
||||
super( BlockDrive.class, Material.iron );
|
||||
super( Material.iron );
|
||||
this.setTileEntity( TileDrive.class );
|
||||
this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.MEDrive ) );
|
||||
}
|
||||
@@ -55,13 +55,17 @@ public class BlockDrive extends AEBaseBlock
|
||||
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
if( p.isSneaking() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TileDrive tg = this.getTileEntity( w, x, y, z );
|
||||
if( tg != null )
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_DRIVE );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -27,19 +27,19 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.tile.storage.TileIOPort;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockIOPort extends AEBaseBlock
|
||||
public class BlockIOPort extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
public BlockIOPort()
|
||||
{
|
||||
super( BlockIOPort.class, Material.iron );
|
||||
super( Material.iron );
|
||||
this.setTileEntity( TileIOPort.class );
|
||||
this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.IOPort ) );
|
||||
}
|
||||
@@ -49,20 +49,26 @@ public class BlockIOPort extends AEBaseBlock
|
||||
{
|
||||
TileIOPort te = this.getTileEntity( w, x, y, z );
|
||||
if( te != null )
|
||||
{
|
||||
te.updateRedstoneState();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
if( p.isSneaking() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TileIOPort tg = this.getTileEntity( w, x, y, z );
|
||||
if( tg != null )
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_IOPORT );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -42,7 +42,7 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.blocks.RenderBlockSkyChest;
|
||||
import appeng.core.features.AEFeature;
|
||||
@@ -52,12 +52,12 @@ import appeng.tile.storage.TileSkyChest;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
|
||||
public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
|
||||
{
|
||||
|
||||
public BlockSkyChest()
|
||||
{
|
||||
super( BlockSkyChest.class, Material.rock );
|
||||
super( Material.rock );
|
||||
this.setTileEntity( TileSkyChest.class );
|
||||
this.isOpaque = this.isFullSize = false;
|
||||
this.lightOpacity = 0;
|
||||
@@ -104,7 +104,9 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
|
||||
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
Platform.openGUI( player, this.getTileEntity( w, x, y, z ), ForgeDirection.getOrientation( side ), GuiBridge.GUI_SKYCHEST );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -127,7 +129,9 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
|
||||
public String getUnlocalizedName( ItemStack is )
|
||||
{
|
||||
if( is.getItemDamage() == 1 )
|
||||
{
|
||||
return this.getUnlocalizedName() + ".Block";
|
||||
}
|
||||
|
||||
return this.getUnlocalizedName();
|
||||
}
|
||||
@@ -140,13 +144,15 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
|
||||
ForgeDirection o = ForgeDirection.UNKNOWN;
|
||||
|
||||
if( sk != null )
|
||||
{
|
||||
o = sk.getUp();
|
||||
}
|
||||
|
||||
double X = o.offsetX == 0 ? 0.06 : 0.0;
|
||||
double Y = o.offsetY == 0 ? 0.06 : 0.0;
|
||||
double Z = o.offsetZ == 0 ? 0.06 : 0.0;
|
||||
double offsetX = o.offsetX == 0 ? 0.06 : 0.0;
|
||||
double offsetY = o.offsetY == 0 ? 0.06 : 0.0;
|
||||
double offsetZ = o.offsetZ == 0 ? 0.06 : 0.0;
|
||||
|
||||
return Collections.singletonList( AxisAlignedBB.getBoundingBox( Math.max( 0.0, X - o.offsetX * sc ), Math.max( 0.0, Y - o.offsetY * sc ), Math.max( 0.0, Z - o.offsetZ * sc ), Math.min( 1.0, ( 1.0 - X ) - o.offsetX * sc ), Math.min( 1.0, ( 1.0 - Y ) - o.offsetY * sc ), Math.min( 1.0, ( 1.0 - Z ) - o.offsetZ * sc ) ) );
|
||||
return Collections.singletonList( AxisAlignedBB.getBoundingBox( Math.max( 0.0, offsetX - o.offsetX * sc ), Math.max( 0.0, offsetY - o.offsetY * sc ), Math.max( 0.0, offsetZ - o.offsetZ * sc ), Math.min( 1.0, ( 1.0 - offsetX ) - o.offsetX * sc ), Math.min( 1.0, ( 1.0 - offsetY ) - o.offsetY * sc ), Math.min( 1.0, ( 1.0 - offsetZ ) - o.offsetZ * sc ) ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
@@ -84,9 +84,6 @@ import appeng.server.ServerHelper;
|
||||
import appeng.transformer.MissingCoreMod;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import static net.minecraftforge.client.IItemRenderer.ItemRenderType.ENTITY;
|
||||
import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D;
|
||||
|
||||
|
||||
public class ClientHelper extends ServerHelper
|
||||
{
|
||||
@@ -119,9 +116,13 @@ public class ClientHelper extends ServerHelper
|
||||
public World getWorld()
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
return Minecraft.getMinecraft().theWorld;
|
||||
}
|
||||
else
|
||||
{
|
||||
return super.getWorld();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -129,7 +130,9 @@ public class ClientHelper extends ServerHelper
|
||||
{
|
||||
BaseBlockRender bbr = blk.getRendererInstance().rendererInstance;
|
||||
if( bbr.hasTESR() && tile != null )
|
||||
{
|
||||
ClientRegistry.bindTileEntitySpecialRenderer( tile, new TESRWrapper( bbr ) );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -142,7 +145,9 @@ public class ClientHelper extends ServerHelper
|
||||
return o;
|
||||
}
|
||||
else
|
||||
{
|
||||
return super.getPlayers();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -243,9 +248,13 @@ public class ClientHelper extends ServerHelper
|
||||
{
|
||||
int setting = Minecraft.getMinecraft().gameSettings.particleSetting;
|
||||
if( setting == 2 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if( setting == 0 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return r.nextInt( 2 * ( setting + 1 ) ) == 0;
|
||||
}
|
||||
|
||||
@@ -289,10 +298,10 @@ public class ClientHelper extends ServerHelper
|
||||
GL11.glRotatef( 30.0f, 0.0f, 1.0f, 0.0f );
|
||||
}
|
||||
|
||||
IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer( itemstack, ENTITY );
|
||||
IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer( itemstack, IItemRenderer.ItemRenderType.ENTITY );
|
||||
if( customRenderer != null && !( itemstack.getItem() instanceof ItemBlock ) )
|
||||
{
|
||||
if( customRenderer.shouldUseRenderHelper( ENTITY, itemstack, BLOCK_3D ) )
|
||||
if( customRenderer.shouldUseRenderHelper( IItemRenderer.ItemRenderType.ENTITY, itemstack, IItemRenderer.ItemRendererHelper.BLOCK_3D ) )
|
||||
{
|
||||
GL11.glTranslatef( 0, -0.04F, 0 );
|
||||
GL11.glScalef( 0.7f, 0.7f, 0.7f );
|
||||
@@ -347,7 +356,9 @@ public class ClientHelper extends ServerHelper
|
||||
public CableRenderMode getRenderMode()
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
return super.getRenderMode();
|
||||
}
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
@@ -360,13 +371,12 @@ public class ClientHelper extends ServerHelper
|
||||
{
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if( mc == null || mc.thePlayer == null || mc.theWorld == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
|
||||
if( player == null )
|
||||
return;
|
||||
|
||||
int x = (int) player.posX;
|
||||
int y = (int) player.posY;
|
||||
int z = (int) player.posZ;
|
||||
@@ -386,7 +396,9 @@ public class ClientHelper extends ServerHelper
|
||||
public void wheelEvent( MouseEvent me )
|
||||
{
|
||||
if( me.isCanceled() || me.dwheel == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
@@ -412,16 +424,22 @@ public class ClientHelper extends ServerHelper
|
||||
if( ev.map.getTextureType() == 1 )
|
||||
{
|
||||
for( ExtraItemTextures et : ExtraItemTextures.values() )
|
||||
{
|
||||
et.registerIcon( ev.map );
|
||||
}
|
||||
}
|
||||
|
||||
if( ev.map.getTextureType() == 0 )
|
||||
{
|
||||
for( ExtraBlockTextures et : ExtraBlockTextures.values() )
|
||||
{
|
||||
et.registerIcon( ev.map );
|
||||
}
|
||||
|
||||
for( CableBusTextures cb : CableBusTextures.values() )
|
||||
{
|
||||
cb.registerIcon( ev.map );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
@@ -30,6 +30,9 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.base.Stopwatch;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -49,9 +52,6 @@ import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.base.Stopwatch;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.gui.widgets.GuiScrollbar;
|
||||
import appeng.client.gui.widgets.ITooltip;
|
||||
@@ -72,14 +72,13 @@ import appeng.container.slot.SlotOutput;
|
||||
import appeng.container.slot.SlotPatternTerm;
|
||||
import appeng.container.slot.SlotRestrictedInput;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketInventoryAction;
|
||||
import appeng.core.sync.packets.PacketSwapSlots;
|
||||
import appeng.helpers.InventoryAction;
|
||||
import appeng.integration.IntegrationRegistry;
|
||||
import appeng.integration.IntegrationType;
|
||||
import appeng.integration.abstraction.INEI;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public abstract class AEBaseGui extends GuiContainer
|
||||
@@ -137,11 +136,17 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
final List<Slot> slots = this.getInventorySlots();
|
||||
Iterator<Slot> i = slots.iterator();
|
||||
while( i.hasNext() )
|
||||
{
|
||||
if( i.next() instanceof SlotME )
|
||||
{
|
||||
i.remove();
|
||||
}
|
||||
}
|
||||
|
||||
for( InternalSlotME me : this.meSlots )
|
||||
{
|
||||
slots.add( new SlotME( me ) );
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings( "unchecked" )
|
||||
@@ -151,13 +156,15 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen( int mouse_x, int mouse_y, float btn )
|
||||
public void drawScreen( int mouseX, int mouseY, float btn )
|
||||
{
|
||||
super.drawScreen( mouse_x, mouse_y, btn );
|
||||
super.drawScreen( mouseX, mouseY, btn );
|
||||
|
||||
boolean hasClicked = Mouse.isButtonDown( 0 );
|
||||
if( hasClicked && this.myScrollBar != null )
|
||||
this.myScrollBar.click( this, mouse_x - this.guiLeft, mouse_y - this.guiTop );
|
||||
{
|
||||
this.myScrollBar.click( this, mouseX - this.guiLeft, mouseY - this.guiTop );
|
||||
}
|
||||
|
||||
for( Object c : this.buttonList )
|
||||
{
|
||||
@@ -167,30 +174,34 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
int x = tooltip.xPos(); // ((GuiImgButton) c).xPosition;
|
||||
int y = tooltip.yPos(); // ((GuiImgButton) c).yPosition;
|
||||
|
||||
if( x < mouse_x && x + tooltip.getWidth() > mouse_x && tooltip.isVisible() )
|
||||
if( x < mouseX && x + tooltip.getWidth() > mouseX && tooltip.isVisible() )
|
||||
{
|
||||
if( y < mouse_y && y + tooltip.getHeight() > mouse_y )
|
||||
if( y < mouseY && y + tooltip.getHeight() > mouseY )
|
||||
{
|
||||
if( y < 15 )
|
||||
{
|
||||
y = 15;
|
||||
}
|
||||
|
||||
String msg = tooltip.getMessage();
|
||||
if( msg != null )
|
||||
{
|
||||
this.drawTooltip( x + 11, y + 4, 0, msg );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void drawTooltip( int par2, int par3, int forceWidth, String Msg )
|
||||
public void drawTooltip( int par2, int par3, int forceWidth, String message )
|
||||
{
|
||||
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
|
||||
GL11.glDisable( GL12.GL_RESCALE_NORMAL );
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glDisable( GL11.GL_LIGHTING );
|
||||
GL11.glDisable( GL11.GL_DEPTH_TEST );
|
||||
String[] var4 = Msg.split( "\n" );
|
||||
String[] var4 = message.split( "\n" );
|
||||
|
||||
if( var4.length > 0 )
|
||||
{
|
||||
@@ -223,7 +234,9 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
}
|
||||
|
||||
if( forceWidth > 0 )
|
||||
{
|
||||
var5 = forceWidth;
|
||||
}
|
||||
|
||||
this.zLevel = 300.0F;
|
||||
itemRender.zLevel = 300.0F;
|
||||
@@ -277,7 +290,9 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||
|
||||
if( this.myScrollBar != null )
|
||||
{
|
||||
this.myScrollBar.draw( this );
|
||||
}
|
||||
|
||||
this.drawFG( ox, oy, x, y );
|
||||
}
|
||||
@@ -358,7 +373,9 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
super.mouseClickMove( x, y, c, d );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -371,7 +388,9 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
final InventoryAction action = ctrlDown == 1 ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN;
|
||||
|
||||
if( this.drag_click.size() > 1 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
PacketInventoryAction p = new PacketInventoryAction( action, slotIdx, 0 );
|
||||
NetworkHandler.instance.sendToServer( p );
|
||||
@@ -382,7 +401,9 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
if( slot instanceof SlotPatternTerm )
|
||||
{
|
||||
if( key == 6 )
|
||||
{
|
||||
return; // prevent weird double clicks..
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
@@ -396,13 +417,19 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
else if( slot instanceof SlotCraftingTerm )
|
||||
{
|
||||
if( key == 6 )
|
||||
{
|
||||
return; // prevent weird double clicks..
|
||||
}
|
||||
|
||||
InventoryAction action = null;
|
||||
if( key == 1 )
|
||||
{
|
||||
action = InventoryAction.CRAFT_SHIFT;
|
||||
}
|
||||
else
|
||||
{
|
||||
action = ctrlDown == 1 ? InventoryAction.CRAFT_STACK : InventoryAction.CRAFT_ITEM;
|
||||
}
|
||||
|
||||
PacketInventoryAction p = new PacketInventoryAction( action, slotIdx, 0 );
|
||||
NetworkHandler.instance.sendToServer( p );
|
||||
@@ -416,12 +443,16 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
{
|
||||
IAEItemStack stack = null;
|
||||
if( slot instanceof SlotME )
|
||||
{
|
||||
stack = ( (SlotME) slot ).getAEStack();
|
||||
}
|
||||
|
||||
int slotNum = this.getInventorySlots().size();
|
||||
|
||||
if( !( slot instanceof SlotME ) && slot != null )
|
||||
{
|
||||
slotNum = slot.slotNumber;
|
||||
}
|
||||
|
||||
( (AEBaseContainer) this.inventorySlots ).setTargetStack( stack );
|
||||
PacketInventoryAction p = new PacketInventoryAction( InventoryAction.MOVE_REGION, slotNum, 0 );
|
||||
@@ -478,7 +509,9 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
stack = ( (SlotME) slot ).getAEStack();
|
||||
|
||||
if( stack != null && action == InventoryAction.PICKUP_OR_SET_DOWN && stack.getStackSize() == 0 && player.inventory.getItemStack() == null )
|
||||
{
|
||||
action = InventoryAction.AUTO_CRAFT;
|
||||
}
|
||||
|
||||
break;
|
||||
case 1:
|
||||
@@ -490,8 +523,9 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
|
||||
stack = ( (SlotME) slot ).getAEStack();
|
||||
if( stack != null && stack.isCraftable() )
|
||||
{
|
||||
action = InventoryAction.AUTO_CRAFT;
|
||||
|
||||
}
|
||||
else if( player.capabilities.isCreativeMode )
|
||||
{
|
||||
IAEItemStack slotItem = ( (SlotME) slot ).getAEStack();
|
||||
@@ -527,9 +561,13 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
this.bl_clicked = slot;
|
||||
this.dbl_clickTimer = Stopwatch.createStarted();
|
||||
if( slot != null )
|
||||
{
|
||||
this.dbl_whichItem = slot.getHasStack() ? slot.getStack().copy() : null;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.dbl_whichItem = null;
|
||||
}
|
||||
}
|
||||
else if( this.dbl_whichItem != null )
|
||||
{
|
||||
@@ -552,7 +590,7 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkHotbarKeys( int p_146983_1_ )
|
||||
protected boolean checkHotbarKeys( int keyCode )
|
||||
{
|
||||
Slot theSlot;
|
||||
|
||||
@@ -569,7 +607,7 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
{
|
||||
for( int j = 0; j < 9; ++j )
|
||||
{
|
||||
if( p_146983_1_ == this.mc.gameSettings.keyBindsHotbar[j].getKeyCode() )
|
||||
if( keyCode == this.mc.gameSettings.keyBindsHotbar[j].getKeyCode() )
|
||||
{
|
||||
final List<Slot> slots = this.getInventorySlots();
|
||||
for( Slot s : slots )
|
||||
@@ -643,7 +681,9 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
this.mouseWheelEvent( x, y, i / Math.abs( i ) );
|
||||
}
|
||||
else if( i != 0 && this.myScrollBar != null )
|
||||
{
|
||||
this.myScrollBar.wheel( i );
|
||||
}
|
||||
}
|
||||
|
||||
protected void mouseWheelEvent( int x, int y, int wheel )
|
||||
@@ -703,7 +743,9 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
private boolean hasCustomInventoryName()
|
||||
{
|
||||
if( this.inventorySlots instanceof AEBaseContainer )
|
||||
{
|
||||
return ( (AEBaseContainer) this.inventorySlots ).customName != null;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -744,8 +786,6 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
catch( Exception err )
|
||||
{
|
||||
AELog.warning( "[AppEng] AE prevented crash while drawing slot: " + err.toString() );
|
||||
if( Platform.isDrawing( Tessellator.instance ) )
|
||||
Tessellator.instance.draw();
|
||||
}
|
||||
this.setItemRender( pIR );
|
||||
return;
|
||||
@@ -794,8 +834,6 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
}
|
||||
catch( Exception err )
|
||||
{
|
||||
if( Platform.isDrawing( tessellator ) )
|
||||
tessellator.draw();
|
||||
}
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
@@ -840,7 +878,9 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
this.safeDrawSlot( s );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.safeDrawSlot( s );
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -855,9 +895,9 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
|
||||
private RenderItem setItemRender( RenderItem item )
|
||||
{
|
||||
if( AppEng.instance.isIntegrationEnabled( IntegrationType.NEI ) )
|
||||
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.NEI ) )
|
||||
{
|
||||
return ( (INEI) AppEng.instance.getIntegration( IntegrationType.NEI ) ).setItemRender( item );
|
||||
return ( (INEI) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.NEI ) ).setItemRender( item );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -876,15 +916,10 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
{
|
||||
try
|
||||
{
|
||||
// drawSlotInventory
|
||||
// super.func_146977_a( s );r
|
||||
GuiContainer.class.getDeclaredMethod( "func_146977_a_original", Slot.class ).invoke( this, s );
|
||||
}
|
||||
catch( Exception err )
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
if( Platform.isDrawing( tessellator ) )
|
||||
tessellator.draw();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -121,10 +121,14 @@ public abstract class AEBaseMEGui extends AEBaseGui
|
||||
List<String> currentToolTip = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips );
|
||||
|
||||
if( myStack.getStackSize() > BigNumber || ( myStack.getStackSize() > 1 && stack.isItemDamaged() ) )
|
||||
{
|
||||
currentToolTip.add( "Items Stored: " + NumberFormat.getNumberInstance( Locale.US ).format( myStack.getStackSize() ) );
|
||||
}
|
||||
|
||||
if( myStack.getCountRequestable() > 0 )
|
||||
{
|
||||
currentToolTip.add( "Items Requestable: " + NumberFormat.getNumberInstance( Locale.US ).format( myStack.getCountRequestable() ) );
|
||||
}
|
||||
|
||||
this.drawTooltip( x, y, 0, join( currentToolTip, "\n" ) );
|
||||
}
|
||||
|
||||
@@ -48,15 +48,21 @@ public class AEConfigGui extends GuiConfig
|
||||
for( String cat : AEConfig.instance.getCategoryNames() )
|
||||
{
|
||||
if( cat.equals( "versionchecker" ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if( cat.equals( "settings" ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
ConfigCategory cc = AEConfig.instance.getCategory( cat );
|
||||
|
||||
if( cc.isChild() )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
ConfigElement ce = new ConfigElement( cc );
|
||||
list.add( ce );
|
||||
|
||||
@@ -98,9 +98,13 @@ public class GuiCellWorkbench extends GuiUpgradeable
|
||||
int dx = this.workbench.availableUpgrades() - 8;
|
||||
this.drawTexturedModalRect( offsetX + 177 + 27, offsetY, 186, 0, 35 - 8, 7 + dx * 18 );
|
||||
if( dx == 8 )
|
||||
{
|
||||
this.drawTexturedModalRect( offsetX + 177 + 27, offsetY + ( 7 + ( dx ) * 18 ), 186, 151, 35 - 8, 7 );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.drawTexturedModalRect( offsetX + 177 + 27 + 4, offsetY + ( 7 + ( dx ) * 18 ), 186 + 4, 151, 35 - 8, 7 );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -113,13 +117,19 @@ public class GuiCellWorkbench extends GuiUpgradeable
|
||||
int dx = this.workbench.availableUpgrades() - 16;
|
||||
this.drawTexturedModalRect( offsetX + 177 + 27 + 18, offsetY, 186, 0, 35 - 8, 7 + dx * 18 );
|
||||
if( dx == 8 )
|
||||
{
|
||||
this.drawTexturedModalRect( offsetX + 177 + 27 + 18, offsetY + ( 7 + ( dx ) * 18 ), 186, 151, 35 - 8, 7 );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.drawTexturedModalRect( offsetX + 177 + 27 + 18 + 4, offsetY + ( 7 + ( dx ) * 18 ), 186 + 4, 151, 35 - 8, 7 );
|
||||
}
|
||||
}
|
||||
}
|
||||
if( this.hasToolbox() )
|
||||
{
|
||||
this.drawTexturedModalRect( offsetX + 178, offsetY + this.ySize - 90, 178, 161, 68, 68 );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -135,7 +145,9 @@ public class GuiCellWorkbench extends GuiUpgradeable
|
||||
if( is != null && is.getItem() instanceof IUpgradeModule )
|
||||
{
|
||||
if( ( (IUpgradeModule) is.getItem() ).getType( is ) == Upgrades.FUZZY )
|
||||
{
|
||||
hasFuzzy = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.fuzzyMode.setVisibility( hasFuzzy );
|
||||
@@ -186,7 +198,9 @@ public class GuiCellWorkbench extends GuiUpgradeable
|
||||
NetworkHandler.instance.sendToServer( new PacketValueConfig( "CellWorkbench.Fuzzy", fz.name() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
super.actionPerformed( btn );
|
||||
}
|
||||
}
|
||||
catch( IOException ignored )
|
||||
{
|
||||
|
||||
@@ -197,10 +197,14 @@ public class GuiCraftAmount extends AEBaseGui
|
||||
}
|
||||
|
||||
if( fixed )
|
||||
{
|
||||
this.amountToCraft.setText( out );
|
||||
}
|
||||
|
||||
if( out.length() == 0 )
|
||||
{
|
||||
out = "0";
|
||||
}
|
||||
|
||||
long result = Long.parseLong( out );
|
||||
if( result < 0 )
|
||||
@@ -248,7 +252,9 @@ public class GuiCraftAmount extends AEBaseGui
|
||||
boolean isMinus = btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000;
|
||||
|
||||
if( isPlus || isMinus )
|
||||
{
|
||||
this.addQty( this.getQty( btn ) );
|
||||
}
|
||||
}
|
||||
|
||||
private void addQty( int i )
|
||||
@@ -265,19 +271,27 @@ public class GuiCraftAmount extends AEBaseGui
|
||||
}
|
||||
|
||||
if( fixed )
|
||||
{
|
||||
this.amountToCraft.setText( out );
|
||||
}
|
||||
|
||||
if( out.length() == 0 )
|
||||
{
|
||||
out = "0";
|
||||
}
|
||||
|
||||
long result = Integer.parseInt( out );
|
||||
|
||||
if( result == 1 && i > 1 )
|
||||
{
|
||||
result = 0;
|
||||
}
|
||||
|
||||
result += i;
|
||||
if( result < 1 )
|
||||
{
|
||||
result = 1;
|
||||
}
|
||||
|
||||
out = Long.toString( result );
|
||||
Integer.parseInt( out );
|
||||
|
||||
@@ -26,6 +26,8 @@ import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -33,8 +35,6 @@ import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
@@ -84,16 +84,24 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
this.ccc = (ContainerCraftConfirm) this.inventorySlots;
|
||||
|
||||
if( te instanceof WirelessTerminalGuiObject )
|
||||
{
|
||||
this.OriginalGui = GuiBridge.GUI_WIRELESS_TERM;
|
||||
}
|
||||
|
||||
if( te instanceof PartTerminal )
|
||||
{
|
||||
this.OriginalGui = GuiBridge.GUI_ME;
|
||||
}
|
||||
|
||||
if( te instanceof PartCraftingTerminal )
|
||||
{
|
||||
this.OriginalGui = GuiBridge.GUI_CRAFTING_TERMINAL;
|
||||
}
|
||||
|
||||
if( te instanceof PartPatternTerminal )
|
||||
{
|
||||
this.OriginalGui = GuiBridge.GUI_PATTERN_TERMINAL;
|
||||
}
|
||||
}
|
||||
|
||||
boolean isAutoStart()
|
||||
@@ -115,13 +123,15 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
this.buttonList.add( this.selectCPU );
|
||||
|
||||
if( this.OriginalGui != null )
|
||||
{
|
||||
this.cancel = new GuiButton( 0, this.guiLeft + 6, this.guiTop + this.ySize - 25, 50, 20, GuiText.Cancel.getLocal() );
|
||||
}
|
||||
|
||||
this.buttonList.add( this.cancel );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen( int mouse_x, int mouse_y, float btn )
|
||||
public void drawScreen( int mouseX, int mouseY, float btn )
|
||||
{
|
||||
this.updateCPUButtonText();
|
||||
|
||||
@@ -142,9 +152,9 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
int minX = gx + 9 + x * 67;
|
||||
int minY = gy + 22 + y * offY;
|
||||
|
||||
if( minX < mouse_x && minX + 67 > mouse_x )
|
||||
if( minX < mouseX && minX + 67 > mouseX )
|
||||
{
|
||||
if( minY < mouse_y && minY + offY - 2 > mouse_y )
|
||||
if( minY < mouseY && minY + offY - 2 > mouseY )
|
||||
{
|
||||
this.tooltip = z;
|
||||
break;
|
||||
@@ -160,7 +170,7 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
}
|
||||
}
|
||||
|
||||
super.drawScreen( mouse_x, mouse_y, btn );
|
||||
super.drawScreen( mouseX, mouseY, btn );
|
||||
}
|
||||
|
||||
private void updateCPUButtonText()
|
||||
@@ -174,11 +184,15 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
btnTextText = GuiText.CraftingCPU.getLocal() + ": " + name;
|
||||
}
|
||||
else
|
||||
{
|
||||
btnTextText = GuiText.CraftingCPU.getLocal() + ": #" + this.ccc.selectedCpu;
|
||||
}
|
||||
}
|
||||
|
||||
if( this.ccc.noCPU )
|
||||
{
|
||||
btnTextText = GuiText.NoCraftingCPUs.getLocal();
|
||||
}
|
||||
|
||||
this.selectCPU.displayString = btnTextText;
|
||||
}
|
||||
@@ -199,9 +213,13 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
String dsp = null;
|
||||
|
||||
if( this.isSimulation() )
|
||||
{
|
||||
dsp = GuiText.Simulation.getLocal();
|
||||
}
|
||||
else
|
||||
{
|
||||
dsp = this.ccc.cpuBytesAvail > 0 ? ( GuiText.Bytes.getLocal() + ": " + this.ccc.cpuBytesAvail + " : " + GuiText.CoProcessors.getLocal() + ": " + this.ccc.cpuCoProcessors ) : GuiText.Bytes.getLocal() + ": N/A : " + GuiText.CoProcessors.getLocal() + ": N/A";
|
||||
}
|
||||
|
||||
int offset = ( 219 - this.fontRendererObj.getStringWidth( dsp ) ) / 2;
|
||||
this.fontRendererObj.drawString( dsp, offset, 165, 4210752 );
|
||||
@@ -237,11 +255,17 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
int lines = 0;
|
||||
|
||||
if( stored != null && stored.getStackSize() > 0 )
|
||||
{
|
||||
lines++;
|
||||
}
|
||||
if( pendingStack != null && pendingStack.getStackSize() > 0 )
|
||||
{
|
||||
lines++;
|
||||
}
|
||||
if( pendingStack != null && pendingStack.getStackSize() > 0 )
|
||||
{
|
||||
lines++;
|
||||
}
|
||||
|
||||
int negY = ( ( lines - 1 ) * 5 ) / 2;
|
||||
int downY = 0;
|
||||
@@ -251,16 +275,22 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
{
|
||||
String str = Long.toString( stored.getStackSize() );
|
||||
if( stored.getStackSize() >= 10000 )
|
||||
{
|
||||
str = Long.toString( stored.getStackSize() / 1000 ) + 'k';
|
||||
}
|
||||
if( stored.getStackSize() >= 10000000 )
|
||||
{
|
||||
str = Long.toString( stored.getStackSize() / 1000000 ) + 'm';
|
||||
}
|
||||
|
||||
str = GuiText.FromStorage.getLocal() + ": " + str;
|
||||
int w = 4 + this.fontRendererObj.getStringWidth( str );
|
||||
this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + yo + 6 - negY + downY ) * 2, 4210752 );
|
||||
|
||||
if( this.tooltip == z - viewStart )
|
||||
{
|
||||
lineList.add( GuiText.FromStorage.getLocal() + ": " + Long.toString( stored.getStackSize() ) );
|
||||
}
|
||||
|
||||
downY += 5;
|
||||
}
|
||||
@@ -269,16 +299,22 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
{
|
||||
String str = Long.toString( missingStack.getStackSize() );
|
||||
if( missingStack.getStackSize() >= 10000 )
|
||||
{
|
||||
str = Long.toString( missingStack.getStackSize() / 1000 ) + 'k';
|
||||
}
|
||||
if( missingStack.getStackSize() >= 10000000 )
|
||||
{
|
||||
str = Long.toString( missingStack.getStackSize() / 1000000 ) + 'm';
|
||||
}
|
||||
|
||||
str = GuiText.Missing.getLocal() + ": " + str;
|
||||
int w = 4 + this.fontRendererObj.getStringWidth( str );
|
||||
this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + yo + 6 - negY + downY ) * 2, 4210752 );
|
||||
|
||||
if( this.tooltip == z - viewStart )
|
||||
{
|
||||
lineList.add( GuiText.Missing.getLocal() + ": " + Long.toString( missingStack.getStackSize() ) );
|
||||
}
|
||||
|
||||
red = true;
|
||||
downY += 5;
|
||||
@@ -288,16 +324,22 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
{
|
||||
String str = Long.toString( pendingStack.getStackSize() );
|
||||
if( pendingStack.getStackSize() >= 10000 )
|
||||
{
|
||||
str = Long.toString( pendingStack.getStackSize() / 1000 ) + 'k';
|
||||
}
|
||||
if( pendingStack.getStackSize() >= 10000000 )
|
||||
{
|
||||
str = Long.toString( pendingStack.getStackSize() / 1000000 ) + 'm';
|
||||
}
|
||||
|
||||
str = GuiText.ToCraft.getLocal() + ": " + str;
|
||||
int w = 4 + this.fontRendererObj.getStringWidth( str );
|
||||
this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + yo + 6 - negY + downY ) * 2, 4210752 );
|
||||
|
||||
if( this.tooltip == z - viewStart )
|
||||
{
|
||||
lineList.add( GuiText.ToCraft.getLocal() + ": " + Long.toString( pendingStack.getStackSize() ) );
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
@@ -311,7 +353,9 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
dspToolTip = Platform.getItemDisplayName( is );
|
||||
|
||||
if( lineList.size() > 0 )
|
||||
{
|
||||
dspToolTip = dspToolTip + '\n' + Joiner.on( "\n" ).join( lineList );
|
||||
}
|
||||
|
||||
toolPosX = x * ( 1 + sectionLength ) + xo + sectionLength - 8;
|
||||
toolPosY = y * offY + yo;
|
||||
@@ -366,17 +410,23 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
{
|
||||
case 0:
|
||||
for( IAEItemStack l : list )
|
||||
{
|
||||
this.handleInput( this.storage, l );
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
for( IAEItemStack l : list )
|
||||
{
|
||||
this.handleInput( this.pending, l );
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
for( IAEItemStack l : list )
|
||||
{
|
||||
this.handleInput( this.missing, l );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -385,7 +435,9 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
long amt = this.getTotal( l );
|
||||
|
||||
if( amt <= 0 )
|
||||
{
|
||||
this.deleteVisualStack( l );
|
||||
}
|
||||
else
|
||||
{
|
||||
IAEItemStack is = this.findVisualStack( l );
|
||||
@@ -403,7 +455,9 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
if( l.getStackSize() <= 0 )
|
||||
{
|
||||
if( a != null )
|
||||
{
|
||||
a.reset();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -414,7 +468,9 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
}
|
||||
|
||||
if( a != null )
|
||||
{
|
||||
a.setStackSize( l.getStackSize() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -427,13 +483,19 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
long total = 0;
|
||||
|
||||
if( a != null )
|
||||
{
|
||||
total += a.getStackSize();
|
||||
}
|
||||
|
||||
if( c != null )
|
||||
{
|
||||
total += c.getStackSize();
|
||||
}
|
||||
|
||||
if( m != null )
|
||||
{
|
||||
total += m.getStackSize();
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
@@ -24,15 +24,17 @@ import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
|
||||
import org.apache.commons.lang3.time.DurationFormatUtils;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.SortDir;
|
||||
import appeng.api.config.SortOrder;
|
||||
@@ -50,20 +52,45 @@ import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.ReadableNumberConverter;
|
||||
|
||||
|
||||
public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
{
|
||||
private final static int GUI_HEIGHT = 184;
|
||||
private final static int GUI_WIDTH = 238;
|
||||
|
||||
final int rows = 6;
|
||||
private final static int DISPLAYED_ROWS = 6;
|
||||
|
||||
IItemList<IAEItemStack> storage = AEApi.instance().storage().createItemList();
|
||||
IItemList<IAEItemStack> active = AEApi.instance().storage().createItemList();
|
||||
IItemList<IAEItemStack> pending = AEApi.instance().storage().createItemList();
|
||||
private final static int TEXT_COLOR = 0x404040;
|
||||
private final static int BACKGROUND_ALPHA = 0x5A000000;
|
||||
|
||||
List<IAEItemStack> visual = new ArrayList<IAEItemStack>();
|
||||
GuiButton cancel;
|
||||
int tooltip = -1;
|
||||
private final static int SECTION_LENGTH = 67;
|
||||
|
||||
private final static int SCROLLBAR_TOP = 19;
|
||||
private final static int SCROLLBAR_LEFT = 218;
|
||||
private final static int SCROLLBAR_HEIGHT = 137;
|
||||
|
||||
private final static int CANCEL_LEFT_OFFSET = 163;
|
||||
private final static int CANCEL_TOP_OFFSET = 25;
|
||||
private final static int CANCEL_HEIGHT = 20;
|
||||
private final static int CANCEL_WIDTH = 50;
|
||||
|
||||
private final static int TITLE_TOP_OFFSET = 7;
|
||||
private final static int TITLE_LEFT_OFFSET = 8;
|
||||
|
||||
private final static int ITEMSTACK_LEFT_OFFSET = 9;
|
||||
private final static int ITEMSTACK_TOP_OFFSET = 22;
|
||||
|
||||
private final ContainerCraftingCPU craftingCpu;
|
||||
|
||||
private IItemList<IAEItemStack> storage = AEApi.instance().storage().createItemList();
|
||||
private IItemList<IAEItemStack> active = AEApi.instance().storage().createItemList();
|
||||
private IItemList<IAEItemStack> pending = AEApi.instance().storage().createItemList();
|
||||
|
||||
private List<IAEItemStack> visual = new ArrayList<IAEItemStack>();
|
||||
private GuiButton cancel;
|
||||
private int tooltip = -1;
|
||||
|
||||
public GuiCraftingCPU( InventoryPlayer inventoryPlayer, Object te )
|
||||
{
|
||||
@@ -73,8 +100,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
protected GuiCraftingCPU( ContainerCraftingCPU container )
|
||||
{
|
||||
super( container );
|
||||
this.ySize = 184;
|
||||
this.xSize = 238;
|
||||
this.craftingCpu = container;
|
||||
this.ySize = GUI_HEIGHT;
|
||||
this.xSize = GUI_WIDTH;
|
||||
this.myScrollBar = new GuiScrollbar();
|
||||
}
|
||||
|
||||
@@ -109,7 +137,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
{
|
||||
super.initGui();
|
||||
this.setScrollBar();
|
||||
this.cancel = new GuiButton( 0, this.guiLeft + 163, this.guiTop + this.ySize - 25, 50, 20, GuiText.Cancel.getLocal() );
|
||||
this.cancel = new GuiButton( 0, this.guiLeft + CANCEL_LEFT_OFFSET, this.guiTop + this.ySize - CANCEL_TOP_OFFSET, CANCEL_WIDTH, CANCEL_HEIGHT, GuiText.Cancel.getLocal() );
|
||||
this.buttonList.add( this.cancel );
|
||||
}
|
||||
|
||||
@@ -117,21 +145,21 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
{
|
||||
int size = this.visual.size();
|
||||
|
||||
this.myScrollBar.setTop( 19 ).setLeft( 218 ).setHeight( 137 );
|
||||
this.myScrollBar.setRange( 0, ( size + 2 ) / 3 - this.rows, 1 );
|
||||
this.myScrollBar.setTop( SCROLLBAR_TOP ).setLeft( SCROLLBAR_LEFT ).setHeight( SCROLLBAR_HEIGHT );
|
||||
this.myScrollBar.setRange( 0, ( size + 2 ) / 3 - DISPLAYED_ROWS, 1 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen( int mouse_x, int mouse_y, float btn )
|
||||
public void drawScreen( int mouseX, int mouseY, float btn )
|
||||
{
|
||||
this.cancel.enabled = !this.visual.isEmpty();
|
||||
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
|
||||
int gx = ( this.width - this.xSize ) / 2;
|
||||
int gy = ( this.height - this.ySize ) / 2;
|
||||
int offY = 23;
|
||||
final int gx = ( this.width - this.xSize ) / 2;
|
||||
final int gy = ( this.height - this.ySize ) / 2;
|
||||
final int offY = 23;
|
||||
|
||||
this.tooltip = -1;
|
||||
|
||||
@@ -140,9 +168,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
int minX = gx + 9 + x * 67;
|
||||
int minY = gy + 22 + y * offY;
|
||||
|
||||
if( minX < mouse_x && minX + 67 > mouse_x )
|
||||
if( minX < mouseX && minX + 67 > mouseX )
|
||||
{
|
||||
if( minY < mouse_y && minY + offY - 2 > mouse_y )
|
||||
if( minY < mouseY && minY + offY - 2 > mouseY )
|
||||
{
|
||||
this.tooltip = z;
|
||||
break;
|
||||
@@ -158,22 +186,28 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
}
|
||||
}
|
||||
|
||||
super.drawScreen( mouse_x, mouse_y, btn );
|
||||
super.drawScreen( mouseX, mouseY, btn );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
|
||||
{
|
||||
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.CraftingStatus.getLocal() ), 8, 7, 4210752 );
|
||||
final ReadableNumberConverter converter = ReadableNumberConverter.INSTANCE;
|
||||
String title = this.getGuiDisplayName( GuiText.CraftingStatus.getLocal() );
|
||||
|
||||
int sectionLength = 67;
|
||||
if( this.craftingCpu.eta > 0 && !this.visual.isEmpty() )
|
||||
{
|
||||
final long etaInMilliseconds = TimeUnit.MILLISECONDS.convert( this.craftingCpu.eta, TimeUnit.NANOSECONDS );
|
||||
final String etaTimeText = DurationFormatUtils.formatDuration( etaInMilliseconds, GuiText.ETAFormat.getLocal() );
|
||||
title += " - " + etaTimeText;
|
||||
}
|
||||
|
||||
this.fontRendererObj.drawString( title, TITLE_LEFT_OFFSET, TITLE_TOP_OFFSET, TEXT_COLOR );
|
||||
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
int xo = 9;
|
||||
int yo = 22;
|
||||
int viewStart = this.myScrollBar.getCurrentScroll() * 3;
|
||||
int viewEnd = viewStart + 3 * 6;
|
||||
final int viewStart = this.myScrollBar.getCurrentScroll() * 3;
|
||||
final int viewEnd = viewStart + 3 * 6;
|
||||
|
||||
String dspToolTip = "";
|
||||
List<String> lineList = new LinkedList<String>();
|
||||
@@ -190,9 +224,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScaled( 0.5, 0.5, 0.5 );
|
||||
|
||||
IAEItemStack stored = this.storage.findPrecise( refStack );
|
||||
IAEItemStack activeStack = this.active.findPrecise( refStack );
|
||||
IAEItemStack pendingStack = this.pending.findPrecise( refStack );
|
||||
final IAEItemStack stored = this.storage.findPrecise( refStack );
|
||||
final IAEItemStack activeStack = this.active.findPrecise( refStack );
|
||||
final IAEItemStack pendingStack = this.pending.findPrecise( refStack );
|
||||
|
||||
int lines = 0;
|
||||
boolean active = false;
|
||||
@@ -215,10 +249,10 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
|
||||
if( AEConfig.instance.useColoredCraftingStatus && ( active || scheduled ) )
|
||||
{
|
||||
int bgColor = ( active ? AEColor.Green.blackVariant : AEColor.Yellow.blackVariant ) | 0x5A000000;
|
||||
int startX = ( x * ( 1 + sectionLength ) + xo ) * 2;
|
||||
int startY = ( ( y * offY + yo ) - 3 ) * 2;
|
||||
drawRect( startX, startY, startX + ( sectionLength * 2 ), startY + ( offY * 2 ) - 2, bgColor );
|
||||
int bgColor = ( active ? AEColor.Green.blackVariant : AEColor.Yellow.blackVariant ) | BACKGROUND_ALPHA;
|
||||
int startX = ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET ) * 2;
|
||||
int startY = ( ( y * offY + ITEMSTACK_TOP_OFFSET ) - 3 ) * 2;
|
||||
drawRect( startX, startY, startX + ( SECTION_LENGTH * 2 ), startY + ( offY * 2 ) - 2, bgColor );
|
||||
}
|
||||
|
||||
int negY = ( ( lines - 1 ) * 5 ) / 2;
|
||||
@@ -226,59 +260,49 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
|
||||
if( stored != null && stored.getStackSize() > 0 )
|
||||
{
|
||||
String str = Long.toString( stored.getStackSize() );
|
||||
if( stored.getStackSize() >= 10000 )
|
||||
str = Long.toString( stored.getStackSize() / 1000 ) + 'k';
|
||||
if( stored.getStackSize() >= 10000000 )
|
||||
str = Long.toString( stored.getStackSize() / 1000000 ) + 'm';
|
||||
|
||||
str = GuiText.Stored.getLocal() + ": " + str;
|
||||
final String str = GuiText.Stored.getLocal() + ": " + converter.toWideReadableForm( stored.getStackSize() );
|
||||
int w = 4 + this.fontRendererObj.getStringWidth( str );
|
||||
this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + yo + 6 - negY + downY ) * 2, 4210752 );
|
||||
this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + ITEMSTACK_TOP_OFFSET + 6 - negY + downY ) * 2, TEXT_COLOR );
|
||||
|
||||
if( this.tooltip == z - viewStart )
|
||||
{
|
||||
lineList.add( GuiText.Stored.getLocal() + ": " + Long.toString( stored.getStackSize() ) );
|
||||
}
|
||||
|
||||
downY += 5;
|
||||
}
|
||||
|
||||
if( activeStack != null && activeStack.getStackSize() > 0 )
|
||||
{
|
||||
String str = Long.toString( activeStack.getStackSize() );
|
||||
if( activeStack.getStackSize() >= 10000 )
|
||||
str = Long.toString( activeStack.getStackSize() / 1000 ) + 'k';
|
||||
if( activeStack.getStackSize() >= 10000000 )
|
||||
str = Long.toString( activeStack.getStackSize() / 1000000 ) + 'm';
|
||||
final String str = GuiText.Crafting.getLocal() + ": " + converter.toWideReadableForm( activeStack.getStackSize() );
|
||||
final int w = 4 + this.fontRendererObj.getStringWidth( str );
|
||||
|
||||
str = GuiText.Crafting.getLocal() + ": " + str;
|
||||
int w = 4 + this.fontRendererObj.getStringWidth( str );
|
||||
this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + yo + 6 - negY + downY ) * 2, 4210752 );
|
||||
this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + ITEMSTACK_TOP_OFFSET + 6 - negY + downY ) * 2, TEXT_COLOR );
|
||||
|
||||
if( this.tooltip == z - viewStart )
|
||||
{
|
||||
lineList.add( GuiText.Crafting.getLocal() + ": " + Long.toString( activeStack.getStackSize() ) );
|
||||
}
|
||||
|
||||
downY += 5;
|
||||
}
|
||||
|
||||
if( pendingStack != null && pendingStack.getStackSize() > 0 )
|
||||
{
|
||||
String str = Long.toString( pendingStack.getStackSize() );
|
||||
if( pendingStack.getStackSize() >= 10000 )
|
||||
str = Long.toString( pendingStack.getStackSize() / 1000 ) + 'k';
|
||||
if( pendingStack.getStackSize() >= 10000000 )
|
||||
str = Long.toString( pendingStack.getStackSize() / 1000000 ) + 'm';
|
||||
final String str = GuiText.Scheduled.getLocal() + ": " + converter.toWideReadableForm( pendingStack.getStackSize() );
|
||||
final int w = 4 + this.fontRendererObj.getStringWidth( str );
|
||||
|
||||
str = GuiText.Scheduled.getLocal() + ": " + str;
|
||||
int w = 4 + this.fontRendererObj.getStringWidth( str );
|
||||
this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + yo + 6 - negY + downY ) * 2, 4210752 );
|
||||
this.fontRendererObj.drawString( str, (int) ( ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19 - ( w * 0.5 ) ) * 2 ), ( y * offY + ITEMSTACK_TOP_OFFSET + 6 - negY + downY ) * 2, TEXT_COLOR );
|
||||
|
||||
if( this.tooltip == z - viewStart )
|
||||
{
|
||||
lineList.add( GuiText.Scheduled.getLocal() + ": " + Long.toString( pendingStack.getStackSize() ) );
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
int posX = x * ( 1 + sectionLength ) + xo + sectionLength - 19;
|
||||
int posY = y * offY + yo;
|
||||
int posX = x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19;
|
||||
int posY = y * offY + ITEMSTACK_TOP_OFFSET;
|
||||
|
||||
ItemStack is = refStack.copy().getItemStack();
|
||||
|
||||
@@ -287,10 +311,12 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
dspToolTip = Platform.getItemDisplayName( is );
|
||||
|
||||
if( lineList.size() > 0 )
|
||||
{
|
||||
dspToolTip = dspToolTip + '\n' + Joiner.on( "\n" ).join( lineList );
|
||||
}
|
||||
|
||||
toolPosX = x * ( 1 + sectionLength ) + xo + sectionLength - 8;
|
||||
toolPosY = y * offY + yo;
|
||||
toolPosX = x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 8;
|
||||
toolPosY = y * offY + ITEMSTACK_TOP_OFFSET;
|
||||
}
|
||||
|
||||
this.drawItem( posX, posY, is );
|
||||
@@ -326,17 +352,23 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
{
|
||||
case 0:
|
||||
for( IAEItemStack l : list )
|
||||
{
|
||||
this.handleInput( this.storage, l );
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
for( IAEItemStack l : list )
|
||||
{
|
||||
this.handleInput( this.active, l );
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
for( IAEItemStack l : list )
|
||||
{
|
||||
this.handleInput( this.pending, l );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -345,7 +377,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
long amt = this.getTotal( l );
|
||||
|
||||
if( amt <= 0 )
|
||||
{
|
||||
this.deleteVisualStack( l );
|
||||
}
|
||||
else
|
||||
{
|
||||
IAEItemStack is = this.findVisualStack( l );
|
||||
@@ -363,7 +397,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
if( l.getStackSize() <= 0 )
|
||||
{
|
||||
if( a != null )
|
||||
{
|
||||
a.reset();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -374,33 +410,42 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
}
|
||||
|
||||
if( a != null )
|
||||
{
|
||||
a.setStackSize( l.getStackSize() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private long getTotal( IAEItemStack is )
|
||||
{
|
||||
IAEItemStack a = this.storage.findPrecise( is );
|
||||
IAEItemStack b = this.active.findPrecise( is );
|
||||
IAEItemStack c = this.pending.findPrecise( is );
|
||||
final IAEItemStack a = this.storage.findPrecise( is );
|
||||
final IAEItemStack b = this.active.findPrecise( is );
|
||||
final IAEItemStack c = this.pending.findPrecise( is );
|
||||
|
||||
long total = 0;
|
||||
|
||||
if( a != null )
|
||||
{
|
||||
total += a.getStackSize();
|
||||
}
|
||||
|
||||
if( b != null )
|
||||
{
|
||||
total += b.getStackSize();
|
||||
}
|
||||
|
||||
if( c != null )
|
||||
{
|
||||
total += c.getStackSize();
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
private void deleteVisualStack( IAEItemStack l )
|
||||
{
|
||||
Iterator<IAEItemStack> i = this.visual.iterator();
|
||||
final Iterator<IAEItemStack> i = this.visual.iterator();
|
||||
|
||||
while( i.hasNext() )
|
||||
{
|
||||
IAEItemStack o = i.next();
|
||||
@@ -422,8 +467,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
}
|
||||
}
|
||||
|
||||
IAEItemStack stack = l.copy();
|
||||
final IAEItemStack stack = l.copy();
|
||||
this.visual.add( stack );
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
|
||||
@@ -166,11 +166,15 @@ public class GuiCraftingStatus extends GuiCraftingCPU
|
||||
btnTextText = GuiText.CPUs.getLocal() + ": " + name;
|
||||
}
|
||||
else
|
||||
{
|
||||
btnTextText = GuiText.CPUs.getLocal() + ": #" + this.status.selectedCpu;
|
||||
}
|
||||
}
|
||||
|
||||
if( this.status.noCPU )
|
||||
{
|
||||
btnTextText = GuiText.NoCraftingJobs.getLocal();
|
||||
}
|
||||
|
||||
this.selectCPU.displayString = btnTextText;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,9 @@ public class GuiCraftingTerm extends GuiMEMonitorable
|
||||
for( Object j : c.inventorySlots )
|
||||
{
|
||||
if( j instanceof SlotCraftingMatrix )
|
||||
{
|
||||
s = (Slot) j;
|
||||
}
|
||||
}
|
||||
|
||||
if( s != null )
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user