Compare commits
205 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 548af3c6cc | |||
| 98b9380494 | |||
| bbf4d4a9ce | |||
| 1513ba3f6a | |||
| f03f8ec432 | |||
| e1dcd588b7 | |||
| 8338a7d13e | |||
| b8e685b1b6 | |||
| d84500c5b7 | |||
| a1679c944b | |||
| a3a39201d1 | |||
| d788da687e | |||
| 030e0c6a14 | |||
| 8e4265aa33 | |||
| 80eaa032b9 | |||
| bee9c70497 | |||
| c4fa21c193 | |||
| 8a7450168b | |||
| 7cb641cdc8 | |||
| b5b8050c4c | |||
| e65083b045 | |||
| b61219ef88 | |||
| 4f9fd1b369 | |||
| 630fae3f73 | |||
| 488ef1b544 | |||
| 098ee2f000 | |||
| 04d2b06c0d | |||
| ac48ab02fc | |||
| 9022150e38 | |||
| 65c6d2249a | |||
| 8e7f79a9ea | |||
| 95b48b9438 | |||
| cdd76b7b22 | |||
| 3e2bc0e038 | |||
| eec3e59eea | |||
| e39855b48f | |||
| cdcab7d91c | |||
| 27ad2c2b96 | |||
| 542a2e5d5a | |||
| 3b58f5e8da | |||
| 092afad4a5 | |||
| 6aa810d62a | |||
| 41d98f9944 | |||
| 1b198979fd | |||
| 8d5cc916e0 | |||
| 5abb8bf886 | |||
| 0bed78a144 | |||
| 30940e91ea | |||
| 0f9ac5fdda | |||
| 5e001d86cb | |||
| b13a338948 | |||
| 454404b0c1 | |||
| bb1e191666 | |||
| b72fce97db | |||
| bcc4a732ed | |||
| 52d28fabe3 | |||
| c077840988 | |||
| 8f6510aad4 | |||
| fa8427dcbd | |||
| 7eb09fc4db | |||
| ac528d09ae | |||
| c97165cc63 | |||
| 08ee8f7656 | |||
| 727fcc528f | |||
| a4c468b9cf | |||
| 4ad31f5066 | |||
| f70e97046f | |||
| 3a053d9ebe | |||
| fbaff342e4 | |||
| f0baea3be8 | |||
| fd7e393d23 | |||
| a24ed38e90 | |||
| 15582fd1df | |||
| f9cad0758d | |||
| 406013142e | |||
| 7de90ed0ae | |||
| 8ec8babb6a | |||
| 621910df91 | |||
| 66437897be | |||
| 7414840530 | |||
| 0741e4ae09 | |||
| 87f6a63f47 | |||
| b0950683a1 | |||
| 009cf8ac40 | |||
| 4c272de77f | |||
| 6648d18f00 | |||
| 16b5b5aea2 | |||
| e20697a7d9 | |||
| dc0447d137 | |||
| 577b1fa757 | |||
| 3d69dc9bc4 | |||
| 66c87a2fa2 | |||
| fdab91323c | |||
| 98a8c3d06b | |||
| 458356a2be | |||
| c91b432e09 | |||
| d67d93b343 | |||
| f6f8da28af | |||
| 76fd3c1166 | |||
| 3da881829e | |||
| 90ee7fb15d | |||
| e5e2714273 | |||
| 1534521362 | |||
| 0f8204cd93 | |||
| eb11845a2f | |||
| fe213e5ac5 | |||
| 25c82b2c9f | |||
| d03faae983 | |||
| 76e19874cf | |||
| 1975c3c262 | |||
| 720feb4f16 | |||
| 588579d67f | |||
| 043f6e9919 | |||
| cc7824a0e5 | |||
| a57cd3f580 | |||
| 33f54a1bd6 | |||
| 3008088ad7 | |||
| 198ea9f16e | |||
| d8c5e6a5fa | |||
| fbcf8c4705 | |||
| d67f97cd16 | |||
| 0e2f8a22a2 | |||
| 20fc0e136d | |||
| 7f7495f1df | |||
| e6e858820f | |||
| 4679b0ee61 | |||
| 890eef1803 | |||
| 780ce89ac3 | |||
| e96339dd2b | |||
| b67d7eed82 | |||
| 5ebd8452bf | |||
| ee774cd3f8 | |||
| 0a2f90d115 | |||
| 0f86efa3f5 | |||
| 7398af0e1c | |||
| eb0b304fd9 | |||
| c455ee69b8 | |||
| 820a6bdbd6 | |||
| 7a8499c455 | |||
| 76f17ba53c | |||
| 16a0872d06 | |||
| 49a87f62ce | |||
| c382ab7300 | |||
| 49a6df5bc7 | |||
| 10e050c35b | |||
| b1e249aad0 | |||
| d3bb71d834 | |||
| 3f7051ec8e | |||
| 2f1f19bbb3 | |||
| 4c7f065af3 | |||
| 6c52f31686 | |||
| 3ac7e518b1 | |||
| af85a2bf67 | |||
| c4b4a257f3 | |||
| 4eba3bca5b | |||
| cd78586910 | |||
| 178198b0c6 | |||
| bdf46a6ee2 | |||
| 0be2011645 | |||
| bce500616c | |||
| e022c23c8f | |||
| 61b81fc802 | |||
| b819fe4adb | |||
| 66a797dd7c | |||
| 99c294e948 | |||
| 6529de911a | |||
| 650edae902 | |||
| 78904204cf | |||
| df7ab00c37 | |||
| 5432decf95 | |||
| da5879b667 | |||
| 370fc49357 | |||
| c74aaddbd3 | |||
| 1a4db4b8d7 | |||
| d77d21858e | |||
| 42bfc549be | |||
| c6bdf845a8 | |||
| ccc46e77a3 | |||
| 7e45cf0e37 | |||
| 86dd8193f7 | |||
| 5fff8310d6 | |||
| 1cde7bc933 | |||
| ed9e6dd21c | |||
| 589730bfad | |||
| 8700a79ca6 | |||
| a14cf2204d | |||
| 8bed7f223e | |||
| db85419702 | |||
| fb79fd284d | |||
| e3305c1963 | |||
| a3c85b4a59 | |||
| a2b20f1d67 | |||
| 86908b1ae6 | |||
| 6bf52b0b0f | |||
| eb1e86cacb | |||
| c405e725b2 | |||
| d377af9a69 | |||
| 12dbd17320 | |||
| 5028c8025b | |||
| d11d6e754f | |||
| 887339f7b8 | |||
| a665200c31 | |||
| 6554e295d5 | |||
| 4eeb554dcb | |||
| 3eae4a7d19 |
+11
-6
@@ -12,15 +12,18 @@ top of things.
|
||||
Applied Energistics 2 crashing, have a suggestion, found a bug? Create an issue now!
|
||||
|
||||
1. Make sure your issue has not already been answered or fixed and you are using the latest version. Also think about whether your issue is a valid one before submitting it.
|
||||
* If it is already possible with vanilla and AE2 itself, the suggestion will be considered invalid.
|
||||
* Asking for a smaller version, more compact version, or more efficient version of something will also be considered invalid.
|
||||
2. Go to [the issues page](https://github.com/AppliedEnergistics/Applied-Energistics-2/issues) and click [new issue](https://github.com/AppliedEnergistics/Applied-Energistics-2/issues/new)
|
||||
3. Enter your a title of your issue (something that summarizes your issue), and then create a detailed description of the issue.
|
||||
* Do not tag it with something like `[Feature]` or `[Bug]`. When it is applicable, we will take care of it.
|
||||
* The following details are required. Not including them can cause the issue to be closed.
|
||||
* Do not tag it with something like `[Feature]`, `[Bug]`, or a version.
|
||||
* Restrict it to a single bug or feature, it makes managing them way easier for us.
|
||||
* The following details are required. Also refer to the issue template when creating one.
|
||||
* Forge version
|
||||
* AE2 version
|
||||
* Crash log, when reporting a crash (Please make sure to use [pastebin](http://pastebin.com/))
|
||||
* Do not post an excerpt of what you consider important, instead:
|
||||
* Post the full log
|
||||
* Never post an excerpt of what you consider important
|
||||
* Always post the full log
|
||||
* Other mods and their version, when reporting an issue between AE and another mod
|
||||
* Also consider updating these before submitting a new issue, it might be already fixed
|
||||
* A detailed description of the bug or feature
|
||||
@@ -33,10 +36,12 @@ Applied Energistics 2 crashing, have a suggestion, found a bug? Create an issue
|
||||
* Mod Pack using and version?
|
||||
* Keep in mind that some mods might use an outdated version of AE2
|
||||
* If so you should report it to your modpack
|
||||
5. Click `Submit New Issue`, and wait for feedback!
|
||||
4. Click `Submit New Issue`, and wait for feedback!
|
||||
|
||||
Providing as many details as possible does help us to find and resolve the issue faster and also you getting a fixed version as fast as possible.
|
||||
|
||||
Please note that we might close any issue not matching these requirements.
|
||||
|
||||
### Submitting Changes
|
||||
|
||||
* Submit an issue to the github project, assuming one does not already exist.
|
||||
@@ -108,7 +113,7 @@ the styling guidelines used by AE.
|
||||
PRs that do not conform to these standards will be rejected.
|
||||
|
||||
You can find presets for Eclipse and IntelliJ IDEA in the `codeformat` folder.
|
||||
We try to keep them up to date, but in case you find them not formatting it correctly, then please report it
|
||||
We try to keep them up to date. Please report any case of maintaining the correct formatting.
|
||||
|
||||
### Whitespace
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[](https://travis-ci.org/AppliedEnergistics/Applied-Energistics-2)
|
||||
[](https://github.com/AppliedEnergistics/Applied-Energistics-2/releases)
|
||||
[](https://github.com/AppliedEnergistics/Applied-Energistics-2/releases)
|
||||
|
||||
# Applied Energistics 2
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
* [Contacts](#contacts)
|
||||
* [License](#license)
|
||||
* [Downloads](#downloads)
|
||||
* [Nightly Builds](#nightly-builds)
|
||||
* [Installation](#installation)
|
||||
* [Issues](#issues)
|
||||
* [Building](#building)
|
||||
@@ -31,13 +30,13 @@ A Mod about Matter, Energy and using them to conquer the world..
|
||||
## License
|
||||
|
||||
* Applied Energistics 2 API
|
||||
- (c) 2013 - 2015 AlgorithmX2 et al
|
||||
- (c) 2013 - 2017 AlgorithmX2 et al
|
||||
- [](http://opensource.org/licenses/MIT)
|
||||
* Applied Energistics 2
|
||||
- (c) 2013 - 2015 AlgorithmX2 et al
|
||||
- (c) 2013 - 2017 AlgorithmX2 et al
|
||||
- [](https://raw.githubusercontent.com/AppliedEnergistics/Applied-Energistics-2/rv2/LICENSE)
|
||||
* Textures and Models
|
||||
- (c) 2013 - 2015 AlgorithmX2 et al
|
||||
- (c) 2013 - 2017 AlgorithmX2 et al
|
||||
- [](https://creativecommons.org/licenses/by-nc-sa/3.0/)
|
||||
* Text and Translations
|
||||
- [](https://creativecommons.org/publicdomain/zero/1.0/)
|
||||
@@ -46,14 +45,6 @@ A Mod about Matter, Energy and using them to conquer the world..
|
||||
|
||||
Downloads can be found on [CurseForge](http://www.curse.com/mc-mods/minecraft/223794-applied-energistics-2) or on the [official website](http://ae-mod.info/Downloads/).
|
||||
|
||||
## Nightly Builds
|
||||
|
||||
[](https://ci.appveyor.com/project/shartte/applied-energistics-2/history)
|
||||
|
||||
[Download Latest Nightly Build](https://ci.appveyor.com/api/projects/shartte/applied-energistics-2/artifacts/ae2-rv4-nightly.zip?branch=master)
|
||||
|
||||
Nightly builds for the Minecraft 1.10.2 branch of AE2 (rv4-alpha) are available from [AppVeyor](https://ci.appveyor.com/project/shartte/applied-energistics-2/history). These builds are only for testing purposes and might lead to loss of data, and will contain significant bugs. Please see below on how you can report bugs you find during testing.
|
||||
|
||||
## Installation
|
||||
|
||||
You install this mod by putting it into the `minecraft/mods/` folder. It has no additional hard dependencies.
|
||||
@@ -63,15 +54,18 @@ You install this mod by putting it into the `minecraft/mods/` folder. It has no
|
||||
Applied Energistics 2 crashing, have a suggestion, found a bug? Create an issue now!
|
||||
|
||||
1. Make sure your issue has not already been answered or fixed and you are using the latest version. Also think about whether your issue is a valid one before submitting it.
|
||||
* If it is already possible with vanilla and AE2 itself, the suggestion will be considered invalid.
|
||||
* Asking for a smaller version, more compact version, or more efficient version of something will also be considered invalid.
|
||||
2. Go to [the issues page](https://github.com/AppliedEnergistics/Applied-Energistics-2/issues) and click [new issue](https://github.com/AppliedEnergistics/Applied-Energistics-2/issues/new)
|
||||
3. Enter your a title of your issue (something that summarizes your issue), and then create a detailed description of the issue.
|
||||
* Do not tag it with something like `[Feature]` or `[Bug]`. When it is applicable, we will take care of it.
|
||||
* The following details are required. Not including them can cause the issue to be closed.
|
||||
* Do not tag it with something like `[Feature]`, `[Bug]`, or a version.
|
||||
* Restrict it to a single bug or feature, it makes managing them way easier for us.
|
||||
* The following details are required. Also refer to the issue template when creating one.
|
||||
* Forge version
|
||||
* AE2 version
|
||||
* Crash log, when reporting a crash (Please make sure to use [pastebin](http://pastebin.com/))
|
||||
* Do not post an excerpt of what you consider important, instead:
|
||||
* Post the full log
|
||||
* Never post an excerpt of what you consider important
|
||||
* Always post the full log
|
||||
* Other mods and their version, when reporting an issue between AE and another mod
|
||||
* Also consider updating these before submitting a new issue, it might be already fixed
|
||||
* A detailed description of the bug or feature
|
||||
@@ -84,10 +78,12 @@ Applied Energistics 2 crashing, have a suggestion, found a bug? Create an issue
|
||||
* Mod Pack using and version?
|
||||
* Keep in mind that some mods might use an outdated version of AE2
|
||||
* If so you should report it to your modpack
|
||||
5. Click `Submit New Issue`, and wait for feedback!
|
||||
4. Click `Submit New Issue`, and wait for feedback!
|
||||
|
||||
Providing as many details as possible does help us to find and resolve the issue faster and also you getting a fixed version as fast as possible.
|
||||
|
||||
Please note that we might close any issue not matching these requirements.
|
||||
|
||||
## Building
|
||||
|
||||
1. Clone this repository via
|
||||
@@ -103,14 +99,14 @@ Providing as many details as possible does help us to find and resolve the issue
|
||||
- Eclipse: execute `gradlew eclipse`
|
||||
5. For add-on developer: Core-Mod Detection
|
||||
- In order to have FML detect AE from your dev environment, add the following VM Option to your run profile
|
||||
- `-Dfml.coreMods.load=appeng.transformer.AppEngCore`
|
||||
- `-Dfml.coreMods.load=appeng.coremod.AppEngCore`
|
||||
|
||||
## Contribution
|
||||
|
||||
Before you want to add major changes, you might want to discuss them with us first, before wasting your time.
|
||||
If you are still willing to contribute to this project, you can contribute via [Pull-Request](https://help.github.com/articles/creating-a-pull-request).
|
||||
|
||||
The [guidelines for contributing](https://github.com/AppliedEnergistics/Applied-Energistics-2/blob/master/CONTRIBUTING.md) contain more detailed information about topics like the used code style and should also be considered.
|
||||
The [guidelines for contributing](https://github.com/AppliedEnergistics/Applied-Energistics-2/blob/master/.github/CONTRIBUTING.md) contain more detailed information about topics like the used code style and should also be considered.
|
||||
|
||||
Here are a few things to keep in mind that will help get your PR approved.
|
||||
|
||||
@@ -122,7 +118,7 @@ Here are a few things to keep in mind that will help get your PR approved.
|
||||
- Does your feature simplify another feature of AE2? These changes will not be accepted.
|
||||
- If your feature can be done by any popular mod, discuss with us first.
|
||||
|
||||
Getting Started
|
||||
**Getting Started**
|
||||
|
||||
1. Fork this repository
|
||||
2. Clone the fork via
|
||||
@@ -142,7 +138,7 @@ If you are only doing single file pull requests, GitHub supports using a quick w
|
||||
|
||||
The API for Applied Energistics 2. It is open source to discuss changes, improve documentation, and provide better add-on support in general.
|
||||
|
||||
Development and standard builds can be obtained [Here](http://ae2.ae-mod.info/Downloads/).
|
||||
Universal builds obtained [Here](http://ae2.ae-mod.info/Downloads/) should work in a development environment.
|
||||
|
||||
### Maven
|
||||
|
||||
|
||||
+12
-17
@@ -27,7 +27,7 @@ buildscript {
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||
@@ -45,6 +45,12 @@ apply from: 'gradle/scripts/optional.gradle'
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
|
||||
// ensure everything uses UTF-8 and not some random codepage chosen by gradle
|
||||
compileJava.options.encoding = 'UTF-8'
|
||||
tasks.withType(JavaCompile) {
|
||||
options.encoding = 'UTF-8'
|
||||
}
|
||||
|
||||
version = aeversion + "-" + aechannel + "-" + aebuild
|
||||
group = aegroup
|
||||
archivesBaseName = aebasename
|
||||
@@ -52,7 +58,7 @@ archivesBaseName = aebasename
|
||||
// Add Coremod Manifest
|
||||
jar {
|
||||
manifest {
|
||||
attributes 'FMLCorePluginContainsFMLMod': 'true'
|
||||
attributes 'FMLAT': 'appeng_at.cfg'
|
||||
}
|
||||
|
||||
from sourceSets.api.output
|
||||
@@ -63,11 +69,10 @@ jar {
|
||||
include "assets/**"
|
||||
include "mcmod.info"
|
||||
include "pack.mcmeta"
|
||||
include "META-INF/appeng_at.cfg"
|
||||
}
|
||||
|
||||
minecraft {
|
||||
coreMod = "appeng.transformer.AppEngCore"
|
||||
|
||||
version = minecraft_version + "-" + forge_version
|
||||
|
||||
replaceIn "AEConfig.java"
|
||||
@@ -84,21 +89,8 @@ minecraft {
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
|
||||
api
|
||||
|
||||
// This source set will contain third party API code that we need to compile, but which is not shipped with the jar
|
||||
thirdparty {
|
||||
// Third Party APIs often need access to Minecraft classes (i.e. EnumFacing), so set this up here
|
||||
compileClasspath += configurations.forgeGradleMc + configurations.forgeGradleMcDeps
|
||||
}
|
||||
|
||||
main
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile sourceSets.thirdparty.output
|
||||
}
|
||||
|
||||
processResources
|
||||
@@ -117,4 +109,7 @@ processResources
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
exclude 'mcmod.info'
|
||||
}
|
||||
|
||||
// move access transformer to META-INF
|
||||
rename '(.+_at.cfg)', 'META-INF/$1'
|
||||
}
|
||||
@@ -1,24 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<profiles version="12">
|
||||
<profile kind="CodeFormatterProfile" name="AE2" version="12">
|
||||
<profiles version="13">
|
||||
<profile kind="CodeFormatterProfile" name="AE2" version="13">
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
|
||||
@@ -26,17 +30,19 @@
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
|
||||
@@ -52,14 +58,16 @@
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
|
||||
@@ -82,6 +90,7 @@
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
|
||||
@@ -93,15 +102,16 @@
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_parameters" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="true"/>
|
||||
@@ -112,9 +122,10 @@
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
|
||||
@@ -153,15 +164,18 @@
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_conditional_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines" value="2147483647"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.source" value="1.8"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="insert"/>
|
||||
@@ -183,6 +197,7 @@
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_assignment_operator" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.8"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="next_line"/>
|
||||
@@ -194,8 +209,10 @@
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_arguments" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
|
||||
@@ -256,6 +273,7 @@
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
|
||||
@@ -271,6 +289,7 @@
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
|
||||
|
||||
+15
-8
@@ -1,4 +1,4 @@
|
||||
aeversion=rv4
|
||||
aeversion=rv5
|
||||
aechannel=alpha
|
||||
aebuild=0
|
||||
aegroup=appeng
|
||||
@@ -7,18 +7,25 @@ aebasename=appliedenergistics2
|
||||
#########################################################
|
||||
# Versions #
|
||||
#########################################################
|
||||
minecraft_version=1.10.2
|
||||
mcp_mappings=snapshot_20161018
|
||||
forge_version=12.18.2.2104
|
||||
minecraft_version=1.12
|
||||
mcp_mappings=snapshot_20170704
|
||||
forge_version=14.21.1.2412
|
||||
|
||||
#########################################################
|
||||
# Installable #
|
||||
#########################################################
|
||||
waila_version=1.7.0-B3_1.9.4
|
||||
hwyla_version=1.8.19-B33_1.12
|
||||
|
||||
#########################################################
|
||||
# Provided APIs #
|
||||
#########################################################
|
||||
jei_version=3.12.7.312
|
||||
tesla_version=1.10.2-1.2.1.49
|
||||
ic2_version=2.6.96-ex110
|
||||
jei_version=4.7.1.69
|
||||
tesla_version=1.0.61
|
||||
ic2_version=2.8.9-ex112
|
||||
top_version=1.12-1.4.8-2
|
||||
|
||||
#########################################################
|
||||
# Deployment #
|
||||
#########################################################
|
||||
website_version=1.12.x
|
||||
curse_versions=1.12,1.12.1
|
||||
|
||||
@@ -38,6 +38,26 @@ repositories {
|
||||
name = "IC2 repo"
|
||||
url = "http://maven.ic2.player.to"
|
||||
}
|
||||
|
||||
maven {
|
||||
name = "CoFH Maven"
|
||||
url = "http://maven.covers1624.net"
|
||||
}
|
||||
|
||||
maven { // TheOneProbe
|
||||
name 'tterrag maven'
|
||||
url "http://maven.tterrag.com/"
|
||||
}
|
||||
|
||||
maven { // McJtyLib
|
||||
name 'mcjty'
|
||||
url "http://maven.k-4u.nl/"
|
||||
}
|
||||
|
||||
maven { // Hwyla
|
||||
name 'tehnut'
|
||||
url "http://tehnut.info/maven"
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
@@ -46,14 +66,19 @@ configurations {
|
||||
|
||||
dependencies {
|
||||
// installable runtime dependencies
|
||||
mods "mcp.mobius.waila:Waila:${waila_version}"
|
||||
mods "mcp.mobius.waila:Hwyla:${hwyla_version}"
|
||||
mods "net.industrial-craft:industrialcraft-2:${ic2_version}:dev"
|
||||
mods "mcjty.theoneprobe:TheOneProbe-${minecraft_version}:${top_version}"
|
||||
// mods "com.github.mcjty:compatlayer:${compatlayer_version}"
|
||||
|
||||
// compile against provided APIs
|
||||
compileOnly "mezz.jei:jei_${minecraft_version}:${jei_version}:api"
|
||||
compileOnly "mcp.mobius.waila:Waila:${waila_version}"
|
||||
compileOnly "net.darkhax.tesla:Tesla:${tesla_version}"
|
||||
compileOnly "mcp.mobius.waila:Hwyla:${hwyla_version}"
|
||||
compileOnly "net.darkhax.tesla:Tesla-${minecraft_version}:${tesla_version}"
|
||||
compileOnly "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
|
||||
compileOnly "mcjty.theoneprobe:TheOneProbe-1.12:${top_version}:api"
|
||||
|
||||
// deobfCompile "mcp.mobius.waila:Hwyla:${hwyla_version}"
|
||||
|
||||
// at runtime, use the full JEI jar
|
||||
runtime "mezz.jei:jei_${minecraft_version}:${jei_version}"
|
||||
|
||||
@@ -20,18 +20,18 @@ task wrapper(type: Wrapper) {
|
||||
gradleVersion = "2.14"
|
||||
}
|
||||
|
||||
// WAILA
|
||||
task installWaila(type: Copy, dependsOn: "deinstallWaila") {
|
||||
// HWYLA
|
||||
task installHwyla(type: Copy, dependsOn: "deinstallHwyla") {
|
||||
from { configurations.mods }
|
||||
include "**/*Waila*.jar"
|
||||
include "**/*Hwyla*.jar"
|
||||
into file(minecraft.runDir + "/mods")
|
||||
}
|
||||
|
||||
task deinstallWaila(type: Delete) {
|
||||
delete fileTree(dir: minecraft.runDir + "/mods", include: "*Waila*.jar")
|
||||
task deinstallHwyla(type: Delete) {
|
||||
delete fileTree(dir: minecraft.runDir + "/mods", include: "*Hwyla*.jar")
|
||||
}
|
||||
|
||||
// IC²
|
||||
// IC2
|
||||
task installIC2(type: Copy, dependsOn: "deinstallIC2") {
|
||||
from { configurations.mods }
|
||||
include "**/*industrialcraft-2*.jar"
|
||||
@@ -41,3 +41,15 @@ task installIC2(type: Copy, dependsOn: "deinstallIC2") {
|
||||
task deinstallIC2(type: Delete) {
|
||||
delete fileTree(dir: minecraft.runDir + "/mods", include: "*industrialcraft-2*.jar")
|
||||
}
|
||||
|
||||
// TOP
|
||||
task installTop(type: Copy, dependsOn: ["deinstallTop"]) {
|
||||
from { configurations.mods }
|
||||
include "**/*TheOneProbe*.jar"
|
||||
into file(minecraft.runDir + "/mods")
|
||||
}
|
||||
|
||||
task deinstallTop(type: Delete) {
|
||||
delete fileTree(dir: minecraft.runDir + "/mods", include: "*TheOneProbe*.jar")
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#Fri Sep 16 14:56:32 CEST 2016
|
||||
#Tue Jul 04 22:38:49 CEST 2017
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -54,7 +54,7 @@ public class BakingPipeline<F, T> implements BakingPipelineElement<F, T>
|
||||
@Override
|
||||
public List pipe( List things, IBakedModel parent, IBlockState state, EnumFacing side, long rand )
|
||||
{
|
||||
for( BakingPipelineElement pipe : pipeline )
|
||||
for( BakingPipelineElement pipe : this.pipeline )
|
||||
{
|
||||
things = pipe.pipe( things, parent, state, side, rand );
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public enum TunnelType
|
||||
{
|
||||
ME, // Network Tunnel
|
||||
IC2_POWER, // EU Tunnel
|
||||
RF_POWER, // RF Tunnel
|
||||
FE_POWER, // Forge Energy tunnel
|
||||
REDSTONE, // Redstone Tunnel
|
||||
FLUID, // Fluid Tunnel
|
||||
ITEM, // Item Tunnel
|
||||
|
||||
@@ -111,8 +111,6 @@ public interface IMaterials
|
||||
|
||||
IItemDefinition matterBall();
|
||||
|
||||
IItemDefinition ironNugget();
|
||||
|
||||
IItemDefinition certusQuartzCrystal();
|
||||
|
||||
IItemDefinition certusQuartzCrystalCharged();
|
||||
|
||||
@@ -38,7 +38,9 @@ public interface IParts
|
||||
|
||||
AEColoredItemDefinition cableGlass();
|
||||
|
||||
AEColoredItemDefinition cableDense();
|
||||
AEColoredItemDefinition cableDenseCovered();
|
||||
|
||||
AEColoredItemDefinition cableDenseSmart();
|
||||
|
||||
AEColoredItemDefinition lumenCableSmart();
|
||||
|
||||
@@ -46,7 +48,7 @@ public interface IParts
|
||||
|
||||
AEColoredItemDefinition lumenCableGlass();
|
||||
|
||||
AEColoredItemDefinition lumenCableDense();
|
||||
AEColoredItemDefinition lumenDenseCableSmart();
|
||||
|
||||
IItemDefinition quartzFiber();
|
||||
|
||||
@@ -76,11 +78,11 @@ public interface IParts
|
||||
|
||||
IItemDefinition p2PTunnelItems();
|
||||
|
||||
IItemDefinition p2PTunnelLiquids();
|
||||
IItemDefinition p2PTunnelFluids();
|
||||
|
||||
IItemDefinition p2PTunnelEU();
|
||||
|
||||
// IItemDefinition p2PTunnelRF();
|
||||
IItemDefinition p2PTunnelFE();
|
||||
|
||||
IItemDefinition p2PTunnelLight();
|
||||
|
||||
|
||||
+15
-43
@@ -24,13 +24,17 @@
|
||||
package appeng.api.features;
|
||||
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
|
||||
/**
|
||||
* Registration Records for {@link IGrinderRegistry}
|
||||
*/
|
||||
public interface IGrinderEntry
|
||||
public interface IGrinderRecipe
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -38,66 +42,40 @@ public interface IGrinderEntry
|
||||
*
|
||||
* @return input that the grinder will accept.
|
||||
*/
|
||||
@Nonnull
|
||||
ItemStack getInput();
|
||||
|
||||
/**
|
||||
* lets you change the grinder recipe by changing its input.
|
||||
*
|
||||
* @param input input item
|
||||
*/
|
||||
void setInput( ItemStack input );
|
||||
|
||||
/**
|
||||
* gets the current output
|
||||
*
|
||||
* @return output that the grinder will produce
|
||||
*/
|
||||
@Nonnull
|
||||
ItemStack getOutput();
|
||||
|
||||
/**
|
||||
* allows you to change the output.
|
||||
* gets the current output
|
||||
*
|
||||
* @param output output item
|
||||
* @return output that the grinder will produce
|
||||
*/
|
||||
void setOutput( ItemStack output );
|
||||
@Nonnull
|
||||
Optional<ItemStack> getOptionalOutput();
|
||||
|
||||
/**
|
||||
* gets the current output
|
||||
*
|
||||
* @return output that the grinder will produce
|
||||
*/
|
||||
ItemStack getOptionalOutput();
|
||||
|
||||
/**
|
||||
* gets the current output
|
||||
*
|
||||
* @return output that the grinder will produce
|
||||
*/
|
||||
ItemStack getSecondOptionalOutput();
|
||||
|
||||
/**
|
||||
* stack, and 0.0-1.0 chance that it will be generated.
|
||||
*
|
||||
* @param output output item
|
||||
* @param chance generation chance
|
||||
*/
|
||||
void setOptionalOutput( ItemStack output, float chance );
|
||||
Optional<ItemStack> getSecondOptionalOutput();
|
||||
|
||||
/**
|
||||
* 0.0 - 1.0 the chance that the optional output will be generated.
|
||||
*
|
||||
* @return chance of optional output
|
||||
*/
|
||||
@Nonnull
|
||||
float getOptionalChance();
|
||||
|
||||
/**
|
||||
* stack, and 0.0-1.0 chance that it will be generated.
|
||||
*
|
||||
* @param output second optional output item
|
||||
* @param chance second optional output chance
|
||||
*/
|
||||
void setSecondOptionalOutput( ItemStack output, float chance );
|
||||
|
||||
/**
|
||||
* 0.0 - 1.0 the chance that the optional output will be generated.
|
||||
*
|
||||
@@ -106,16 +84,10 @@ public interface IGrinderEntry
|
||||
float getSecondOptionalChance();
|
||||
|
||||
/**
|
||||
* Energy cost, in turns.
|
||||
* Amount of turns required to process the item.
|
||||
*
|
||||
* @return number of turns it takes to produce the output from the input.
|
||||
*/
|
||||
int getEnergyCost();
|
||||
int getRequiredTurns();
|
||||
|
||||
/**
|
||||
* Allows you to adjust the number of turns
|
||||
*
|
||||
* @param c number of turns to produce output.
|
||||
*/
|
||||
void setEnergyCost( int c );
|
||||
}
|
||||
@@ -24,7 +24,10 @@
|
||||
package appeng.api.features;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Collection;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -36,51 +39,90 @@ public interface IGrinderRegistry
|
||||
{
|
||||
|
||||
/**
|
||||
* Current list of registered recipes, you can modify this if you want too.
|
||||
* An immutable list of the currently registered recipes.
|
||||
*
|
||||
* @return currentlyRegisteredRecipes
|
||||
*/
|
||||
List<IGrinderEntry> getRecipes();
|
||||
@Nonnull
|
||||
Collection<IGrinderRecipe> getRecipes();
|
||||
|
||||
/**
|
||||
* add a new recipe the easy way, in → out, how many turns., duplicates will not be added.
|
||||
* Add a new recipe with a single input and output and how many turns it requires.
|
||||
*
|
||||
* @param in input
|
||||
* @param out output
|
||||
* @param turns amount of turns to turn the input into the output
|
||||
* Will ignore duplicate recipes with the same input item.
|
||||
*
|
||||
* @param in The {@link ItemStack} to grind.
|
||||
* @param out The {@link ItemStack} to output.
|
||||
* @param turns Amount of turns to turn the input into the output, with turns > 0.
|
||||
*/
|
||||
void addRecipe( ItemStack in, ItemStack out, int turns );
|
||||
void addRecipe( @Nonnull ItemStack in, @Nonnull ItemStack out, int turns );
|
||||
|
||||
/**
|
||||
* Add a new recipe with an input, output and a single optional output.
|
||||
*
|
||||
* Will ignore duplicate recipes with the same input item.
|
||||
*
|
||||
* @param in The {@link ItemStack} to grind.
|
||||
* @param out The {@link ItemStack} to output.
|
||||
* @param optional The optional {@link ItemStack} to output of a certain chance.
|
||||
* @param chance Chance to get the optional output within 0.0 - 1.0
|
||||
* @param turns Amount of turns to turn the input into the output, with turns > 0.
|
||||
*/
|
||||
void addRecipe( @Nonnull ItemStack in, @Nonnull ItemStack out, @Nonnull ItemStack optional, float chance, int turns );
|
||||
|
||||
/**
|
||||
* add a new recipe with optional outputs, duplicates will not be added.
|
||||
*
|
||||
* @param in input
|
||||
* @param out output
|
||||
* @param optional optional output
|
||||
* @param chance chance to get the optional output within 0.0 - 1.0
|
||||
* @param turns amount of turns to turn the input into the outputs
|
||||
*/
|
||||
void addRecipe( ItemStack in, ItemStack out, ItemStack optional, float chance, int turns );
|
||||
|
||||
/**
|
||||
* add a new recipe with optional outputs, duplicates will not be added.
|
||||
* Will ignore duplicate recipes with the same input item.
|
||||
*
|
||||
* @param in input
|
||||
* @param out output
|
||||
* @param optional optional output
|
||||
* @param chance chance to get the optional output within 0.0 - 1.0
|
||||
* @param optional2 second optional output
|
||||
* @param in The {@link ItemStack} to grind.
|
||||
* @param out The {@link ItemStack} to output.
|
||||
* @param optional The first optional {@link ItemStack} to output of a certain chance.
|
||||
* @param chance Chance to get the first optional output within 0.0 - 1.0
|
||||
* @param optional2 The second optional {@link ItemStack} to output of a certain chance.
|
||||
* @param chance2 chance to get the second optional output within 0.0 - 1.0
|
||||
* @param turns amount of turns to turn the input into the outputs
|
||||
* @param turns Amount of turns to turn the input into the output, with turns > 0.
|
||||
*
|
||||
*/
|
||||
void addRecipe( ItemStack in, ItemStack out, ItemStack optional, float chance, ItemStack optional2, float chance2, int turns );
|
||||
void addRecipe( @Nonnull ItemStack in, @Nonnull ItemStack out, @Nonnull ItemStack optional, float chance, @Nonnull ItemStack optional2, float chance2, int turns );
|
||||
|
||||
/**
|
||||
* Remove the specific from the recipe list.
|
||||
*
|
||||
* @param recipe The recipe to be removed.
|
||||
* @return true, if it was removed
|
||||
*/
|
||||
boolean removeRecipe( @Nonnull IGrinderRecipe recipe );
|
||||
|
||||
/**
|
||||
* Searches for a recipe for a given input, and returns it.
|
||||
*
|
||||
* @param input input
|
||||
* @param input The {@link ItemStack} to be grinded.
|
||||
*
|
||||
* @return identified recipe or null
|
||||
*/
|
||||
IGrinderEntry getRecipeForInput( ItemStack input );
|
||||
@Nullable
|
||||
IGrinderRecipe getRecipeForInput( @Nonnull ItemStack input );
|
||||
|
||||
/**
|
||||
* Allows do add a custom ratio from an ore to dust when being grinded.
|
||||
*
|
||||
* The default ratio is 1 ore to 2 dusts.
|
||||
*
|
||||
* These have to be added before any recipe is registered. Otherwise it will use the default value.
|
||||
*
|
||||
* @param oredictName The name of the ore;
|
||||
* @param ratio The amount, must be > 0;
|
||||
*/
|
||||
void addDustRatio( @Nonnull String oredictName, int ratio );
|
||||
|
||||
/**
|
||||
* Remove a custom ratio for a specific ore name.
|
||||
*
|
||||
* Will use the default of 2 value afterwards.
|
||||
*
|
||||
* @param oredictName The name of the ore;
|
||||
*/
|
||||
boolean removeDustRatio( @Nonnull String oredictName );
|
||||
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
package appeng.api.features;
|
||||
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -44,7 +45,8 @@ public interface IP2PTunnelRegistry
|
||||
* @param trigger - the item which triggers attunement. Nullable, but then ignored
|
||||
* @param type - the type of tunnel. Nullable, but then ignored
|
||||
*/
|
||||
void addNewAttunement( @Nullable ItemStack trigger, @Nullable TunnelType type );
|
||||
void addNewAttunement( @Nonnull ItemStack trigger, @Nullable TunnelType type );
|
||||
void addNewAttunement( @Nonnull String ModId, @Nullable TunnelType type );
|
||||
|
||||
/**
|
||||
* returns null if no attunement can be found.
|
||||
@@ -53,6 +55,6 @@ public interface IP2PTunnelRegistry
|
||||
*
|
||||
* @return null if no attunement can be found or attunement
|
||||
*/
|
||||
@Nullable
|
||||
@Nonnull
|
||||
TunnelType getTunnelTypeByItem( ItemStack trigger );
|
||||
}
|
||||
@@ -24,7 +24,7 @@
|
||||
package appeng.api.implementations.guiobjects;
|
||||
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.networking.IGridHost;
|
||||
|
||||
@@ -32,8 +32,9 @@ import appeng.api.networking.IGridHost;
|
||||
/**
|
||||
* Obtained via {@link IGuiItem} getGuiObject
|
||||
*/
|
||||
public interface INetworkTool extends IInventory, IGuiItemObject
|
||||
public interface INetworkTool extends IGuiItemObject
|
||||
{
|
||||
|
||||
IGridHost getGridHost(); // null for most purposes.
|
||||
|
||||
IItemHandler getInventory();
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ package appeng.api.implementations.items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.config.AccessRestriction;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.networking.energy.IAEPowerStorage;
|
||||
|
||||
|
||||
@@ -42,27 +43,27 @@ public interface IAEItemPowerStorage
|
||||
*
|
||||
* @return amount unable to be stored
|
||||
*/
|
||||
double injectAEPower( ItemStack is, double amt );
|
||||
double injectAEPower( ItemStack stack, double amount, Actionable mode );
|
||||
|
||||
/**
|
||||
* Attempt to extract power from the device, it will extract what it can and
|
||||
* return it.
|
||||
*
|
||||
* @param amt to be extracted power from device
|
||||
* @param amount to be extracted power from device
|
||||
*
|
||||
* @return what it could extract
|
||||
*/
|
||||
double extractAEPower( ItemStack is, double amt );
|
||||
double extractAEPower( ItemStack stack, double amount, Actionable mode );
|
||||
|
||||
/**
|
||||
* @return the current maximum power ( this can change :P )
|
||||
*/
|
||||
double getAEMaxPower( ItemStack is );
|
||||
double getAEMaxPower( ItemStack stack );
|
||||
|
||||
/**
|
||||
* @return the current AE Power Level, this may exceed getMEMaxPower()
|
||||
*/
|
||||
double getAECurrentPower( ItemStack is );
|
||||
double getAECurrentPower( ItemStack stack );
|
||||
|
||||
/**
|
||||
* Control the power flow by telling what the network can do, either add? or
|
||||
@@ -70,5 +71,5 @@ public interface IAEItemPowerStorage
|
||||
*
|
||||
* @return access restriction of network
|
||||
*/
|
||||
AccessRestriction getPowerFlow( ItemStack is );
|
||||
AccessRestriction getPowerFlow( ItemStack stack );
|
||||
}
|
||||
@@ -29,6 +29,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.implementations.TransitionResult;
|
||||
import appeng.api.storage.ISpatialDimension;
|
||||
import appeng.api.util.WorldCoord;
|
||||
|
||||
|
||||
@@ -57,7 +58,7 @@ public interface ISpatialStorageCell
|
||||
*
|
||||
* @return the world for this cell
|
||||
*/
|
||||
World getWorld( ItemStack is );
|
||||
ISpatialDimension getSpatialDimension();
|
||||
|
||||
/**
|
||||
* get the currently stored size.
|
||||
@@ -69,22 +70,13 @@ public interface ISpatialStorageCell
|
||||
WorldCoord getStoredSize( ItemStack is );
|
||||
|
||||
/**
|
||||
* Minimum coordinates in its world for the storage cell.
|
||||
* get the currently stored Dimension id.
|
||||
*
|
||||
* @param is spatial storage cell
|
||||
*
|
||||
* @return minimum coordinate of dimension
|
||||
* @return dimension id or -1
|
||||
*/
|
||||
WorldCoord getMin( ItemStack is );
|
||||
|
||||
/**
|
||||
* Maximum coordinates in its world for the storage cell.
|
||||
*
|
||||
* @param is spatial storage cell
|
||||
*
|
||||
* @return maximum coordinate of dimension
|
||||
*/
|
||||
WorldCoord getMax( ItemStack is );
|
||||
int getStoredDimensionID( ItemStack is );
|
||||
|
||||
/**
|
||||
* Perform a spatial swap with the contents of the cell, and the world.
|
||||
@@ -93,9 +85,9 @@ public interface ISpatialStorageCell
|
||||
* @param w world of spatial
|
||||
* @param min min coord
|
||||
* @param max max coord
|
||||
* @param doTransition transition
|
||||
* @param playerId owner of current grid or -1
|
||||
*
|
||||
* @return result of transition
|
||||
*/
|
||||
TransitionResult doSpatialTransition( ItemStack is, World w, WorldCoord min, WorldCoord max, boolean doTransition );
|
||||
TransitionResult doSpatialTransition( ItemStack is, World w, WorldCoord min, WorldCoord max, int playerId );
|
||||
}
|
||||
@@ -23,8 +23,7 @@
|
||||
|
||||
package appeng.api.implementations.tiles;
|
||||
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
|
||||
public interface ISegmentedInventory
|
||||
@@ -38,5 +37,5 @@ public interface ISegmentedInventory
|
||||
*
|
||||
* @return inventory with inventory name
|
||||
*/
|
||||
IInventory getInventoryByName( String name );
|
||||
IItemHandler getInventoryByName( String name );
|
||||
}
|
||||
|
||||
@@ -23,8 +23,7 @@
|
||||
|
||||
package appeng.api.implementations.tiles;
|
||||
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
|
||||
public interface IViewCellStorage
|
||||
@@ -35,5 +34,5 @@ public interface IViewCellStorage
|
||||
*
|
||||
* @return inventory with at least 5 slot
|
||||
*/
|
||||
IInventory getViewCellStorage();
|
||||
IItemHandler getViewCellStorage();
|
||||
}
|
||||
|
||||
@@ -24,12 +24,36 @@
|
||||
package appeng.api.networking.crafting;
|
||||
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
|
||||
|
||||
public interface ICraftingWatcher extends Collection<IAEStack>
|
||||
/**
|
||||
* DO NOT IMPLEMENT.
|
||||
*
|
||||
* Will be injected when adding an {@link ICraftingWatcherHost} to a grid.
|
||||
*/
|
||||
public interface ICraftingWatcher
|
||||
{
|
||||
/**
|
||||
* Add a specific {@link IAEStack} to watch.
|
||||
*
|
||||
* Supports multiple values, duplicate ones will not be added.
|
||||
*
|
||||
* @param stack
|
||||
* @return true, if successfully added.
|
||||
*/
|
||||
boolean add( IAEStack<?> stack );
|
||||
|
||||
/**
|
||||
* Remove a specific {@link IAEStack} from the watcher.
|
||||
*
|
||||
* @param stack
|
||||
* @return true, if successfully removed.
|
||||
*/
|
||||
boolean remove( IAEStack<?> stack );
|
||||
|
||||
/**
|
||||
* Removes all watched stacks and resets the watcher to a clean state.
|
||||
*/
|
||||
void reset();
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
package appeng.api.networking.energy;
|
||||
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
@@ -37,15 +38,30 @@ public interface IEnergyGridProvider
|
||||
/**
|
||||
* internal use only
|
||||
*/
|
||||
double extractAEPower( double amt, Actionable mode, Set<IEnergyGrid> seen );
|
||||
Collection<IEnergyGridProvider> providers();
|
||||
|
||||
/**
|
||||
* internal use only
|
||||
*/
|
||||
double injectAEPower( double amt, Actionable mode, Set<IEnergyGrid> seen );
|
||||
double extractProviderPower( double amt, Actionable mode, Set<IEnergyGridProvider> seen );
|
||||
|
||||
/**
|
||||
* internal use only
|
||||
*/
|
||||
double getEnergyDemand( double d, Set<IEnergyGrid> seen );
|
||||
double injectProviderPower( double amt, Actionable mode, Set<IEnergyGridProvider> seen );
|
||||
|
||||
/**
|
||||
* internal use only
|
||||
*/
|
||||
double getProviderEnergyDemand( double d, Set<IEnergyGridProvider> seen );
|
||||
|
||||
/**
|
||||
* internal use only
|
||||
*/
|
||||
double getProviderStoredEnergy();
|
||||
|
||||
/**
|
||||
* internal use only
|
||||
*/
|
||||
double getProviderMaxEnergy();
|
||||
}
|
||||
|
||||
@@ -24,10 +24,34 @@
|
||||
package appeng.api.networking.energy;
|
||||
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
|
||||
public interface IEnergyWatcher extends Collection<Double>
|
||||
/**
|
||||
* DO NOT IMPLEMENT.
|
||||
*
|
||||
* Will be injected when adding an {@link IEnergyWatcherHost} to a grid.
|
||||
*/
|
||||
public interface IEnergyWatcher
|
||||
{
|
||||
/**
|
||||
* Add a specific threshold to watch.
|
||||
*
|
||||
* Supports multiple values, duplicate ones will not be added.
|
||||
*
|
||||
* @param amount
|
||||
* @return true, if successfully added.
|
||||
*/
|
||||
boolean add( double amount );
|
||||
|
||||
/**
|
||||
* Remove a specific threshold from the watcher.
|
||||
*
|
||||
* @param amount
|
||||
* @return true, if successfully removed.
|
||||
*/
|
||||
boolean remove( double amount );
|
||||
|
||||
/**
|
||||
* Removes all thresholds and resets the watcher to a clean state.
|
||||
*/
|
||||
void reset();
|
||||
|
||||
}
|
||||
|
||||
@@ -24,12 +24,36 @@
|
||||
package appeng.api.networking.storage;
|
||||
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
|
||||
|
||||
public interface IStackWatcher extends Collection<IAEStack>
|
||||
/**
|
||||
* DO NOT IMPLEMENT.
|
||||
*
|
||||
* Will be injected when adding an {@link IStackWatcherHost} to a grid.
|
||||
*/
|
||||
public interface IStackWatcher
|
||||
{
|
||||
/**
|
||||
* Add a specific {@link IAEStack} to watch.
|
||||
*
|
||||
* Supports multiple values, duplicate ones will not be added.
|
||||
*
|
||||
* @param stack
|
||||
* @return true, if successfully added.
|
||||
*/
|
||||
boolean add( IAEStack<?> stack );
|
||||
|
||||
/**
|
||||
* Remove a specific {@link IAEStack} from the watcher.
|
||||
*
|
||||
* @param stack
|
||||
* @return true, if successfully removed.
|
||||
*/
|
||||
boolean remove( IAEStack<?> stack );
|
||||
|
||||
/**
|
||||
* Removes all watched stacks and resets the watcher to a clean state.
|
||||
*/
|
||||
void reset();
|
||||
}
|
||||
|
||||
@@ -29,5 +29,5 @@ public enum BusSupport
|
||||
CABLE,
|
||||
|
||||
DENSE_CABLE
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
package appeng.api.parts;
|
||||
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -71,7 +69,6 @@ public interface IFacadePart
|
||||
/**
|
||||
* The item that this facade masquerades as.
|
||||
*/
|
||||
@Nullable
|
||||
ItemStack getTextureItem();
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,10 +25,11 @@ package appeng.api.parts;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -39,9 +40,9 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
@@ -71,7 +72,8 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
|
||||
ItemStack getItemStack( PartItemStack type );
|
||||
|
||||
/**
|
||||
* Render dynamic portions of this part, as part of the cable bus TESR. This part has to return true for {@link #requireDynamicRender()} in order for
|
||||
* Render dynamic portions of this part, as part of the cable bus TESR. This part has to return true for
|
||||
* {@link #requireDynamicRender()} in order for
|
||||
* this method to be called.
|
||||
*/
|
||||
@SideOnly( Side.CLIENT )
|
||||
@@ -128,7 +130,7 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
|
||||
/**
|
||||
* a block around the bus's host has been changed.
|
||||
*/
|
||||
void onNeighborChanged();
|
||||
void onNeighborChanged( IBlockAccess w, BlockPos pos, BlockPos neighbor );
|
||||
|
||||
/**
|
||||
* @return output redstone on facing side
|
||||
@@ -267,8 +269,10 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
|
||||
boolean canBePlacedOn( BusSupport what );
|
||||
|
||||
/**
|
||||
* This method is used when a chunk is rebuilt to determine how this part should be rendered. The returned models should represent the
|
||||
* part oriented north. They will be automatically rotated to match the part's actual orientation. Tint indices 1-4 can be used in the
|
||||
* This method is used when a chunk is rebuilt to determine how this part should be rendered. The returned models
|
||||
* should represent the
|
||||
* part oriented north. They will be automatically rotated to match the part's actual orientation. Tint indices 1-4
|
||||
* can be used in the
|
||||
* models to access the parts color.
|
||||
*
|
||||
* <dl>
|
||||
@@ -279,18 +283,23 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
|
||||
* <dt>Tint Index 3</dt>
|
||||
* <dd>The {@link AEColor#whiteVariant bright variant color} of the cable that this part is attached to.</dd>
|
||||
* <dt>Tint Index 4</dt>
|
||||
* <dd>A color variant that is between the cable's {@link AEColor#mediumVariant color} and its {@link AEColor#whiteVariant bright variant}.</dd>
|
||||
* <dd>A color variant that is between the cable's {@link AEColor#mediumVariant color} and its
|
||||
* {@link AEColor#whiteVariant bright variant}.</dd>
|
||||
* </dl>
|
||||
*
|
||||
* <b>Important:</b> All models must have been registered via the {@link IPartModels} API before use.
|
||||
*/
|
||||
default List<ResourceLocation> getStaticModels()
|
||||
@Nonnull
|
||||
default IPartModel getStaticModels()
|
||||
{
|
||||
return Collections.emptyList();
|
||||
return new IPartModel()
|
||||
{
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Implement this method if your part exposes capabilitys. Any requests for capabilities on the cable bus will be forwarded to parts on the appropriate
|
||||
* Implement this method if your part exposes capabilitys. Any requests for capabilities on the cable bus will be
|
||||
* forwarded to parts on the appropriate
|
||||
* side.
|
||||
*
|
||||
* @see TileEntity#hasCapability(Capability, EnumFacing)
|
||||
@@ -303,7 +312,8 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
|
||||
}
|
||||
|
||||
/**
|
||||
* Implement this method if your part exposes capabilitys. Any requests for capabilities on the cable bus will be forwarded to parts on the appropriate
|
||||
* Implement this method if your part exposes capabilitys. Any requests for capabilities on the cable bus will be
|
||||
* forwarded to parts on the appropriate
|
||||
* side.
|
||||
*
|
||||
* @see TileEntity#getCapability(Capability, EnumFacing)
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* 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.parts;
|
||||
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
|
||||
/**
|
||||
* A container to store a collection of {@link ResourceLocation} as models for a part as well as other properties.
|
||||
*/
|
||||
public interface IPartModel
|
||||
{
|
||||
|
||||
/**
|
||||
* A solid {@link IPartModel} indicates that the rendering requires a cable connection, which will also result in
|
||||
* creating an intersection for the cable.
|
||||
*
|
||||
* This should be true for pretty much all parts.
|
||||
*
|
||||
* @return true for a solid part.
|
||||
*/
|
||||
default boolean requireCableConnection()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* A collection of {@link ResourceLocation} used as models for a part.
|
||||
*
|
||||
* @return a collection of models, never null.
|
||||
*/
|
||||
@Nonnull
|
||||
default List<ResourceLocation> getModels()
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -24,8 +24,8 @@
|
||||
package appeng.api.storage;
|
||||
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
@@ -52,12 +52,12 @@ public interface ICellInventory extends IMEInventory<IAEItemStack>
|
||||
/**
|
||||
* @return access configured list
|
||||
*/
|
||||
IInventory getConfigInventory();
|
||||
IItemHandler getConfigInventory();
|
||||
|
||||
/**
|
||||
* @return access installed upgrades.
|
||||
*/
|
||||
IInventory getUpgradesInventory();
|
||||
IItemHandler getUpgradesInventory();
|
||||
|
||||
/**
|
||||
* @return How many bytes are used for each type?
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
package appeng.api.storage;
|
||||
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.config.FuzzyMode;
|
||||
|
||||
@@ -48,7 +48,7 @@ public interface ICellWorkbenchItem
|
||||
*
|
||||
* onInventoryChange will be called when saving is needed.
|
||||
*/
|
||||
IInventory getUpgradesInventory( ItemStack is );
|
||||
IItemHandler getUpgradesInventory( ItemStack is );
|
||||
|
||||
/**
|
||||
* Used to extract, or mirror the contents of the work bench onto the cell.
|
||||
@@ -57,7 +57,7 @@ public interface ICellWorkbenchItem
|
||||
*
|
||||
* onInventoryChange will be called when saving is needed.
|
||||
*/
|
||||
IInventory getConfigInventory( ItemStack is );
|
||||
IItemHandler getConfigInventory( ItemStack is );
|
||||
|
||||
/**
|
||||
* @return the current fuzzy status.
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2017, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.api.storage;
|
||||
|
||||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
||||
public interface ISpatialDimension
|
||||
{
|
||||
World getWorld();
|
||||
|
||||
int createNewCellDimension( BlockPos contentSize, int playerId );
|
||||
|
||||
void deleteCellDimension( int cellDimId );
|
||||
|
||||
boolean isCellDimension( int cellDimID );
|
||||
|
||||
int getCellDimensionOwner( int cellDimId );
|
||||
|
||||
BlockPos getCellDimensionOrigin( int cellDimId );
|
||||
|
||||
BlockPos getCellContentSize( int cellDimId );
|
||||
}
|
||||
@@ -52,7 +52,7 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
|
||||
|
||||
private final IMEInventoryHandler<StackType> internalHandler;
|
||||
private final IItemList<StackType> cachedList;
|
||||
private final HashMap<IMEMonitorHandlerReceiver<StackType>, Object> listeners = new HashMap<IMEMonitorHandlerReceiver<StackType>, Object>();
|
||||
private final HashMap<IMEMonitorHandlerReceiver<StackType>, Object> listeners = new HashMap<>();
|
||||
|
||||
protected boolean hasChanged = true;
|
||||
|
||||
|
||||
@@ -203,4 +203,15 @@ public interface IAEStack<StackType extends IAEStack>
|
||||
* @return ITEM or FLUID
|
||||
*/
|
||||
StorageChannel getChannel();
|
||||
|
||||
/**
|
||||
* @return true if it should show the crafting label.
|
||||
*/
|
||||
boolean getShowCraftingLabel();
|
||||
|
||||
/**
|
||||
* Used internally to show that it should show a Crafting label instead of a "1"
|
||||
*/
|
||||
void setShowCraftingLabel( boolean showCraftingLabel );
|
||||
|
||||
}
|
||||
|
||||
@@ -47,15 +47,21 @@ public enum AECableType
|
||||
SMART,
|
||||
|
||||
/**
|
||||
* Dense Cable, represents a tier 2 block that can carry 32 channels.
|
||||
* Smart Dense Cable, represents a tier 2 block that can carry 32 channels.
|
||||
*/
|
||||
DENSE;
|
||||
DENSE_COVERED,
|
||||
|
||||
/**
|
||||
* Smart Dense Cable, represents a tier 2 block that can carry 32 channels.
|
||||
*/
|
||||
DENSE_SMART;
|
||||
|
||||
public static final AECableType[] VALIDCABLES = {
|
||||
GLASS,
|
||||
COVERED,
|
||||
SMART,
|
||||
DENSE
|
||||
DENSE_COVERED,
|
||||
DENSE_SMART
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -146,14 +146,14 @@ public enum AEColor
|
||||
case 0:
|
||||
return -1;
|
||||
case TINTINDEX_DARK:
|
||||
return blackVariant;
|
||||
return this.blackVariant;
|
||||
case TINTINDEX_MEDIUM:
|
||||
return mediumVariant;
|
||||
return this.mediumVariant;
|
||||
case TINTINDEX_BRIGHT:
|
||||
return whiteVariant;
|
||||
return this.whiteVariant;
|
||||
case TINTINDEX_MEDIUM_BRIGHT:
|
||||
final int light = whiteVariant;
|
||||
final int dark = mediumVariant;
|
||||
final int light = this.whiteVariant;
|
||||
final int dark = this.mediumVariant;
|
||||
return ( ( ( ( ( light >> 16 ) & 0xff ) + ( ( dark >> 16 ) & 0xff ) ) / 2 ) << 16 ) | ( ( ( ( ( light >> 8 ) & 0xff ) + ( ( dark >> 8 ) & 0xff ) ) / 2 ) << 8 ) | ( ( ( ( light ) & 0xff ) + ( ( dark ) & 0xff ) ) / 2 );
|
||||
default:
|
||||
return -1;
|
||||
|
||||
@@ -31,10 +31,9 @@ import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
@@ -65,12 +64,6 @@ public abstract class AEBaseBlock extends Block
|
||||
|
||||
protected AxisAlignedBB boundingBox = FULL_BLOCK_AABB;
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque()
|
||||
{
|
||||
return this.isOpaque() && this.isFullSize();
|
||||
}
|
||||
|
||||
protected AEBaseBlock( final Material mat )
|
||||
{
|
||||
super( mat );
|
||||
@@ -96,13 +89,9 @@ public abstract class AEBaseBlock extends Block
|
||||
this.setLightLevel( 0 );
|
||||
this.setHardness( 2.2F );
|
||||
this.setHarvestLevel( "pickaxe", 0 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
String regName = getRegistryName() != null ? getRegistryName().getResourcePath() : "unregistered";
|
||||
return getClass().getSimpleName() + "[" + regName + "]";
|
||||
// Workaround as vanilla sets it way too early.
|
||||
this.fullBlock = this.isFullSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -111,50 +100,34 @@ public abstract class AEBaseBlock extends Block
|
||||
return new BlockStateContainer( this, this.getAEStates() );
|
||||
}
|
||||
|
||||
protected IProperty[] getAEStates()
|
||||
{
|
||||
return new IProperty[0];
|
||||
}
|
||||
|
||||
public boolean isOpaque()
|
||||
{
|
||||
return this.isOpaque;
|
||||
}
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
public boolean isNormalCube( IBlockState state )
|
||||
public final boolean isNormalCube( IBlockState state )
|
||||
{
|
||||
return this.isFullSize() && this.isOpaque();
|
||||
}
|
||||
|
||||
protected ICustomCollision getCustomCollision( final World w, final BlockPos pos )
|
||||
{
|
||||
if( this instanceof ICustomCollision )
|
||||
{
|
||||
return (ICustomCollision) this;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox( IBlockState state, IBlockAccess source, BlockPos pos )
|
||||
{
|
||||
return boundingBox;
|
||||
return this.boundingBox;
|
||||
}
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
public void addCollisionBoxToList( final IBlockState state, final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
|
||||
public void addCollisionBoxToList( final IBlockState state, final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, @Nullable final Entity e, boolean p_185477_7_ )
|
||||
{
|
||||
final ICustomCollision collisionHandler = this.getCustomCollision( w, pos );
|
||||
|
||||
if( collisionHandler != null && bb != null )
|
||||
{
|
||||
final List<AxisAlignedBB> tmp = new ArrayList<AxisAlignedBB>();
|
||||
final List<AxisAlignedBB> tmp = new ArrayList<>();
|
||||
collisionHandler.addCollidingBlockToList( w, pos, bb, tmp, e );
|
||||
for( final AxisAlignedBB b : tmp )
|
||||
{
|
||||
final AxisAlignedBB offset = b.offset( pos.getX(), pos.getY(), pos.getZ() );
|
||||
if( bb.intersectsWith( offset ) )
|
||||
if( bb.intersects( offset ) )
|
||||
{
|
||||
out.add( offset );
|
||||
}
|
||||
@@ -162,10 +135,11 @@ public abstract class AEBaseBlock extends Block
|
||||
}
|
||||
else
|
||||
{
|
||||
super.addCollisionBoxToList( state, w, pos, bb, out, e );
|
||||
super.addCollisionBoxToList( state, w, pos, bb, out, e, p_185477_7_ );
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public AxisAlignedBB getSelectedBoundingBox( IBlockState state, final World w, final BlockPos pos )
|
||||
@@ -176,10 +150,10 @@ public abstract class AEBaseBlock extends Block
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
final EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
final EntityPlayer player = Minecraft.getMinecraft().player;
|
||||
final LookDirection ld = Platform.getPlayerRay( player, Platform.getEyeOffset( player ) );
|
||||
|
||||
final Iterable<AxisAlignedBB> bbs = collisionHandler.getSelectedBoundingBoxesFromPool( w, pos, Minecraft.getMinecraft().thePlayer, true );
|
||||
final Iterable<AxisAlignedBB> bbs = collisionHandler.getSelectedBoundingBoxesFromPool( w, pos, Minecraft.getMinecraft().player, true );
|
||||
AxisAlignedBB br = null;
|
||||
|
||||
double lastDist = 0;
|
||||
@@ -194,9 +168,9 @@ public abstract class AEBaseBlock extends Block
|
||||
|
||||
if( r != null )
|
||||
{
|
||||
final double xLen = ( ld.getA().xCoord - r.hitVec.xCoord );
|
||||
final double yLen = ( ld.getA().yCoord - r.hitVec.yCoord );
|
||||
final double zLen = ( ld.getA().zCoord - r.hitVec.zCoord );
|
||||
final double xLen = ( ld.getA().x - r.hitVec.x );
|
||||
final double yLen = ( ld.getA().y - r.hitVec.y );
|
||||
final double zLen = ( ld.getA().z - r.hitVec.z );
|
||||
|
||||
final double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
|
||||
|
||||
@@ -210,7 +184,8 @@ public abstract class AEBaseBlock extends Block
|
||||
|
||||
if( br != null )
|
||||
{
|
||||
br = new AxisAlignedBB( br.minX + pos.getX(), br.minY + pos.getY(), br.minZ + pos.getZ(), br.maxX + pos.getX(), br.maxY + pos.getY(), br.maxZ + pos.getZ() );
|
||||
br = new AxisAlignedBB( br.minX + pos.getX(), br.minY + pos.getY(), br.minZ + pos.getZ(), br.maxX + pos.getX(), br.maxY + pos
|
||||
.getY(), br.maxZ + pos.getZ() );
|
||||
return br;
|
||||
}
|
||||
}
|
||||
@@ -241,7 +216,8 @@ public abstract class AEBaseBlock extends Block
|
||||
}
|
||||
else
|
||||
{
|
||||
b = new AxisAlignedBB( b.minX + pos.getX(), b.minY + pos.getY(), b.minZ + pos.getZ(), b.maxX + pos.getX(), b.maxY + pos.getY(), b.maxZ + pos.getZ() );
|
||||
b = new AxisAlignedBB( b.minX + pos.getX(), b.minY + pos.getY(), b.minZ + pos.getZ(), b.maxX + pos.getX(), b.maxY + pos.getY(), b.maxZ + pos
|
||||
.getZ() );
|
||||
}
|
||||
|
||||
return b;
|
||||
@@ -250,12 +226,14 @@ public abstract class AEBaseBlock extends Block
|
||||
return super.getSelectedBoundingBox( state, w, pos );
|
||||
}
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
public final boolean isOpaqueCube( IBlockState state )
|
||||
{
|
||||
return this.isOpaque();
|
||||
}
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
public RayTraceResult collisionRayTrace( final IBlockState state, final World w, final BlockPos pos, final Vec3d a, final Vec3d b )
|
||||
{
|
||||
@@ -278,9 +256,9 @@ public abstract class AEBaseBlock extends Block
|
||||
|
||||
if( r != null )
|
||||
{
|
||||
final double xLen = ( a.xCoord - r.hitVec.xCoord );
|
||||
final double yLen = ( a.yCoord - r.hitVec.yCoord );
|
||||
final double zLen = ( a.zCoord - r.hitVec.zCoord );
|
||||
final double xLen = ( a.x - r.hitVec.x );
|
||||
final double yLen = ( a.y - r.hitVec.y );
|
||||
final double zLen = ( a.z - r.hitVec.z );
|
||||
|
||||
final double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
|
||||
if( br == null || lastDist > thisDist )
|
||||
@@ -303,25 +281,14 @@ public abstract class AEBaseBlock extends Block
|
||||
return super.collisionRayTrace( state, w, pos, a, b );
|
||||
}
|
||||
|
||||
public boolean onActivated( final World w, final BlockPos pos, final EntityPlayer player, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
@SuppressWarnings( "unchecked" )
|
||||
public final void getSubBlocks( final Item item, final CreativeTabs tabs, final List itemStacks )
|
||||
{
|
||||
this.getCheckedSubBlocks( item, tabs, itemStacks );
|
||||
}
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride( IBlockState state )
|
||||
{
|
||||
return this.isInventory();
|
||||
}
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
public int getComparatorInputOverride( IBlockState state, final World worldIn, final BlockPos pos )
|
||||
{
|
||||
@@ -329,21 +296,11 @@ public abstract class AEBaseBlock extends Block
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNormalCube( IBlockState state, final IBlockAccess world, final BlockPos pos )
|
||||
public final boolean isNormalCube( IBlockState state, final IBlockAccess world, final BlockPos pos )
|
||||
{
|
||||
return this.isFullSize();
|
||||
}
|
||||
|
||||
public IOrientable getOrientable( final IBlockAccess w, final BlockPos pos )
|
||||
{
|
||||
if( this instanceof IOrientableBlock )
|
||||
{
|
||||
IOrientableBlock orientable = (IOrientableBlock) this;
|
||||
return orientable.getOrientable( w, pos );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean rotateBlock( final World w, final BlockPos pos, final EnumFacing axis )
|
||||
{
|
||||
@@ -378,21 +335,6 @@ public abstract class AEBaseBlock extends Block
|
||||
return super.rotateBlock( w, pos, axis );
|
||||
}
|
||||
|
||||
protected boolean hasCustomRotation()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void customRotateBlock( final IOrientable rotatable, final EnumFacing axis )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public boolean isValidOrientation( final World w, final BlockPos pos, final EnumFacing forward, final EnumFacing up )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumFacing[] getValidRotations( final World w, final BlockPos pos )
|
||||
{
|
||||
@@ -400,28 +342,18 @@ public abstract class AEBaseBlock extends Block
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
|
||||
{
|
||||
super.getSubBlocks( item, tabs, itemStacks );
|
||||
}
|
||||
|
||||
public String getUnlocalizedName( final ItemStack is )
|
||||
{
|
||||
return this.getUnlocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation( final ItemStack is, final EntityPlayer player, final List<String> lines, final boolean advancedItemTooltips )
|
||||
public void addInformation( final ItemStack is, final World world, final List<String> lines, final ITooltipFlag advancedItemTooltips )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public boolean hasSubtypes()
|
||||
public boolean onActivated( final World w, final BlockPos pos, final EntityPlayer player, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
return this.hasSubtypes;
|
||||
return false;
|
||||
}
|
||||
|
||||
public EnumFacing mapRotation( final IOrientable ori, final EnumFacing dir )
|
||||
public final EnumFacing mapRotation( final IOrientable ori, final EnumFacing dir )
|
||||
{
|
||||
// case DOWN: return bottomIcon;
|
||||
// case UP: return blockIcon;
|
||||
@@ -486,36 +418,97 @@ public abstract class AEBaseBlock extends Block
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isFullSize()
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return this.isFullSize;
|
||||
String regName = this.getRegistryName() != null ? this.getRegistryName().getResourcePath() : "unregistered";
|
||||
return this.getClass().getSimpleName() + "[" + regName + "]";
|
||||
}
|
||||
|
||||
public boolean setFullSize( final boolean isFullSize )
|
||||
protected String getUnlocalizedName( final ItemStack is )
|
||||
{
|
||||
this.isFullSize = isFullSize;
|
||||
return isFullSize;
|
||||
return this.getUnlocalizedName();
|
||||
}
|
||||
|
||||
public boolean setOpaque( final boolean isOpaque )
|
||||
protected boolean hasCustomRotation()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void customRotateBlock( final IOrientable rotatable, final EnumFacing axis )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected IOrientable getOrientable( final IBlockAccess w, final BlockPos pos )
|
||||
{
|
||||
if( this instanceof IOrientableBlock )
|
||||
{
|
||||
IOrientableBlock orientable = (IOrientableBlock) this;
|
||||
return orientable.getOrientable( w, pos );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected boolean isValidOrientation( final World w, final BlockPos pos, final EnumFacing forward, final EnumFacing up )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
protected ICustomCollision getCustomCollision( final World w, final BlockPos pos )
|
||||
{
|
||||
if( this instanceof ICustomCollision )
|
||||
{
|
||||
return (ICustomCollision) this;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected IProperty[] getAEStates()
|
||||
{
|
||||
return new IProperty[0];
|
||||
}
|
||||
|
||||
protected boolean isOpaque()
|
||||
{
|
||||
return this.isOpaque;
|
||||
}
|
||||
|
||||
protected boolean setOpaque( final boolean isOpaque )
|
||||
{
|
||||
this.isOpaque = isOpaque;
|
||||
return isOpaque;
|
||||
}
|
||||
|
||||
public boolean isInventory()
|
||||
protected boolean hasSubtypes()
|
||||
{
|
||||
return this.isInventory;
|
||||
return this.hasSubtypes;
|
||||
}
|
||||
|
||||
public void setInventory( final boolean isInventory )
|
||||
{
|
||||
this.isInventory = isInventory;
|
||||
}
|
||||
|
||||
public void setHasSubtypes( final boolean hasSubtypes )
|
||||
protected void setHasSubtypes( final boolean hasSubtypes )
|
||||
{
|
||||
this.hasSubtypes = hasSubtypes;
|
||||
}
|
||||
|
||||
protected boolean isFullSize()
|
||||
{
|
||||
return this.isFullSize;
|
||||
}
|
||||
|
||||
protected boolean setFullSize( final boolean isFullSize )
|
||||
{
|
||||
this.isFullSize = isFullSize;
|
||||
return isFullSize;
|
||||
}
|
||||
|
||||
protected boolean isInventory()
|
||||
{
|
||||
return this.isInventory;
|
||||
}
|
||||
|
||||
protected void setInventory( final boolean isInventory )
|
||||
{
|
||||
this.isInventory = isInventory;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -67,15 +68,15 @@ public class AEBaseItemBlock extends ItemBlock
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
@SuppressWarnings( "unchecked" )
|
||||
public final void addInformation( final ItemStack itemStack, final EntityPlayer player, final List toolTip, final boolean advancedTooltips )
|
||||
public final void addInformation( final ItemStack itemStack, final World world, final List<String> toolTip, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
this.addCheckedInformation( itemStack, player, toolTip, advancedTooltips );
|
||||
this.addCheckedInformation( itemStack, world, toolTip, advancedTooltips );
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void addCheckedInformation( final ItemStack itemStack, final EntityPlayer player, final List<String> toolTip, final boolean advancedToolTips )
|
||||
public void addCheckedInformation( final ItemStack itemStack, final World world, final List<String> toolTip, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
this.blockType.addInformation( itemStack, player, toolTip, advancedToolTips );
|
||||
this.blockType.addInformation( itemStack, world, toolTip, advancedTooltips );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -126,7 +127,7 @@ public class AEBaseItemBlock extends ItemBlock
|
||||
{
|
||||
up = EnumFacing.UP;
|
||||
|
||||
final byte rotation = (byte) ( MathHelper.floor_double( ( player.rotationYaw * 4F ) / 360F + 2.5D ) & 3 );
|
||||
final byte rotation = (byte) ( MathHelper.floor( ( player.rotationYaw * 4F ) / 360F + 2.5D ) & 3 );
|
||||
|
||||
switch( rotation )
|
||||
{
|
||||
|
||||
@@ -23,13 +23,15 @@ import java.text.MessageFormat;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import appeng.api.config.AccessRestriction;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerUnits;
|
||||
import appeng.api.definitions.IBlockDefinition;
|
||||
import appeng.api.implementations.items.IAEItemPowerStorage;
|
||||
@@ -48,9 +50,9 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void addCheckedInformation( final ItemStack itemStack, final EntityPlayer player, final List<String> toolTip, final boolean advancedTooltips )
|
||||
public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
final NBTTagCompound tag = itemStack.getTagCompound();
|
||||
final NBTTagCompound tag = stack.getTagCompound();
|
||||
double internalCurrentPower = 0;
|
||||
final double internalMaxPower = this.getMaxEnergyCapacity();
|
||||
|
||||
@@ -61,70 +63,43 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
|
||||
|
||||
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()
|
||||
{
|
||||
final Block blockID = Block.getBlockFromItem( this );
|
||||
final IBlockDefinition energyCell = Api.INSTANCE.definitions().blocks().energyCell();
|
||||
return energyCell.maybeBlock().map( block -> {
|
||||
if( blockID == block )
|
||||
{
|
||||
return 200000;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 8 * 200000;
|
||||
}
|
||||
}
|
||||
).orElse( 0 );
|
||||
lines.add( GuiText.StoredEnergy.getLocal() + ':' + MessageFormat.format( " {0,number,#} ", internalCurrentPower ) + Platform
|
||||
.gui_localize( PowerUnits.AE.unlocalizedName ) + " - " + MessageFormat.format( " {0,number,#.##%} ", percent ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public double injectAEPower( final ItemStack is, double amt )
|
||||
public double injectAEPower( final ItemStack is, double amount, Actionable mode )
|
||||
{
|
||||
double internalCurrentPower = this.getInternal( is );
|
||||
final double internalMaxPower = this.getMaxEnergyCapacity();
|
||||
internalCurrentPower += amt;
|
||||
if( internalCurrentPower > internalMaxPower )
|
||||
final double internalCurrentPower = this.getInternal( is );
|
||||
final double internalMaxPower = this.getAEMaxPower( is );
|
||||
final double required = internalMaxPower - internalCurrentPower;
|
||||
final double overflow = Math.max( 0, amount - required );
|
||||
|
||||
if( mode == Actionable.MODULATE )
|
||||
{
|
||||
amt = internalCurrentPower - internalMaxPower;
|
||||
internalCurrentPower = internalMaxPower;
|
||||
this.setInternal( is, internalCurrentPower );
|
||||
return amt;
|
||||
final double toAdd = Math.min( required, amount );
|
||||
final double newPowerStored = internalCurrentPower + toAdd;
|
||||
|
||||
this.setInternal( is, newPowerStored );
|
||||
}
|
||||
|
||||
this.setInternal( is, internalCurrentPower );
|
||||
return 0;
|
||||
}
|
||||
|
||||
private double getInternal( final ItemStack is )
|
||||
{
|
||||
final NBTTagCompound nbt = Platform.openNbtData( is );
|
||||
return nbt.getDouble( "internalCurrentPower" );
|
||||
}
|
||||
|
||||
private void setInternal( final ItemStack is, final double amt )
|
||||
{
|
||||
final NBTTagCompound nbt = Platform.openNbtData( is );
|
||||
nbt.setDouble( "internalCurrentPower", amt );
|
||||
return overflow;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double extractAEPower( final ItemStack is, double amt )
|
||||
public double extractAEPower( final ItemStack is, double amount, Actionable mode )
|
||||
{
|
||||
double internalCurrentPower = this.getInternal( is );
|
||||
if( internalCurrentPower > amt )
|
||||
final double internalCurrentPower = this.getInternal( is );
|
||||
final double fulfillable = Math.min( amount, internalCurrentPower );
|
||||
|
||||
if( mode == Actionable.MODULATE )
|
||||
{
|
||||
internalCurrentPower -= amt;
|
||||
this.setInternal( is, internalCurrentPower );
|
||||
return amt;
|
||||
final double newPowerStored = internalCurrentPower - fulfillable;
|
||||
|
||||
this.setInternal( is, newPowerStored );
|
||||
}
|
||||
|
||||
amt = internalCurrentPower;
|
||||
this.setInternal( is, 0 );
|
||||
return amt;
|
||||
return fulfillable;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -144,4 +119,34 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
|
||||
{
|
||||
return AccessRestriction.WRITE;
|
||||
}
|
||||
|
||||
private double getMaxEnergyCapacity()
|
||||
{
|
||||
final Block blockID = Block.getBlockFromItem( this );
|
||||
final IBlockDefinition energyCell = Api.INSTANCE.definitions().blocks().energyCell();
|
||||
|
||||
return energyCell.maybeBlock().map( block ->
|
||||
{
|
||||
if( blockID == block )
|
||||
{
|
||||
return 200000;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 8 * 200000;
|
||||
}
|
||||
} ).orElse( 0 );
|
||||
}
|
||||
|
||||
private double getInternal( final ItemStack is )
|
||||
{
|
||||
final NBTTagCompound nbt = Platform.openNbtData( is );
|
||||
return nbt.getDouble( "internalCurrentPower" );
|
||||
}
|
||||
|
||||
private void setInternal( final ItemStack is, final double amt )
|
||||
{
|
||||
final NBTTagCompound nbt = Platform.openNbtData( is );
|
||||
nbt.setDouble( "internalCurrentPower", amt );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,8 +43,8 @@ public abstract class AEBaseStairBlock extends BlockStairs
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
String regName = getRegistryName() != null ? getRegistryName().getResourcePath() : "unregistered";
|
||||
return getClass().getSimpleName() + "[" + regName + "]";
|
||||
String regName = this.getRegistryName() != null ? this.getRegistryName().getResourcePath() : "unregistered";
|
||||
return this.getClass().getSimpleName() + "[" + regName + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -34,8 +34,6 @@ import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -48,6 +46,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.property.ExtendedBlockState;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
import net.minecraftforge.common.property.IUnlistedProperty;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
|
||||
import appeng.api.implementations.items.IMemoryCard;
|
||||
import appeng.api.implementations.items.MemoryCardMessages;
|
||||
@@ -56,6 +55,7 @@ import appeng.api.util.AEColor;
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.block.networking.BlockCableBus;
|
||||
import appeng.helpers.ICustomCollision;
|
||||
import appeng.tile.AEBaseInvTile;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.networking.TileCableBus;
|
||||
import appeng.tile.storage.TileSkyChest;
|
||||
@@ -86,7 +86,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
|
||||
return state;
|
||||
}
|
||||
|
||||
AEBaseTile tile = getTileEntity( world, pos );
|
||||
AEBaseTile tile = this.getTileEntity( world, pos );
|
||||
if( tile == null )
|
||||
{
|
||||
return state; // No info available
|
||||
@@ -99,7 +99,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
return new ExtendedBlockState( this, getAEStates(), new IUnlistedProperty[] {
|
||||
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] {
|
||||
FORWARD,
|
||||
UP
|
||||
} );
|
||||
@@ -111,16 +111,17 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected void setTileEntity( final Class<? extends AEBaseTile> c )
|
||||
// TODO : Was this change needed?
|
||||
public void setTileEntity( final Class<? extends AEBaseTile> c )
|
||||
{
|
||||
this.tileEntityType = c;
|
||||
this.setInventory( IInventory.class.isAssignableFrom( c ) );
|
||||
this.setInventory( AEBaseInvTile.class.isAssignableFrom( c ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity( IBlockState state )
|
||||
{
|
||||
return hasBlockTileEntity();
|
||||
return this.hasBlockTileEntity();
|
||||
}
|
||||
|
||||
private boolean hasBlockTileEntity()
|
||||
@@ -184,7 +185,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
|
||||
final AEBaseTile te = this.getTileEntity( w, pos );
|
||||
if( te != null )
|
||||
{
|
||||
final ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
|
||||
final ArrayList<ItemStack> drops = new ArrayList<>();
|
||||
if( te.dropItems() )
|
||||
{
|
||||
te.getDrops( w, pos, drops );
|
||||
@@ -240,9 +241,13 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
|
||||
public int getComparatorInputOverride( IBlockState state, final World w, final BlockPos pos )
|
||||
{
|
||||
final TileEntity te = this.getTileEntity( w, pos );
|
||||
if( te instanceof IInventory )
|
||||
if( te instanceof AEBaseInvTile )
|
||||
{
|
||||
return Container.calcRedstoneFromInventory( (IInventory) te );
|
||||
AEBaseInvTile invTile = (AEBaseInvTile) te;
|
||||
if( invTile.getInternalInventory().getSlots() > 0 )
|
||||
{
|
||||
return ItemHandlerHelper.calcRedstoneFromInventory( invTile.getInternalInventory() );
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -269,13 +274,16 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated( final World w, final BlockPos pos, final IBlockState state, final EntityPlayer player, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
||||
public boolean onBlockActivated( World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
if( player != null && heldItem != null )
|
||||
ItemStack heldItem;
|
||||
if( player != null && !player.getHeldItem( hand ).isEmpty() )
|
||||
{
|
||||
heldItem = player.getHeldItem( hand );
|
||||
|
||||
if( Platform.isWrench( player, heldItem, pos ) && player.isSneaking() )
|
||||
{
|
||||
final IBlockState blockState = w.getBlockState( pos );
|
||||
final IBlockState blockState = world.getBlockState( pos );
|
||||
final Block block = blockState.getBlock();
|
||||
|
||||
if( block == null )
|
||||
@@ -283,7 +291,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
|
||||
return false;
|
||||
}
|
||||
|
||||
final AEBaseTile tile = this.getTileEntity( w, pos );
|
||||
final AEBaseTile tile = this.getTileEntity( world, pos );
|
||||
|
||||
if( tile == null )
|
||||
{
|
||||
@@ -295,7 +303,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
|
||||
return false;
|
||||
}
|
||||
|
||||
final ItemStack[] itemDropCandidates = Platform.getBlockDrops( w, pos );
|
||||
final ItemStack[] itemDropCandidates = Platform.getBlockDrops( world, pos );
|
||||
final ItemStack op = new ItemStack( this );
|
||||
|
||||
for( final ItemStack ol : itemDropCandidates )
|
||||
@@ -310,11 +318,11 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
|
||||
}
|
||||
}
|
||||
|
||||
if( block.removedByPlayer( blockState, w, pos, player, false ) )
|
||||
if( block.removedByPlayer( blockState, world, pos, player, false ) )
|
||||
{
|
||||
final List<ItemStack> itemsToDrop = Lists.newArrayList( itemDropCandidates );
|
||||
Platform.spawnDrops( w, pos, itemsToDrop );
|
||||
w.setBlockToAir( pos );
|
||||
Platform.spawnDrops( world, pos, itemsToDrop );
|
||||
world.setBlockToAir( pos );
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -323,7 +331,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
|
||||
if( heldItem.getItem() instanceof IMemoryCard && !( this instanceof BlockCableBus ) )
|
||||
{
|
||||
final IMemoryCard memoryCard = (IMemoryCard) heldItem.getItem();
|
||||
final AEBaseTile tileEntity = this.getTileEntity( w, pos );
|
||||
final AEBaseTile tileEntity = this.getTileEntity( world, pos );
|
||||
|
||||
if( tileEntity == null )
|
||||
{
|
||||
@@ -361,7 +369,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
|
||||
}
|
||||
}
|
||||
|
||||
return this.onActivated( w, pos, player, hand, heldItem, side, hitX, hitY, hitZ );
|
||||
return this.onActivated( world, pos, player, hand, player.getHeldItem( hand ), facing, hitX, hitY, hitZ );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -36,7 +36,7 @@ public class UnlistedDirection implements IUnlistedProperty<EnumFacing>
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
return this.name;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,14 +19,12 @@
|
||||
package appeng.block.crafting;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.property.ExtendedBlockState;
|
||||
@@ -48,13 +46,12 @@ public class BlockCraftingMonitor extends BlockCraftingUnit
|
||||
public BlockCraftingMonitor()
|
||||
{
|
||||
super( CraftingUnitType.MONITOR );
|
||||
this.setTileEntity( TileCraftingMonitorTile.class );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
return new ExtendedBlockState( this, getAEStates(), new IUnlistedProperty[] {
|
||||
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] {
|
||||
STATE,
|
||||
COLOR,
|
||||
FORWARD,
|
||||
@@ -69,7 +66,7 @@ public class BlockCraftingMonitor extends BlockCraftingUnit
|
||||
EnumFacing forward = EnumFacing.NORTH;
|
||||
EnumFacing up = EnumFacing.UP;
|
||||
|
||||
TileCraftingMonitorTile te = getTileEntity( world, pos );
|
||||
TileCraftingMonitorTile te = this.getTileEntity( world, pos );
|
||||
if( te != null )
|
||||
{
|
||||
color = te.getColor();
|
||||
@@ -85,7 +82,7 @@ public class BlockCraftingMonitor extends BlockCraftingUnit
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
|
||||
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
|
||||
{
|
||||
itemStacks.add( new ItemStack( this, 1, 0 ) );
|
||||
}
|
||||
|
||||
@@ -19,16 +19,12 @@
|
||||
package appeng.block.crafting;
|
||||
|
||||
|
||||
import appeng.tile.crafting.TileCraftingStorageTile;
|
||||
|
||||
|
||||
public class BlockCraftingStorage extends BlockCraftingUnit
|
||||
{
|
||||
|
||||
public BlockCraftingStorage( final CraftingUnitType type )
|
||||
{
|
||||
super( type );
|
||||
this.setTileEntity( TileCraftingStorageTile.class );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,8 +21,6 @@ package appeng.block.crafting;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
@@ -30,7 +28,6 @@ import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
@@ -63,7 +60,6 @@ public class BlockCraftingUnit extends AEBaseTileBlock
|
||||
super( Material.IRON );
|
||||
|
||||
this.type = type;
|
||||
this.setTileEntity( TileCraftingTile.class );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -80,7 +76,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock
|
||||
|
||||
for( EnumFacing facing : EnumFacing.values() )
|
||||
{
|
||||
if( isConnected( world, pos, facing ) )
|
||||
if( this.isConnected( world, pos, facing ) )
|
||||
{
|
||||
connections.add( facing );
|
||||
}
|
||||
@@ -100,7 +96,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
return new ExtendedBlockState( this, getAEStates(), new IUnlistedProperty[] { STATE } );
|
||||
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] { STATE } );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -118,7 +114,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged( final IBlockState state, final World worldIn, final BlockPos pos, final Block neighborBlock )
|
||||
public void neighborChanged( final IBlockState state, final World worldIn, final BlockPos pos, final Block blockIn, final BlockPos fromPos )
|
||||
{
|
||||
final TileCraftingTile cp = this.getTileEntity( worldIn, pos );
|
||||
if( cp != null )
|
||||
@@ -146,9 +142,10 @@ public class BlockCraftingUnit extends AEBaseTileBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated( final World w, final BlockPos pos, final IBlockState state, final EntityPlayer p, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
||||
public boolean onBlockActivated( final World w, final BlockPos pos, final IBlockState state, final EntityPlayer p, final EnumHand hand, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
final TileCraftingTile tg = this.getTileEntity( w, pos );
|
||||
|
||||
if( tg != null && !p.isSneaking() && tg.isFormed() && tg.isActive() )
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
@@ -160,7 +157,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return super.onBlockActivated( w, pos, state, p, hand, side, hitX, hitY, hitZ );
|
||||
}
|
||||
|
||||
public enum CraftingUnitType
|
||||
|
||||
@@ -19,14 +19,11 @@
|
||||
package appeng.block.crafting;
|
||||
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
@@ -42,6 +39,7 @@ import appeng.core.sync.GuiBridge;
|
||||
import appeng.tile.crafting.TileMolecularAssembler;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockMolecularAssembler extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
@@ -51,7 +49,6 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
|
||||
{
|
||||
super( Material.IRON );
|
||||
|
||||
this.setTileEntity( TileMolecularAssembler.class );
|
||||
this.setOpaque( false );
|
||||
this.lightOpacity = 1;
|
||||
}
|
||||
@@ -66,7 +63,7 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
|
||||
public IBlockState getActualState( IBlockState state, IBlockAccess worldIn, BlockPos pos )
|
||||
{
|
||||
boolean powered = false;
|
||||
TileMolecularAssembler te = getTileEntity( worldIn, pos );
|
||||
TileMolecularAssembler te = this.getTileEntity( worldIn, pos );
|
||||
if( te != null )
|
||||
{
|
||||
powered = te.isPowered();
|
||||
@@ -88,18 +85,19 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@Override
|
||||
public boolean canRenderInLayer( BlockRenderLayer layer )
|
||||
public boolean canRenderInLayer( IBlockState state, BlockRenderLayer layer )
|
||||
{
|
||||
return layer == BlockRenderLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
public boolean isFullCube(IBlockState state)
|
||||
@Override
|
||||
public boolean isFullCube( IBlockState state )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated( final World w, final BlockPos pos, final IBlockState state, final EntityPlayer p, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
||||
public boolean onBlockActivated( final World w, final BlockPos pos, final IBlockState state, final EntityPlayer p, final EnumHand hand, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
final TileMolecularAssembler tg = this.getTileEntity( w, pos );
|
||||
if( tg != null && !p.isSneaking() )
|
||||
@@ -107,6 +105,7 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
|
||||
Platform.openGUI( p, tg, AEPartLocation.fromFacing( side ), GuiBridge.GUI_MAC );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
return super.onBlockActivated( w, pos, state, p, hand, side, hitX, hitY, hitZ );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,12 +39,12 @@ public class ItemCraftingStorage extends AEBaseItemBlock
|
||||
@Override
|
||||
public ItemStack getContainerItem( final ItemStack itemStack )
|
||||
{
|
||||
return AEApi.instance().definitions().blocks().craftingUnit().maybeStack( 1 ).orElse( null );
|
||||
return AEApi.instance().definitions().blocks().craftingUnit().maybeStack( 1 ).orElse( ItemStack.EMPTY );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasContainerItem( final ItemStack stack )
|
||||
{
|
||||
return AEConfig.instance.isFeatureEnabled( AEFeature.EnableDisassemblyCrafting );
|
||||
return AEConfig.instance().isFeatureEnabled( AEFeature.ENABLE_DISASSEMBLY_CRAFTING );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ import appeng.core.stats.Stats;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.grindstone.TileCrank;
|
||||
|
||||
|
||||
public class BlockCrank extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
@@ -48,7 +49,6 @@ public class BlockCrank extends AEBaseTileBlock
|
||||
{
|
||||
super( Material.WOOD );
|
||||
|
||||
this.setTileEntity( TileCrank.class );
|
||||
this.setLightOpacity( 0 );
|
||||
this.setHarvestLevel( "axe", 0 );
|
||||
this.setFullSize( this.setOpaque( false ) );
|
||||
@@ -78,7 +78,7 @@ public class BlockCrank extends AEBaseTileBlock
|
||||
private void dropCrank( final World world, final BlockPos pos )
|
||||
{
|
||||
world.destroyBlock( pos, true ); // w.destroyBlock( x, y, z, true );
|
||||
world.notifyBlockUpdate( pos, getDefaultState(), world.getBlockState( pos ), 3 );
|
||||
world.notifyBlockUpdate( pos, this.getDefaultState(), world.getBlockState( pos ), 3 );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -135,7 +135,7 @@ public class BlockCrank extends AEBaseTileBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged( final IBlockState state, final World world, final BlockPos pos, final Block neighborBlock )
|
||||
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
|
||||
{
|
||||
|
||||
final AEBaseTile tile = this.getTileEntity( world, pos );
|
||||
|
||||
@@ -35,6 +35,7 @@ import appeng.core.sync.GuiBridge;
|
||||
import appeng.tile.grindstone.TileGrinder;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockGrinder extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
@@ -42,7 +43,6 @@ public class BlockGrinder extends AEBaseTileBlock
|
||||
{
|
||||
super( Material.ROCK );
|
||||
|
||||
this.setTileEntity( TileGrinder.class );
|
||||
this.setHardness( 3.2F );
|
||||
}
|
||||
|
||||
|
||||
@@ -35,14 +35,13 @@ import appeng.core.sync.GuiBridge;
|
||||
import appeng.tile.misc.TileCellWorkbench;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockCellWorkbench extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
public BlockCellWorkbench()
|
||||
{
|
||||
super( Material.IRON );
|
||||
|
||||
this.setTileEntity( TileCellWorkbench.class );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -22,6 +22,7 @@ package appeng.block.misc;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
@@ -51,7 +52,7 @@ import appeng.client.render.effects.LightningFX;
|
||||
import appeng.client.render.renderable.ItemRenderable;
|
||||
import appeng.client.render.tesr.ModularTESR;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.helpers.ICustomCollision;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.misc.TileCharger;
|
||||
@@ -65,7 +66,6 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
|
||||
{
|
||||
super( Material.IRON );
|
||||
|
||||
this.setTileEntity( TileCharger.class );
|
||||
this.setLightOpacity( 2 );
|
||||
this.setFullSize( this.setOpaque( false ) );
|
||||
}
|
||||
@@ -94,7 +94,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
|
||||
{
|
||||
if( !AEConfig.instance.enableEffects )
|
||||
if( !AEConfig.instance().isEnableEffects() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -109,7 +109,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
|
||||
{
|
||||
final TileCharger tc = (TileCharger) tile;
|
||||
|
||||
if( AEApi.instance().definitions().materials().certusQuartzCrystalCharged().isSameAs( tc.getStackInSlot( 0 ) ) )
|
||||
if( AEApi.instance().definitions().materials().certusQuartzCrystalCharged().isSameAs( tc.getInternalInventory().getStackInSlot( 0 ) ) )
|
||||
{
|
||||
final double xOff = 0.0;
|
||||
final double yOff = 0.0;
|
||||
@@ -117,9 +117,10 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
|
||||
|
||||
for( int bolts = 0; bolts < 3; bolts++ )
|
||||
{
|
||||
if( CommonHelper.proxy.shouldAddParticles( r ) )
|
||||
if( AppEng.proxy.shouldAddParticles( r ) )
|
||||
{
|
||||
final LightningFX fx = new LightningFX( w, xOff + 0.5 + pos.getX(), yOff + 0.5 + pos.getY(), zOff + 0.5 + pos.getZ(), 0.0D, 0.0D, 0.0D );
|
||||
final LightningFX fx = new LightningFX( w, xOff + 0.5 + pos.getX(), yOff + 0.5 + pos.getY(), zOff + 0.5 + pos
|
||||
.getZ(), 0.0D, 0.0D, 0.0D );
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
|
||||
}
|
||||
}
|
||||
@@ -200,7 +201,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
|
||||
{
|
||||
Matrix4f transform = new Matrix4f();
|
||||
transform.translate( new Vector3f( 0.5f, 0.4f, 0.5f ) );
|
||||
return new ImmutablePair<>( tile.getStackInSlot( 0 ), transform );
|
||||
return new ImmutablePair<>( tile.getInternalInventory().getStackInSlot( 0 ), transform );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -42,8 +42,6 @@ public class BlockCondenser extends AEBaseTileBlock
|
||||
public BlockCondenser()
|
||||
{
|
||||
super( Material.IRON );
|
||||
|
||||
this.setTileEntity( TileCondenser.class );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -37,6 +37,7 @@ import appeng.core.sync.GuiBridge;
|
||||
import appeng.tile.misc.TileInscriber;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockInscriber extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
@@ -44,7 +45,6 @@ public class BlockInscriber extends AEBaseTileBlock
|
||||
{
|
||||
super( Material.IRON );
|
||||
|
||||
this.setTileEntity( TileInscriber.class );
|
||||
this.setLightOpacity( 2 );
|
||||
this.setFullSize( this.setOpaque( false ) );
|
||||
}
|
||||
|
||||
@@ -49,8 +49,6 @@ public class BlockInterface extends AEBaseTileBlock
|
||||
public BlockInterface()
|
||||
{
|
||||
super( Material.IRON );
|
||||
|
||||
this.setTileEntity( TileInterface.class );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -63,7 +61,7 @@ public class BlockInterface extends AEBaseTileBlock
|
||||
public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos )
|
||||
{
|
||||
// Determine whether the interface is omni-directional or not
|
||||
TileInterface te = getTileEntity( world, pos );
|
||||
TileInterface te = this.getTileEntity( world, pos );
|
||||
boolean omniDirectional = true; // The default
|
||||
if( te != null )
|
||||
{
|
||||
|
||||
@@ -46,6 +46,7 @@ import appeng.helpers.ICustomCollision;
|
||||
import appeng.helpers.MetaRotation;
|
||||
import appeng.tile.misc.TileLightDetector;
|
||||
|
||||
|
||||
public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBlock, ICustomCollision
|
||||
{
|
||||
|
||||
@@ -63,8 +64,6 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
|
||||
this.setLightOpacity( 0 );
|
||||
this.setFullSize( false );
|
||||
this.setOpaque( false );
|
||||
|
||||
this.setTileEntity( TileLightDetector.class );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -77,7 +76,7 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
|
||||
public IBlockState getStateFromMeta( final int meta )
|
||||
{
|
||||
EnumFacing facing = EnumFacing.values()[meta];
|
||||
return getDefaultState().withProperty(FACING, facing);
|
||||
return this.getDefaultState().withProperty( FACING, facing );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -139,21 +138,21 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
|
||||
@Override
|
||||
public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
|
||||
{/*
|
||||
* double xOff = -0.15 * getUp().offsetX; double yOff = -0.15 *
|
||||
* getUp().offsetY; double zOff = -0.15 * getUp().offsetZ; out.add(
|
||||
* AxisAlignedBB.getBoundingBox( xOff + (double) x + 0.15, yOff +
|
||||
* (double) y + 0.15, zOff + (double) z + 0.15,// ahh xOff + (double) x
|
||||
* + 0.85, yOff + (double) y + 0.85, zOff + (double) z + 0.85 ) );
|
||||
*/
|
||||
* double xOff = -0.15 * getUp().offsetX; double yOff = -0.15 *
|
||||
* getUp().offsetY; double zOff = -0.15 * getUp().offsetZ; out.add(
|
||||
* AxisAlignedBB.getBoundingBox( xOff + (double) x + 0.15, yOff +
|
||||
* (double) y + 0.15, zOff + (double) z + 0.15,// ahh xOff + (double) x
|
||||
* + 0.85, yOff + (double) y + 0.85, zOff + (double) z + 0.85 ) );
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void neighborChanged( IBlockState state, World w, BlockPos pos, Block blockIn )
|
||||
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
|
||||
{
|
||||
final EnumFacing up = this.getOrientable( w, pos ).getUp();
|
||||
if( !this.canPlaceAt( (World) w, pos, up.getOpposite() ) )
|
||||
final EnumFacing up = this.getOrientable( world, pos ).getUp();
|
||||
if( !this.canPlaceAt( (World) world, pos, up.getOpposite() ) )
|
||||
{
|
||||
this.dropTorch( (World) w, pos );
|
||||
this.dropTorch( (World) world, pos );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,7 +189,7 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT)
|
||||
@SideOnly( Side.CLIENT )
|
||||
public BlockRenderLayer getBlockLayer()
|
||||
{
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
|
||||
@@ -45,10 +45,11 @@ import appeng.api.util.IOrientableBlock;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.client.render.effects.LightningFX;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.helpers.ICustomCollision;
|
||||
import appeng.helpers.MetaRotation;
|
||||
|
||||
|
||||
public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock, ICustomCollision
|
||||
{
|
||||
|
||||
@@ -75,7 +76,7 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
|
||||
@Override
|
||||
public IBlockState getActualState( IBlockState state, IBlockAccess worldIn, BlockPos pos )
|
||||
{
|
||||
boolean oddPlacement = ((pos.getX() + pos.getY() + pos.getZ()) % 2) != 0;
|
||||
boolean oddPlacement = ( ( pos.getX() + pos.getY() + pos.getZ() ) % 2 ) != 0;
|
||||
|
||||
return super.getActualState( state, worldIn, pos )
|
||||
.withProperty( ODD, oddPlacement );
|
||||
@@ -91,7 +92,7 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
|
||||
public IBlockState getStateFromMeta( final int meta )
|
||||
{
|
||||
EnumFacing facing = EnumFacing.values()[meta];
|
||||
return getDefaultState().withProperty(FACING, facing);
|
||||
return this.getDefaultState().withProperty( FACING, facing );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -125,17 +126,18 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
|
||||
@Override
|
||||
public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List out, final Entity e )
|
||||
{/*
|
||||
* double xOff = -0.15 * getUp().offsetX; double yOff = -0.15 * getUp().offsetY; double zOff = -0.15 *
|
||||
* getUp().offsetZ; out.add( AxisAlignedBB.getBoundingBox( xOff + (double) x + 0.15, yOff + (double) y + 0.15, zOff
|
||||
* + (double) z + 0.15,// ahh xOff + (double) x + 0.85, yOff + (double) y + 0.85, zOff + (double) z + 0.85 ) );
|
||||
*/
|
||||
* double xOff = -0.15 * getUp().offsetX; double yOff = -0.15 * getUp().offsetY; double zOff = -0.15 *
|
||||
* getUp().offsetZ; out.add( AxisAlignedBB.getBoundingBox( xOff + (double) x + 0.15, yOff + (double) y + 0.15,
|
||||
* zOff
|
||||
* + (double) z + 0.15,// ahh xOff + (double) x + 0.85, yOff + (double) y + 0.85, zOff + (double) z + 0.85 ) );
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
|
||||
{
|
||||
if( !AEConfig.instance.enableEffects )
|
||||
if( !AEConfig.instance().isEnableEffects() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -151,7 +153,7 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
|
||||
final double zOff = -0.3 * up.getFrontOffsetZ();
|
||||
for( int bolts = 0; bolts < 3; bolts++ )
|
||||
{
|
||||
if( CommonHelper.proxy.shouldAddParticles( r ) )
|
||||
if( AppEng.proxy.shouldAddParticles( r ) )
|
||||
{
|
||||
final LightningFX fx = new LightningFX( w, xOff + 0.5 + pos.getX(), yOff + 0.5 + pos.getY(), zOff + 0.5 + pos.getZ(), 0.0D, 0.0D, 0.0D );
|
||||
|
||||
@@ -161,12 +163,12 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos,final Block neighborBlock )
|
||||
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
|
||||
{
|
||||
final EnumFacing up = this.getOrientable( w, pos ).getUp();
|
||||
if( !this.canPlaceAt( w, pos, up.getOpposite() ) )
|
||||
final EnumFacing up = this.getOrientable( world, pos ).getUp();
|
||||
if( !this.canPlaceAt( world, pos, up.getOpposite() ) )
|
||||
{
|
||||
this.dropTorch( w, pos );
|
||||
this.dropTorch( world, pos );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,7 +217,7 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SideOnly( Side.CLIENT )
|
||||
public BlockRenderLayer getBlockLayer()
|
||||
{
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
|
||||
@@ -38,7 +38,7 @@ import appeng.api.util.IOrientableBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.client.render.effects.LightningFX;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.tile.misc.TileQuartzGrowthAccelerator;
|
||||
import appeng.util.Platform;
|
||||
|
||||
@@ -52,14 +52,13 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
|
||||
{
|
||||
super( Material.ROCK );
|
||||
this.setSoundType( SoundType.METAL );
|
||||
this.setTileEntity( TileQuartzGrowthAccelerator.class );
|
||||
this.setDefaultState( getDefaultState().withProperty( POWERED, false ) );
|
||||
this.setDefaultState( this.getDefaultState().withProperty( POWERED, false ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos )
|
||||
{
|
||||
TileQuartzGrowthAccelerator te = getTileEntity( world, pos );
|
||||
TileQuartzGrowthAccelerator te = this.getTileEntity( world, pos );
|
||||
boolean powered = te != null && te.isPowered();
|
||||
|
||||
return super.getActualState( state, world, pos )
|
||||
@@ -76,14 +75,14 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
|
||||
@Override
|
||||
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
|
||||
{
|
||||
if( !AEConfig.instance.enableEffects )
|
||||
if( !AEConfig.instance().isEnableEffects() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final TileQuartzGrowthAccelerator cga = this.getTileEntity( w, pos );
|
||||
|
||||
if( cga != null && cga.isPowered() && CommonHelper.proxy.shouldAddParticles( r ) )
|
||||
if( cga != null && cga.isPowered() && AppEng.proxy.shouldAddParticles( r ) )
|
||||
{
|
||||
final double d0 = r.nextFloat() - 0.5F;
|
||||
final double d1 = r.nextFloat() - 0.5F;
|
||||
|
||||
@@ -40,6 +40,7 @@ import appeng.core.sync.GuiBridge;
|
||||
import appeng.tile.misc.TileSecurityStation;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockSecurityStation extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
@@ -49,8 +50,7 @@ public class BlockSecurityStation extends AEBaseTileBlock
|
||||
{
|
||||
super( Material.IRON );
|
||||
|
||||
this.setTileEntity( TileSecurityStation.class );
|
||||
this.setDefaultState( getDefaultState().withProperty( POWERED, false ) );
|
||||
this.setDefaultState( this.getDefaultState().withProperty( POWERED, false ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -69,7 +69,7 @@ public class BlockSecurityStation extends AEBaseTileBlock
|
||||
public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos )
|
||||
{
|
||||
boolean powered = false;
|
||||
TileSecurityStation te = getTileEntity( world, pos );
|
||||
TileSecurityStation te = this.getTileEntity( world, pos );
|
||||
if( te != null )
|
||||
{
|
||||
powered = te.isActive();
|
||||
|
||||
@@ -40,6 +40,7 @@ import appeng.block.AEBaseTileBlock;
|
||||
import appeng.helpers.ICustomCollision;
|
||||
import appeng.tile.misc.TileSkyCompass;
|
||||
|
||||
|
||||
public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
|
||||
{
|
||||
|
||||
@@ -49,7 +50,6 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
|
||||
public BlockSkyCompass()
|
||||
{
|
||||
super( Material.CIRCUITS );
|
||||
this.setTileEntity( TileSkyCompass.class );
|
||||
this.setLightOpacity( 0 );
|
||||
this.setFullSize( false );
|
||||
this.setOpaque( false );
|
||||
@@ -58,7 +58,7 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
return new ExtendedBlockState( this, getAEStates(), new IUnlistedProperty[] { FORWARD, UP, ROTATION } );
|
||||
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] { FORWARD, UP, ROTATION } );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -78,13 +78,13 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
|
||||
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
|
||||
{
|
||||
final TileSkyCompass sc = this.getTileEntity( w, pos );
|
||||
final TileSkyCompass sc = this.getTileEntity( world, pos );
|
||||
final EnumFacing forward = sc.getForward();
|
||||
if( !this.canPlaceAt( w, pos, forward.getOpposite() ) )
|
||||
if( !this.canPlaceAt( world, pos, forward.getOpposite() ) )
|
||||
{
|
||||
this.dropTorch( w, pos );
|
||||
this.dropTorch( world, pos );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,14 +42,12 @@ import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.registry.EntityRegistry;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.entity.EntityIds;
|
||||
import appeng.entity.EntityTinyTNTPrimed;
|
||||
import appeng.helpers.ICustomCollision;
|
||||
|
||||
|
||||
public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
|
||||
{
|
||||
|
||||
@@ -62,7 +60,9 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
|
||||
this.setSoundType( SoundType.GROUND );
|
||||
this.setHardness( 0F );
|
||||
|
||||
EntityRegistry.registerModEntity( EntityTinyTNTPrimed.class, "EntityTinyTNTPrimed", EntityIds.get( EntityTinyTNTPrimed.class ), AppEng.instance(), 16, 4, true );
|
||||
// TODO: 1.11
|
||||
// EntityRegistry.registerModEntity( EntityTinyTNTPrimed.class, "EntityTinyTNTPrimed", EntityIds.get(
|
||||
// EntityTinyTNTPrimed.class ), AppEng.instance(), 16, 4, true );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -86,18 +86,19 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
|
||||
if( !w.isRemote )
|
||||
{
|
||||
final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, igniter );
|
||||
w.spawnEntityInWorld( primedTinyTNTEntity );
|
||||
w.playSound( null, primedTinyTNTEntity.posX, primedTinyTNTEntity.posY, primedTinyTNTEntity.posZ, SoundEvents.ENTITY_TNT_PRIMED, SoundCategory.BLOCKS, 1, 1 );
|
||||
w.spawnEntity( primedTinyTNTEntity );
|
||||
w.playSound( null, primedTinyTNTEntity.posX, primedTinyTNTEntity.posY, primedTinyTNTEntity.posZ, SoundEvents.ENTITY_TNT_PRIMED,
|
||||
SoundCategory.BLOCKS, 1, 1 );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
|
||||
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
|
||||
{
|
||||
if( w.isBlockIndirectlyGettingPowered( pos ) > 0 )
|
||||
if( world.isBlockIndirectlyGettingPowered( pos ) > 0 )
|
||||
{
|
||||
this.startFuse( w, pos, null );
|
||||
w.setBlockToAir( pos );
|
||||
this.startFuse( world, pos, null );
|
||||
world.setBlockToAir( pos );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,9 +141,10 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
|
||||
super.onBlockExploded( w, pos, exp );
|
||||
if( !w.isRemote )
|
||||
{
|
||||
final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, exp.getExplosivePlacedBy() );
|
||||
final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, exp
|
||||
.getExplosivePlacedBy() );
|
||||
primedTinyTNTEntity.setFuse( w.rand.nextInt( primedTinyTNTEntity.getFuse() / 4 ) + primedTinyTNTEntity.getFuse() / 8 );
|
||||
w.spawnEntityInWorld( primedTinyTNTEntity );
|
||||
w.spawnEntity( primedTinyTNTEntity );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.misc.TileVibrationChamber;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public final class BlockVibrationChamber extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
@@ -53,9 +54,8 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
|
||||
public BlockVibrationChamber()
|
||||
{
|
||||
super( Material.IRON );
|
||||
this.setTileEntity( TileVibrationChamber.class );
|
||||
this.setHardness( 4.2F );
|
||||
this.setDefaultState( getDefaultState().withProperty( ACTIVE, false ) );
|
||||
this.setDefaultState( this.getDefaultState().withProperty( ACTIVE, false ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -71,7 +71,7 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
|
||||
@Override
|
||||
protected IProperty[] getAEStates()
|
||||
{
|
||||
return new IProperty[]{ ACTIVE };
|
||||
return new IProperty[] { ACTIVE };
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -94,11 +94,11 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
|
||||
{
|
||||
if( !AEConfig.instance.enableEffects )
|
||||
if( !AEConfig.instance().isEnableEffects() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package appeng.block.misc;
|
||||
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ package appeng.block.networking;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -45,6 +46,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
@@ -99,6 +101,7 @@ public class BlockCableBus extends AEBaseTileBlock
|
||||
// this will actually be overwritten later through setupTile and the
|
||||
// combined layers
|
||||
this.setTileEntity( TileCableBus.class );
|
||||
this.useNeighborBrightness = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -116,7 +119,7 @@ public class BlockCableBus extends AEBaseTileBlock
|
||||
@Override
|
||||
public IBlockState getExtendedState( IBlockState state, IBlockAccess world, BlockPos pos )
|
||||
{
|
||||
CableBusRenderState renderState = cb( world, pos ).getRenderState();
|
||||
CableBusRenderState renderState = this.cb( world, pos ).getRenderState();
|
||||
return ( (IExtendedBlockState) state ).withProperty( RENDER_STATE_PROPERTY, renderState );
|
||||
}
|
||||
|
||||
@@ -129,7 +132,7 @@ public class BlockCableBus extends AEBaseTileBlock
|
||||
@Override
|
||||
public void onNeighborChange( final IBlockAccess w, final BlockPos pos, final BlockPos neighbor )
|
||||
{
|
||||
this.cb( w, pos ).onNeighborChanged();
|
||||
this.cb( w, pos ).onNeighborChanged( w, pos, neighbor );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -235,7 +238,7 @@ public class BlockCableBus extends AEBaseTileBlock
|
||||
return sp.facade.getItemStack();
|
||||
}
|
||||
|
||||
return null;
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -253,9 +256,9 @@ public class BlockCableBus extends AEBaseTileBlock
|
||||
ICableBusContainer cb = this.cb( world, target.getBlockPos() );
|
||||
|
||||
// Our built-in model has the actual baked sprites we need
|
||||
IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState( getDefaultState() );
|
||||
IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState( this.getDefaultState() );
|
||||
|
||||
// We cannot add the effect if we dont have the model
|
||||
// We cannot add the effect if we don't have the model
|
||||
if( !( model instanceof CableBusBakedModel ) )
|
||||
{
|
||||
return true;
|
||||
@@ -269,9 +272,9 @@ public class BlockCableBus extends AEBaseTileBlock
|
||||
TextureAtlasSprite texture = Platform.pickRandom( cableBusModel.getParticleTextures( renderState ) );
|
||||
if( texture != null )
|
||||
{
|
||||
double x = target.hitVec.xCoord;
|
||||
double y = target.hitVec.yCoord;
|
||||
double z = target.hitVec.zCoord;
|
||||
double x = target.hitVec.x;
|
||||
double y = target.hitVec.y;
|
||||
double z = target.hitVec.z;
|
||||
|
||||
Particle fx = new DestroyFX( world, x, y, z, 0.0D, 0.0D, 0.0D, state ).setBlockPos( target.getBlockPos() ).multipleParticleScaleBy( 0.8F );
|
||||
fx.setParticleTexture( texture );
|
||||
@@ -288,7 +291,7 @@ public class BlockCableBus extends AEBaseTileBlock
|
||||
ICableBusContainer cb = this.cb( world, pos );
|
||||
|
||||
// Our built-in model has the actual baked sprites we need
|
||||
IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState( getDefaultState() );
|
||||
IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState( this.getDefaultState() );
|
||||
|
||||
// We cannot add the effect if we dont have the model
|
||||
if( !( model instanceof CableBusBakedModel ) )
|
||||
@@ -317,7 +320,8 @@ public class BlockCableBus extends AEBaseTileBlock
|
||||
double d0 = (double) pos.getX() + ( (double) j + 0.5D ) / 4.0D;
|
||||
double d1 = (double) pos.getY() + ( (double) k + 0.5D ) / 4.0D;
|
||||
double d2 = (double) pos.getZ() + ( (double) l + 0.5D ) / 4.0D;
|
||||
ParticleDigging particle = new DestroyFX( world, d0, d1, d2, d0 - (double) pos.getX() - 0.5D, d1 - (double) pos.getY() - 0.5D, d2 - (double) pos.getZ() - 0.5D, getDefaultState() ).setBlockPos( pos );
|
||||
ParticleDigging particle = new DestroyFX( world, d0, d1, d2, d0 - (double) pos.getX() - 0.5D, d1 - (double) pos
|
||||
.getY() - 0.5D, d2 - (double) pos.getZ() - 0.5D, this.getDefaultState() ).setBlockPos( pos );
|
||||
particle.setParticleTexture( texture );
|
||||
effectRenderer.addEffect( particle );
|
||||
}
|
||||
@@ -329,11 +333,11 @@ public class BlockCableBus extends AEBaseTileBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
|
||||
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
this.cb( w, pos ).onNeighborChanged();
|
||||
this.cb( world, pos ).onNeighborChanged( world, pos, fromPos );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -376,7 +380,7 @@ public class BlockCableBus extends AEBaseTileBlock
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
|
||||
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
@@ -385,8 +389,9 @@ public class BlockCableBus extends AEBaseTileBlock
|
||||
{
|
||||
noTesrTile = Api.INSTANCE.partHelper().getCombinedInstance( TileCableBus.class );
|
||||
this.setTileEntity( noTesrTile );
|
||||
// TODO: Change after transition phase
|
||||
GameRegistry.registerTileEntityWithAlternatives( noTesrTile, AppEng.MOD_ID.toLowerCase() + ":" + "BlockCableBus", "BlockCableBus" );
|
||||
|
||||
GameRegistry.registerTileEntity( noTesrTile, AppEng.MOD_ID.toLowerCase() + ":" + "BlockCableBus" );
|
||||
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
setupTesr();
|
||||
@@ -397,8 +402,7 @@ public class BlockCableBus extends AEBaseTileBlock
|
||||
private static void setupTesr()
|
||||
{
|
||||
tesrTile = Api.INSTANCE.partHelper().getCombinedInstance( TileCableBusTESR.class );
|
||||
// TODO: Change after transition phase
|
||||
GameRegistry.registerTileEntityWithAlternatives( tesrTile, AppEng.MOD_ID.toLowerCase() + ":" + "ClientOnly_TESR_CableBus", "ClientOnly_TESR_CableBus" );
|
||||
GameRegistry.registerTileEntity( tesrTile, AppEng.MOD_ID.toLowerCase() + ":" + "ClientOnly_TESR_CableBus" );
|
||||
ClientRegistry.bindTileEntitySpecialRenderer( BlockCableBus.getTesrTile(), new CableBusTESR() );
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ import net.minecraft.world.World;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.tile.networking.TileController;
|
||||
|
||||
|
||||
public class BlockController extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
@@ -49,11 +50,11 @@ public class BlockController extends AEBaseTileBlock
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Controls the rendering of the controller block (connected texture style).
|
||||
* inside_a and inside_b are alternating patterns for a controller that is enclosed by other controllers,
|
||||
* and since they are always offline, they do not have the usual sub-states.
|
||||
*/
|
||||
/**
|
||||
* Controls the rendering of the controller block (connected texture style).
|
||||
* inside_a and inside_b are alternating patterns for a controller that is enclosed by other controllers,
|
||||
* and since they are always offline, they do not have the usual sub-states.
|
||||
*/
|
||||
public enum ControllerRenderType implements IStringSerializable
|
||||
{
|
||||
block, column_x, column_y, column_z, inside_a, inside_b;
|
||||
@@ -73,9 +74,8 @@ public class BlockController extends AEBaseTileBlock
|
||||
public BlockController()
|
||||
{
|
||||
super( Material.IRON );
|
||||
this.setTileEntity( TileController.class );
|
||||
this.setHardness( 6 );
|
||||
this.setDefaultState( getDefaultState()
|
||||
this.setDefaultState( this.getDefaultState()
|
||||
.withProperty( CONTROLLER_STATE, ControllerBlockState.offline )
|
||||
.withProperty( CONTROLLER_TYPE, ControllerRenderType.block ) );
|
||||
}
|
||||
@@ -89,7 +89,7 @@ public class BlockController extends AEBaseTileBlock
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
return new BlockStateContainer( this, getAEStates() );
|
||||
return new BlockStateContainer( this, this.getAEStates() );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -97,6 +97,7 @@ public class BlockController extends AEBaseTileBlock
|
||||
* controllers and the network state of this controller (offline, online, conflicted). This is used to
|
||||
* get a rudimentary connected texture feel for the controller based on how it is placed.
|
||||
*/
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos )
|
||||
{
|
||||
@@ -109,9 +110,12 @@ public class BlockController extends AEBaseTileBlock
|
||||
int z = pos.getZ();
|
||||
|
||||
// Detect whether controllers are on both sides of the x, y, and z axes
|
||||
final boolean xx = this.getTileEntity( world, x - 1, y, z ) instanceof TileController && this.getTileEntity( world, x + 1, y, z ) instanceof TileController;
|
||||
final boolean yy = this.getTileEntity( world, x, y - 1, z ) instanceof TileController && this.getTileEntity( world, x, y + 1, z ) instanceof TileController;
|
||||
final boolean zz = this.getTileEntity( world, x, y, z - 1 ) instanceof TileController && this.getTileEntity( world, x, y, z + 1 ) instanceof TileController;
|
||||
final boolean xx = this.getTileEntity( world, x - 1, y, z ) instanceof TileController && this.getTileEntity( world, x + 1, y,
|
||||
z ) instanceof TileController;
|
||||
final boolean yy = this.getTileEntity( world, x, y - 1, z ) instanceof TileController && this.getTileEntity( world, x, y + 1,
|
||||
z ) instanceof TileController;
|
||||
final boolean zz = this.getTileEntity( world, x, y, z - 1 ) instanceof TileController && this.getTileEntity( world, x, y,
|
||||
z + 1 ) instanceof TileController;
|
||||
|
||||
if( xx && !yy && !zz )
|
||||
{
|
||||
@@ -156,6 +160,7 @@ public class BlockController extends AEBaseTileBlock
|
||||
return state.getValue( CONTROLLER_STATE ).ordinal();
|
||||
}
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
public IBlockState getStateFromMeta( final int meta )
|
||||
{
|
||||
@@ -169,10 +174,11 @@ public class BlockController extends AEBaseTileBlock
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
|
||||
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
|
||||
{
|
||||
final TileController tc = this.getTileEntity( w, pos );
|
||||
final TileController tc = this.getTileEntity( world, pos );
|
||||
if( tc != null )
|
||||
{
|
||||
tc.onNeighborChange( false );
|
||||
|
||||
@@ -21,7 +21,7 @@ package appeng.block.networking;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.helpers.AEGlassMaterial;
|
||||
import appeng.tile.networking.TileCreativeEnergyCell;
|
||||
|
||||
|
||||
public class BlockCreativeEnergyCell extends AEBaseTileBlock
|
||||
{
|
||||
@@ -29,6 +29,5 @@ public class BlockCreativeEnergyCell extends AEBaseTileBlock
|
||||
public BlockCreativeEnergyCell()
|
||||
{
|
||||
super( AEGlassMaterial.INSTANCE );
|
||||
this.setTileEntity( TileCreativeEnergyCell.class );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,14 +19,12 @@
|
||||
package appeng.block.networking;
|
||||
|
||||
|
||||
import appeng.tile.networking.TileDenseEnergyCell;
|
||||
|
||||
public class BlockDenseEnergyCell extends BlockEnergyCell
|
||||
{
|
||||
|
||||
public BlockDenseEnergyCell()
|
||||
{
|
||||
this.setTileEntity( TileDenseEnergyCell.class );
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -22,7 +22,6 @@ package appeng.block.networking;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.tile.networking.TileEnergyAcceptor;
|
||||
|
||||
|
||||
public class BlockEnergyAcceptor extends AEBaseTileBlock
|
||||
@@ -31,6 +30,5 @@ public class BlockEnergyAcceptor extends AEBaseTileBlock
|
||||
public BlockEnergyAcceptor()
|
||||
{
|
||||
super( Material.IRON );
|
||||
this.setTileEntity( TileEnergyAcceptor.class );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,21 +19,18 @@
|
||||
package appeng.block.networking;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.helpers.AEGlassMaterial;
|
||||
import appeng.tile.networking.TileEnergyCell;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
@@ -57,15 +54,13 @@ public class BlockEnergyCell extends AEBaseTileBlock
|
||||
public BlockEnergyCell()
|
||||
{
|
||||
super( AEGlassMaterial.INSTANCE );
|
||||
|
||||
this.setTileEntity( TileEnergyCell.class );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
|
||||
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
|
||||
{
|
||||
super.getCheckedSubBlocks( item, tabs, itemStacks );
|
||||
super.getSubBlocks( tabs, itemStacks );
|
||||
|
||||
final ItemStack charged = new ItemStack( this, 1 );
|
||||
final NBTTagCompound tag = Platform.openNbtData( charged );
|
||||
|
||||
@@ -57,7 +57,7 @@ public class BlockEnergyCellRendering extends BlockRenderingCustomizer
|
||||
double fillFactor = getFillFactor( is );
|
||||
|
||||
int storageLevel = TileEnergyCell.getStorageLevelFromFillFactor( fillFactor );
|
||||
return new ModelResourceLocation( baseModel, "fullness=" + storageLevel );
|
||||
return new ModelResourceLocation( this.baseModel, "fullness=" + storageLevel );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,14 +21,12 @@ package appeng.block.networking;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
@@ -46,6 +44,7 @@ import appeng.helpers.ICustomCollision;
|
||||
import appeng.tile.networking.TileWireless;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
|
||||
{
|
||||
|
||||
@@ -58,21 +57,19 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return name().toLowerCase();
|
||||
return this.name().toLowerCase();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static final PropertyEnum<State> STATE = PropertyEnum.create( "state", State.class );
|
||||
|
||||
public BlockWireless()
|
||||
{
|
||||
super( AEGlassMaterial.INSTANCE );
|
||||
this.setTileEntity( TileWireless.class );
|
||||
this.setLightOpacity( 0 );
|
||||
this.setFullSize( false );
|
||||
this.setOpaque( false );
|
||||
this.setDefaultState( getDefaultState().withProperty( STATE, State.OFF ) );
|
||||
this.setDefaultState( this.getDefaultState().withProperty( STATE, State.OFF ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -86,7 +83,7 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
|
||||
{
|
||||
State teState = State.OFF;
|
||||
|
||||
TileWireless te = getTileEntity( worldIn, pos );
|
||||
TileWireless te = this.getTileEntity( worldIn, pos );
|
||||
if( te != null )
|
||||
{
|
||||
if( te.isActive() )
|
||||
@@ -110,15 +107,11 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated( final World w, final BlockPos pos, final IBlockState state, final EntityPlayer player, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
||||
public boolean onBlockActivated( final World w, final BlockPos pos, final IBlockState state, final EntityPlayer player, final EnumHand hand, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
if( player.isSneaking() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
final TileWireless tg = this.getTileEntity( w, pos );
|
||||
if( tg != null )
|
||||
|
||||
if( tg != null && !player.isSneaking() )
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
@@ -126,7 +119,8 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
return super.onBlockActivated( w, pos, state, player, hand, side, hitX, hitY, hitZ );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -45,7 +45,7 @@ public class CableBusRendering extends BlockRenderingCustomizer
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void customize( IBlockRendering rendering, IItemRendering itemRendering )
|
||||
{
|
||||
rendering.builtInModel( "models/block/builtin/cable_bus", new CableBusModel( partModels ) );
|
||||
rendering.builtInModel( "models/block/builtin/cable_bus", new CableBusModel( this.partModels ) );
|
||||
rendering.blockColor( new CableBusColor() );
|
||||
rendering.modelCustomizer( ( loc, model ) -> model );
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package appeng.block.networking;
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ package appeng.block.paint;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -34,6 +33,7 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -49,6 +49,7 @@ import appeng.helpers.Splotch;
|
||||
import appeng.tile.misc.TilePaint;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockPaint extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
@@ -58,7 +59,6 @@ public class BlockPaint extends AEBaseTileBlock
|
||||
{
|
||||
super( new MaterialLiquid( MapColor.AIR ) );
|
||||
|
||||
this.setTileEntity( TilePaint.class );
|
||||
this.setLightOpacity( 0 );
|
||||
this.setFullSize( false );
|
||||
this.setOpaque( false );
|
||||
@@ -75,7 +75,7 @@ public class BlockPaint extends AEBaseTileBlock
|
||||
{
|
||||
IExtendedBlockState extState = (IExtendedBlockState) state;
|
||||
|
||||
TilePaint te = getTileEntity( world, pos );
|
||||
TilePaint te = this.getTileEntity( world, pos );
|
||||
|
||||
Collection<Splotch> splotches = Collections.emptyList();
|
||||
if( te != null )
|
||||
@@ -94,13 +94,13 @@ public class BlockPaint extends AEBaseTileBlock
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
|
||||
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox( final IBlockState state, final World worldIn, final BlockPos pos )
|
||||
public AxisAlignedBB getCollisionBoundingBox( IBlockState blockState, IBlockAccess worldIn, BlockPos pos )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -112,9 +112,9 @@ public class BlockPaint extends AEBaseTileBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
|
||||
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
|
||||
{
|
||||
final TilePaint tp = this.getTileEntity( w, pos );
|
||||
final TilePaint tp = this.getTileEntity( world, pos );
|
||||
|
||||
if( tp != null )
|
||||
{
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
|
||||
package appeng.block.paint;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -26,7 +28,8 @@ import appeng.helpers.Splotch;
|
||||
|
||||
|
||||
/**
|
||||
* Renders paint blocks, which render multiple "splotches" that have been applied to the sides of adjacent blocks using a
|
||||
* Renders paint blocks, which render multiple "splotches" that have been applied to the sides of adjacent blocks using
|
||||
* a
|
||||
* matter cannon with paint balls.
|
||||
*/
|
||||
class PaintBakedModel implements IBakedModel
|
||||
@@ -63,7 +66,7 @@ class PaintBakedModel implements IBakedModel
|
||||
// This is the inventory model which should usually not be used other than in special cases
|
||||
List<BakedQuad> quads = new ArrayList<>( 1 );
|
||||
CubeBuilder builder = new CubeBuilder( this.vertexFormat, quads );
|
||||
builder.setTexture( textures[0] );
|
||||
builder.setTexture( this.textures[0] );
|
||||
builder.addCube( 0, 0, 0, 16, 16, 16 );
|
||||
return quads;
|
||||
}
|
||||
@@ -78,10 +81,11 @@ class PaintBakedModel implements IBakedModel
|
||||
|
||||
List<Splotch> splotches = splotchesState.getSplotches();
|
||||
|
||||
CubeBuilder builder = new CubeBuilder( vertexFormat );
|
||||
CubeBuilder builder = new CubeBuilder( this.vertexFormat );
|
||||
|
||||
float offsetConstant = 0.001f;
|
||||
for( final Splotch s : splotches) {
|
||||
for( final Splotch s : splotches )
|
||||
{
|
||||
|
||||
if( s.isLumen() )
|
||||
{
|
||||
@@ -105,7 +109,7 @@ class PaintBakedModel implements IBakedModel
|
||||
pos_x = Math.max( buffer, Math.min( 1.0f - buffer, pos_x ) );
|
||||
pos_y = Math.max( buffer, Math.min( 1.0f - buffer, pos_y ) );
|
||||
|
||||
TextureAtlasSprite ico = textures[s.getSeed() % textures.length];
|
||||
TextureAtlasSprite ico = this.textures[s.getSeed() % this.textures.length];
|
||||
builder.setTexture( ico );
|
||||
builder.setCustomUv( s.getSide().getOpposite(), 0, 0, 16, 16 );
|
||||
|
||||
@@ -172,7 +176,7 @@ class PaintBakedModel implements IBakedModel
|
||||
@Override
|
||||
public TextureAtlasSprite getParticleTexture()
|
||||
{
|
||||
return textures[0];
|
||||
return this.textures[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -190,7 +194,6 @@ class PaintBakedModel implements IBakedModel
|
||||
static List<ResourceLocation> getRequiredTextures()
|
||||
{
|
||||
return ImmutableList.of(
|
||||
TEXTURE_PAINT1, TEXTURE_PAINT2, TEXTURE_PAINT3
|
||||
);
|
||||
TEXTURE_PAINT1, TEXTURE_PAINT2, TEXTURE_PAINT3 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
|
||||
package appeng.block.paint;
|
||||
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import java.util.function.Function;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package appeng.block.paint;
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package appeng.block.paint;
|
||||
|
||||
|
||||
@@ -24,7 +25,7 @@ class PaintSplotches
|
||||
|
||||
List<Splotch> getSplotches()
|
||||
{
|
||||
return splotches;
|
||||
return this.splotches;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package appeng.block.paint;
|
||||
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ import appeng.block.AEBaseTileBlock;
|
||||
import appeng.helpers.ICustomCollision;
|
||||
import appeng.tile.qnb.TileQuantumBridge;
|
||||
|
||||
|
||||
public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICustomCollision
|
||||
{
|
||||
|
||||
@@ -48,12 +49,11 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto
|
||||
public BlockQuantumBase( final Material mat )
|
||||
{
|
||||
super( mat );
|
||||
this.setTileEntity( TileQuantumBridge.class );
|
||||
final float shave = 2.0f / 16.0f;
|
||||
this.boundingBox = new AxisAlignedBB( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave );
|
||||
this.setLightOpacity( 0 );
|
||||
this.setFullSize( this.setOpaque( false ) );
|
||||
this.setDefaultState( getDefaultState().withProperty( FORMED, false ) );
|
||||
this.setDefaultState( this.getDefaultState().withProperty( FORMED, false ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -65,7 +65,7 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
return new ExtendedBlockState( this, getAEStates(), new IUnlistedProperty[] { FORMED_STATE } );
|
||||
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] { FORMED_STATE } );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -73,7 +73,7 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto
|
||||
{
|
||||
IExtendedBlockState extState = (IExtendedBlockState) state;
|
||||
|
||||
TileQuantumBridge bridge = getTileEntity( world, pos );
|
||||
TileQuantumBridge bridge = this.getTileEntity( world, pos );
|
||||
if( bridge != null )
|
||||
{
|
||||
QnbFormedState formedState = new QnbFormedState( bridge.getAdjacentQuantumBridges(), bridge.isCorner(), bridge.isPowered() );
|
||||
@@ -86,7 +86,7 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto
|
||||
@Override
|
||||
public IBlockState getActualState( IBlockState state, IBlockAccess worldIn, BlockPos pos )
|
||||
{
|
||||
TileQuantumBridge bridge = getTileEntity( worldIn, pos );
|
||||
TileQuantumBridge bridge = this.getTileEntity( worldIn, pos );
|
||||
if( bridge != null )
|
||||
{
|
||||
state = state.withProperty( FORMED, bridge.isFormed() );
|
||||
@@ -101,9 +101,9 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
|
||||
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
|
||||
{
|
||||
final TileQuantumBridge bridge = this.getTileEntity( w, pos );
|
||||
final TileQuantumBridge bridge = this.getTileEntity( world, pos );
|
||||
if( bridge != null )
|
||||
{
|
||||
bridge.neighborUpdate();
|
||||
|
||||
@@ -37,7 +37,7 @@ import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.client.EffectType;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.helpers.AEGlassMaterial;
|
||||
import appeng.tile.qnb.TileQuantumBridge;
|
||||
@@ -60,9 +60,9 @@ public class BlockQuantumLinkChamber extends BlockQuantumBase
|
||||
{
|
||||
if( bridge.hasQES() )
|
||||
{
|
||||
if( CommonHelper.proxy.shouldAddParticles( rand ) )
|
||||
if( AppEng.proxy.shouldAddParticles( rand ) )
|
||||
{
|
||||
CommonHelper.proxy.spawnEffect( EffectType.Energy, w, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, null );
|
||||
AppEng.proxy.spawnEffect( EffectType.Energy, w, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, null );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
|
||||
package appeng.block.qnb;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -77,46 +79,47 @@ class QnbFormedBakedModel implements IBakedModel
|
||||
// Get the correct base model
|
||||
if( !( state instanceof IExtendedBlockState ) )
|
||||
{
|
||||
return baseModel.getQuads( state, side, rand );
|
||||
return this.baseModel.getQuads( state, side, rand );
|
||||
}
|
||||
|
||||
IExtendedBlockState extendedBlockState = (IExtendedBlockState) state;
|
||||
QnbFormedState formedState = extendedBlockState.getValue( BlockQuantumBase.FORMED_STATE );
|
||||
|
||||
return getQuads( formedState, state, side, rand );
|
||||
return this.getQuads( formedState, state, side, rand );
|
||||
}
|
||||
|
||||
private List<BakedQuad> getQuads( QnbFormedState formedState, IBlockState state, EnumFacing side, long rand )
|
||||
{
|
||||
CubeBuilder builder = new CubeBuilder( vertexFormat );
|
||||
CubeBuilder builder = new CubeBuilder( this.vertexFormat );
|
||||
|
||||
if( state.getBlock() == linkBlock )
|
||||
if( state.getBlock() == this.linkBlock )
|
||||
{
|
||||
Set<EnumFacing> sides = formedState.getAdjacentQuantumBridges();
|
||||
|
||||
this.renderCableAt( builder, 0.11f * 16, glassCableTexture, 0.141f * 16, sides );
|
||||
this.renderCableAt( builder, 0.11f * 16, this.glassCableTexture, 0.141f * 16, sides );
|
||||
|
||||
this.renderCableAt( builder, 0.188f * 16, coveredCableTexture, 0.1875f * 16, sides );
|
||||
this.renderCableAt( builder, 0.188f * 16, this.coveredCableTexture, 0.1875f * 16, sides );
|
||||
|
||||
builder.setTexture( linkTexture );
|
||||
builder.setTexture( this.linkTexture );
|
||||
builder.addCube( DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( formedState.isCorner() )
|
||||
{
|
||||
this.renderCableAt( builder, 0.188f * 16, coveredCableTexture, 0.05f * 16, formedState.getAdjacentQuantumBridges() );
|
||||
this.renderCableAt( builder, 0.188f * 16, this.coveredCableTexture, 0.05f * 16, formedState.getAdjacentQuantumBridges() );
|
||||
|
||||
builder.setTexture( ringTexture );
|
||||
builder.setTexture( this.ringTexture );
|
||||
builder.addCube( DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX );
|
||||
|
||||
if( formedState.isPowered() )
|
||||
{
|
||||
builder.setTexture( lightCornerTexture );
|
||||
builder.setTexture( this.lightCornerTexture );
|
||||
builder.setRenderFullBright( true );
|
||||
for( EnumFacing facing : EnumFacing.values() )
|
||||
{
|
||||
// Offset the face by a slight amount so that it is drawn over the already drawn ring texture (avoids z-fighting)
|
||||
// Offset the face by a slight amount so that it is drawn over the already drawn ring texture
|
||||
// (avoids z-fighting)
|
||||
float xOffset = Math.abs( facing.getFrontOffsetX() * 0.01f );
|
||||
float yOffset = Math.abs( facing.getFrontOffsetY() * 0.01f );
|
||||
float zOffset = Math.abs( facing.getFrontOffsetZ() * 0.01f );
|
||||
@@ -124,14 +127,13 @@ class QnbFormedBakedModel implements IBakedModel
|
||||
builder.setDrawFaces( EnumSet.of( facing ) );
|
||||
builder.addCube(
|
||||
DEFAULT_RENDER_MIN - xOffset, DEFAULT_RENDER_MIN - yOffset, DEFAULT_RENDER_MIN - zOffset,
|
||||
DEFAULT_RENDER_MAX + xOffset, DEFAULT_RENDER_MAX + yOffset, DEFAULT_RENDER_MAX + zOffset
|
||||
);
|
||||
DEFAULT_RENDER_MAX + xOffset, DEFAULT_RENDER_MAX + yOffset, DEFAULT_RENDER_MAX + zOffset );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
builder.setTexture( ringTexture );
|
||||
builder.setTexture( this.ringTexture );
|
||||
|
||||
builder.addCube( 0, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, 16, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX );
|
||||
|
||||
@@ -141,11 +143,12 @@ class QnbFormedBakedModel implements IBakedModel
|
||||
|
||||
if( formedState.isPowered() )
|
||||
{
|
||||
builder.setTexture( lightTexture );
|
||||
builder.setTexture( this.lightTexture );
|
||||
builder.setRenderFullBright( true );
|
||||
for( EnumFacing facing : EnumFacing.values() )
|
||||
{
|
||||
// Offset the face by a slight amount so that it is drawn over the already drawn ring texture (avoids z-fighting)
|
||||
// Offset the face by a slight amount so that it is drawn over the already drawn ring texture
|
||||
// (avoids z-fighting)
|
||||
float xOffset = Math.abs( facing.getFrontOffsetX() * 0.01f );
|
||||
float yOffset = Math.abs( facing.getFrontOffsetY() * 0.01f );
|
||||
float zOffset = Math.abs( facing.getFrontOffsetZ() * 0.01f );
|
||||
@@ -153,8 +156,7 @@ class QnbFormedBakedModel implements IBakedModel
|
||||
builder.setDrawFaces( EnumSet.of( facing ) );
|
||||
builder.addCube(
|
||||
-xOffset, -yOffset, -zOffset,
|
||||
16 + xOffset, 16 + yOffset, 16 + zOffset
|
||||
);
|
||||
16 + xOffset, 16 + yOffset, 16 + zOffset );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -201,7 +203,7 @@ class QnbFormedBakedModel implements IBakedModel
|
||||
@Override
|
||||
public boolean isAmbientOcclusion()
|
||||
{
|
||||
return baseModel.isAmbientOcclusion();
|
||||
return this.baseModel.isAmbientOcclusion();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -219,25 +221,24 @@ class QnbFormedBakedModel implements IBakedModel
|
||||
@Override
|
||||
public TextureAtlasSprite getParticleTexture()
|
||||
{
|
||||
return baseModel.getParticleTexture();
|
||||
return this.baseModel.getParticleTexture();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemCameraTransforms getItemCameraTransforms()
|
||||
{
|
||||
return baseModel.getItemCameraTransforms();
|
||||
return this.baseModel.getItemCameraTransforms();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemOverrideList getOverrides()
|
||||
{
|
||||
return baseModel.getOverrides();
|
||||
return this.baseModel.getOverrides();
|
||||
}
|
||||
|
||||
public static List<ResourceLocation> getRequiredTextures()
|
||||
{
|
||||
return ImmutableList.of(
|
||||
TEXTURE_LINK, TEXTURE_RING, TEXTURE_CABLE_GLASS, TEXTURE_COVERED_CABLE, TEXTURE_RING_LIGHT, TEXTURE_RING_LIGHT_CORNER
|
||||
);
|
||||
TEXTURE_LINK, TEXTURE_RING, TEXTURE_CABLE_GLASS, TEXTURE_COVERED_CABLE, TEXTURE_RING_LIGHT, TEXTURE_RING_LIGHT_CORNER );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
|
||||
package appeng.block.qnb;
|
||||
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
@@ -38,7 +39,7 @@ public class QnbFormedModel implements IModel
|
||||
@Override
|
||||
public IBakedModel bake( IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter )
|
||||
{
|
||||
IBakedModel ringModel = getBaseModel( MODEL_RING, state, format, bakedTextureGetter );
|
||||
IBakedModel ringModel = this.getBaseModel( MODEL_RING, state, format, bakedTextureGetter );
|
||||
return new QnbFormedBakedModel( format, ringModel, bakedTextureGetter );
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package appeng.block.qnb;
|
||||
|
||||
|
||||
@@ -24,17 +25,17 @@ public class QnbFormedState
|
||||
|
||||
public Set<EnumFacing> getAdjacentQuantumBridges()
|
||||
{
|
||||
return adjacentQuantumBridges;
|
||||
return this.adjacentQuantumBridges;
|
||||
}
|
||||
|
||||
public boolean isCorner()
|
||||
{
|
||||
return corner;
|
||||
return this.corner;
|
||||
}
|
||||
|
||||
public boolean isPowered()
|
||||
{
|
||||
return powered;
|
||||
return this.powered;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package appeng.block.qnb;
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package appeng.block.qnb;
|
||||
|
||||
|
||||
@@ -18,6 +19,6 @@ public class QuantumBridgeRendering extends BlockRenderingCustomizer
|
||||
{
|
||||
rendering.builtInModel( "models/block/qnb/qnb_formed", new QnbFormedModel() );
|
||||
// Disable auto rotation
|
||||
rendering.modelCustomizer( (location, model) -> model );
|
||||
rendering.modelCustomizer( ( location, model ) -> model );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,8 +26,8 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.Explosion;
|
||||
@@ -39,6 +39,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.helpers.ICustomCollision;
|
||||
|
||||
|
||||
public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision
|
||||
{
|
||||
|
||||
@@ -53,7 +54,7 @@ public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
|
||||
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@@ -37,19 +37,19 @@ import appeng.core.sync.GuiBridge;
|
||||
import appeng.tile.spatial.TileSpatialIOPort;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockSpatialIOPort extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
public BlockSpatialIOPort()
|
||||
{
|
||||
super( Material.IRON );
|
||||
this.setTileEntity( TileSpatialIOPort.class );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
|
||||
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
|
||||
{
|
||||
final TileSpatialIOPort te = this.getTileEntity( w, pos );
|
||||
final TileSpatialIOPort te = this.getTileEntity( world, pos );
|
||||
if( te != null )
|
||||
{
|
||||
te.updateRedstoneState();
|
||||
|
||||
@@ -44,13 +44,12 @@ public class BlockSpatialPylon extends AEBaseTileBlock
|
||||
public BlockSpatialPylon()
|
||||
{
|
||||
super( AEGlassMaterial.INSTANCE );
|
||||
this.setTileEntity( TileSpatialPylon.class );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
return new ExtendedBlockState( this, getAEStates(), new IUnlistedProperty[] { STATE } );
|
||||
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] { STATE } );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -58,13 +57,13 @@ public class BlockSpatialPylon extends AEBaseTileBlock
|
||||
{
|
||||
IExtendedBlockState extState = (IExtendedBlockState) state;
|
||||
|
||||
return extState.withProperty( STATE, getDisplayState( world, pos ) );
|
||||
return extState.withProperty( STATE, this.getDisplayState( world, pos ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
|
||||
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
|
||||
{
|
||||
final TileSpatialPylon tsp = this.getTileEntity( w, pos );
|
||||
final TileSpatialPylon tsp = this.getTileEntity( world, pos );
|
||||
if( tsp != null )
|
||||
{
|
||||
tsp.neighborChanged();
|
||||
@@ -84,7 +83,7 @@ public class BlockSpatialPylon extends AEBaseTileBlock
|
||||
|
||||
private int getDisplayState( IBlockAccess world, BlockPos pos )
|
||||
{
|
||||
TileSpatialPylon te = getTileEntity( world, pos );
|
||||
TileSpatialPylon te = this.getTileEntity( world, pos );
|
||||
|
||||
if( te == null )
|
||||
{
|
||||
|
||||
@@ -52,8 +52,7 @@ public class BlockChest extends AEBaseTileBlock
|
||||
public BlockChest()
|
||||
{
|
||||
super( Material.IRON );
|
||||
this.setTileEntity( TileChest.class );
|
||||
this.setDefaultState( getDefaultState().withProperty( SLOT_STATE, DriveSlotState.EMPTY ) );
|
||||
this.setDefaultState( this.getDefaultState().withProperty( SLOT_STATE, DriveSlotState.EMPTY ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -73,7 +72,7 @@ public class BlockChest extends AEBaseTileBlock
|
||||
{
|
||||
DriveSlotState slotState = DriveSlotState.EMPTY;
|
||||
|
||||
TileChest te = getTileEntity( worldIn, pos );
|
||||
TileChest te = this.getTileEntity( worldIn, pos );
|
||||
|
||||
if( te != null )
|
||||
{
|
||||
@@ -109,8 +108,8 @@ public class BlockChest extends AEBaseTileBlock
|
||||
}
|
||||
else
|
||||
{
|
||||
final ItemStack cell = tg.getStackInSlot( 1 );
|
||||
if( cell != null )
|
||||
final ItemStack cell = tg.getCell();
|
||||
if( !cell.isEmpty() )
|
||||
{
|
||||
final ICellHandler ch = AEApi.instance().registries().cell().getHandler( cell );
|
||||
|
||||
@@ -118,7 +117,7 @@ public class BlockChest extends AEBaseTileBlock
|
||||
}
|
||||
else
|
||||
{
|
||||
p.addChatMessage( PlayerMessages.ChestCannotReadStorageCell.get() );
|
||||
p.sendMessage( PlayerMessages.ChestCannotReadStorageCell.get() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,12 +47,11 @@ import appeng.util.Platform;
|
||||
public class BlockDrive extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
public static final UnlistedProperty<DriveSlotsState> SLOTS_STATE = new UnlistedProperty<>("drive_slots_state", DriveSlotsState.class);
|
||||
public static final UnlistedProperty<DriveSlotsState> SLOTS_STATE = new UnlistedProperty<>( "drive_slots_state", DriveSlotsState.class );
|
||||
|
||||
public BlockDrive()
|
||||
{
|
||||
super( Material.IRON );
|
||||
this.setTileEntity( TileDrive.class );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -64,7 +63,7 @@ public class BlockDrive extends AEBaseTileBlock
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
return new ExtendedBlockState( this, getAEStates(), new IUnlistedProperty[] {
|
||||
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] {
|
||||
SLOTS_STATE,
|
||||
FORWARD,
|
||||
UP
|
||||
@@ -74,7 +73,7 @@ public class BlockDrive extends AEBaseTileBlock
|
||||
@Override
|
||||
public IBlockState getExtendedState( IBlockState state, IBlockAccess world, BlockPos pos )
|
||||
{
|
||||
TileDrive te = getTileEntity( world, pos );
|
||||
TileDrive te = this.getTileEntity( world, pos );
|
||||
if( te == null )
|
||||
{
|
||||
return super.getExtendedState( state, world, pos );
|
||||
|
||||
@@ -44,13 +44,12 @@ public class BlockIOPort extends AEBaseTileBlock
|
||||
public BlockIOPort()
|
||||
{
|
||||
super( Material.IRON );
|
||||
this.setTileEntity( TileIOPort.class );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
|
||||
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
|
||||
{
|
||||
final TileIOPort te = this.getTileEntity( w, pos );
|
||||
final TileIOPort te = this.getTileEntity( world, pos );
|
||||
if( te != null )
|
||||
{
|
||||
te.updateRedstoneState();
|
||||
|
||||
@@ -47,6 +47,10 @@ import appeng.util.Platform;
|
||||
public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
|
||||
{
|
||||
|
||||
private static final double AABB_OFFSET_BOTTOM = .0625d;
|
||||
private static final double AABB_OFFSET_SIDES = 0;
|
||||
private static final double AABB_OFFSET_TOP = .125d;
|
||||
|
||||
public enum SkyChestType
|
||||
{
|
||||
STONE, BLOCK
|
||||
@@ -57,7 +61,6 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
|
||||
public BlockSkyChest( final SkyChestType type )
|
||||
{
|
||||
super( Material.ROCK );
|
||||
this.setTileEntity( TileSkyChest.class );
|
||||
this.setOpaque( this.setFullSize( false ) );
|
||||
this.lightOpacity = 0;
|
||||
this.setHardness( 50 );
|
||||
@@ -71,7 +74,6 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
|
||||
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onActivated( final World w, final BlockPos pos, final EntityPlayer player, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
@@ -85,6 +87,21 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
|
||||
|
||||
@Override
|
||||
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final BlockPos pos, final Entity thePlayer, final boolean b )
|
||||
{
|
||||
final AxisAlignedBB aabb = this.computeAABB( w, pos );
|
||||
|
||||
return Collections.singletonList( aabb );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
|
||||
{
|
||||
final AxisAlignedBB aabb = this.computeAABB( w, pos );
|
||||
|
||||
out.add( aabb );
|
||||
}
|
||||
|
||||
private AxisAlignedBB computeAABB( final World w, final BlockPos pos )
|
||||
{
|
||||
final TileSkyChest sk = this.getTileEntity( w, pos );
|
||||
EnumFacing o = EnumFacing.UP;
|
||||
@@ -94,17 +111,19 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
|
||||
o = sk.getUp();
|
||||
}
|
||||
|
||||
final double offsetX = o.getFrontOffsetX() == 0 ? 0.06 : 0.0;
|
||||
final double offsetY = o.getFrontOffsetY() == 0 ? 0.06 : 0.0;
|
||||
final double offsetZ = o.getFrontOffsetZ() == 0 ? 0.06 : 0.0;
|
||||
final double offsetX = o.getFrontOffsetX() == 0 ? AABB_OFFSET_BOTTOM : AABB_OFFSET_SIDES;
|
||||
final double offsetY = o.getFrontOffsetY() == 0 ? AABB_OFFSET_BOTTOM : AABB_OFFSET_SIDES;
|
||||
final double offsetZ = o.getFrontOffsetZ() == 0 ? AABB_OFFSET_BOTTOM : AABB_OFFSET_SIDES;
|
||||
|
||||
final double sc = 0.06;
|
||||
return Collections.singletonList( new AxisAlignedBB( Math.max( 0.0, offsetX - o.getFrontOffsetX() * sc ), Math.max( 0.0, offsetY - o.getFrontOffsetY() * sc ), Math.max( 0.0, offsetZ - o.getFrontOffsetZ() * sc ), Math.min( 1.0, ( 1.0 - offsetX ) - o.getFrontOffsetX() * sc ), Math.min( 1.0, ( 1.0 - offsetY ) - o.getFrontOffsetY() * sc ), Math.min( 1.0, ( 1.0 - offsetZ ) - o.getFrontOffsetZ() * sc ) ) );
|
||||
}
|
||||
// x/z needs to be multiplied by -1, thus we simply add not substract.
|
||||
final double minX = Math.max( 0.0, offsetX + o.getFrontOffsetX() * AABB_OFFSET_TOP );
|
||||
final double minY = Math.max( 0.0, offsetY - o.getFrontOffsetY() * AABB_OFFSET_TOP );
|
||||
final double minZ = Math.max( 0.0, offsetZ + o.getFrontOffsetZ() * AABB_OFFSET_TOP );
|
||||
|
||||
@Override
|
||||
public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
|
||||
{
|
||||
out.add( new AxisAlignedBB( 0.05, 0.05, 0.05, 0.95, 0.95, 0.95 ) );
|
||||
final double maxX = Math.min( 1.0, ( 1.0 - offsetX ) + o.getFrontOffsetX() * AABB_OFFSET_TOP );
|
||||
final double maxY = Math.min( 1.0, ( 1.0 - offsetY ) - o.getFrontOffsetY() * AABB_OFFSET_TOP );
|
||||
final double maxZ = Math.min( 1.0, ( 1.0 - offsetZ ) + o.getFrontOffsetZ() * AABB_OFFSET_TOP );
|
||||
|
||||
return new AxisAlignedBB( minX, minY, minZ, maxX, maxY, maxZ );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public enum DriveSlotState implements IStringSerializable
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public static DriveSlotState fromCellStatus( int cellStatus )
|
||||
|
||||
@@ -37,16 +37,16 @@ public class DriveSlotsState
|
||||
|
||||
public DriveSlotState getState( int index )
|
||||
{
|
||||
if( index >= slots.length )
|
||||
if( index >= this.slots.length )
|
||||
{
|
||||
return DriveSlotState.EMPTY;
|
||||
}
|
||||
return slots[index];
|
||||
return this.slots[index];
|
||||
}
|
||||
|
||||
public int getSlotCount()
|
||||
{
|
||||
return slots.length;
|
||||
return this.slots.length;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -46,7 +46,7 @@ public class SkyChestRenderingCustomizer extends BlockRenderingCustomizer
|
||||
rendering.tesr( new SkyChestTESR() );
|
||||
|
||||
// Register a custom non-tesr item model
|
||||
String modelName = getModelFromType();
|
||||
String modelName = this.getModelFromType();
|
||||
ModelResourceLocation model = new ModelResourceLocation( "appliedenergistics2:" + modelName, "inventory" );
|
||||
itemRendering.model( model ).variants( model );
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public class SkyChestRenderingCustomizer extends BlockRenderingCustomizer
|
||||
private String getModelFromType()
|
||||
{
|
||||
final String modelName;
|
||||
switch( type )
|
||||
switch( this.type )
|
||||
{
|
||||
default:
|
||||
case STONE:
|
||||
|
||||
@@ -23,9 +23,10 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -34,7 +35,6 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -42,6 +42,10 @@ import appeng.api.definitions.IBlockDefinition;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEBaseItemBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.bootstrap.components.IBlockRegistrationComponent;
|
||||
import appeng.bootstrap.components.IItemRegistrationComponent;
|
||||
import appeng.bootstrap.components.IPreInitComponent;
|
||||
import appeng.bootstrap.definitions.TileEntityDefinition;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.CreativeTab;
|
||||
@@ -63,16 +67,14 @@ class BlockDefinitionBuilder implements IBlockBuilder
|
||||
|
||||
private final Supplier<? extends Block> blockSupplier;
|
||||
|
||||
private final List<BiConsumer<Block, Item>> preInitCallbacks = new ArrayList<>();
|
||||
|
||||
private final List<BiConsumer<Block, Item>> initCallbacks = new ArrayList<>();
|
||||
|
||||
private final List<BiConsumer<Block, Item>> postInitCallbacks = new ArrayList<>();
|
||||
private final List<BiFunction<Block, Item, IBootstrapComponent>> bootstrapComponents = new ArrayList<>();
|
||||
|
||||
private final EnumSet<AEFeature> features = EnumSet.noneOf( AEFeature.class );
|
||||
|
||||
private CreativeTabs creativeTab = CreativeTab.instance;
|
||||
|
||||
private TileEntityDefinition tileEntityDefinition;
|
||||
|
||||
private boolean disableItem = false;
|
||||
|
||||
private Function<Block, ItemBlock> itemFactory;
|
||||
@@ -91,29 +93,15 @@ class BlockDefinitionBuilder implements IBlockBuilder
|
||||
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
blockRendering = new BlockRendering();
|
||||
itemRendering = new ItemRendering();
|
||||
this.blockRendering = new BlockRendering();
|
||||
this.itemRendering = new ItemRendering();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockDefinitionBuilder preInit( BiConsumer<Block, Item> callback )
|
||||
public BlockDefinitionBuilder bootstrap( BiFunction<Block, Item, IBootstrapComponent> callback )
|
||||
{
|
||||
preInitCallbacks.add( callback );
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockDefinitionBuilder init( BiConsumer<Block, Item> callback )
|
||||
{
|
||||
initCallbacks.add( callback );
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockDefinitionBuilder postInit( BiConsumer<Block, Item> callback )
|
||||
{
|
||||
postInitCallbacks.add( callback );
|
||||
this.bootstrapComponents.add( callback );
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -121,7 +109,7 @@ class BlockDefinitionBuilder implements IBlockBuilder
|
||||
public IBlockBuilder features( AEFeature... features )
|
||||
{
|
||||
this.features.clear();
|
||||
addFeatures( features );
|
||||
this.addFeatures( features );
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -137,22 +125,29 @@ class BlockDefinitionBuilder implements IBlockBuilder
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
customizeForClient( callback );
|
||||
this.customizeForClient( callback );
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockBuilder tileEntity( TileEntityDefinition tileEntityDefinition )
|
||||
{
|
||||
this.tileEntityDefinition = tileEntityDefinition;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockBuilder useCustomItemModel()
|
||||
{
|
||||
rendering( new BlockRenderingCustomizer()
|
||||
this.rendering( new BlockRenderingCustomizer()
|
||||
{
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void customize( IBlockRendering rendering, IItemRendering itemRendering )
|
||||
{
|
||||
ModelResourceLocation model = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, registryName ), "inventory" );
|
||||
ModelResourceLocation model = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, BlockDefinitionBuilder.this.registryName ), "inventory" );
|
||||
itemRendering.model( model ).variants( model );
|
||||
}
|
||||
} );
|
||||
@@ -177,94 +172,102 @@ class BlockDefinitionBuilder implements IBlockBuilder
|
||||
@SideOnly( Side.CLIENT )
|
||||
private void customizeForClient( BlockRenderingCustomizer callback )
|
||||
{
|
||||
callback.customize( blockRendering, itemRendering );
|
||||
callback.customize( this.blockRendering, this.itemRendering );
|
||||
}
|
||||
|
||||
@SuppressWarnings( "unchecked" )
|
||||
@Override
|
||||
public <T extends IBlockDefinition> T build()
|
||||
{
|
||||
if( !AEConfig.instance.areFeaturesEnabled( features ) )
|
||||
if( !AEConfig.instance().areFeaturesEnabled( this.features ) )
|
||||
{
|
||||
return (T) new TileDefinition( registryName, null, null );
|
||||
return (T) new TileDefinition( this.registryName, null, null );
|
||||
}
|
||||
|
||||
// Create block and matching item, and set factory name of both
|
||||
Block block = blockSupplier.get();
|
||||
block.setRegistryName( AppEng.MOD_ID, registryName );
|
||||
Block block = this.blockSupplier.get();
|
||||
block.setRegistryName( AppEng.MOD_ID, this.registryName );
|
||||
block.setUnlocalizedName( "appliedenergistics2." + this.registryName );
|
||||
|
||||
ItemBlock item = constructItemFromBlock( block );
|
||||
ItemBlock item = this.constructItemFromBlock( block );
|
||||
if( item != null )
|
||||
{
|
||||
item.setRegistryName( AppEng.MOD_ID, registryName );
|
||||
item.setRegistryName( AppEng.MOD_ID, this.registryName );
|
||||
}
|
||||
|
||||
// Register the item and block with the game
|
||||
factory.addPreInit( side -> {
|
||||
GameRegistry.register( block );
|
||||
if( item != null )
|
||||
{
|
||||
GameRegistry.register( item );
|
||||
}
|
||||
} );
|
||||
this.factory.addBootstrapComponent( (IBlockRegistrationComponent) ( side, registry ) -> registry.register( block ) );
|
||||
if( item != null )
|
||||
{
|
||||
this.factory.addBootstrapComponent( (IItemRegistrationComponent) ( side, registry ) -> registry.register( item ) );
|
||||
}
|
||||
|
||||
block.setCreativeTab( creativeTab );
|
||||
block.setUnlocalizedName( "appliedenergistics2." + registryName );
|
||||
block.setCreativeTab( this.creativeTab );
|
||||
|
||||
// Register all extra handlers
|
||||
preInitCallbacks.forEach( consumer -> factory.addPreInit( side -> consumer.accept( block, item ) ) );
|
||||
initCallbacks.forEach( consumer -> factory.addInit( side -> consumer.accept( block, item ) ) );
|
||||
postInitCallbacks.forEach( consumer -> factory.addPostInit( side -> consumer.accept( block, item ) ) );
|
||||
this.bootstrapComponents.forEach( component -> this.factory.addBootstrapComponent( component.apply( block, item ) ) );
|
||||
|
||||
if( this.tileEntityDefinition != null && block instanceof AEBaseTileBlock )
|
||||
{
|
||||
( (AEBaseTileBlock) block ).setTileEntity( this.tileEntityDefinition.getTileEntityClass() );
|
||||
if( this.tileEntityDefinition.getName() == null )
|
||||
{
|
||||
this.tileEntityDefinition.setName( this.registryName );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
if( block instanceof AEBaseTileBlock )
|
||||
{
|
||||
AEBaseTileBlock tileBlock = (AEBaseTileBlock) block;
|
||||
blockRendering.apply( factory, block, tileBlock.getTileEntityClass() );
|
||||
this.blockRendering.apply( this.factory, block, tileBlock.getTileEntityClass() );
|
||||
}
|
||||
else
|
||||
{
|
||||
blockRendering.apply( factory, block, null );
|
||||
this.blockRendering.apply( this.factory, block, null );
|
||||
}
|
||||
|
||||
if( item != null )
|
||||
{
|
||||
itemRendering.apply( factory, item );
|
||||
this.itemRendering.apply( this.factory, item );
|
||||
}
|
||||
}
|
||||
|
||||
if( block instanceof AEBaseTileBlock )
|
||||
{
|
||||
AEBaseTileBlock tileBlock = (AEBaseTileBlock) block;
|
||||
|
||||
factory.addPreInit( side -> {
|
||||
Class<? extends AEBaseTile> tileEntityClass = tileBlock.getTileEntityClass();
|
||||
AEBaseTile.registerTileItem( tileEntityClass, new BlockStackSrc( block, 0, ActivityState.Enabled ) );
|
||||
|
||||
// TODO: Change after transition phase
|
||||
GameRegistry.registerTileEntityWithAlternatives( tileEntityClass, AppEng.MOD_ID.toLowerCase() + ":" + registryName, registryName );
|
||||
this.factory.addBootstrapComponent( (IPreInitComponent) side ->
|
||||
{
|
||||
AEBaseTile.registerTileItem(
|
||||
this.tileEntityDefinition == null ? ( (AEBaseTileBlock) block ).getTileEntityClass() : this.tileEntityDefinition.getTileEntityClass(),
|
||||
new BlockStackSrc( block, 0, ActivityState.Enabled ) );
|
||||
} );
|
||||
|
||||
return (T) new TileDefinition( registryName, (AEBaseTileBlock) block, item );
|
||||
if( this.tileEntityDefinition != null )
|
||||
{
|
||||
this.factory.tileEntityComponent.addTileEntity( this.tileEntityDefinition );
|
||||
}
|
||||
|
||||
return (T) new TileDefinition( this.registryName, (AEBaseTileBlock) block, item );
|
||||
}
|
||||
else
|
||||
{
|
||||
return (T) new BlockDefinition( registryName, block, item );
|
||||
return (T) new BlockDefinition( this.registryName, block, item );
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private ItemBlock constructItemFromBlock( Block block )
|
||||
{
|
||||
if( disableItem )
|
||||
if( this.disableItem )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if( itemFactory != null )
|
||||
if( this.itemFactory != null )
|
||||
{
|
||||
return itemFactory.apply( block );
|
||||
return this.itemFactory.apply( block );
|
||||
}
|
||||
else if( block instanceof AEBaseBlock )
|
||||
{
|
||||
|
||||
@@ -62,7 +62,7 @@ class BlockRendering implements IBlockRendering
|
||||
@SideOnly( Side.CLIENT )
|
||||
public IBlockRendering modelCustomizer( BiFunction<ModelResourceLocation, IBakedModel, IBakedModel> customizer )
|
||||
{
|
||||
modelCustomizer = customizer;
|
||||
this.modelCustomizer = customizer;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -99,36 +99,37 @@ class BlockRendering implements IBlockRendering
|
||||
|
||||
void apply( FeatureFactory factory, Block block, Class<?> tileEntityClass )
|
||||
{
|
||||
if( tesr != null )
|
||||
if( this.tesr != null )
|
||||
{
|
||||
if( tileEntityClass == null )
|
||||
{
|
||||
throw new IllegalStateException( "Tried to register a TESR for " + block + " even though no tile entity has been specified." );
|
||||
}
|
||||
factory.addBootstrapComponent( new TesrComponent( tileEntityClass, tesr ) );
|
||||
factory.addBootstrapComponent( new TesrComponent( tileEntityClass, this.tesr ) );
|
||||
}
|
||||
|
||||
if( modelCustomizer != null )
|
||||
if( this.modelCustomizer != null )
|
||||
{
|
||||
factory.modelOverrideComponent.addOverride( block.getRegistryName().getResourcePath(), modelCustomizer );
|
||||
factory.addModelOverride( block.getRegistryName().getResourcePath(), this.modelCustomizer );
|
||||
}
|
||||
else if( block instanceof AEBaseTileBlock )
|
||||
{
|
||||
// This is a default rotating model if the base-block uses an AE tile entity which exposes UP/FRONT as
|
||||
// extended props
|
||||
factory.modelOverrideComponent.addOverride( block.getRegistryName().getResourcePath(), ( l, m ) -> new AutoRotatingModel( m ) );
|
||||
factory.addModelOverride( block.getRegistryName().getResourcePath(), ( l, m ) -> new AutoRotatingModel( m ) );
|
||||
}
|
||||
|
||||
builtInModels.forEach( factory::addBuiltInModel );
|
||||
// TODO : 1.12
|
||||
this.builtInModels.forEach( factory::addBuiltInModel );
|
||||
|
||||
if( blockColor != null )
|
||||
if( this.blockColor != null )
|
||||
{
|
||||
factory.addBootstrapComponent( new BlockColorComponent( block, blockColor ) );
|
||||
factory.addBootstrapComponent( new BlockColorComponent( block, this.blockColor ) );
|
||||
}
|
||||
|
||||
if( stateMapper != null )
|
||||
if( this.stateMapper != null )
|
||||
{
|
||||
factory.addBootstrapComponent( new StateMapperComponent( block, stateMapper ) );
|
||||
factory.addBootstrapComponent( new StateMapperComponent( block, this.stateMapper ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,10 +20,18 @@ package appeng.bootstrap;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraftforge.client.model.IModel;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
@@ -33,10 +41,8 @@ import appeng.api.definitions.IItemDefinition;
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.api.util.AEColoredItemDefinition;
|
||||
import appeng.bootstrap.components.BuiltInModelComponent;
|
||||
import appeng.bootstrap.components.InitComponent;
|
||||
import appeng.bootstrap.components.ModelOverrideComponent;
|
||||
import appeng.bootstrap.components.PostInitComponent;
|
||||
import appeng.bootstrap.components.PreInitComponent;
|
||||
import appeng.bootstrap.components.TileEntityComponent;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.features.ActivityState;
|
||||
import appeng.core.features.ColoredItemDefinition;
|
||||
@@ -49,26 +55,31 @@ public class FeatureFactory
|
||||
|
||||
private final AEFeature[] defaultFeatures;
|
||||
|
||||
private final List<IBootstrapComponent> bootstrapComponents;
|
||||
private final Map<Class<? extends IBootstrapComponent>, List<IBootstrapComponent>> bootstrapComponents;
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
ModelOverrideComponent modelOverrideComponent;
|
||||
private ModelOverrideComponent modelOverrideComponent;
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
private BuiltInModelComponent builtInModelComponent;
|
||||
|
||||
public final TileEntityComponent tileEntityComponent;
|
||||
|
||||
public FeatureFactory()
|
||||
{
|
||||
this.defaultFeatures = new AEFeature[] { AEFeature.Core };
|
||||
this.bootstrapComponents = new ArrayList<>();
|
||||
this.defaultFeatures = new AEFeature[] { AEFeature.CORE };
|
||||
this.bootstrapComponents = new HashMap<>();
|
||||
|
||||
this.tileEntityComponent = new TileEntityComponent();
|
||||
this.addBootstrapComponent( this.tileEntityComponent );
|
||||
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
modelOverrideComponent = new ModelOverrideComponent();
|
||||
bootstrapComponents.add( modelOverrideComponent );
|
||||
this.modelOverrideComponent = new ModelOverrideComponent();
|
||||
this.addBootstrapComponent( this.modelOverrideComponent );
|
||||
|
||||
builtInModelComponent = new BuiltInModelComponent();
|
||||
bootstrapComponents.add( builtInModelComponent );
|
||||
this.builtInModelComponent = new BuiltInModelComponent();
|
||||
this.addBootstrapComponent( this.builtInModelComponent );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,6 +87,7 @@ public class FeatureFactory
|
||||
{
|
||||
this.defaultFeatures = defaultFeatures.clone();
|
||||
this.bootstrapComponents = parent.bootstrapComponents;
|
||||
this.tileEntityComponent = parent.tileEntityComponent;
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
this.modelOverrideComponent = parent.modelOverrideComponent;
|
||||
@@ -85,19 +97,20 @@ public class FeatureFactory
|
||||
|
||||
public IBlockBuilder block( String id, Supplier<Block> block )
|
||||
{
|
||||
return new BlockDefinitionBuilder( this, id, block ).features( defaultFeatures );
|
||||
return new BlockDefinitionBuilder( this, id, block ).features( this.defaultFeatures );
|
||||
}
|
||||
|
||||
public IItemBuilder item( String id, Supplier<Item> item )
|
||||
{
|
||||
return new ItemDefinitionBuilder( this, id, item ).features( defaultFeatures );
|
||||
return new ItemDefinitionBuilder( this, id, item ).features( this.defaultFeatures );
|
||||
}
|
||||
|
||||
public AEColoredItemDefinition colored( IItemDefinition target, int offset )
|
||||
{
|
||||
ColoredItemDefinition definition = new ColoredItemDefinition();
|
||||
|
||||
target.maybeItem().ifPresent( targetItem -> {
|
||||
target.maybeItem().ifPresent( targetItem ->
|
||||
{
|
||||
for( final AEColor color : AEColor.VALID_COLORS )
|
||||
{
|
||||
final ActivityState state = ActivityState.from( target.isEnabled() );
|
||||
@@ -114,34 +127,32 @@ public class FeatureFactory
|
||||
return new FeatureFactory( this, features );
|
||||
}
|
||||
|
||||
void addBootstrapComponent( IBootstrapComponent component )
|
||||
public void addBootstrapComponent( IBootstrapComponent component )
|
||||
{
|
||||
this.bootstrapComponents.add( component );
|
||||
Arrays.stream( component.getClass().getInterfaces() )
|
||||
.filter( i -> IBootstrapComponent.class.isAssignableFrom( i ) )
|
||||
.forEach( i -> this.addBootstrapComponent( (Class<? extends IBootstrapComponent>) i, component ) );
|
||||
}
|
||||
|
||||
void addPreInit( PreInitComponent component )
|
||||
private <T extends IBootstrapComponent> void addBootstrapComponent( Class<? extends IBootstrapComponent> eventType, T component )
|
||||
{
|
||||
this.bootstrapComponents.add( component );
|
||||
}
|
||||
|
||||
void addInit( InitComponent component )
|
||||
{
|
||||
this.bootstrapComponents.add( component );
|
||||
}
|
||||
|
||||
void addPostInit( PostInitComponent component )
|
||||
{
|
||||
this.bootstrapComponents.add( component );
|
||||
bootstrapComponents.computeIfAbsent( eventType, c -> new ArrayList<IBootstrapComponent>() ).add( component );
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
void addBuiltInModel( String path, IModel model )
|
||||
{
|
||||
builtInModelComponent.addModel( path, model );
|
||||
this.builtInModelComponent.addModel( path, model );
|
||||
}
|
||||
|
||||
public List<IBootstrapComponent> getBootstrapComponents()
|
||||
@SideOnly( Side.CLIENT )
|
||||
void addModelOverride( String resourcePath, BiFunction<ModelResourceLocation, IBakedModel, IBakedModel> customizer )
|
||||
{
|
||||
return bootstrapComponents;
|
||||
this.modelOverrideComponent.addOverride( resourcePath, customizer );
|
||||
}
|
||||
|
||||
public <T extends IBootstrapComponent> Iterator<T> getBootstrapComponents( Class<T> eventType )
|
||||
{
|
||||
return (Iterator<T>) this.bootstrapComponents.getOrDefault( eventType, Collections.emptyList() ).iterator();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package appeng.bootstrap;
|
||||
|
||||
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Function;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -27,17 +27,13 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
|
||||
import appeng.api.definitions.IBlockDefinition;
|
||||
import appeng.bootstrap.definitions.TileEntityDefinition;
|
||||
import appeng.core.features.AEFeature;
|
||||
|
||||
|
||||
public interface IBlockBuilder
|
||||
{
|
||||
|
||||
IBlockBuilder preInit( BiConsumer<Block, Item> callback );
|
||||
|
||||
IBlockBuilder init( BiConsumer<Block, Item> callback );
|
||||
|
||||
IBlockBuilder postInit( BiConsumer<Block, Item> callback );
|
||||
IBlockBuilder bootstrap( BiFunction<Block, Item, IBootstrapComponent> component );
|
||||
|
||||
IBlockBuilder features( AEFeature... features );
|
||||
|
||||
@@ -45,6 +41,8 @@ public interface IBlockBuilder
|
||||
|
||||
IBlockBuilder rendering( BlockRenderingCustomizer callback );
|
||||
|
||||
IBlockBuilder tileEntity( TileEntityDefinition tileEntityDefinition );
|
||||
|
||||
/**
|
||||
* Don't register an item for this block.
|
||||
*/
|
||||
|
||||
@@ -19,24 +19,10 @@
|
||||
package appeng.bootstrap;
|
||||
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
|
||||
/**
|
||||
* Bootstrap components can be registered to take part in the various initialization phases of Forge.
|
||||
* See the individual subclasses for a specific forge initalization event.
|
||||
*/
|
||||
public interface IBootstrapComponent
|
||||
{
|
||||
|
||||
default void preInitialize( Side side )
|
||||
{
|
||||
}
|
||||
|
||||
default void initialize( Side side )
|
||||
{
|
||||
}
|
||||
|
||||
default void postInitialize( Side side )
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package appeng.bootstrap;
|
||||
|
||||
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -36,12 +36,7 @@ import appeng.core.features.ItemDefinition;
|
||||
*/
|
||||
public interface IItemBuilder
|
||||
{
|
||||
|
||||
IItemBuilder preInit( Consumer<Item> callback );
|
||||
|
||||
IItemBuilder init( Consumer<Item> callback );
|
||||
|
||||
IItemBuilder postInit( Consumer<Item> callback );
|
||||
IItemBuilder bootstrap( Function<Item, IBootstrapComponent> component );
|
||||
|
||||
IItemBuilder features( AEFeature... features );
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user