Compare commits
204 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1e15b23506 | |||
| 2ed7a5598a | |||
| 1c05dd5834 | |||
| 632d124359 | |||
| 829c18e2bb | |||
| d3a5be7ed6 | |||
| 217cbf0982 | |||
| 4dd0a4cd96 | |||
| 54c0ce43ea | |||
| bd8f43acbf | |||
| 970630a90d | |||
| 771a944058 | |||
| db1cd8c312 | |||
| 375e1efb15 | |||
| 955fcac92a | |||
| 216e2cb1e3 | |||
| 53f5724657 | |||
| a3269826f9 | |||
| 1a918be658 | |||
| 90130e72aa | |||
| c8f10d92bb | |||
| 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 |
+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
|
||||
@@ -110,7 +106,7 @@ Providing as many details as possible does help us to find and resolve the issue
|
||||
Before you want to add major changes, you might want to discuss them with us first, before wasting your time.
|
||||
If you are still willing to contribute to this project, you can contribute via [Pull-Request](https://help.github.com/articles/creating-a-pull-request).
|
||||
|
||||
The [guidelines for contributing](https://github.com/AppliedEnergistics/Applied-Energistics-2/blob/master/CONTRIBUTING.md) contain more detailed information about topics like the used code style and should also be considered.
|
||||
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
|
||||
|
||||
|
||||
+7
-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,6 @@ archivesBaseName = aebasename
|
||||
// Add Coremod Manifest
|
||||
jar {
|
||||
manifest {
|
||||
attributes 'FMLCorePluginContainsFMLMod': 'true'
|
||||
attributes 'FMLAT': 'appeng_at.cfg'
|
||||
}
|
||||
|
||||
@@ -68,8 +73,6 @@ jar {
|
||||
}
|
||||
|
||||
minecraft {
|
||||
coreMod = "appeng.coremod.AppEngCore"
|
||||
|
||||
version = minecraft_version + "-" + forge_version
|
||||
|
||||
replaceIn "AEConfig.java"
|
||||
@@ -86,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
|
||||
|
||||
@@ -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
-9
@@ -1,4 +1,4 @@
|
||||
aeversion=rv4
|
||||
aeversion=rv5
|
||||
aechannel=alpha
|
||||
aebuild=0
|
||||
aegroup=appeng
|
||||
@@ -7,19 +7,25 @@ aebasename=appliedenergistics2
|
||||
#########################################################
|
||||
# Versions #
|
||||
#########################################################
|
||||
minecraft_version=1.10.2
|
||||
mcp_mappings=snapshot_20161111
|
||||
forge_version=12.18.3.2185
|
||||
minecraft_version=1.12.1
|
||||
mcp_mappings=snapshot_20170811
|
||||
forge_version=14.22.1.2478
|
||||
|
||||
#########################################################
|
||||
# Installable #
|
||||
#########################################################
|
||||
waila_version=1.7.0-B3_1.9.4
|
||||
hwyla_version=1.8.20-B35_1.12
|
||||
|
||||
#########################################################
|
||||
# Provided APIs #
|
||||
#########################################################
|
||||
jei_version=3.13.6.391
|
||||
tesla_version=1.10.2-1.2.1.50
|
||||
ic2_version=2.6.99-ex110
|
||||
top_version=1.10-1.3.3-41
|
||||
jei_version=4.7.8.95
|
||||
tesla_version=1.0.61
|
||||
ic2_version=2.8.19-ex112
|
||||
top_version=1.12-1.4.18-10
|
||||
|
||||
#########################################################
|
||||
# Deployment #
|
||||
#########################################################
|
||||
website_version=1.12.x
|
||||
curse_versions=1.12,1.12.1
|
||||
|
||||
@@ -39,10 +39,25 @@ repositories {
|
||||
url = "http://maven.ic2.player.to"
|
||||
}
|
||||
|
||||
maven {
|
||||
name = "CoFH Maven"
|
||||
url = "http://maven.covers1624.net"
|
||||
}
|
||||
|
||||
maven { // TheOneProbe
|
||||
name 'tterrag maven'
|
||||
url "http://maven.tterrag.com/"
|
||||
}
|
||||
|
||||
maven { // McJtyLib
|
||||
name 'mcjty'
|
||||
url "http://maven.k-4u.nl/"
|
||||
}
|
||||
|
||||
maven { // Hwyla
|
||||
name 'tehnut'
|
||||
url "http://tehnut.info/maven"
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
@@ -51,16 +66,16 @@ 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:${top_version}"
|
||||
mods "mcjty.theoneprobe:TheOneProbe-${minecraft_version}:${top_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-1.12:${tesla_version}"
|
||||
compileOnly "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
|
||||
compileOnly "mcjty.theoneprobe:TheOneProbe:${top_version}:api"
|
||||
compileOnly "mcjty.theoneprobe:TheOneProbe-1.12:${top_version}:api"
|
||||
|
||||
// at runtime, use the full JEI jar
|
||||
runtime "mezz.jei:jei_${minecraft_version}:${jei_version}"
|
||||
|
||||
@@ -20,15 +20,15 @@ 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")
|
||||
}
|
||||
|
||||
// IC2
|
||||
@@ -43,7 +43,7 @@ task deinstallIC2(type: Delete) {
|
||||
}
|
||||
|
||||
// TOP
|
||||
task installTop(type: Copy, dependsOn: "deinstallTop") {
|
||||
task installTop(type: Copy, dependsOn: ["deinstallTop"]) {
|
||||
from { configurations.mods }
|
||||
include "**/*TheOneProbe*.jar"
|
||||
into file(minecraft.runDir + "/mods")
|
||||
|
||||
+1
-1
@@ -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();
|
||||
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2013 AlgorithmX2
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package appeng.api.features;
|
||||
|
||||
|
||||
import javax.annotation.Nonnegative;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
|
||||
/**
|
||||
* Builder for a grinder recipe.
|
||||
*
|
||||
* The only default value provided are turns at a value of 8.
|
||||
*
|
||||
* @author yueh
|
||||
* @version rv5
|
||||
* @since rv5
|
||||
*/
|
||||
public interface IGrinderRecipeBuilder
|
||||
{
|
||||
|
||||
/**
|
||||
* Creates an grinder recipe with inputs.
|
||||
* Needs to be invoked.
|
||||
*
|
||||
* @param input new input for the recipe
|
||||
*
|
||||
* @return currently used builder
|
||||
*/
|
||||
@Nonnull
|
||||
IGrinderRecipeBuilder withInput( @Nonnull ItemStack input );
|
||||
|
||||
/**
|
||||
* Creates an grinder recipe with output.
|
||||
* Needs to be invoked.
|
||||
*
|
||||
* @param output new output for the recipe
|
||||
*
|
||||
* @return currently used builder
|
||||
*/
|
||||
@Nonnull
|
||||
IGrinderRecipeBuilder withOutput( @Nonnull ItemStack output );
|
||||
|
||||
/**
|
||||
* Creates an grinder recipe with the first optional output and its chance.
|
||||
*
|
||||
* @param optional new first optional for the recipe
|
||||
* @param chance chance for the first optional output, must be within 0.0 - 1.0
|
||||
*
|
||||
* @return currently used builder
|
||||
*/
|
||||
@Nonnull
|
||||
IGrinderRecipeBuilder withFirstOptional( @Nonnull ItemStack optional, float chance );
|
||||
|
||||
/**
|
||||
* Creates an grinder recipe with the second optional output and its chance.
|
||||
*
|
||||
* @param optional new second optional for the recipe
|
||||
* @param chance chance for the second optional output, must be within 0.0 - 1.0
|
||||
*
|
||||
* @return currently used builder
|
||||
*/
|
||||
@Nonnull
|
||||
IGrinderRecipeBuilder withSecondOptional( @Nonnull ItemStack optional, float chance );
|
||||
|
||||
/**
|
||||
* Creates an grinder recipe with the amount of turns as cost.
|
||||
*
|
||||
* Defaults to 8 when not called.
|
||||
*
|
||||
* @param turns new turns for the recipe, must be > 0
|
||||
*
|
||||
* @return currently used builder
|
||||
*/
|
||||
@Nonnull
|
||||
IGrinderRecipeBuilder withTurns( @Nonnegative int turns );
|
||||
|
||||
/**
|
||||
* Finalizes the process of making the recipe.
|
||||
* Needs to be invoked to fetch grinder recipe.
|
||||
*
|
||||
* @return valid grinder recipe
|
||||
*
|
||||
* @throws IllegalStateException when input is not defined
|
||||
* @throws IllegalStateException when input has no size
|
||||
* @throws IllegalStateException when output is not defined
|
||||
* @throws IllegalStateException when both optionals are not defined
|
||||
* @throws IllegalStateException when process type is not defined
|
||||
*/
|
||||
@Nonnull
|
||||
IGrinderRecipe build();
|
||||
}
|
||||
@@ -38,6 +38,14 @@ import net.minecraft.item.ItemStack;
|
||||
public interface IGrinderRegistry
|
||||
{
|
||||
|
||||
/**
|
||||
* Extensible way to create a grinder recipe.
|
||||
*
|
||||
* @return builder for grinder recipes
|
||||
*/
|
||||
@Nonnull
|
||||
IGrinderRecipeBuilder builder();
|
||||
|
||||
/**
|
||||
* An immutable list of the currently registered recipes.
|
||||
*
|
||||
@@ -47,44 +55,9 @@ public interface IGrinderRegistry
|
||||
Collection<IGrinderRecipe> getRecipes();
|
||||
|
||||
/**
|
||||
* Add a new recipe with a single input and output and how many turns it requires.
|
||||
*
|
||||
* Will ignore duplicate recipes with the same input item.
|
||||
*
|
||||
* @param in The {@link ItemStack} to grind.
|
||||
* @param out The {@link ItemStack} to output.
|
||||
* @param turns Amount of turns to turn the input into the output, with turns > 0.
|
||||
* Add a new recipe to the registry.
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* 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 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 output, with turns > 0.
|
||||
*
|
||||
*/
|
||||
void addRecipe( @Nonnull ItemStack in, @Nonnull ItemStack out, @Nonnull ItemStack optional, float chance, @Nonnull ItemStack optional2, float chance2, int turns );
|
||||
boolean addRecipe( IGrinderRecipe recipe );
|
||||
|
||||
/**
|
||||
* Remove the specific from the recipe list.
|
||||
|
||||
@@ -31,11 +31,19 @@ import net.minecraft.item.ItemStack;
|
||||
* Lets you manipulate Inscriber Recipes, by adding or editing existing ones.
|
||||
*
|
||||
* @author thatsIch
|
||||
* @version rv3
|
||||
* @version rv5
|
||||
* @since rv2
|
||||
*/
|
||||
public interface IInscriberRegistry
|
||||
{
|
||||
/**
|
||||
* Extensible way to create an inscriber recipe.
|
||||
*
|
||||
* @return builder for inscriber recipes
|
||||
*/
|
||||
@Nonnull
|
||||
IInscriberRecipeBuilder builder();
|
||||
|
||||
/**
|
||||
* An immutable copy of currently registered recipes.
|
||||
*
|
||||
@@ -65,29 +73,25 @@ public interface IInscriberRegistry
|
||||
@Nonnull
|
||||
Set<ItemStack> getInputs();
|
||||
|
||||
/**
|
||||
* Extensible way to create an inscriber recipe.
|
||||
*
|
||||
* @return builder for inscriber recipes
|
||||
*/
|
||||
@Nonnull
|
||||
IInscriberRecipeBuilder builder();
|
||||
|
||||
/**
|
||||
* add a new recipe the easy way, duplicates will not be added.
|
||||
* Added recipes will be automatically added to the optionals and inputs.
|
||||
*
|
||||
* @param recipe new recipe
|
||||
*
|
||||
* @return true, when successfully added
|
||||
*
|
||||
* @throws IllegalArgumentException if null is added
|
||||
*/
|
||||
void addRecipe( IInscriberRecipe recipe );
|
||||
boolean addRecipe( IInscriberRecipe recipe );
|
||||
|
||||
/**
|
||||
* Removes all equal recipes from the registry.
|
||||
*
|
||||
*
|
||||
* @param toBeRemovedRecipe to be removed recipe, can be null, makes just no sense.
|
||||
*
|
||||
* @return true, when successfully removed
|
||||
*/
|
||||
void removeRecipe( IInscriberRecipe toBeRemovedRecipe );
|
||||
boolean removeRecipe( IInscriberRecipe toBeRemovedRecipe );
|
||||
|
||||
}
|
||||
|
||||
@@ -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,7 +24,7 @@
|
||||
package appeng.api.networking.crafting;
|
||||
|
||||
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.networking.security.IActionSource;
|
||||
import appeng.api.networking.storage.IBaseMonitor;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
|
||||
@@ -40,7 +40,7 @@ public interface ICraftingCPU extends IBaseMonitor<IAEItemStack>
|
||||
/**
|
||||
* @return the action source for the CPU.
|
||||
*/
|
||||
BaseActionSource getActionSource();
|
||||
IActionSource getActionSource();
|
||||
|
||||
/**
|
||||
* @return the available storage in bytes
|
||||
|
||||
@@ -33,7 +33,7 @@ import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.networking.IGrid;
|
||||
import appeng.api.networking.IGridCache;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.networking.security.IActionSource;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ public interface ICraftingGrid extends IGridCache
|
||||
* @return a future which will at an undetermined point in the future get you the {@link ICraftingJob} do not wait
|
||||
* on this, your be waiting forever.
|
||||
*/
|
||||
Future<ICraftingJob> beginCraftingJob( World world, IGrid grid, BaseActionSource actionSrc, IAEItemStack craftWhat, ICraftingCallback callback );
|
||||
Future<ICraftingJob> beginCraftingJob( World world, IGrid grid, IActionSource actionSrc, IAEItemStack craftWhat, ICraftingCallback callback );
|
||||
|
||||
/**
|
||||
* Submit the job to the Crafting system for processing.
|
||||
@@ -82,7 +82,7 @@ public interface ICraftingGrid extends IGridCache
|
||||
* {@link ICraftingRequester} methods. if you send null, this object should be discarded after verifying the
|
||||
* return state.
|
||||
*/
|
||||
ICraftingLink submitJob( ICraftingJob job, ICraftingRequester requestingMachine, ICraftingCPU target, boolean prioritizePower, BaseActionSource src );
|
||||
ICraftingLink submitJob( ICraftingJob job, ICraftingRequester requestingMachine, ICraftingCPU target, boolean prioritizePower, IActionSource src );
|
||||
|
||||
/**
|
||||
* @return list of all the crafting cpus on the grid
|
||||
|
||||
@@ -29,16 +29,16 @@ import appeng.api.storage.data.IAEStack;
|
||||
|
||||
/**
|
||||
* DO NOT IMPLEMENT.
|
||||
*
|
||||
*
|
||||
* Will be injected when adding an {@link ICraftingWatcherHost} to a grid.
|
||||
*/
|
||||
public interface ICraftingWatcher
|
||||
{
|
||||
/**
|
||||
* Add a specific {@link IAEStack} to watch.
|
||||
*
|
||||
*
|
||||
* Supports multiple values, duplicate ones will not be added.
|
||||
*
|
||||
*
|
||||
* @param stack
|
||||
* @return true, if successfully added.
|
||||
*/
|
||||
@@ -46,7 +46,7 @@ public interface ICraftingWatcher
|
||||
|
||||
/**
|
||||
* Remove a specific {@link IAEStack} from the watcher.
|
||||
*
|
||||
*
|
||||
* @param stack
|
||||
* @return true, if successfully removed.
|
||||
*/
|
||||
|
||||
@@ -24,7 +24,10 @@
|
||||
package appeng.api.networking.energy;
|
||||
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.Collection;
|
||||
|
||||
import javax.annotation.Nonnegative;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
|
||||
@@ -35,17 +38,91 @@ import appeng.api.config.Actionable;
|
||||
public interface IEnergyGridProvider
|
||||
{
|
||||
/**
|
||||
* internal use only
|
||||
*
|
||||
* Can return a list of providers behind the current.
|
||||
*
|
||||
* An example would be something acting as proxy between different {@link IEnergyGrid}s.
|
||||
*
|
||||
* This can contain duplicate entries, AE will ensure that each provider is only visited once.
|
||||
*
|
||||
* internal use only
|
||||
*/
|
||||
double extractAEPower( double amt, Actionable mode, Set<IEnergyGrid> seen );
|
||||
@Nonnull
|
||||
Collection<IEnergyGridProvider> providers();
|
||||
|
||||
/**
|
||||
* internal use only
|
||||
*
|
||||
* Extracts the requested amount from the provider.
|
||||
*
|
||||
* This should never forward a call to another {@link IEnergyGridProvider}, instead return them via
|
||||
* {@link IEnergyGridProvider#providers()}
|
||||
*
|
||||
* @return the used amount
|
||||
*/
|
||||
double injectAEPower( double amt, Actionable mode, Set<IEnergyGrid> seen );
|
||||
@Nonnegative
|
||||
double extractProviderPower( @Nonnegative double amt, @Nonnull Actionable mode );
|
||||
|
||||
/**
|
||||
* Injects the offered amount into the provider.
|
||||
*
|
||||
* This should never forward a call to another {@link IEnergyGridProvider}, instead return them via
|
||||
* {@link IEnergyGridProvider#providers()}
|
||||
*
|
||||
* internal use only
|
||||
*
|
||||
* @return the leftover amount
|
||||
*/
|
||||
@Nonnegative
|
||||
double injectProviderPower( @Nonnegative double amt, @Nonnull Actionable mode );
|
||||
|
||||
/**
|
||||
* internal use only
|
||||
*
|
||||
* Returns the current demand of an provider.
|
||||
*
|
||||
* This should never forward a call to another {@link IEnergyGridProvider}, instead return them via
|
||||
* {@link IEnergyGridProvider#providers()}
|
||||
*
|
||||
*
|
||||
* @param d the max amount offered, the demand should never exceed it.
|
||||
* @return the total amount demanded
|
||||
*/
|
||||
double getEnergyDemand( double d, Set<IEnergyGrid> seen );
|
||||
@Nonnegative
|
||||
double getProviderEnergyDemand( @Nonnegative double d );
|
||||
|
||||
/**
|
||||
* internal use only
|
||||
*
|
||||
* AE currently uses this to enqueue the next visited provider.
|
||||
*
|
||||
* There is no guarantee that this works on in a perfect way.
|
||||
* It can be limited to the returns of the past {@link IEnergyGridProvider#providers()}, but not any future one
|
||||
* discovered by visiting further providers.
|
||||
*
|
||||
* E.g. inject into the the lowest one first or extract from the highest one.
|
||||
*
|
||||
* @return the current stored amount.
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Nonnegative
|
||||
double getProviderStoredEnergy();
|
||||
|
||||
/**
|
||||
* internal use only
|
||||
*
|
||||
* AE currently uses this to enqueue the next visited provider.
|
||||
*
|
||||
* There is no guarantee that this works on in a perfect way.
|
||||
* It can be limited to the returns of the past {@link IEnergyGridProvider#providers()}, but not any future one
|
||||
* discovered by visiting further providers.
|
||||
*
|
||||
* E.g. inject into the the lowest one first or extract from the highest one.
|
||||
*
|
||||
* @return the maximum amount stored.
|
||||
*/
|
||||
@Nonnegative
|
||||
double getProviderMaxEnergy();
|
||||
}
|
||||
|
||||
@@ -26,16 +26,16 @@ package appeng.api.networking.energy;
|
||||
|
||||
/**
|
||||
* DO NOT IMPLEMENT.
|
||||
*
|
||||
*
|
||||
* Will be injected when adding an {@link IEnergyWatcherHost} to a grid.
|
||||
*/
|
||||
public interface IEnergyWatcher
|
||||
{
|
||||
/**
|
||||
* Add a specific threshold to watch.
|
||||
*
|
||||
*
|
||||
* Supports multiple values, duplicate ones will not be added.
|
||||
*
|
||||
*
|
||||
* @param amount
|
||||
* @return true, if successfully added.
|
||||
*/
|
||||
@@ -43,7 +43,7 @@ public interface IEnergyWatcher
|
||||
|
||||
/**
|
||||
* Remove a specific threshold from the watcher.
|
||||
*
|
||||
*
|
||||
* @param amount
|
||||
* @return true, if successfully removed.
|
||||
*/
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2013 AlgorithmX2
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package appeng.api.networking.security;
|
||||
|
||||
/**
|
||||
* TODO: Consider refactoring.
|
||||
*/
|
||||
public class BaseActionSource
|
||||
{
|
||||
|
||||
public boolean isPlayer()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isMachine()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -24,11 +24,10 @@
|
||||
package appeng.api.networking.security;
|
||||
|
||||
|
||||
import appeng.api.networking.IGridHost;
|
||||
import appeng.api.networking.IGridNode;
|
||||
|
||||
|
||||
public interface IActionHost extends IGridHost
|
||||
public interface IActionHost
|
||||
{
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2013 AlgorithmX2
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package appeng.api.networking.security;
|
||||
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
|
||||
/**
|
||||
* The source of any action.
|
||||
*
|
||||
* This can either be a {@link EntityPlayer} or an {@link IActionHost}.
|
||||
*
|
||||
* In most cases this is used for security checks, but can be used to validate the source itself.
|
||||
*
|
||||
*/
|
||||
public interface IActionSource
|
||||
{
|
||||
|
||||
/**
|
||||
* If present, AE will consider the player being the source for the action.
|
||||
*
|
||||
* This will take precedence over {@link IActionSource#machine()} in any case.
|
||||
*
|
||||
* @return An optional player issuing the action.
|
||||
*/
|
||||
@Nonnull
|
||||
Optional<EntityPlayer> player();
|
||||
|
||||
/**
|
||||
* If present, it indicates the {@link IActionHost} of the source.
|
||||
*
|
||||
* Should {@link IActionSource#player()} be absent, it will consider a machine as source.
|
||||
*
|
||||
* It is recommended to include the machine even when a player is present.
|
||||
*
|
||||
* @return An optional machine issuing the action or acting as proxy for a player.
|
||||
*/
|
||||
@Nonnull
|
||||
Optional<IActionHost> machine();
|
||||
|
||||
/**
|
||||
* An {@link IActionSource} can have multiple optional contexts.
|
||||
*
|
||||
* It is strongly recommended to limit the uses for absolutely necessary cases.
|
||||
*
|
||||
* Currently there are no public contexts made available by AE.
|
||||
* An example would be the context interfaces use internally to avoid looping items between each other.
|
||||
*/
|
||||
@Nonnull
|
||||
<T> Optional<T> context( @Nonnull Class<T> key );
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2013 AlgorithmX2
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package appeng.api.networking.security;
|
||||
|
||||
/**
|
||||
* TODO: Consider refactoring.
|
||||
*/
|
||||
public class MachineSource extends BaseActionSource
|
||||
{
|
||||
|
||||
public final IActionHost via;
|
||||
|
||||
public MachineSource( final IActionHost v )
|
||||
{
|
||||
this.via = v;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMachine()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -29,16 +29,16 @@ import appeng.api.storage.data.IAEStack;
|
||||
|
||||
/**
|
||||
* DO NOT IMPLEMENT.
|
||||
*
|
||||
*
|
||||
* Will be injected when adding an {@link IStackWatcherHost} to a grid.
|
||||
*/
|
||||
public interface IStackWatcher
|
||||
{
|
||||
/**
|
||||
* Add a specific {@link IAEStack} to watch.
|
||||
*
|
||||
*
|
||||
* Supports multiple values, duplicate ones will not be added.
|
||||
*
|
||||
*
|
||||
* @param stack
|
||||
* @return true, if successfully added.
|
||||
*/
|
||||
@@ -46,7 +46,7 @@ public interface IStackWatcher
|
||||
|
||||
/**
|
||||
* Remove a specific {@link IAEStack} from the watcher.
|
||||
*
|
||||
*
|
||||
* @param stack
|
||||
* @return true, if successfully removed.
|
||||
*/
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
package appeng.api.networking.storage;
|
||||
|
||||
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.networking.security.IActionSource;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
@@ -50,5 +50,5 @@ public interface IStackWatcherHost
|
||||
* @param src action source
|
||||
* @param chan storage channel
|
||||
*/
|
||||
void onStackChange( IItemList o, IAEStack fullStack, IAEStack diffStack, BaseActionSource src, StorageChannel chan );
|
||||
void onStackChange( IItemList o, IAEStack fullStack, IAEStack diffStack, IActionSource src, StorageChannel chan );
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ package appeng.api.networking.storage;
|
||||
|
||||
import appeng.api.networking.IGridCache;
|
||||
import appeng.api.networking.IGridHost;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.networking.security.IActionSource;
|
||||
import appeng.api.storage.ICellContainer;
|
||||
import appeng.api.storage.ICellProvider;
|
||||
import appeng.api.storage.IStorageMonitorable;
|
||||
@@ -50,7 +50,7 @@ public interface IStorageGrid extends IGridCache, IStorageMonitorable
|
||||
*
|
||||
* @param input injected items
|
||||
*/
|
||||
void postAlterationOfStoredItems( StorageChannel chan, Iterable<? extends IAEStack> input, BaseActionSource src );
|
||||
void postAlterationOfStoredItems( StorageChannel chan, Iterable<? extends IAEStack> input, IActionSource src );
|
||||
|
||||
/**
|
||||
* Used to add a cell provider to the storage system
|
||||
|
||||
@@ -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();
|
||||
|
||||
/**
|
||||
|
||||
@@ -42,6 +42,7 @@ import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
@@ -129,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
|
||||
|
||||
@@ -41,9 +41,9 @@ public interface IPartModel
|
||||
/**
|
||||
* A solid {@link IPartModel} indicates that the rendering requires a cable connection, which will also result in
|
||||
* creating an intersection for the cable.
|
||||
*
|
||||
*
|
||||
* This should be true for pretty much all parts.
|
||||
*
|
||||
*
|
||||
* @return true for a solid part.
|
||||
*/
|
||||
default boolean requireCableConnection()
|
||||
@@ -53,7 +53,7 @@ public interface IPartModel
|
||||
|
||||
/**
|
||||
* A collection of {@link ResourceLocation} used as models for a part.
|
||||
*
|
||||
*
|
||||
* @return a collection of models, never null.
|
||||
*/
|
||||
@Nonnull
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
package appeng.api.storage;
|
||||
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
@@ -52,12 +52,12 @@ public interface ICellInventory extends IMEInventory<IAEItemStack>
|
||||
/**
|
||||
* @return access configured list
|
||||
*/
|
||||
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.
|
||||
|
||||
@@ -25,7 +25,7 @@ package appeng.api.storage;
|
||||
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.networking.security.IActionSource;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
|
||||
@@ -52,7 +52,7 @@ public interface IMEInventory<StackType extends IAEStack>
|
||||
*
|
||||
* @return returns the number of items not added.
|
||||
*/
|
||||
StackType injectItems( StackType input, Actionable type, BaseActionSource src );
|
||||
StackType injectItems( StackType input, Actionable type, IActionSource src );
|
||||
|
||||
/**
|
||||
* Extract the specified item from the ME Inventory
|
||||
@@ -62,7 +62,7 @@ public interface IMEInventory<StackType extends IAEStack>
|
||||
*
|
||||
* @return returns the number of items extracted, null
|
||||
*/
|
||||
StackType extractItems( StackType request, Actionable mode, BaseActionSource src );
|
||||
StackType extractItems( StackType request, Actionable mode, IActionSource src );
|
||||
|
||||
/**
|
||||
* request a full report of all available items, storage.
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
package appeng.api.storage;
|
||||
|
||||
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.networking.security.IActionSource;
|
||||
import appeng.api.networking.storage.IBaseMonitor;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
|
||||
@@ -46,7 +46,7 @@ public interface IMEMonitorHandlerReceiver<StackType extends IAEStack>
|
||||
*
|
||||
* @param change done change
|
||||
*/
|
||||
void postChange( IBaseMonitor<StackType> monitor, Iterable<StackType> change, BaseActionSource actionSource );
|
||||
void postChange( IBaseMonitor<StackType> monitor, Iterable<StackType> change, IActionSource actionSource );
|
||||
|
||||
/**
|
||||
* called when the list updates its contents, this is mostly for handling power events.
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
@@ -35,7 +35,7 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import appeng.api.networking.crafting.ICraftingLink;
|
||||
import appeng.api.networking.crafting.ICraftingRequester;
|
||||
import appeng.api.networking.energy.IEnergySource;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.networking.security.IActionSource;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
@@ -109,7 +109,7 @@ public interface IStorageHelper
|
||||
*
|
||||
* @return items that successfully extracted.
|
||||
*/
|
||||
IAEItemStack poweredExtraction( IEnergySource energy, IMEInventory<IAEItemStack> cell, IAEItemStack request, BaseActionSource src );
|
||||
IAEItemStack poweredExtraction( IEnergySource energy, IMEInventory<IAEItemStack> cell, IAEItemStack request, IActionSource src );
|
||||
|
||||
/**
|
||||
* use energy from energy, to inject input items into cell, at the request of src
|
||||
@@ -121,5 +121,5 @@ public interface IStorageHelper
|
||||
*
|
||||
* @return items that failed to insert.
|
||||
*/
|
||||
IAEItemStack poweredInsert( IEnergySource energy, IMEInventory<IAEItemStack> cell, IAEItemStack input, BaseActionSource src );
|
||||
IAEItemStack poweredInsert( IEnergySource energy, IMEInventory<IAEItemStack> cell, IAEItemStack input, IActionSource src );
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ package appeng.api.storage;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.networking.security.IActionSource;
|
||||
|
||||
|
||||
/**
|
||||
@@ -22,5 +22,5 @@ public interface IStorageMonitorableAccessor
|
||||
* @return Null if the network cannot be accessed by the given action source (i.e. security doesn't permit it).
|
||||
*/
|
||||
@Nullable
|
||||
IStorageMonitorable getInventory( BaseActionSource src );
|
||||
IStorageMonitorable getInventory( IActionSource src );
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ import com.google.common.collect.ImmutableList;
|
||||
|
||||
import appeng.api.config.AccessRestriction;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.networking.security.IActionSource;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -81,7 +81,7 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
|
||||
}
|
||||
|
||||
@Override
|
||||
public StackType injectItems( final StackType input, final Actionable mode, final BaseActionSource src )
|
||||
public StackType injectItems( final StackType input, final Actionable mode, final IActionSource src )
|
||||
{
|
||||
if( mode == Actionable.SIMULATE )
|
||||
{
|
||||
@@ -95,7 +95,7 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
|
||||
return this.internalHandler;
|
||||
}
|
||||
|
||||
private StackType monitorDifference( final IAEStack original, final StackType leftOvers, final boolean extraction, final BaseActionSource src )
|
||||
private StackType monitorDifference( final IAEStack original, final StackType leftOvers, final boolean extraction, final IActionSource src )
|
||||
{
|
||||
final StackType diff = (StackType) original.copy();
|
||||
|
||||
@@ -116,12 +116,12 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
|
||||
return leftOvers;
|
||||
}
|
||||
|
||||
protected void postChangesToListeners( final Iterable<StackType> changes, final BaseActionSource src )
|
||||
protected void postChangesToListeners( final Iterable<StackType> changes, final IActionSource src )
|
||||
{
|
||||
this.notifyListenersOfChange( changes, src );
|
||||
}
|
||||
|
||||
protected void notifyListenersOfChange( final Iterable<StackType> diff, final BaseActionSource src )
|
||||
protected void notifyListenersOfChange( final Iterable<StackType> diff, final IActionSource src )
|
||||
{
|
||||
this.hasChanged = true;// need to update the cache.
|
||||
final Iterator<Entry<IMEMonitorHandlerReceiver<StackType>, Object>> i = this.getListeners();
|
||||
@@ -146,7 +146,7 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
|
||||
}
|
||||
|
||||
@Override
|
||||
public StackType extractItems( final StackType request, final Actionable mode, final BaseActionSource src )
|
||||
public StackType extractItems( final StackType request, final Actionable mode, final IActionSource src )
|
||||
{
|
||||
if( mode == Actionable.SIMULATE )
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@ public interface IAEItemStack extends IAEStack<IAEItemStack>
|
||||
*
|
||||
* @return new ItemStack
|
||||
*/
|
||||
ItemStack getItemStack();
|
||||
ItemStack createItemStack();
|
||||
|
||||
/**
|
||||
* is there NBT Data for this item?
|
||||
@@ -105,4 +105,11 @@ public interface IAEItemStack extends IAEStack<IAEItemStack>
|
||||
* @return true if it is the same type (same item, damage, nbt)
|
||||
*/
|
||||
boolean isSameType( ItemStack stored );
|
||||
|
||||
/**
|
||||
* DO NOT MODIFY THIS STACK! NEVER. If you think about it .. DON'T
|
||||
*
|
||||
* @return definition stack
|
||||
*/
|
||||
ItemStack getDefinition();
|
||||
}
|
||||
@@ -28,13 +28,14 @@ import java.io.IOException;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
|
||||
|
||||
public interface IAEStack<StackType extends IAEStack>
|
||||
public interface IAEStack<StackType extends IAEStack<StackType>>
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -182,13 +183,6 @@ public interface IAEStack<StackType extends IAEStack>
|
||||
*/
|
||||
StackType empty();
|
||||
|
||||
/**
|
||||
* obtain the NBT Data for the item.
|
||||
*
|
||||
* @return nbt data
|
||||
*/
|
||||
IAETagCompound getTagCompound();
|
||||
|
||||
/**
|
||||
* @return true if the stack is a {@link IAEItemStack}
|
||||
*/
|
||||
@@ -203,4 +197,11 @@ public interface IAEStack<StackType extends IAEStack>
|
||||
* @return ITEM or FLUID
|
||||
*/
|
||||
StorageChannel getChannel();
|
||||
|
||||
/**
|
||||
* Returns itemstack for display and similar purposes. Always has a count of 1.
|
||||
*
|
||||
* @return itemstack
|
||||
*/
|
||||
ItemStack asItemStackRepresentation();
|
||||
}
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2013 AlgorithmX2
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package appeng.api.storage.data;
|
||||
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import appeng.api.features.IItemComparison;
|
||||
|
||||
|
||||
/**
|
||||
* Don't cast this... either compare with it, or copy it.
|
||||
*
|
||||
* Don't Implement.
|
||||
*/
|
||||
public interface IAETagCompound
|
||||
{
|
||||
|
||||
/**
|
||||
* @return a copy ( the copy will not be a IAETagCompound, it will be a NBTTagCompound )
|
||||
*/
|
||||
NBTTagCompound getNBTTagCompoundCopy();
|
||||
|
||||
/**
|
||||
* compare to other NBTTagCompounds or IAETagCompounds
|
||||
*
|
||||
* @param a compared object
|
||||
*
|
||||
* @return true, if they are the same.
|
||||
*/
|
||||
@Override
|
||||
boolean equals( Object a );
|
||||
|
||||
/**
|
||||
* @return the special comparison for this tag
|
||||
*/
|
||||
IItemComparison getSpecialComparison();
|
||||
}
|
||||
@@ -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,6 +31,7 @@ import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -93,43 +94,40 @@ public abstract class AEBaseBlock extends Block
|
||||
this.fullBlock = this.isFullSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean isVisuallyOpaque()
|
||||
{
|
||||
return this.isOpaque() && this.isFullSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
return new BlockStateContainer( this, this.getAEStates() );
|
||||
}
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
public final boolean isNormalCube( IBlockState state )
|
||||
{
|
||||
return this.isFullSize() && this.isOpaque();
|
||||
}
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox( IBlockState state, IBlockAccess source, BlockPos pos )
|
||||
{
|
||||
return 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 );
|
||||
}
|
||||
@@ -137,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 )
|
||||
@@ -151,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;
|
||||
@@ -169,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;
|
||||
|
||||
@@ -227,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 )
|
||||
{
|
||||
@@ -255,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 )
|
||||
@@ -280,12 +281,14 @@ public abstract class AEBaseBlock extends Block
|
||||
return super.collisionRayTrace( state, w, pos, a, b );
|
||||
}
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride( IBlockState state )
|
||||
{
|
||||
return this.isInventory();
|
||||
}
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
public int getComparatorInputOverride( IBlockState state, final World worldIn, final BlockPos pos )
|
||||
{
|
||||
@@ -338,8 +341,9 @@ public abstract class AEBaseBlock extends Block
|
||||
return new EnumFacing[0];
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@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 )
|
||||
{
|
||||
|
||||
}
|
||||
@@ -417,8 +421,8 @@ public abstract class AEBaseBlock extends Block
|
||||
@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 + "]";
|
||||
}
|
||||
|
||||
protected String getUnlocalizedName( final ItemStack is )
|
||||
|
||||
@@ -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 getSubBlocks( 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,7 +39,7 @@ 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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -52,7 +52,7 @@ import appeng.client.render.effects.LightningFX;
|
||||
import appeng.client.render.renderable.ItemRenderable;
|
||||
import appeng.client.render.tesr.ModularTESR;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.helpers.ICustomCollision;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.misc.TileCharger;
|
||||
@@ -66,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 ) );
|
||||
}
|
||||
@@ -110,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;
|
||||
@@ -118,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 );
|
||||
}
|
||||
}
|
||||
@@ -201,7 +201,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
|
||||
{
|
||||
Matrix4f transform = new Matrix4f();
|
||||
transform.translate( new Vector3f( 0.5f, 0.4f, 0.5f ) );
|
||||
return new ImmutablePair<>( tile.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,10 +126,11 @@ 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
|
||||
@@ -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 )
|
||||
@@ -83,7 +82,7 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
|
||||
|
||||
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,7 +94,7 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
|
||||
{
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package appeng.block.misc;
|
||||
|
||||
|
||||
|
||||
@@ -46,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;
|
||||
@@ -100,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
|
||||
@@ -117,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 );
|
||||
}
|
||||
|
||||
@@ -130,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
|
||||
@@ -236,7 +238,7 @@ public class BlockCableBus extends AEBaseTileBlock
|
||||
return sp.facade.getItemStack();
|
||||
}
|
||||
|
||||
return null;
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -254,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;
|
||||
@@ -270,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 );
|
||||
@@ -289,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 ) )
|
||||
@@ -318,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 );
|
||||
}
|
||||
@@ -330,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 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -377,7 +380,7 @@ public class BlockCableBus extends AEBaseTileBlock
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void getSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
|
||||
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
@@ -386,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();
|
||||
@@ -398,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 getSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
|
||||
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
|
||||
{
|
||||
super.getSubBlocks( 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 );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,14 +22,11 @@ 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;
|
||||
@@ -47,6 +44,7 @@ import appeng.helpers.ICustomCollision;
|
||||
import appeng.tile.networking.TileWireless;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
|
||||
{
|
||||
|
||||
@@ -59,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
|
||||
@@ -87,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() )
|
||||
@@ -111,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() )
|
||||
{
|
||||
@@ -127,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 getSubBlocks( 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,13 +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;
|
||||
@@ -27,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
|
||||
@@ -64,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;
|
||||
}
|
||||
@@ -79,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() )
|
||||
{
|
||||
@@ -106,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 );
|
||||
|
||||
@@ -173,7 +176,7 @@ class PaintBakedModel implements IBakedModel
|
||||
@Override
|
||||
public TextureAtlasSprite getParticleTexture()
|
||||
{
|
||||
return textures[0];
|
||||
return this.textures[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -191,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,13 +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;
|
||||
@@ -78,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 );
|
||||
@@ -125,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 );
|
||||
|
||||
@@ -142,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 );
|
||||
@@ -154,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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -202,7 +203,7 @@ class QnbFormedBakedModel implements IBakedModel
|
||||
@Override
|
||||
public boolean isAmbientOcclusion()
|
||||
{
|
||||
return baseModel.isAmbientOcclusion();
|
||||
return this.baseModel.isAmbientOcclusion();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -220,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 getSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
|
||||
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user