Compare commits
222 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8d5cc916e0 | |||
| 5abb8bf886 | |||
| 0bed78a144 | |||
| 30940e91ea | |||
| 0f9ac5fdda | |||
| 5e001d86cb | |||
| b13a338948 | |||
| 454404b0c1 | |||
| bb1e191666 | |||
| b72fce97db | |||
| bcc4a732ed | |||
| 52d28fabe3 | |||
| c077840988 | |||
| 8f6510aad4 | |||
| fa8427dcbd | |||
| 7eb09fc4db | |||
| ac528d09ae | |||
| c97165cc63 | |||
| 08ee8f7656 | |||
| 727fcc528f | |||
| a4c468b9cf | |||
| 4ad31f5066 | |||
| f70e97046f | |||
| 3a053d9ebe | |||
| fbaff342e4 | |||
| f0baea3be8 | |||
| fd7e393d23 | |||
| a24ed38e90 | |||
| 15582fd1df | |||
| f9cad0758d | |||
| 406013142e | |||
| 7de90ed0ae | |||
| 8ec8babb6a | |||
| 621910df91 | |||
| 66437897be | |||
| 7414840530 | |||
| 0741e4ae09 | |||
| 87f6a63f47 | |||
| b0950683a1 | |||
| 009cf8ac40 | |||
| 4c272de77f | |||
| 6648d18f00 | |||
| 16b5b5aea2 | |||
| e20697a7d9 | |||
| dc0447d137 | |||
| 577b1fa757 | |||
| 3d69dc9bc4 | |||
| 66c87a2fa2 | |||
| fdab91323c | |||
| 98a8c3d06b | |||
| 458356a2be | |||
| c91b432e09 | |||
| d67d93b343 | |||
| f6f8da28af | |||
| 76fd3c1166 | |||
| 3da881829e | |||
| 90ee7fb15d | |||
| e5e2714273 | |||
| 1534521362 | |||
| 0f8204cd93 | |||
| eb11845a2f | |||
| fe213e5ac5 | |||
| 25c82b2c9f | |||
| d03faae983 | |||
| 76e19874cf | |||
| 1975c3c262 | |||
| 720feb4f16 | |||
| 588579d67f | |||
| 043f6e9919 | |||
| cc7824a0e5 | |||
| a57cd3f580 | |||
| 33f54a1bd6 | |||
| 3008088ad7 | |||
| 198ea9f16e | |||
| d8c5e6a5fa | |||
| fbcf8c4705 | |||
| d67f97cd16 | |||
| 0e2f8a22a2 | |||
| 20fc0e136d | |||
| 7f7495f1df | |||
| e6e858820f | |||
| 4679b0ee61 | |||
| 890eef1803 | |||
| 780ce89ac3 | |||
| e96339dd2b | |||
| b67d7eed82 | |||
| 5ebd8452bf | |||
| ee774cd3f8 | |||
| 0a2f90d115 | |||
| 0f86efa3f5 | |||
| 7398af0e1c | |||
| eb0b304fd9 | |||
| c455ee69b8 | |||
| 820a6bdbd6 | |||
| 7a8499c455 | |||
| 76f17ba53c | |||
| 16a0872d06 | |||
| 49a87f62ce | |||
| c382ab7300 | |||
| 49a6df5bc7 | |||
| 10e050c35b | |||
| b1e249aad0 | |||
| d3bb71d834 | |||
| 3f7051ec8e | |||
| 2f1f19bbb3 | |||
| 4c7f065af3 | |||
| 6c52f31686 | |||
| 3ac7e518b1 | |||
| af85a2bf67 | |||
| c4b4a257f3 | |||
| 4eba3bca5b | |||
| cd78586910 | |||
| 178198b0c6 | |||
| bdf46a6ee2 | |||
| 0be2011645 | |||
| bce500616c | |||
| e022c23c8f | |||
| 61b81fc802 | |||
| b819fe4adb | |||
| 66a797dd7c | |||
| 99c294e948 | |||
| 6529de911a | |||
| 650edae902 | |||
| 78904204cf | |||
| df7ab00c37 | |||
| 5432decf95 | |||
| da5879b667 | |||
| 370fc49357 | |||
| c74aaddbd3 | |||
| 1a4db4b8d7 | |||
| d77d21858e | |||
| 42bfc549be | |||
| c6bdf845a8 | |||
| ccc46e77a3 | |||
| 7e45cf0e37 | |||
| 86dd8193f7 | |||
| 5fff8310d6 | |||
| 1cde7bc933 | |||
| ed9e6dd21c | |||
| 589730bfad | |||
| 8700a79ca6 | |||
| a14cf2204d | |||
| 8bed7f223e | |||
| db85419702 | |||
| fb79fd284d | |||
| e3305c1963 | |||
| a3c85b4a59 | |||
| a2b20f1d67 | |||
| 86908b1ae6 | |||
| 6bf52b0b0f | |||
| eb1e86cacb | |||
| c405e725b2 | |||
| d377af9a69 | |||
| 12dbd17320 | |||
| 5028c8025b | |||
| d11d6e754f | |||
| 887339f7b8 | |||
| a665200c31 | |||
| 6554e295d5 | |||
| 4eeb554dcb | |||
| 3eae4a7d19 | |||
| 6c91e852ec | |||
| 52f516299b | |||
| c74166b02a | |||
| 26e86a114c | |||
| fc834036a0 | |||
| f96f7d82c5 | |||
| c592f54a77 | |||
| 89609a83ea | |||
| e67969f52f | |||
| 32a0496bc2 | |||
| 6df311c11a | |||
| 2e23b92763 | |||
| 41a029ffb4 | |||
| 9c8f914f42 | |||
| d75cdc9696 | |||
| 77bb28ded6 | |||
| 0e7981d717 | |||
| fbb0c05c7f | |||
| efa0ab7e4e | |||
| 70fe5189e0 | |||
| 3a8d6d0bcd | |||
| 7ac817e9ae | |||
| 0ceb4765a2 | |||
| 7ce9654402 | |||
| 5328627d7a | |||
| fe1a67ffaa | |||
| 4253d659f1 | |||
| b3560aaa00 | |||
| 005392911d | |||
| 7f02562e0c | |||
| 84bc00fa20 | |||
| c1483d87c7 | |||
| f5e4a202cb | |||
| 6f15c2921a | |||
| d891e5da15 | |||
| 6607c8cd2f | |||
| 1e20086799 | |||
| f85ab7ddc2 | |||
| c3700737c3 | |||
| 2f8013a49b | |||
| af54883fd3 | |||
| 223a210d49 | |||
| c133e4f0ef | |||
| 424d27b71c | |||
| 2fe5a3cef8 | |||
| a3c33d5323 | |||
| e927c27b85 | |||
| d7d99c5e7e | |||
| b6d3be41e1 | |||
| 071ee83b7a | |||
| dfe7a29c92 | |||
| 2b02dc19c0 | |||
| 9bf296bec9 | |||
| 5db7fc8e8c | |||
| c7eb696d60 | |||
| 4f53f5910b | |||
| 971fc3d243 | |||
| c2b5a58dd2 | |||
| 53c32cc296 | |||
| 89299cdb3c | |||
| 2972f0ddc8 |
+11
-6
@@ -12,15 +12,18 @@ top of things.
|
|||||||
Applied Energistics 2 crashing, have a suggestion, found a bug? Create an issue now!
|
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.
|
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)
|
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.
|
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.
|
* Do not tag it with something like `[Feature]`, `[Bug]`, or a version.
|
||||||
* The following details are required. Not including them can cause the issue to be closed.
|
* 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
|
* Forge version
|
||||||
* AE2 version
|
* AE2 version
|
||||||
* Crash log, when reporting a crash (Please make sure to use [pastebin](http://pastebin.com/))
|
* 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:
|
* Never post an excerpt of what you consider important
|
||||||
* Post the full log
|
* Always post the full log
|
||||||
* Other mods and their version, when reporting an issue between AE and another mod
|
* 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
|
* Also consider updating these before submitting a new issue, it might be already fixed
|
||||||
* A detailed description of the bug or feature
|
* 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?
|
* Mod Pack using and version?
|
||||||
* Keep in mind that some mods might use an outdated version of AE2
|
* Keep in mind that some mods might use an outdated version of AE2
|
||||||
* If so you should report it to your modpack
|
* 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.
|
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
|
### Submitting Changes
|
||||||
|
|
||||||
* Submit an issue to the github project, assuming one does not already exist.
|
* 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.
|
PRs that do not conform to these standards will be rejected.
|
||||||
|
|
||||||
You can find presets for Eclipse and IntelliJ IDEA in the `codeformat` folder.
|
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
|
### Whitespace
|
||||||
|
|
||||||
|
|||||||
@@ -26,3 +26,6 @@
|
|||||||
|
|
||||||
# Github specific files and directories
|
# Github specific files and directories
|
||||||
!.github/
|
!.github/
|
||||||
|
|
||||||
|
# Explicit ignores
|
||||||
|
Thumbs.db
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
[](https://travis-ci.org/AppliedEnergistics/Applied-Energistics-2)
|
[](https://travis-ci.org/AppliedEnergistics/Applied-Energistics-2)
|
||||||
[](https://github.com/AppliedEnergistics/Applied-Energistics-2/tags)
|
[](https://github.com/AppliedEnergistics/Applied-Energistics-2/releases)
|
||||||
[](https://github.com/AppliedEnergistics/Applied-Energistics-2/releases)
|
|
||||||
|
|
||||||
# Applied Energistics 2
|
# Applied Energistics 2
|
||||||
|
|
||||||
@@ -10,7 +9,6 @@
|
|||||||
* [Contacts](#contacts)
|
* [Contacts](#contacts)
|
||||||
* [License](#license)
|
* [License](#license)
|
||||||
* [Downloads](#downloads)
|
* [Downloads](#downloads)
|
||||||
* [Nightly Builds](#nightly-builds)
|
|
||||||
* [Installation](#installation)
|
* [Installation](#installation)
|
||||||
* [Issues](#issues)
|
* [Issues](#issues)
|
||||||
* [Building](#building)
|
* [Building](#building)
|
||||||
@@ -32,13 +30,13 @@ A Mod about Matter, Energy and using them to conquer the world..
|
|||||||
## License
|
## License
|
||||||
|
|
||||||
* Applied Energistics 2 API
|
* Applied Energistics 2 API
|
||||||
- (c) 2013 - 2015 AlgorithmX2 et al
|
- (c) 2013 - 2017 AlgorithmX2 et al
|
||||||
- [](http://opensource.org/licenses/MIT)
|
- [](http://opensource.org/licenses/MIT)
|
||||||
* Applied Energistics 2
|
* 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)
|
- [](https://raw.githubusercontent.com/AppliedEnergistics/Applied-Energistics-2/rv2/LICENSE)
|
||||||
* Textures and Models
|
* Textures and Models
|
||||||
- (c) 2013 - 2015 AlgorithmX2 et al
|
- (c) 2013 - 2017 AlgorithmX2 et al
|
||||||
- [](https://creativecommons.org/licenses/by-nc-sa/3.0/)
|
- [](https://creativecommons.org/licenses/by-nc-sa/3.0/)
|
||||||
* Text and Translations
|
* Text and Translations
|
||||||
- [](https://creativecommons.org/publicdomain/zero/1.0/)
|
- [](https://creativecommons.org/publicdomain/zero/1.0/)
|
||||||
@@ -47,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/).
|
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/api/projects/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
|
## Installation
|
||||||
|
|
||||||
You install this mod by putting it into the `minecraft/mods/` folder. It has no additional hard dependencies.
|
You install this mod by putting it into the `minecraft/mods/` folder. It has no additional hard dependencies.
|
||||||
@@ -64,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!
|
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.
|
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)
|
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.
|
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.
|
* Do not tag it with something like `[Feature]`, `[Bug]`, or a version.
|
||||||
* The following details are required. Not including them can cause the issue to be closed.
|
* 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
|
* Forge version
|
||||||
* AE2 version
|
* AE2 version
|
||||||
* Crash log, when reporting a crash (Please make sure to use [pastebin](http://pastebin.com/))
|
* 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:
|
* Never post an excerpt of what you consider important
|
||||||
* Post the full log
|
* Always post the full log
|
||||||
* Other mods and their version, when reporting an issue between AE and another mod
|
* 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
|
* Also consider updating these before submitting a new issue, it might be already fixed
|
||||||
* A detailed description of the bug or feature
|
* A detailed description of the bug or feature
|
||||||
@@ -85,10 +78,12 @@ Applied Energistics 2 crashing, have a suggestion, found a bug? Create an issue
|
|||||||
* Mod Pack using and version?
|
* Mod Pack using and version?
|
||||||
* Keep in mind that some mods might use an outdated version of AE2
|
* Keep in mind that some mods might use an outdated version of AE2
|
||||||
* If so you should report it to your modpack
|
* 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.
|
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
|
## Building
|
||||||
|
|
||||||
1. Clone this repository via
|
1. Clone this repository via
|
||||||
@@ -104,14 +99,14 @@ Providing as many details as possible does help us to find and resolve the issue
|
|||||||
- Eclipse: execute `gradlew eclipse`
|
- Eclipse: execute `gradlew eclipse`
|
||||||
5. For add-on developer: Core-Mod Detection
|
5. For add-on developer: Core-Mod Detection
|
||||||
- In order to have FML detect AE from your dev environment, add the following VM Option to your run profile
|
- In order to have FML detect AE from your dev environment, add the following VM Option to your run profile
|
||||||
- `-Dfml.coreMods.load=appeng.transformer.AppEngCore`
|
- `-Dfml.coreMods.load=appeng.coremod.AppEngCore`
|
||||||
|
|
||||||
## Contribution
|
## Contribution
|
||||||
|
|
||||||
Before you want to add major changes, you might want to discuss them with us first, before wasting your time.
|
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).
|
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.
|
Here are a few things to keep in mind that will help get your PR approved.
|
||||||
|
|
||||||
@@ -123,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.
|
- 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.
|
- If your feature can be done by any popular mod, discuss with us first.
|
||||||
|
|
||||||
Getting Started
|
**Getting Started**
|
||||||
|
|
||||||
1. Fork this repository
|
1. Fork this repository
|
||||||
2. Clone the fork via
|
2. Clone the fork via
|
||||||
@@ -143,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.
|
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
|
### Maven
|
||||||
|
|
||||||
|
|||||||
+12
-23
@@ -27,7 +27,7 @@ buildscript {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
|
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||||
@@ -40,7 +40,6 @@ repositories {
|
|||||||
|
|
||||||
apply from: 'gradle/scripts/dependencies.gradle'
|
apply from: 'gradle/scripts/dependencies.gradle'
|
||||||
apply from: 'gradle/scripts/artifacts.gradle'
|
apply from: 'gradle/scripts/artifacts.gradle'
|
||||||
apply from: 'gradle/scripts/integration.gradle'
|
|
||||||
apply from: 'gradle/scripts/optional.gradle'
|
apply from: 'gradle/scripts/optional.gradle'
|
||||||
|
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
@@ -54,17 +53,22 @@ archivesBaseName = aebasename
|
|||||||
jar {
|
jar {
|
||||||
manifest {
|
manifest {
|
||||||
attributes 'FMLCorePluginContainsFMLMod': 'true'
|
attributes 'FMLCorePluginContainsFMLMod': 'true'
|
||||||
|
attributes 'FMLAT': 'appeng_at.cfg'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
from sourceSets.api.output
|
||||||
|
dependsOn apiClasses
|
||||||
|
|
||||||
// specify which files are really included, can control which APIs should be in
|
// specify which files are really included, can control which APIs should be in
|
||||||
include "appeng/**"
|
include "appeng/**"
|
||||||
include "assets/**"
|
include "assets/**"
|
||||||
include "mcmod.info"
|
include "mcmod.info"
|
||||||
include "pack.mcmeta"
|
include "pack.mcmeta"
|
||||||
|
include "META-INF/appeng_at.cfg"
|
||||||
}
|
}
|
||||||
|
|
||||||
minecraft {
|
minecraft {
|
||||||
coreMod = "appeng.transformer.AppEngCore"
|
coreMod = "appeng.coremod.AppEngCore"
|
||||||
|
|
||||||
version = minecraft_version + "-" + forge_version
|
version = minecraft_version + "-" + forge_version
|
||||||
|
|
||||||
@@ -82,26 +86,8 @@ minecraft {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
api
|
||||||
java {
|
main
|
||||||
srcDirs += 'src/api/java'
|
|
||||||
srcDirs += 'src/main/java/'
|
|
||||||
}
|
|
||||||
|
|
||||||
resources {
|
|
||||||
srcDir "src/main/resources/"
|
|
||||||
include "assets/appliedenergistics2/recipes/**/*.recipe",
|
|
||||||
"assets/appliedenergistics2/recipes/README.html",
|
|
||||||
"assets/appliedenergistics2/lang/*.lang",
|
|
||||||
"assets/appliedenergistics2/blockstates/**/*.json",
|
|
||||||
"assets/appliedenergistics2/models/**/*.json",
|
|
||||||
"assets/appliedenergistics2/textures/**/*.png",
|
|
||||||
"assets/appliedenergistics2/textures/**/*.mcmeta",
|
|
||||||
"assets/appliedenergistics2/meta/*",
|
|
||||||
"mcmod.info",
|
|
||||||
"pack.mcmeta"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources
|
processResources
|
||||||
@@ -120,4 +106,7 @@ processResources
|
|||||||
from(sourceSets.main.resources.srcDirs) {
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
exclude 'mcmod.info'
|
exclude 'mcmod.info'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// move access transformer to META-INF
|
||||||
|
rename '(.+_at.cfg)', 'META-INF/$1'
|
||||||
}
|
}
|
||||||
@@ -1,24 +1,28 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<profiles version="12">
|
<profiles version="13">
|
||||||
<profile kind="CodeFormatterProfile" name="AE2" version="12">
|
<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_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_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_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_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.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.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.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.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.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.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.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.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.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_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.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.comment.format_javadoc_comments" value="true"/>
|
||||||
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
|
<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.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_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_after_comma_in_type_arguments" value="insert"/>
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
|
<setting id="org.eclipse.jdt.core.formatter.insert_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.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.disabling_tag" value="@formatter:off"/>
|
||||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
|
<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_before_imports" value="1"/>
|
||||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="2"/>
|
<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_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.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.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.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.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.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.enabling_tag" value="@formatter:on"/>
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_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.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.alignment_for_throws_clause_in_method_declaration" value="0"/>
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
|
<setting id="org.eclipse.jdt.core.formatter.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_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_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.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_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_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.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.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_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.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.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_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_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"/>
|
<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.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.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.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_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_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"/>
|
<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.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_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_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.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_comma_in_type_parameters" value="do not insert"/>
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="do not insert"/>
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="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.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.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_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.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.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.compiler.problem.assertIdentifier" value="error"/>
|
||||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="true"/>
|
<setting id="org.eclipse.jdt.core.formatter.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_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_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.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.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.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_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_ellipsis" value="do not insert"/>
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" 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.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.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.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.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_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.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.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.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.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.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.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.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.compiler.source" value="1.8"/>
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="insert"/>
|
<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_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.alignment_for_superinterfaces_in_enum_declaration" value="0"/>
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="do not insert"/>
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="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.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.compiler.codegen.targetPlatform" value="1.8"/>
|
||||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="next_line"/>
|
<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.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_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.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.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.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_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_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"/>
|
<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_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_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.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_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_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"/>
|
<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_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_comma_in_for_increments" value="do not insert"/>
|
||||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_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_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_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"/>
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
|
||||||
|
|||||||
+10
-8
@@ -1,4 +1,4 @@
|
|||||||
aeversion=rv4
|
aeversion=rv5
|
||||||
aechannel=alpha
|
aechannel=alpha
|
||||||
aebuild=0
|
aebuild=0
|
||||||
aegroup=appeng
|
aegroup=appeng
|
||||||
@@ -7,18 +7,20 @@ aebasename=appliedenergistics2
|
|||||||
#########################################################
|
#########################################################
|
||||||
# Versions #
|
# Versions #
|
||||||
#########################################################
|
#########################################################
|
||||||
minecraft_version=1.10.2
|
minecraft_version=1.12
|
||||||
mcp_mappings=snapshot_20161018
|
mcp_mappings=snapshot_20170704
|
||||||
forge_version=12.18.2.2104
|
forge_version=14.21.1.2412
|
||||||
|
|
||||||
#########################################################
|
#########################################################
|
||||||
# Installable #
|
# Installable #
|
||||||
#########################################################
|
#########################################################
|
||||||
waila_version=1.7.0-B3_1.9.4
|
hwyla_version=1.8.19-B33_1.12
|
||||||
|
|
||||||
#########################################################
|
#########################################################
|
||||||
# Provided APIs #
|
# Provided APIs #
|
||||||
#########################################################
|
#########################################################
|
||||||
jei_version=3.12.7.312
|
jei_version=4.7.1.69
|
||||||
tesla_version=1.10.2-1.2.1.49
|
tesla_version=1.0.61
|
||||||
ic2_version=2.6.96-ex110
|
ic2_version=2.8.7-ex112
|
||||||
|
rf_version=2.0.0.1
|
||||||
|
top_version=1.12-1.4.8-2
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ task apiJar(type: Jar) {
|
|||||||
from sourceSets.api.java
|
from sourceSets.api.java
|
||||||
include "appeng/api/**"
|
include "appeng/api/**"
|
||||||
|
|
||||||
from sourceSets.main.output
|
from sourceSets.api.output
|
||||||
include "appeng/api/**"
|
include "appeng/api/**"
|
||||||
|
|
||||||
classifier = 'api'
|
classifier = 'api'
|
||||||
|
|||||||
@@ -38,6 +38,26 @@ repositories {
|
|||||||
name = "IC2 repo"
|
name = "IC2 repo"
|
||||||
url = "http://maven.ic2.player.to"
|
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 {
|
configurations {
|
||||||
@@ -46,14 +66,20 @@ configurations {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// installable runtime 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 "net.industrial-craft:industrialcraft-2:${ic2_version}:dev"
|
||||||
|
mods "mcjty.theoneprobe:TheOneProbe-${minecraft_version}:${top_version}"
|
||||||
|
// mods "com.github.mcjty:compatlayer:${compatlayer_version}"
|
||||||
|
|
||||||
// compile against provided APIs
|
// compile against provided APIs
|
||||||
compileOnly "mezz.jei:jei_${minecraft_version}:${jei_version}:api"
|
compileOnly "mezz.jei:jei_${minecraft_version}:${jei_version}:api"
|
||||||
compileOnly "mcp.mobius.waila:Waila:${waila_version}"
|
compileOnly "mcp.mobius.waila:Hwyla:${hwyla_version}"
|
||||||
compileOnly "net.darkhax.tesla:Tesla:${tesla_version}"
|
compileOnly "net.darkhax.tesla:Tesla-${minecraft_version}:${tesla_version}"
|
||||||
compileOnly "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
|
compileOnly "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
|
||||||
|
compileOnly "mcjty.theoneprobe:TheOneProbe-1.12:${top_version}:api"
|
||||||
|
|
||||||
|
// deobfCompile "mcp.mobius.waila:Hwyla:${hwyla_version}"
|
||||||
|
deobfCompile "cofh:RedstoneFlux:${minecraft_version}-${rf_version}:universal"
|
||||||
|
|
||||||
// at runtime, use the full JEI jar
|
// at runtime, use the full JEI jar
|
||||||
runtime "mezz.jei:jei_${minecraft_version}:${jei_version}"
|
runtime "mezz.jei:jei_${minecraft_version}:${jei_version}"
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is part of Applied Energistics 2.
|
|
||||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
|
||||||
*
|
|
||||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
|
||||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Should be provided by ForgeGradle, some idea user should confirm it.
|
|
||||||
apply plugin: 'idea'
|
|
||||||
|
|
||||||
idea {
|
|
||||||
module {
|
|
||||||
inheritOutputDirs = true
|
|
||||||
|
|
||||||
// excludes integration due to not being available upon port
|
|
||||||
excludeDirs += file('src/main/java/appeng/parts/layers/')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -20,18 +20,18 @@ task wrapper(type: Wrapper) {
|
|||||||
gradleVersion = "2.14"
|
gradleVersion = "2.14"
|
||||||
}
|
}
|
||||||
|
|
||||||
// WAILA
|
// HWYLA
|
||||||
task installWaila(type: Copy, dependsOn: "deinstallWaila") {
|
task installHwyla(type: Copy, dependsOn: "deinstallHwyla") {
|
||||||
from { configurations.mods }
|
from { configurations.mods }
|
||||||
include "**/*Waila*.jar"
|
include "**/*Hwyla*.jar"
|
||||||
into file(minecraft.runDir + "/mods")
|
into file(minecraft.runDir + "/mods")
|
||||||
}
|
}
|
||||||
|
|
||||||
task deinstallWaila(type: Delete) {
|
task deinstallHwyla(type: Delete) {
|
||||||
delete fileTree(dir: minecraft.runDir + "/mods", include: "*Waila*.jar")
|
delete fileTree(dir: minecraft.runDir + "/mods", include: "*Hwyla*.jar")
|
||||||
}
|
}
|
||||||
|
|
||||||
// IC²
|
// IC2
|
||||||
task installIC2(type: Copy, dependsOn: "deinstallIC2") {
|
task installIC2(type: Copy, dependsOn: "deinstallIC2") {
|
||||||
from { configurations.mods }
|
from { configurations.mods }
|
||||||
include "**/*industrialcraft-2*.jar"
|
include "**/*industrialcraft-2*.jar"
|
||||||
@@ -41,3 +41,15 @@ task installIC2(type: Copy, dependsOn: "deinstallIC2") {
|
|||||||
task deinstallIC2(type: Delete) {
|
task deinstallIC2(type: Delete) {
|
||||||
delete fileTree(dir: minecraft.runDir + "/mods", include: "*industrialcraft-2*.jar")
|
delete fileTree(dir: minecraft.runDir + "/mods", include: "*industrialcraft-2*.jar")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TOP
|
||||||
|
task installTop(type: Copy, dependsOn: ["deinstallTop"]) {
|
||||||
|
from { configurations.mods }
|
||||||
|
include "**/*TheOneProbe*.jar"
|
||||||
|
into file(minecraft.runDir + "/mods")
|
||||||
|
}
|
||||||
|
|
||||||
|
task deinstallTop(type: Delete) {
|
||||||
|
delete fileTree(dir: minecraft.runDir + "/mods", include: "*TheOneProbe*.jar")
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#Fri Sep 16 14:56:32 CEST 2016
|
#Tue Jul 04 22:38:49 CEST 2017
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public class BakingPipeline<F, T> implements BakingPipelineElement<F, T>
|
|||||||
@Override
|
@Override
|
||||||
public List pipe( List things, IBakedModel parent, IBlockState state, EnumFacing side, long rand )
|
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 );
|
things = pipe.pipe( things, parent, state, side, rand );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ public enum TunnelType
|
|||||||
ME, // Network Tunnel
|
ME, // Network Tunnel
|
||||||
IC2_POWER, // EU Tunnel
|
IC2_POWER, // EU Tunnel
|
||||||
RF_POWER, // RF Tunnel
|
RF_POWER, // RF Tunnel
|
||||||
|
FE_POWER, // Forge Energy tunnel
|
||||||
REDSTONE, // Redstone Tunnel
|
REDSTONE, // Redstone Tunnel
|
||||||
FLUID, // Fluid Tunnel
|
FLUID, // Fluid Tunnel
|
||||||
ITEM, // Item Tunnel
|
ITEM, // Item Tunnel
|
||||||
|
|||||||
@@ -111,8 +111,6 @@ public interface IMaterials
|
|||||||
|
|
||||||
IItemDefinition matterBall();
|
IItemDefinition matterBall();
|
||||||
|
|
||||||
IItemDefinition ironNugget();
|
|
||||||
|
|
||||||
IItemDefinition certusQuartzCrystal();
|
IItemDefinition certusQuartzCrystal();
|
||||||
|
|
||||||
IItemDefinition certusQuartzCrystalCharged();
|
IItemDefinition certusQuartzCrystalCharged();
|
||||||
|
|||||||
@@ -76,11 +76,13 @@ public interface IParts
|
|||||||
|
|
||||||
IItemDefinition p2PTunnelItems();
|
IItemDefinition p2PTunnelItems();
|
||||||
|
|
||||||
IItemDefinition p2PTunnelLiquids();
|
IItemDefinition p2PTunnelFluids();
|
||||||
|
|
||||||
// IItemDefinition p2PTunnelEU();
|
IItemDefinition p2PTunnelEU();
|
||||||
|
|
||||||
// IItemDefinition p2PTunnelRF();
|
IItemDefinition p2PTunnelRF();
|
||||||
|
|
||||||
|
IItemDefinition p2PTunnelFE();
|
||||||
|
|
||||||
IItemDefinition p2PTunnelLight();
|
IItemDefinition p2PTunnelLight();
|
||||||
|
|
||||||
|
|||||||
+15
-43
@@ -24,13 +24,17 @@
|
|||||||
package appeng.api.features;
|
package appeng.api.features;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registration Records for {@link IGrinderRegistry}
|
* Registration Records for {@link IGrinderRegistry}
|
||||||
*/
|
*/
|
||||||
public interface IGrinderEntry
|
public interface IGrinderRecipe
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,66 +42,40 @@ public interface IGrinderEntry
|
|||||||
*
|
*
|
||||||
* @return input that the grinder will accept.
|
* @return input that the grinder will accept.
|
||||||
*/
|
*/
|
||||||
|
@Nonnull
|
||||||
ItemStack getInput();
|
ItemStack getInput();
|
||||||
|
|
||||||
/**
|
|
||||||
* lets you change the grinder recipe by changing its input.
|
|
||||||
*
|
|
||||||
* @param input input item
|
|
||||||
*/
|
|
||||||
void setInput( ItemStack input );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gets the current output
|
* gets the current output
|
||||||
*
|
*
|
||||||
* @return output that the grinder will produce
|
* @return output that the grinder will produce
|
||||||
*/
|
*/
|
||||||
|
@Nonnull
|
||||||
ItemStack getOutput();
|
ItemStack getOutput();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* allows you to change the output.
|
* gets the current output
|
||||||
*
|
*
|
||||||
* @param output output item
|
* @return output that the grinder will produce
|
||||||
*/
|
*/
|
||||||
void setOutput( ItemStack output );
|
@Nonnull
|
||||||
|
Optional<ItemStack> getOptionalOutput();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gets the current output
|
* gets the current output
|
||||||
*
|
*
|
||||||
* @return output that the grinder will produce
|
* @return output that the grinder will produce
|
||||||
*/
|
*/
|
||||||
ItemStack getOptionalOutput();
|
Optional<ItemStack> getSecondOptionalOutput();
|
||||||
|
|
||||||
/**
|
|
||||||
* gets the current output
|
|
||||||
*
|
|
||||||
* @return output that the grinder will produce
|
|
||||||
*/
|
|
||||||
ItemStack getSecondOptionalOutput();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* stack, and 0.0-1.0 chance that it will be generated.
|
|
||||||
*
|
|
||||||
* @param output output item
|
|
||||||
* @param chance generation chance
|
|
||||||
*/
|
|
||||||
void setOptionalOutput( ItemStack output, float chance );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 0.0 - 1.0 the chance that the optional output will be generated.
|
* 0.0 - 1.0 the chance that the optional output will be generated.
|
||||||
*
|
*
|
||||||
* @return chance of optional output
|
* @return chance of optional output
|
||||||
*/
|
*/
|
||||||
|
@Nonnull
|
||||||
float getOptionalChance();
|
float getOptionalChance();
|
||||||
|
|
||||||
/**
|
|
||||||
* stack, and 0.0-1.0 chance that it will be generated.
|
|
||||||
*
|
|
||||||
* @param output second optional output item
|
|
||||||
* @param chance second optional output chance
|
|
||||||
*/
|
|
||||||
void setSecondOptionalOutput( ItemStack output, float chance );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 0.0 - 1.0 the chance that the optional output will be generated.
|
* 0.0 - 1.0 the chance that the optional output will be generated.
|
||||||
*
|
*
|
||||||
@@ -106,16 +84,10 @@ public interface IGrinderEntry
|
|||||||
float getSecondOptionalChance();
|
float getSecondOptionalChance();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Energy cost, in turns.
|
* Amount of turns required to process the item.
|
||||||
*
|
*
|
||||||
* @return number of turns it takes to produce the output from the input.
|
* @return number of turns it takes to produce the output from the input.
|
||||||
*/
|
*/
|
||||||
int getEnergyCost();
|
int getRequiredTurns();
|
||||||
|
|
||||||
/**
|
|
||||||
* Allows you to adjust the number of turns
|
|
||||||
*
|
|
||||||
* @param c number of turns to produce output.
|
|
||||||
*/
|
|
||||||
void setEnergyCost( int c );
|
|
||||||
}
|
}
|
||||||
@@ -24,7 +24,10 @@
|
|||||||
package appeng.api.features;
|
package appeng.api.features;
|
||||||
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
@@ -36,51 +39,90 @@ public interface IGrinderRegistry
|
|||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Current list of registered recipes, you can modify this if you want too.
|
* An immutable list of the currently registered recipes.
|
||||||
*
|
*
|
||||||
* @return currentlyRegisteredRecipes
|
* @return currentlyRegisteredRecipes
|
||||||
*/
|
*/
|
||||||
List<IGrinderEntry> getRecipes();
|
@Nonnull
|
||||||
|
Collection<IGrinderRecipe> getRecipes();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* add a new recipe the easy way, in → out, how many turns., duplicates will not be added.
|
* Add a new recipe with a single input and output and how many turns it requires.
|
||||||
*
|
*
|
||||||
* @param in input
|
* Will ignore duplicate recipes with the same input item.
|
||||||
* @param out output
|
*
|
||||||
* @param turns amount of turns to turn the input into the output
|
* @param in The {@link ItemStack} to grind.
|
||||||
|
* @param out The {@link ItemStack} to output.
|
||||||
|
* @param turns Amount of turns to turn the input into the output, with turns > 0.
|
||||||
*/
|
*/
|
||||||
void addRecipe( ItemStack in, ItemStack out, int turns );
|
void addRecipe( @Nonnull ItemStack in, @Nonnull ItemStack out, int turns );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a new recipe with an input, output and a single optional output.
|
||||||
|
*
|
||||||
|
* Will ignore duplicate recipes with the same input item.
|
||||||
|
*
|
||||||
|
* @param in The {@link ItemStack} to grind.
|
||||||
|
* @param out The {@link ItemStack} to output.
|
||||||
|
* @param optional The optional {@link ItemStack} to output of a certain chance.
|
||||||
|
* @param chance Chance to get the optional output within 0.0 - 1.0
|
||||||
|
* @param turns Amount of turns to turn the input into the output, with turns > 0.
|
||||||
|
*/
|
||||||
|
void addRecipe( @Nonnull ItemStack in, @Nonnull ItemStack out, @Nonnull ItemStack optional, float chance, int turns );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* add a new recipe with optional outputs, duplicates will not be added.
|
* add a new recipe with optional outputs, duplicates will not be added.
|
||||||
*
|
*
|
||||||
* @param in input
|
* Will ignore duplicate recipes with the same input item.
|
||||||
* @param out output
|
|
||||||
* @param optional optional output
|
|
||||||
* @param chance chance to get the optional output within 0.0 - 1.0
|
|
||||||
* @param turns amount of turns to turn the input into the outputs
|
|
||||||
*/
|
|
||||||
void addRecipe( ItemStack in, ItemStack out, ItemStack optional, float chance, int turns );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* add a new recipe with optional outputs, duplicates will not be added.
|
|
||||||
*
|
*
|
||||||
* @param in input
|
* @param in The {@link ItemStack} to grind.
|
||||||
* @param out output
|
* @param out The {@link ItemStack} to output.
|
||||||
* @param optional optional output
|
* @param optional The first optional {@link ItemStack} to output of a certain chance.
|
||||||
* @param chance chance to get the optional output within 0.0 - 1.0
|
* @param chance Chance to get the first optional output within 0.0 - 1.0
|
||||||
* @param optional2 second optional output
|
* @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 chance2 chance to get the second optional output within 0.0 - 1.0
|
||||||
* @param turns amount of turns to turn the input into the outputs
|
* @param turns Amount of turns to turn the input into the output, with turns > 0.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
void addRecipe( ItemStack in, ItemStack out, ItemStack optional, float chance, ItemStack optional2, float chance2, int turns );
|
void addRecipe( @Nonnull ItemStack in, @Nonnull ItemStack out, @Nonnull ItemStack optional, float chance, @Nonnull ItemStack optional2, float chance2, int turns );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the specific from the recipe list.
|
||||||
|
*
|
||||||
|
* @param recipe The recipe to be removed.
|
||||||
|
* @return true, if it was removed
|
||||||
|
*/
|
||||||
|
boolean removeRecipe( @Nonnull IGrinderRecipe recipe );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Searches for a recipe for a given input, and returns it.
|
* Searches for a recipe for a given input, and returns it.
|
||||||
*
|
*
|
||||||
* @param input input
|
* @param input The {@link ItemStack} to be grinded.
|
||||||
*
|
*
|
||||||
* @return identified recipe or null
|
* @return identified recipe or null
|
||||||
*/
|
*/
|
||||||
IGrinderEntry getRecipeForInput( ItemStack input );
|
@Nullable
|
||||||
|
IGrinderRecipe getRecipeForInput( @Nonnull ItemStack input );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows do add a custom ratio from an ore to dust when being grinded.
|
||||||
|
*
|
||||||
|
* The default ratio is 1 ore to 2 dusts.
|
||||||
|
*
|
||||||
|
* These have to be added before any recipe is registered. Otherwise it will use the default value.
|
||||||
|
*
|
||||||
|
* @param oredictName The name of the ore;
|
||||||
|
* @param ratio The amount, must be > 0;
|
||||||
|
*/
|
||||||
|
void addDustRatio( @Nonnull String oredictName, int ratio );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove a custom ratio for a specific ore name.
|
||||||
|
*
|
||||||
|
* Will use the default of 2 value afterwards.
|
||||||
|
*
|
||||||
|
* @param oredictName The name of the ore;
|
||||||
|
*/
|
||||||
|
boolean removeDustRatio( @Nonnull String oredictName );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
package appeng.api.features;
|
package appeng.api.features;
|
||||||
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@@ -44,7 +45,8 @@ public interface IP2PTunnelRegistry
|
|||||||
* @param trigger - the item which triggers attunement. Nullable, but then ignored
|
* @param trigger - the item which triggers attunement. Nullable, but then ignored
|
||||||
* @param type - the type of tunnel. 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.
|
* 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
|
* @return null if no attunement can be found or attunement
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nonnull
|
||||||
TunnelType getTunnelTypeByItem( ItemStack trigger );
|
TunnelType getTunnelTypeByItem( ItemStack trigger );
|
||||||
}
|
}
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
package appeng.api.implementations.guiobjects;
|
package appeng.api.implementations.guiobjects;
|
||||||
|
|
||||||
|
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraftforge.items.IItemHandler;
|
||||||
|
|
||||||
import appeng.api.networking.IGridHost;
|
import appeng.api.networking.IGridHost;
|
||||||
|
|
||||||
@@ -32,8 +32,9 @@ import appeng.api.networking.IGridHost;
|
|||||||
/**
|
/**
|
||||||
* Obtained via {@link IGuiItem} getGuiObject
|
* Obtained via {@link IGuiItem} getGuiObject
|
||||||
*/
|
*/
|
||||||
public interface INetworkTool extends IInventory, IGuiItemObject
|
public interface INetworkTool extends IGuiItemObject
|
||||||
{
|
{
|
||||||
|
|
||||||
IGridHost getGridHost(); // null for most purposes.
|
IGridHost getGridHost(); // null for most purposes.
|
||||||
|
|
||||||
|
IItemHandler getInventory();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,8 +23,7 @@
|
|||||||
|
|
||||||
package appeng.api.implementations.tiles;
|
package appeng.api.implementations.tiles;
|
||||||
|
|
||||||
|
import net.minecraftforge.items.IItemHandler;
|
||||||
import net.minecraft.inventory.IInventory;
|
|
||||||
|
|
||||||
|
|
||||||
public interface ISegmentedInventory
|
public interface ISegmentedInventory
|
||||||
@@ -38,5 +37,5 @@ public interface ISegmentedInventory
|
|||||||
*
|
*
|
||||||
* @return inventory with inventory name
|
* @return inventory with inventory name
|
||||||
*/
|
*/
|
||||||
IInventory getInventoryByName( String name );
|
IItemHandler getInventoryByName( String name );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,8 +23,7 @@
|
|||||||
|
|
||||||
package appeng.api.implementations.tiles;
|
package appeng.api.implementations.tiles;
|
||||||
|
|
||||||
|
import net.minecraftforge.items.IItemHandler;
|
||||||
import net.minecraft.inventory.IInventory;
|
|
||||||
|
|
||||||
|
|
||||||
public interface IViewCellStorage
|
public interface IViewCellStorage
|
||||||
@@ -35,5 +34,5 @@ public interface IViewCellStorage
|
|||||||
*
|
*
|
||||||
* @return inventory with at least 5 slot
|
* @return inventory with at least 5 slot
|
||||||
*/
|
*/
|
||||||
IInventory getViewCellStorage();
|
IItemHandler getViewCellStorage();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,12 +24,36 @@
|
|||||||
package appeng.api.networking.crafting;
|
package appeng.api.networking.crafting;
|
||||||
|
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
import appeng.api.storage.data.IAEStack;
|
import appeng.api.storage.data.IAEStack;
|
||||||
|
|
||||||
|
|
||||||
public interface ICraftingWatcher extends Collection<IAEStack>
|
/**
|
||||||
|
* DO NOT IMPLEMENT.
|
||||||
|
*
|
||||||
|
* Will be injected when adding an {@link ICraftingWatcherHost} to a grid.
|
||||||
|
*/
|
||||||
|
public interface ICraftingWatcher
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Add a specific {@link IAEStack} to watch.
|
||||||
|
*
|
||||||
|
* Supports multiple values, duplicate ones will not be added.
|
||||||
|
*
|
||||||
|
* @param stack
|
||||||
|
* @return true, if successfully added.
|
||||||
|
*/
|
||||||
|
boolean add( IAEStack<?> stack );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove a specific {@link IAEStack} from the watcher.
|
||||||
|
*
|
||||||
|
* @param stack
|
||||||
|
* @return true, if successfully removed.
|
||||||
|
*/
|
||||||
|
boolean remove( IAEStack<?> stack );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes all watched stacks and resets the watcher to a clean state.
|
||||||
|
*/
|
||||||
|
void reset();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,10 +24,34 @@
|
|||||||
package appeng.api.networking.energy;
|
package appeng.api.networking.energy;
|
||||||
|
|
||||||
|
|
||||||
import java.util.Collection;
|
/**
|
||||||
|
* DO NOT IMPLEMENT.
|
||||||
|
*
|
||||||
public interface IEnergyWatcher extends Collection<Double>
|
* Will be injected when adding an {@link IEnergyWatcherHost} to a grid.
|
||||||
|
*/
|
||||||
|
public interface IEnergyWatcher
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Add a specific threshold to watch.
|
||||||
|
*
|
||||||
|
* Supports multiple values, duplicate ones will not be added.
|
||||||
|
*
|
||||||
|
* @param amount
|
||||||
|
* @return true, if successfully added.
|
||||||
|
*/
|
||||||
|
boolean add( double amount );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove a specific threshold from the watcher.
|
||||||
|
*
|
||||||
|
* @param amount
|
||||||
|
* @return true, if successfully removed.
|
||||||
|
*/
|
||||||
|
boolean remove( double amount );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes all thresholds and resets the watcher to a clean state.
|
||||||
|
*/
|
||||||
|
void reset();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,12 +24,36 @@
|
|||||||
package appeng.api.networking.storage;
|
package appeng.api.networking.storage;
|
||||||
|
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
import appeng.api.storage.data.IAEStack;
|
import appeng.api.storage.data.IAEStack;
|
||||||
|
|
||||||
|
|
||||||
public interface IStackWatcher extends Collection<IAEStack>
|
/**
|
||||||
|
* DO NOT IMPLEMENT.
|
||||||
|
*
|
||||||
|
* Will be injected when adding an {@link IStackWatcherHost} to a grid.
|
||||||
|
*/
|
||||||
|
public interface IStackWatcher
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Add a specific {@link IAEStack} to watch.
|
||||||
|
*
|
||||||
|
* Supports multiple values, duplicate ones will not be added.
|
||||||
|
*
|
||||||
|
* @param stack
|
||||||
|
* @return true, if successfully added.
|
||||||
|
*/
|
||||||
|
boolean add( IAEStack<?> stack );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove a specific {@link IAEStack} from the watcher.
|
||||||
|
*
|
||||||
|
* @param stack
|
||||||
|
* @return true, if successfully removed.
|
||||||
|
*/
|
||||||
|
boolean remove( IAEStack<?> stack );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes all watched stacks and resets the watcher to a clean state.
|
||||||
|
*/
|
||||||
|
void reset();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,8 +24,6 @@
|
|||||||
package appeng.api.parts;
|
package appeng.api.parts;
|
||||||
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
@@ -71,7 +69,6 @@ public interface IFacadePart
|
|||||||
/**
|
/**
|
||||||
* The item that this facade masquerades as.
|
* The item that this facade masquerades as.
|
||||||
*/
|
*/
|
||||||
@Nullable
|
|
||||||
ItemStack getTextureItem();
|
ItemStack getTextureItem();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -25,10 +25,11 @@ package appeng.api.parts;
|
|||||||
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
@@ -39,9 +40,9 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.EnumHand;
|
import net.minecraft.util.EnumHand;
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.capabilities.Capability;
|
import net.minecraftforge.common.capabilities.Capability;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
@@ -71,7 +72,8 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
|
|||||||
ItemStack getItemStack( PartItemStack type );
|
ItemStack getItemStack( PartItemStack type );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render dynamic portions of this part, as part of the cable bus TESR. This part has to return true for {@link #requireDynamicRender()} in order for
|
* Render dynamic portions of this part, as part of the cable bus TESR. This part has to return true for
|
||||||
|
* {@link #requireDynamicRender()} in order for
|
||||||
* this method to be called.
|
* this method to be called.
|
||||||
*/
|
*/
|
||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
@@ -128,7 +130,7 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
|
|||||||
/**
|
/**
|
||||||
* a block around the bus's host has been changed.
|
* 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
|
* @return output redstone on facing side
|
||||||
@@ -267,8 +269,10 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
|
|||||||
boolean canBePlacedOn( BusSupport what );
|
boolean canBePlacedOn( BusSupport what );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is used when a chunk is rebuilt to determine how this part should be rendered. The returned models should represent the
|
* This method is used when a chunk is rebuilt to determine how this part should be rendered. The returned models
|
||||||
* part oriented north. They will be automatically rotated to match the part's actual orientation. Tint indices 1-4 can be used in the
|
* should represent the
|
||||||
|
* part oriented north. They will be automatically rotated to match the part's actual orientation. Tint indices 1-4
|
||||||
|
* can be used in the
|
||||||
* models to access the parts color.
|
* models to access the parts color.
|
||||||
*
|
*
|
||||||
* <dl>
|
* <dl>
|
||||||
@@ -279,18 +283,23 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
|
|||||||
* <dt>Tint Index 3</dt>
|
* <dt>Tint Index 3</dt>
|
||||||
* <dd>The {@link AEColor#whiteVariant bright variant color} of the cable that this part is attached to.</dd>
|
* <dd>The {@link AEColor#whiteVariant bright variant color} of the cable that this part is attached to.</dd>
|
||||||
* <dt>Tint Index 4</dt>
|
* <dt>Tint Index 4</dt>
|
||||||
* <dd>A color variant that is between the cable's {@link AEColor#mediumVariant color} and its {@link AEColor#whiteVariant bright variant}.</dd>
|
* <dd>A color variant that is between the cable's {@link AEColor#mediumVariant color} and its
|
||||||
|
* {@link AEColor#whiteVariant bright variant}.</dd>
|
||||||
* </dl>
|
* </dl>
|
||||||
*
|
*
|
||||||
* <b>Important:</b> All models must have been registered via the {@link IPartModels} API before use.
|
* <b>Important:</b> All models must have been registered via the {@link IPartModels} API before use.
|
||||||
*/
|
*/
|
||||||
default List<ResourceLocation> getStaticModels()
|
@Nonnull
|
||||||
|
default IPartModel getStaticModels()
|
||||||
{
|
{
|
||||||
return Collections.emptyList();
|
return new IPartModel()
|
||||||
|
{
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement this method if your part exposes capabilitys. Any requests for capabilities on the cable bus will be forwarded to parts on the appropriate
|
* Implement this method if your part exposes capabilitys. Any requests for capabilities on the cable bus will be
|
||||||
|
* forwarded to parts on the appropriate
|
||||||
* side.
|
* side.
|
||||||
*
|
*
|
||||||
* @see TileEntity#hasCapability(Capability, EnumFacing)
|
* @see TileEntity#hasCapability(Capability, EnumFacing)
|
||||||
@@ -303,7 +312,8 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement this method if your part exposes capabilitys. Any requests for capabilities on the cable bus will be forwarded to parts on the appropriate
|
* Implement this method if your part exposes capabilitys. Any requests for capabilities on the cable bus will be
|
||||||
|
* forwarded to parts on the appropriate
|
||||||
* side.
|
* side.
|
||||||
*
|
*
|
||||||
* @see TileEntity#getCapability(Capability, EnumFacing)
|
* @see TileEntity#getCapability(Capability, EnumFacing)
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
/*
|
||||||
|
* The MIT License (MIT)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013 - 2015 AlgorithmX2
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
* this software and associated documentation files (the "Software"), to deal in
|
||||||
|
* the Software without restriction, including without limitation the rights to
|
||||||
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
* subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package appeng.api.parts;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A container to store a collection of {@link ResourceLocation} as models for a part as well as other properties.
|
||||||
|
*/
|
||||||
|
public interface IPartModel
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A solid {@link IPartModel} indicates that the rendering requires a cable connection, which will also result in
|
||||||
|
* creating an intersection for the cable.
|
||||||
|
*
|
||||||
|
* This should be true for pretty much all parts.
|
||||||
|
*
|
||||||
|
* @return true for a solid part.
|
||||||
|
*/
|
||||||
|
default boolean requireCableConnection()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A collection of {@link ResourceLocation} used as models for a part.
|
||||||
|
*
|
||||||
|
* @return a collection of models, never null.
|
||||||
|
*/
|
||||||
|
@Nonnull
|
||||||
|
default List<ResourceLocation> getModels()
|
||||||
|
{
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -24,8 +24,8 @@
|
|||||||
package appeng.api.storage;
|
package appeng.api.storage;
|
||||||
|
|
||||||
|
|
||||||
import net.minecraft.inventory.IInventory;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraftforge.items.IItemHandler;
|
||||||
|
|
||||||
import appeng.api.config.FuzzyMode;
|
import appeng.api.config.FuzzyMode;
|
||||||
import appeng.api.storage.data.IAEItemStack;
|
import appeng.api.storage.data.IAEItemStack;
|
||||||
@@ -52,12 +52,12 @@ public interface ICellInventory extends IMEInventory<IAEItemStack>
|
|||||||
/**
|
/**
|
||||||
* @return access configured list
|
* @return access configured list
|
||||||
*/
|
*/
|
||||||
IInventory getConfigInventory();
|
IItemHandler getConfigInventory();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return access installed upgrades.
|
* @return access installed upgrades.
|
||||||
*/
|
*/
|
||||||
IInventory getUpgradesInventory();
|
IItemHandler getUpgradesInventory();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return How many bytes are used for each type?
|
* @return How many bytes are used for each type?
|
||||||
|
|||||||
@@ -24,8 +24,8 @@
|
|||||||
package appeng.api.storage;
|
package appeng.api.storage;
|
||||||
|
|
||||||
|
|
||||||
import net.minecraft.inventory.IInventory;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraftforge.items.IItemHandler;
|
||||||
|
|
||||||
import appeng.api.config.FuzzyMode;
|
import appeng.api.config.FuzzyMode;
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ public interface ICellWorkbenchItem
|
|||||||
*
|
*
|
||||||
* onInventoryChange will be called when saving is needed.
|
* 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.
|
* 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.
|
* onInventoryChange will be called when saving is needed.
|
||||||
*/
|
*/
|
||||||
IInventory getConfigInventory( ItemStack is );
|
IItemHandler getConfigInventory( ItemStack is );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the current fuzzy status.
|
* @return the current fuzzy status.
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
|
|||||||
|
|
||||||
private final IMEInventoryHandler<StackType> internalHandler;
|
private final IMEInventoryHandler<StackType> internalHandler;
|
||||||
private final IItemList<StackType> cachedList;
|
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;
|
protected boolean hasChanged = true;
|
||||||
|
|
||||||
|
|||||||
@@ -203,4 +203,15 @@ public interface IAEStack<StackType extends IAEStack>
|
|||||||
* @return ITEM or FLUID
|
* @return ITEM or FLUID
|
||||||
*/
|
*/
|
||||||
StorageChannel getChannel();
|
StorageChannel getChannel();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true if it should show the crafting label.
|
||||||
|
*/
|
||||||
|
boolean getShowCraftingLabel();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used internally to show that it should show a Crafting label instead of a "1"
|
||||||
|
*/
|
||||||
|
void setShowCraftingLabel( boolean showCraftingLabel );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,15 +47,15 @@ public enum AECableType
|
|||||||
SMART,
|
SMART,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dense Cable, represents a tier 2 block that can carry 32 channels.
|
* Smart Dense Cable, represents a tier 2 block that can carry 32 channels.
|
||||||
*/
|
*/
|
||||||
DENSE;
|
DENSE_SMART;
|
||||||
|
|
||||||
public static final AECableType[] VALIDCABLES = {
|
public static final AECableType[] VALIDCABLES = {
|
||||||
GLASS,
|
GLASS,
|
||||||
COVERED,
|
COVERED,
|
||||||
SMART,
|
SMART,
|
||||||
DENSE
|
DENSE_SMART
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -146,14 +146,14 @@ public enum AEColor
|
|||||||
case 0:
|
case 0:
|
||||||
return -1;
|
return -1;
|
||||||
case TINTINDEX_DARK:
|
case TINTINDEX_DARK:
|
||||||
return blackVariant;
|
return this.blackVariant;
|
||||||
case TINTINDEX_MEDIUM:
|
case TINTINDEX_MEDIUM:
|
||||||
return mediumVariant;
|
return this.mediumVariant;
|
||||||
case TINTINDEX_BRIGHT:
|
case TINTINDEX_BRIGHT:
|
||||||
return whiteVariant;
|
return this.whiteVariant;
|
||||||
case TINTINDEX_MEDIUM_BRIGHT:
|
case TINTINDEX_MEDIUM_BRIGHT:
|
||||||
final int light = whiteVariant;
|
final int light = this.whiteVariant;
|
||||||
final int dark = mediumVariant;
|
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 );
|
return ( ( ( ( ( light >> 16 ) & 0xff ) + ( ( dark >> 16 ) & 0xff ) ) / 2 ) << 16 ) | ( ( ( ( ( light >> 8 ) & 0xff ) + ( ( dark >> 8 ) & 0xff ) ) / 2 ) << 8 ) | ( ( ( ( light ) & 0xff ) + ( ( dark ) & 0xff ) ) / 2 );
|
||||||
default:
|
default:
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@@ -31,10 +31,9 @@ import net.minecraft.block.properties.IProperty;
|
|||||||
import net.minecraft.block.state.BlockStateContainer;
|
import net.minecraft.block.state.BlockStateContainer;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.client.util.ITooltipFlag;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.EnumHand;
|
import net.minecraft.util.EnumHand;
|
||||||
@@ -65,12 +64,6 @@ public abstract class AEBaseBlock extends Block
|
|||||||
|
|
||||||
protected AxisAlignedBB boundingBox = FULL_BLOCK_AABB;
|
protected AxisAlignedBB boundingBox = FULL_BLOCK_AABB;
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isVisuallyOpaque()
|
|
||||||
{
|
|
||||||
return this.isOpaque() && this.isFullSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected AEBaseBlock( final Material mat )
|
protected AEBaseBlock( final Material mat )
|
||||||
{
|
{
|
||||||
super( mat );
|
super( mat );
|
||||||
@@ -96,13 +89,9 @@ public abstract class AEBaseBlock extends Block
|
|||||||
this.setLightLevel( 0 );
|
this.setLightLevel( 0 );
|
||||||
this.setHardness( 2.2F );
|
this.setHardness( 2.2F );
|
||||||
this.setHarvestLevel( "pickaxe", 0 );
|
this.setHarvestLevel( "pickaxe", 0 );
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
// Workaround as vanilla sets it way too early.
|
||||||
public String toString()
|
this.fullBlock = this.isFullSize();
|
||||||
{
|
|
||||||
String regName = getRegistryName() != null ? getRegistryName().getResourcePath() : "unregistered";
|
|
||||||
return getClass().getSimpleName() + "[" + regName + "]";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -111,50 +100,34 @@ public abstract class AEBaseBlock extends Block
|
|||||||
return new BlockStateContainer( this, this.getAEStates() );
|
return new BlockStateContainer( this, this.getAEStates() );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected IProperty[] getAEStates()
|
@SuppressWarnings( "deprecation" )
|
||||||
{
|
|
||||||
return new IProperty[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isOpaque()
|
|
||||||
{
|
|
||||||
return this.isOpaque;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isNormalCube( IBlockState state )
|
public final boolean isNormalCube( IBlockState state )
|
||||||
{
|
{
|
||||||
return this.isFullSize() && this.isOpaque();
|
return this.isFullSize() && this.isOpaque();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ICustomCollision getCustomCollision( final World w, final BlockPos pos )
|
@SuppressWarnings( "deprecation" )
|
||||||
{
|
|
||||||
if( this instanceof ICustomCollision )
|
|
||||||
{
|
|
||||||
return (ICustomCollision) this;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AxisAlignedBB getBoundingBox( IBlockState state, IBlockAccess source, BlockPos pos )
|
public AxisAlignedBB getBoundingBox( IBlockState state, IBlockAccess source, BlockPos pos )
|
||||||
{
|
{
|
||||||
return boundingBox;
|
return this.boundingBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings( "deprecation" )
|
||||||
@Override
|
@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 );
|
final ICustomCollision collisionHandler = this.getCustomCollision( w, pos );
|
||||||
|
|
||||||
if( collisionHandler != null && bb != null )
|
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 );
|
collisionHandler.addCollidingBlockToList( w, pos, bb, tmp, e );
|
||||||
for( final AxisAlignedBB b : tmp )
|
for( final AxisAlignedBB b : tmp )
|
||||||
{
|
{
|
||||||
final AxisAlignedBB offset = b.offset( pos.getX(), pos.getY(), pos.getZ() );
|
final AxisAlignedBB offset = b.offset( pos.getX(), pos.getY(), pos.getZ() );
|
||||||
if( bb.intersectsWith( offset ) )
|
if( bb.intersects( offset ) )
|
||||||
{
|
{
|
||||||
out.add( offset );
|
out.add( offset );
|
||||||
}
|
}
|
||||||
@@ -162,10 +135,11 @@ public abstract class AEBaseBlock extends Block
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
super.addCollisionBoxToList( state, w, pos, bb, out, e );
|
super.addCollisionBoxToList( state, w, pos, bb, out, e, p_185477_7_ );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings( "deprecation" )
|
||||||
@Override
|
@Override
|
||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
public AxisAlignedBB getSelectedBoundingBox( IBlockState state, final World w, final BlockPos pos )
|
public AxisAlignedBB getSelectedBoundingBox( IBlockState state, final World w, final BlockPos pos )
|
||||||
@@ -176,10 +150,10 @@ public abstract class AEBaseBlock extends Block
|
|||||||
{
|
{
|
||||||
if( Platform.isClient() )
|
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 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;
|
AxisAlignedBB br = null;
|
||||||
|
|
||||||
double lastDist = 0;
|
double lastDist = 0;
|
||||||
@@ -194,9 +168,9 @@ public abstract class AEBaseBlock extends Block
|
|||||||
|
|
||||||
if( r != null )
|
if( r != null )
|
||||||
{
|
{
|
||||||
final double xLen = ( ld.getA().xCoord - r.hitVec.xCoord );
|
final double xLen = ( ld.getA().x - r.hitVec.x );
|
||||||
final double yLen = ( ld.getA().yCoord - r.hitVec.yCoord );
|
final double yLen = ( ld.getA().y - r.hitVec.y );
|
||||||
final double zLen = ( ld.getA().zCoord - r.hitVec.zCoord );
|
final double zLen = ( ld.getA().z - r.hitVec.z );
|
||||||
|
|
||||||
final double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
|
final double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
|
||||||
|
|
||||||
@@ -210,7 +184,8 @@ public abstract class AEBaseBlock extends Block
|
|||||||
|
|
||||||
if( br != null )
|
if( br != null )
|
||||||
{
|
{
|
||||||
br = new AxisAlignedBB( br.minX + pos.getX(), br.minY + pos.getY(), br.minZ + pos.getZ(), br.maxX + pos.getX(), br.maxY + pos.getY(), br.maxZ + pos.getZ() );
|
br = new AxisAlignedBB( br.minX + pos.getX(), br.minY + pos.getY(), br.minZ + pos.getZ(), br.maxX + pos.getX(), br.maxY + pos
|
||||||
|
.getY(), br.maxZ + pos.getZ() );
|
||||||
return br;
|
return br;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -241,7 +216,8 @@ public abstract class AEBaseBlock extends Block
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
b = new AxisAlignedBB( b.minX + pos.getX(), b.minY + pos.getY(), b.minZ + pos.getZ(), b.maxX + pos.getX(), b.maxY + pos.getY(), b.maxZ + pos.getZ() );
|
b = new AxisAlignedBB( b.minX + pos.getX(), b.minY + pos.getY(), b.minZ + pos.getZ(), b.maxX + pos.getX(), b.maxY + pos.getY(), b.maxZ + pos
|
||||||
|
.getZ() );
|
||||||
}
|
}
|
||||||
|
|
||||||
return b;
|
return b;
|
||||||
@@ -250,12 +226,14 @@ public abstract class AEBaseBlock extends Block
|
|||||||
return super.getSelectedBoundingBox( state, w, pos );
|
return super.getSelectedBoundingBox( state, w, pos );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings( "deprecation" )
|
||||||
@Override
|
@Override
|
||||||
public final boolean isOpaqueCube( IBlockState state )
|
public final boolean isOpaqueCube( IBlockState state )
|
||||||
{
|
{
|
||||||
return this.isOpaque();
|
return this.isOpaque();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings( "deprecation" )
|
||||||
@Override
|
@Override
|
||||||
public RayTraceResult collisionRayTrace( final IBlockState state, final World w, final BlockPos pos, final Vec3d a, final Vec3d b )
|
public RayTraceResult collisionRayTrace( final IBlockState state, final World w, final BlockPos pos, final Vec3d a, final Vec3d b )
|
||||||
{
|
{
|
||||||
@@ -278,9 +256,9 @@ public abstract class AEBaseBlock extends Block
|
|||||||
|
|
||||||
if( r != null )
|
if( r != null )
|
||||||
{
|
{
|
||||||
final double xLen = ( a.xCoord - r.hitVec.xCoord );
|
final double xLen = ( a.x - r.hitVec.x );
|
||||||
final double yLen = ( a.yCoord - r.hitVec.yCoord );
|
final double yLen = ( a.y - r.hitVec.y );
|
||||||
final double zLen = ( a.zCoord - r.hitVec.zCoord );
|
final double zLen = ( a.z - r.hitVec.z );
|
||||||
|
|
||||||
final double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
|
final double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
|
||||||
if( br == null || lastDist > thisDist )
|
if( br == null || lastDist > thisDist )
|
||||||
@@ -303,25 +281,14 @@ public abstract class AEBaseBlock extends Block
|
|||||||
return super.collisionRayTrace( state, w, pos, a, b );
|
return super.collisionRayTrace( state, w, pos, a, b );
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean onActivated( final World w, final BlockPos pos, final EntityPlayer player, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
@SuppressWarnings( "deprecation" )
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly( Side.CLIENT )
|
|
||||||
@SuppressWarnings( "unchecked" )
|
|
||||||
public final void getSubBlocks( final Item item, final CreativeTabs tabs, final List itemStacks )
|
|
||||||
{
|
|
||||||
this.getCheckedSubBlocks( item, tabs, itemStacks );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasComparatorInputOverride( IBlockState state )
|
public boolean hasComparatorInputOverride( IBlockState state )
|
||||||
{
|
{
|
||||||
return this.isInventory();
|
return this.isInventory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings( "deprecation" )
|
||||||
@Override
|
@Override
|
||||||
public int getComparatorInputOverride( IBlockState state, final World worldIn, final BlockPos pos )
|
public int getComparatorInputOverride( IBlockState state, final World worldIn, final BlockPos pos )
|
||||||
{
|
{
|
||||||
@@ -329,21 +296,11 @@ public abstract class AEBaseBlock extends Block
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isNormalCube( IBlockState state, final IBlockAccess world, final BlockPos pos )
|
public final boolean isNormalCube( IBlockState state, final IBlockAccess world, final BlockPos pos )
|
||||||
{
|
{
|
||||||
return this.isFullSize();
|
return this.isFullSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IOrientable getOrientable( final IBlockAccess w, final BlockPos pos )
|
|
||||||
{
|
|
||||||
if( this instanceof IOrientableBlock )
|
|
||||||
{
|
|
||||||
IOrientableBlock orientable = (IOrientableBlock) this;
|
|
||||||
return orientable.getOrientable( w, pos );
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean rotateBlock( final World w, final BlockPos pos, final EnumFacing axis )
|
public boolean rotateBlock( final World w, final BlockPos pos, final EnumFacing axis )
|
||||||
{
|
{
|
||||||
@@ -378,21 +335,6 @@ public abstract class AEBaseBlock extends Block
|
|||||||
return super.rotateBlock( w, pos, axis );
|
return super.rotateBlock( w, pos, axis );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean hasCustomRotation()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void customRotateBlock( final IOrientable rotatable, final EnumFacing axis )
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isValidOrientation( final World w, final BlockPos pos, final EnumFacing forward, final EnumFacing up )
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumFacing[] getValidRotations( final World w, final BlockPos pos )
|
public EnumFacing[] getValidRotations( final World w, final BlockPos pos )
|
||||||
{
|
{
|
||||||
@@ -400,28 +342,18 @@ public abstract class AEBaseBlock extends Block
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
|
|
||||||
{
|
|
||||||
super.getSubBlocks( item, tabs, itemStacks );
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUnlocalizedName( final ItemStack is )
|
|
||||||
{
|
|
||||||
return this.getUnlocalizedName();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addInformation( final ItemStack is, final EntityPlayer player, final List<String> lines, final boolean advancedItemTooltips )
|
public void addInformation( final ItemStack is, final World world, final List<String> lines, final ITooltipFlag advancedItemTooltips )
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasSubtypes()
|
public boolean onActivated( final World w, final BlockPos pos, final EntityPlayer player, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
||||||
{
|
{
|
||||||
return this.hasSubtypes;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public EnumFacing mapRotation( final IOrientable ori, final EnumFacing dir )
|
public final EnumFacing mapRotation( final IOrientable ori, final EnumFacing dir )
|
||||||
{
|
{
|
||||||
// case DOWN: return bottomIcon;
|
// case DOWN: return bottomIcon;
|
||||||
// case UP: return blockIcon;
|
// case UP: return blockIcon;
|
||||||
@@ -486,36 +418,97 @@ public abstract class AEBaseBlock extends Block
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isFullSize()
|
@Override
|
||||||
|
public String toString()
|
||||||
{
|
{
|
||||||
return this.isFullSize;
|
String regName = this.getRegistryName() != null ? this.getRegistryName().getResourcePath() : "unregistered";
|
||||||
|
return this.getClass().getSimpleName() + "[" + regName + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean setFullSize( final boolean isFullSize )
|
protected String getUnlocalizedName( final ItemStack is )
|
||||||
{
|
{
|
||||||
this.isFullSize = isFullSize;
|
return this.getUnlocalizedName();
|
||||||
return isFullSize;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean setOpaque( final boolean isOpaque )
|
protected boolean hasCustomRotation()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void customRotateBlock( final IOrientable rotatable, final EnumFacing axis )
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected IOrientable getOrientable( final IBlockAccess w, final BlockPos pos )
|
||||||
|
{
|
||||||
|
if( this instanceof IOrientableBlock )
|
||||||
|
{
|
||||||
|
IOrientableBlock orientable = (IOrientableBlock) this;
|
||||||
|
return orientable.getOrientable( w, pos );
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean isValidOrientation( final World w, final BlockPos pos, final EnumFacing forward, final EnumFacing up )
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected ICustomCollision getCustomCollision( final World w, final BlockPos pos )
|
||||||
|
{
|
||||||
|
if( this instanceof ICustomCollision )
|
||||||
|
{
|
||||||
|
return (ICustomCollision) this;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected IProperty[] getAEStates()
|
||||||
|
{
|
||||||
|
return new IProperty[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean isOpaque()
|
||||||
|
{
|
||||||
|
return this.isOpaque;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean setOpaque( final boolean isOpaque )
|
||||||
{
|
{
|
||||||
this.isOpaque = isOpaque;
|
this.isOpaque = isOpaque;
|
||||||
return isOpaque;
|
return isOpaque;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isInventory()
|
protected boolean hasSubtypes()
|
||||||
{
|
{
|
||||||
return this.isInventory;
|
return this.hasSubtypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setInventory( final boolean isInventory )
|
protected void setHasSubtypes( final boolean hasSubtypes )
|
||||||
{
|
|
||||||
this.isInventory = isInventory;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setHasSubtypes( final boolean hasSubtypes )
|
|
||||||
{
|
{
|
||||||
this.hasSubtypes = hasSubtypes;
|
this.hasSubtypes = hasSubtypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected boolean isFullSize()
|
||||||
|
{
|
||||||
|
return this.isFullSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean setFullSize( final boolean isFullSize )
|
||||||
|
{
|
||||||
|
this.isFullSize = isFullSize;
|
||||||
|
return isFullSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean isInventory()
|
||||||
|
{
|
||||||
|
return this.isInventory;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setInventory( final boolean isInventory )
|
||||||
|
{
|
||||||
|
this.isInventory = isInventory;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraft.client.util.ITooltipFlag;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@@ -67,15 +68,15 @@ public class AEBaseItemBlock extends ItemBlock
|
|||||||
@Override
|
@Override
|
||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
@SuppressWarnings( "unchecked" )
|
@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 )
|
@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
|
@Override
|
||||||
@@ -126,7 +127,7 @@ public class AEBaseItemBlock extends ItemBlock
|
|||||||
{
|
{
|
||||||
up = EnumFacing.UP;
|
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 )
|
switch( rotation )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,9 +23,10 @@ import java.text.MessageFormat;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
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.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
@@ -48,9 +49,9 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly( Side.CLIENT )
|
@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;
|
double internalCurrentPower = 0;
|
||||||
final double internalMaxPower = this.getMaxEnergyCapacity();
|
final double internalMaxPower = this.getMaxEnergyCapacity();
|
||||||
|
|
||||||
@@ -61,24 +62,25 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
|
|||||||
|
|
||||||
final double percent = internalCurrentPower / internalMaxPower;
|
final double percent = internalCurrentPower / internalMaxPower;
|
||||||
|
|
||||||
toolTip.add( GuiText.StoredEnergy.getLocal() + ':' + MessageFormat.format( " {0,number,#} ", internalCurrentPower ) + Platform.gui_localize( PowerUnits.AE.unlocalizedName ) + " - " + MessageFormat.format( " {0,number,#.##%} ", percent ) );
|
lines.add( GuiText.StoredEnergy.getLocal() + ':' + MessageFormat.format( " {0,number,#} ", internalCurrentPower ) + Platform
|
||||||
|
.gui_localize( PowerUnits.AE.unlocalizedName ) + " - " + MessageFormat.format( " {0,number,#.##%} ", percent ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
private double getMaxEnergyCapacity()
|
private double getMaxEnergyCapacity()
|
||||||
{
|
{
|
||||||
final Block blockID = Block.getBlockFromItem( this );
|
final Block blockID = Block.getBlockFromItem( this );
|
||||||
final IBlockDefinition energyCell = Api.INSTANCE.definitions().blocks().energyCell();
|
final IBlockDefinition energyCell = Api.INSTANCE.definitions().blocks().energyCell();
|
||||||
return energyCell.maybeBlock().map( block -> {
|
return energyCell.maybeBlock().map( block ->
|
||||||
if( blockID == block )
|
{
|
||||||
{
|
if( blockID == block )
|
||||||
return 200000;
|
{
|
||||||
}
|
return 200000;
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
return 8 * 200000;
|
{
|
||||||
}
|
return 8 * 200000;
|
||||||
}
|
}
|
||||||
).orElse( 0 );
|
} ).orElse( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ public abstract class AEBaseStairBlock extends BlockStairs
|
|||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
String regName = getRegistryName() != null ? getRegistryName().getResourcePath() : "unregistered";
|
String regName = this.getRegistryName() != null ? this.getRegistryName().getResourcePath() : "unregistered";
|
||||||
return getClass().getSimpleName() + "[" + regName + "]";
|
return this.getClass().getSimpleName() + "[" + regName + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,8 +34,6 @@ import net.minecraft.block.state.BlockStateContainer;
|
|||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
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.EnumDyeColor;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
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.ExtendedBlockState;
|
||||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||||
import net.minecraftforge.common.property.IUnlistedProperty;
|
import net.minecraftforge.common.property.IUnlistedProperty;
|
||||||
|
import net.minecraftforge.items.ItemHandlerHelper;
|
||||||
|
|
||||||
import appeng.api.implementations.items.IMemoryCard;
|
import appeng.api.implementations.items.IMemoryCard;
|
||||||
import appeng.api.implementations.items.MemoryCardMessages;
|
import appeng.api.implementations.items.MemoryCardMessages;
|
||||||
@@ -56,6 +55,7 @@ import appeng.api.util.AEColor;
|
|||||||
import appeng.api.util.IOrientable;
|
import appeng.api.util.IOrientable;
|
||||||
import appeng.block.networking.BlockCableBus;
|
import appeng.block.networking.BlockCableBus;
|
||||||
import appeng.helpers.ICustomCollision;
|
import appeng.helpers.ICustomCollision;
|
||||||
|
import appeng.tile.AEBaseInvTile;
|
||||||
import appeng.tile.AEBaseTile;
|
import appeng.tile.AEBaseTile;
|
||||||
import appeng.tile.networking.TileCableBus;
|
import appeng.tile.networking.TileCableBus;
|
||||||
import appeng.tile.storage.TileSkyChest;
|
import appeng.tile.storage.TileSkyChest;
|
||||||
@@ -86,7 +86,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
|
|||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
AEBaseTile tile = getTileEntity( world, pos );
|
AEBaseTile tile = this.getTileEntity( world, pos );
|
||||||
if( tile == null )
|
if( tile == null )
|
||||||
{
|
{
|
||||||
return state; // No info available
|
return state; // No info available
|
||||||
@@ -99,7 +99,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
|
|||||||
@Override
|
@Override
|
||||||
protected BlockStateContainer createBlockState()
|
protected BlockStateContainer createBlockState()
|
||||||
{
|
{
|
||||||
return new ExtendedBlockState( this, getAEStates(), new IUnlistedProperty[] {
|
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] {
|
||||||
FORWARD,
|
FORWARD,
|
||||||
UP
|
UP
|
||||||
} );
|
} );
|
||||||
@@ -111,16 +111,17 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
|
|||||||
return 0;
|
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.tileEntityType = c;
|
||||||
this.setInventory( IInventory.class.isAssignableFrom( c ) );
|
this.setInventory( AEBaseInvTile.class.isAssignableFrom( c ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasTileEntity( IBlockState state )
|
public boolean hasTileEntity( IBlockState state )
|
||||||
{
|
{
|
||||||
return hasBlockTileEntity();
|
return this.hasBlockTileEntity();
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean hasBlockTileEntity()
|
private boolean hasBlockTileEntity()
|
||||||
@@ -184,7 +185,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
|
|||||||
final AEBaseTile te = this.getTileEntity( w, pos );
|
final AEBaseTile te = this.getTileEntity( w, pos );
|
||||||
if( te != null )
|
if( te != null )
|
||||||
{
|
{
|
||||||
final ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
|
final ArrayList<ItemStack> drops = new ArrayList<>();
|
||||||
if( te.dropItems() )
|
if( te.dropItems() )
|
||||||
{
|
{
|
||||||
te.getDrops( w, pos, drops );
|
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 )
|
public int getComparatorInputOverride( IBlockState state, final World w, final BlockPos pos )
|
||||||
{
|
{
|
||||||
final TileEntity te = this.getTileEntity( w, 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;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -269,93 +274,102 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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 )
|
ItemStack heldItem;
|
||||||
|
if( player != null && !player.getHeldItem( hand ).isEmpty() )
|
||||||
{
|
{
|
||||||
if( heldItem != null )
|
heldItem = player.getHeldItem( hand );
|
||||||
|
|
||||||
|
if( Platform.isWrench( player, heldItem, pos ) && player.isSneaking() )
|
||||||
{
|
{
|
||||||
if( Platform.isWrench( player, heldItem, pos ) && player.isSneaking() )
|
final IBlockState blockState = world.getBlockState( pos );
|
||||||
|
final Block block = blockState.getBlock();
|
||||||
|
|
||||||
|
if( block == null )
|
||||||
{
|
{
|
||||||
final IBlockState ids = w.getBlockState( pos );
|
|
||||||
final Block id = ids.getBlock();
|
|
||||||
if( id != null )
|
|
||||||
{
|
|
||||||
final AEBaseTile tile = this.getTileEntity( w, pos );
|
|
||||||
final ItemStack[] drops = Platform.getBlockDrops( w, pos );
|
|
||||||
|
|
||||||
if( tile == null )
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( tile instanceof TileCableBus || tile instanceof TileSkyChest )
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
final ItemStack op = new ItemStack( this );
|
|
||||||
for( final ItemStack ol : drops )
|
|
||||||
{
|
|
||||||
if( Platform.isSameItemType( ol, op ) )
|
|
||||||
{
|
|
||||||
final NBTTagCompound tag = tile.downloadSettings( SettingsFrom.DISMANTLE_ITEM );
|
|
||||||
if( tag != null )
|
|
||||||
{
|
|
||||||
ol.setTagCompound( tag );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if( id.removedByPlayer( ids, w, pos, player, false ) )
|
|
||||||
{
|
|
||||||
final List<ItemStack> l = Lists.newArrayList( drops );
|
|
||||||
Platform.spawnDrops( w, pos, l );
|
|
||||||
w.setBlockToAir( pos );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( heldItem.getItem() instanceof IMemoryCard && !( this instanceof BlockCableBus ) )
|
final AEBaseTile tile = this.getTileEntity( world, pos );
|
||||||
|
|
||||||
|
if( tile == null )
|
||||||
{
|
{
|
||||||
final IMemoryCard memoryCard = (IMemoryCard) heldItem.getItem();
|
return false;
|
||||||
if( player.isSneaking() )
|
}
|
||||||
|
|
||||||
|
if( tile instanceof TileCableBus || tile instanceof TileSkyChest )
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
final ItemStack[] itemDropCandidates = Platform.getBlockDrops( world, pos );
|
||||||
|
final ItemStack op = new ItemStack( this );
|
||||||
|
|
||||||
|
for( final ItemStack ol : itemDropCandidates )
|
||||||
|
{
|
||||||
|
if( Platform.itemComparisons().isEqualItemType( ol, op ) )
|
||||||
{
|
{
|
||||||
final AEBaseTile t = this.getTileEntity( w, pos );
|
final NBTTagCompound tag = tile.downloadSettings( SettingsFrom.DISMANTLE_ITEM );
|
||||||
if( t != null )
|
if( tag != null )
|
||||||
{
|
{
|
||||||
final String name = this.getUnlocalizedName();
|
ol.setTagCompound( tag );
|
||||||
final NBTTagCompound data = t.downloadSettings( SettingsFrom.MEMORY_CARD );
|
|
||||||
if( data != null )
|
|
||||||
{
|
|
||||||
memoryCard.setMemoryCardContents( heldItem, name, data );
|
|
||||||
memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_SAVED );
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( block.removedByPlayer( blockState, world, pos, player, false ) )
|
||||||
|
{
|
||||||
|
final List<ItemStack> itemsToDrop = Lists.newArrayList( itemDropCandidates );
|
||||||
|
Platform.spawnDrops( world, pos, itemsToDrop );
|
||||||
|
world.setBlockToAir( pos );
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( heldItem.getItem() instanceof IMemoryCard && !( this instanceof BlockCableBus ) )
|
||||||
|
{
|
||||||
|
final IMemoryCard memoryCard = (IMemoryCard) heldItem.getItem();
|
||||||
|
final AEBaseTile tileEntity = this.getTileEntity( world, pos );
|
||||||
|
|
||||||
|
if( tileEntity == null )
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
final String name = this.getUnlocalizedName();
|
||||||
|
|
||||||
|
if( player.isSneaking() )
|
||||||
|
{
|
||||||
|
final NBTTagCompound data = tileEntity.downloadSettings( SettingsFrom.MEMORY_CARD );
|
||||||
|
if( data != null )
|
||||||
|
{
|
||||||
|
memoryCard.setMemoryCardContents( heldItem, name, data );
|
||||||
|
memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_SAVED );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
final String savedName = memoryCard.getSettingsName( heldItem );
|
||||||
|
final NBTTagCompound data = memoryCard.getData( heldItem );
|
||||||
|
|
||||||
|
if( this.getUnlocalizedName().equals( savedName ) )
|
||||||
|
{
|
||||||
|
tileEntity.uploadSettings( SettingsFrom.MEMORY_CARD, data );
|
||||||
|
memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_LOADED );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
final String name = memoryCard.getSettingsName( heldItem );
|
memoryCard.notifyUser( player, MemoryCardMessages.INVALID_MACHINE );
|
||||||
final NBTTagCompound data = memoryCard.getData( heldItem );
|
|
||||||
if( this.getUnlocalizedName().equals( name ) )
|
|
||||||
{
|
|
||||||
final AEBaseTile t = this.getTileEntity( w, pos );
|
|
||||||
t.uploadSettings( SettingsFrom.MEMORY_CARD, data );
|
|
||||||
memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_LOADED );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
memoryCard.notifyUser( player, MemoryCardMessages.INVALID_MACHINE );
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
@Override
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public class UnlistedDirection implements IUnlistedProperty<EnumFacing>
|
|||||||
@Override
|
@Override
|
||||||
public String getName()
|
public String getName()
|
||||||
{
|
{
|
||||||
return name;
|
return this.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -19,14 +19,12 @@
|
|||||||
package appeng.block.crafting;
|
package appeng.block.crafting;
|
||||||
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.minecraft.block.state.BlockStateContainer;
|
import net.minecraft.block.state.BlockStateContainer;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraft.util.NonNullList;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraftforge.common.property.ExtendedBlockState;
|
import net.minecraftforge.common.property.ExtendedBlockState;
|
||||||
@@ -48,13 +46,12 @@ public class BlockCraftingMonitor extends BlockCraftingUnit
|
|||||||
public BlockCraftingMonitor()
|
public BlockCraftingMonitor()
|
||||||
{
|
{
|
||||||
super( CraftingUnitType.MONITOR );
|
super( CraftingUnitType.MONITOR );
|
||||||
this.setTileEntity( TileCraftingMonitorTile.class );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected BlockStateContainer createBlockState()
|
protected BlockStateContainer createBlockState()
|
||||||
{
|
{
|
||||||
return new ExtendedBlockState( this, getAEStates(), new IUnlistedProperty[] {
|
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] {
|
||||||
STATE,
|
STATE,
|
||||||
COLOR,
|
COLOR,
|
||||||
FORWARD,
|
FORWARD,
|
||||||
@@ -69,7 +66,7 @@ public class BlockCraftingMonitor extends BlockCraftingUnit
|
|||||||
EnumFacing forward = EnumFacing.NORTH;
|
EnumFacing forward = EnumFacing.NORTH;
|
||||||
EnumFacing up = EnumFacing.UP;
|
EnumFacing up = EnumFacing.UP;
|
||||||
|
|
||||||
TileCraftingMonitorTile te = getTileEntity( world, pos );
|
TileCraftingMonitorTile te = this.getTileEntity( world, pos );
|
||||||
if( te != null )
|
if( te != null )
|
||||||
{
|
{
|
||||||
color = te.getColor();
|
color = te.getColor();
|
||||||
@@ -85,7 +82,7 @@ public class BlockCraftingMonitor extends BlockCraftingUnit
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
|
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
|
||||||
{
|
{
|
||||||
itemStacks.add( new ItemStack( this, 1, 0 ) );
|
itemStacks.add( new ItemStack( this, 1, 0 ) );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,16 +19,12 @@
|
|||||||
package appeng.block.crafting;
|
package appeng.block.crafting;
|
||||||
|
|
||||||
|
|
||||||
import appeng.tile.crafting.TileCraftingStorageTile;
|
|
||||||
|
|
||||||
|
|
||||||
public class BlockCraftingStorage extends BlockCraftingUnit
|
public class BlockCraftingStorage extends BlockCraftingUnit
|
||||||
{
|
{
|
||||||
|
|
||||||
public BlockCraftingStorage( final CraftingUnitType type )
|
public BlockCraftingStorage( final CraftingUnitType type )
|
||||||
{
|
{
|
||||||
super( type );
|
super( type );
|
||||||
this.setTileEntity( TileCraftingStorageTile.class );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ package appeng.block.crafting;
|
|||||||
|
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.block.properties.IProperty;
|
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.BlockStateContainer;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.util.BlockRenderLayer;
|
import net.minecraft.util.BlockRenderLayer;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.EnumHand;
|
import net.minecraft.util.EnumHand;
|
||||||
@@ -63,7 +60,6 @@ public class BlockCraftingUnit extends AEBaseTileBlock
|
|||||||
super( Material.IRON );
|
super( Material.IRON );
|
||||||
|
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.setTileEntity( TileCraftingTile.class );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -80,7 +76,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock
|
|||||||
|
|
||||||
for( EnumFacing facing : EnumFacing.values() )
|
for( EnumFacing facing : EnumFacing.values() )
|
||||||
{
|
{
|
||||||
if( isConnected( world, pos, facing ) )
|
if( this.isConnected( world, pos, facing ) )
|
||||||
{
|
{
|
||||||
connections.add( facing );
|
connections.add( facing );
|
||||||
}
|
}
|
||||||
@@ -100,7 +96,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock
|
|||||||
@Override
|
@Override
|
||||||
protected BlockStateContainer createBlockState()
|
protected BlockStateContainer createBlockState()
|
||||||
{
|
{
|
||||||
return new ExtendedBlockState( this, getAEStates(), new IUnlistedProperty[] { STATE } );
|
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] { STATE } );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -118,7 +114,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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 );
|
final TileCraftingTile cp = this.getTileEntity( worldIn, pos );
|
||||||
if( cp != null )
|
if( cp != null )
|
||||||
@@ -146,9 +142,10 @@ public class BlockCraftingUnit extends AEBaseTileBlock
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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 );
|
final TileCraftingTile tg = this.getTileEntity( w, pos );
|
||||||
|
|
||||||
if( tg != null && !p.isSneaking() && tg.isFormed() && tg.isActive() )
|
if( tg != null && !p.isSneaking() && tg.isFormed() && tg.isActive() )
|
||||||
{
|
{
|
||||||
if( Platform.isClient() )
|
if( Platform.isClient() )
|
||||||
@@ -160,7 +157,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return super.onBlockActivated( w, pos, state, p, hand, side, hitX, hitY, hitZ );
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum CraftingUnitType
|
public enum CraftingUnitType
|
||||||
|
|||||||
@@ -19,14 +19,11 @@
|
|||||||
package appeng.block.crafting;
|
package appeng.block.crafting;
|
||||||
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.block.properties.IProperty;
|
import net.minecraft.block.properties.IProperty;
|
||||||
import net.minecraft.block.properties.PropertyBool;
|
import net.minecraft.block.properties.PropertyBool;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.util.BlockRenderLayer;
|
import net.minecraft.util.BlockRenderLayer;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.EnumHand;
|
import net.minecraft.util.EnumHand;
|
||||||
@@ -42,6 +39,7 @@ import appeng.core.sync.GuiBridge;
|
|||||||
import appeng.tile.crafting.TileMolecularAssembler;
|
import appeng.tile.crafting.TileMolecularAssembler;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
|
|
||||||
|
|
||||||
public class BlockMolecularAssembler extends AEBaseTileBlock
|
public class BlockMolecularAssembler extends AEBaseTileBlock
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -51,7 +49,6 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
|
|||||||
{
|
{
|
||||||
super( Material.IRON );
|
super( Material.IRON );
|
||||||
|
|
||||||
this.setTileEntity( TileMolecularAssembler.class );
|
|
||||||
this.setOpaque( false );
|
this.setOpaque( false );
|
||||||
this.lightOpacity = 1;
|
this.lightOpacity = 1;
|
||||||
}
|
}
|
||||||
@@ -66,7 +63,7 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
|
|||||||
public IBlockState getActualState( IBlockState state, IBlockAccess worldIn, BlockPos pos )
|
public IBlockState getActualState( IBlockState state, IBlockAccess worldIn, BlockPos pos )
|
||||||
{
|
{
|
||||||
boolean powered = false;
|
boolean powered = false;
|
||||||
TileMolecularAssembler te = getTileEntity( worldIn, pos );
|
TileMolecularAssembler te = this.getTileEntity( worldIn, pos );
|
||||||
if( te != null )
|
if( te != null )
|
||||||
{
|
{
|
||||||
powered = te.isPowered();
|
powered = te.isPowered();
|
||||||
@@ -75,19 +72,32 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
|
|||||||
return super.getActualState( state, worldIn, pos ).withProperty( POWERED, powered );
|
return super.getActualState( state, worldIn, pos ).withProperty( POWERED, powered );
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly( Side.CLIENT)
|
/**
|
||||||
|
* NOTE: This is only used to determine how to render an item being held in hand.
|
||||||
|
* For determining block rendering, the method below is used (canRenderInLayer).
|
||||||
|
*/
|
||||||
|
@SideOnly( Side.CLIENT )
|
||||||
|
@Override
|
||||||
public BlockRenderLayer getBlockLayer()
|
public BlockRenderLayer getBlockLayer()
|
||||||
{
|
{
|
||||||
return BlockRenderLayer.TRANSLUCENT;
|
return BlockRenderLayer.CUTOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isFullCube(IBlockState state)
|
@SideOnly( Side.CLIENT )
|
||||||
|
@Override
|
||||||
|
public boolean canRenderInLayer( IBlockState state, BlockRenderLayer layer )
|
||||||
|
{
|
||||||
|
return layer == BlockRenderLayer.TRANSLUCENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isFullCube( IBlockState state )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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 );
|
final TileMolecularAssembler tg = this.getTileEntity( w, pos );
|
||||||
if( tg != null && !p.isSneaking() )
|
if( tg != null && !p.isSneaking() )
|
||||||
@@ -95,6 +105,7 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
|
|||||||
Platform.openGUI( p, tg, AEPartLocation.fromFacing( side ), GuiBridge.GUI_MAC );
|
Platform.openGUI( p, tg, AEPartLocation.fromFacing( side ), GuiBridge.GUI_MAC );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
|
return super.onBlockActivated( w, pos, state, p, hand, side, hitX, hitY, hitZ );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,12 +39,12 @@ public class ItemCraftingStorage extends AEBaseItemBlock
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack getContainerItem( final ItemStack itemStack )
|
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
|
@Override
|
||||||
public boolean hasContainerItem( final ItemStack stack )
|
public boolean hasContainerItem( final ItemStack stack )
|
||||||
{
|
{
|
||||||
return AEConfig.instance.isFeatureEnabled( AEFeature.EnableDisassemblyCrafting );
|
return AEConfig.instance().isFeatureEnabled( AEFeature.ENABLE_DISASSEMBLY_CRAFTING );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ import appeng.core.stats.Stats;
|
|||||||
import appeng.tile.AEBaseTile;
|
import appeng.tile.AEBaseTile;
|
||||||
import appeng.tile.grindstone.TileCrank;
|
import appeng.tile.grindstone.TileCrank;
|
||||||
|
|
||||||
|
|
||||||
public class BlockCrank extends AEBaseTileBlock
|
public class BlockCrank extends AEBaseTileBlock
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -48,7 +49,6 @@ public class BlockCrank extends AEBaseTileBlock
|
|||||||
{
|
{
|
||||||
super( Material.WOOD );
|
super( Material.WOOD );
|
||||||
|
|
||||||
this.setTileEntity( TileCrank.class );
|
|
||||||
this.setLightOpacity( 0 );
|
this.setLightOpacity( 0 );
|
||||||
this.setHarvestLevel( "axe", 0 );
|
this.setHarvestLevel( "axe", 0 );
|
||||||
this.setFullSize( this.setOpaque( false ) );
|
this.setFullSize( this.setOpaque( false ) );
|
||||||
@@ -78,7 +78,7 @@ public class BlockCrank extends AEBaseTileBlock
|
|||||||
private void dropCrank( final World world, final BlockPos pos )
|
private void dropCrank( final World world, final BlockPos pos )
|
||||||
{
|
{
|
||||||
world.destroyBlock( pos, true ); // w.destroyBlock( x, y, z, true );
|
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
|
@Override
|
||||||
@@ -135,7 +135,7 @@ public class BlockCrank extends AEBaseTileBlock
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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 );
|
final AEBaseTile tile = this.getTileEntity( world, pos );
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import appeng.core.sync.GuiBridge;
|
|||||||
import appeng.tile.grindstone.TileGrinder;
|
import appeng.tile.grindstone.TileGrinder;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
|
|
||||||
|
|
||||||
public class BlockGrinder extends AEBaseTileBlock
|
public class BlockGrinder extends AEBaseTileBlock
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -42,7 +43,6 @@ public class BlockGrinder extends AEBaseTileBlock
|
|||||||
{
|
{
|
||||||
super( Material.ROCK );
|
super( Material.ROCK );
|
||||||
|
|
||||||
this.setTileEntity( TileGrinder.class );
|
|
||||||
this.setHardness( 3.2F );
|
this.setHardness( 3.2F );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,14 +35,13 @@ import appeng.core.sync.GuiBridge;
|
|||||||
import appeng.tile.misc.TileCellWorkbench;
|
import appeng.tile.misc.TileCellWorkbench;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
|
|
||||||
|
|
||||||
public class BlockCellWorkbench extends AEBaseTileBlock
|
public class BlockCellWorkbench extends AEBaseTileBlock
|
||||||
{
|
{
|
||||||
|
|
||||||
public BlockCellWorkbench()
|
public BlockCellWorkbench()
|
||||||
{
|
{
|
||||||
super( Material.IRON );
|
super( Material.IRON );
|
||||||
|
|
||||||
this.setTileEntity( TileCellWorkbench.class );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ package appeng.block.misc;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||||
@@ -51,7 +52,7 @@ import appeng.client.render.effects.LightningFX;
|
|||||||
import appeng.client.render.renderable.ItemRenderable;
|
import appeng.client.render.renderable.ItemRenderable;
|
||||||
import appeng.client.render.tesr.ModularTESR;
|
import appeng.client.render.tesr.ModularTESR;
|
||||||
import appeng.core.AEConfig;
|
import appeng.core.AEConfig;
|
||||||
import appeng.core.CommonHelper;
|
import appeng.core.AppEng;
|
||||||
import appeng.helpers.ICustomCollision;
|
import appeng.helpers.ICustomCollision;
|
||||||
import appeng.tile.AEBaseTile;
|
import appeng.tile.AEBaseTile;
|
||||||
import appeng.tile.misc.TileCharger;
|
import appeng.tile.misc.TileCharger;
|
||||||
@@ -65,7 +66,6 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
|
|||||||
{
|
{
|
||||||
super( Material.IRON );
|
super( Material.IRON );
|
||||||
|
|
||||||
this.setTileEntity( TileCharger.class );
|
|
||||||
this.setLightOpacity( 2 );
|
this.setLightOpacity( 2 );
|
||||||
this.setFullSize( this.setOpaque( false ) );
|
this.setFullSize( this.setOpaque( false ) );
|
||||||
}
|
}
|
||||||
@@ -94,7 +94,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
|
|||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
|
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
|
||||||
{
|
{
|
||||||
if( !AEConfig.instance.enableEffects )
|
if( !AEConfig.instance().isEnableEffects() )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -109,7 +109,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
|
|||||||
{
|
{
|
||||||
final TileCharger tc = (TileCharger) tile;
|
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 xOff = 0.0;
|
||||||
final double yOff = 0.0;
|
final double yOff = 0.0;
|
||||||
@@ -117,9 +117,10 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
|
|||||||
|
|
||||||
for( int bolts = 0; bolts < 3; bolts++ )
|
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 );
|
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -200,7 +201,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
|
|||||||
{
|
{
|
||||||
Matrix4f transform = new Matrix4f();
|
Matrix4f transform = new Matrix4f();
|
||||||
transform.translate( new Vector3f( 0.5f, 0.4f, 0.5f ) );
|
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()
|
public BlockCondenser()
|
||||||
{
|
{
|
||||||
super( Material.IRON );
|
super( Material.IRON );
|
||||||
|
|
||||||
this.setTileEntity( TileCondenser.class );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import appeng.core.sync.GuiBridge;
|
|||||||
import appeng.tile.misc.TileInscriber;
|
import appeng.tile.misc.TileInscriber;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
|
|
||||||
|
|
||||||
public class BlockInscriber extends AEBaseTileBlock
|
public class BlockInscriber extends AEBaseTileBlock
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -44,7 +45,6 @@ public class BlockInscriber extends AEBaseTileBlock
|
|||||||
{
|
{
|
||||||
super( Material.IRON );
|
super( Material.IRON );
|
||||||
|
|
||||||
this.setTileEntity( TileInscriber.class );
|
|
||||||
this.setLightOpacity( 2 );
|
this.setLightOpacity( 2 );
|
||||||
this.setFullSize( this.setOpaque( false ) );
|
this.setFullSize( this.setOpaque( false ) );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,8 +49,6 @@ public class BlockInterface extends AEBaseTileBlock
|
|||||||
public BlockInterface()
|
public BlockInterface()
|
||||||
{
|
{
|
||||||
super( Material.IRON );
|
super( Material.IRON );
|
||||||
|
|
||||||
this.setTileEntity( TileInterface.class );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -63,7 +61,7 @@ public class BlockInterface extends AEBaseTileBlock
|
|||||||
public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos )
|
public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos )
|
||||||
{
|
{
|
||||||
// Determine whether the interface is omni-directional or not
|
// 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
|
boolean omniDirectional = true; // The default
|
||||||
if( te != null )
|
if( te != null )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ import appeng.helpers.ICustomCollision;
|
|||||||
import appeng.helpers.MetaRotation;
|
import appeng.helpers.MetaRotation;
|
||||||
import appeng.tile.misc.TileLightDetector;
|
import appeng.tile.misc.TileLightDetector;
|
||||||
|
|
||||||
|
|
||||||
public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBlock, ICustomCollision
|
public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBlock, ICustomCollision
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -63,8 +64,6 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
|
|||||||
this.setLightOpacity( 0 );
|
this.setLightOpacity( 0 );
|
||||||
this.setFullSize( false );
|
this.setFullSize( false );
|
||||||
this.setOpaque( false );
|
this.setOpaque( false );
|
||||||
|
|
||||||
this.setTileEntity( TileLightDetector.class );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -77,7 +76,7 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
|
|||||||
public IBlockState getStateFromMeta( final int meta )
|
public IBlockState getStateFromMeta( final int meta )
|
||||||
{
|
{
|
||||||
EnumFacing facing = EnumFacing.values()[meta];
|
EnumFacing facing = EnumFacing.values()[meta];
|
||||||
return getDefaultState().withProperty(FACING, facing);
|
return this.getDefaultState().withProperty( FACING, facing );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -139,21 +138,21 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
|
|||||||
@Override
|
@Override
|
||||||
public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
|
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 *
|
* double xOff = -0.15 * getUp().offsetX; double yOff = -0.15 *
|
||||||
* getUp().offsetY; double zOff = -0.15 * getUp().offsetZ; out.add(
|
* getUp().offsetY; double zOff = -0.15 * getUp().offsetZ; out.add(
|
||||||
* AxisAlignedBB.getBoundingBox( xOff + (double) x + 0.15, yOff +
|
* AxisAlignedBB.getBoundingBox( xOff + (double) x + 0.15, yOff +
|
||||||
* (double) y + 0.15, zOff + (double) z + 0.15,// ahh xOff + (double) x
|
* (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 ) );
|
* + 0.85, yOff + (double) y + 0.85, zOff + (double) z + 0.85 ) );
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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();
|
final EnumFacing up = this.getOrientable( world, pos ).getUp();
|
||||||
if( !this.canPlaceAt( (World) w, pos, up.getOpposite() ) )
|
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
|
@Override
|
||||||
@SideOnly( Side.CLIENT)
|
@SideOnly( Side.CLIENT )
|
||||||
public BlockRenderLayer getBlockLayer()
|
public BlockRenderLayer getBlockLayer()
|
||||||
{
|
{
|
||||||
return BlockRenderLayer.CUTOUT;
|
return BlockRenderLayer.CUTOUT;
|
||||||
|
|||||||
@@ -45,10 +45,11 @@ import appeng.api.util.IOrientableBlock;
|
|||||||
import appeng.block.AEBaseBlock;
|
import appeng.block.AEBaseBlock;
|
||||||
import appeng.client.render.effects.LightningFX;
|
import appeng.client.render.effects.LightningFX;
|
||||||
import appeng.core.AEConfig;
|
import appeng.core.AEConfig;
|
||||||
import appeng.core.CommonHelper;
|
import appeng.core.AppEng;
|
||||||
import appeng.helpers.ICustomCollision;
|
import appeng.helpers.ICustomCollision;
|
||||||
import appeng.helpers.MetaRotation;
|
import appeng.helpers.MetaRotation;
|
||||||
|
|
||||||
|
|
||||||
public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock, ICustomCollision
|
public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock, ICustomCollision
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -75,7 +76,7 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
|
|||||||
@Override
|
@Override
|
||||||
public IBlockState getActualState( IBlockState state, IBlockAccess worldIn, BlockPos pos )
|
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 )
|
return super.getActualState( state, worldIn, pos )
|
||||||
.withProperty( ODD, oddPlacement );
|
.withProperty( ODD, oddPlacement );
|
||||||
@@ -91,7 +92,7 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
|
|||||||
public IBlockState getStateFromMeta( final int meta )
|
public IBlockState getStateFromMeta( final int meta )
|
||||||
{
|
{
|
||||||
EnumFacing facing = EnumFacing.values()[meta];
|
EnumFacing facing = EnumFacing.values()[meta];
|
||||||
return getDefaultState().withProperty(FACING, facing);
|
return this.getDefaultState().withProperty( FACING, facing );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -125,17 +126,18 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
|
|||||||
@Override
|
@Override
|
||||||
public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List out, final Entity e )
|
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 *
|
* 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
|
* getUp().offsetZ; out.add( AxisAlignedBB.getBoundingBox( xOff + (double) x + 0.15, yOff + (double) y + 0.15,
|
||||||
* + (double) z + 0.15,// ahh xOff + (double) x + 0.85, yOff + (double) y + 0.85, zOff + (double) z + 0.85 ) );
|
* zOff
|
||||||
*/
|
* + (double) z + 0.15,// ahh xOff + (double) x + 0.85, yOff + (double) y + 0.85, zOff + (double) z + 0.85 ) );
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
|
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
|
||||||
{
|
{
|
||||||
if( !AEConfig.instance.enableEffects )
|
if( !AEConfig.instance().isEnableEffects() )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -151,7 +153,7 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
|
|||||||
final double zOff = -0.3 * up.getFrontOffsetZ();
|
final double zOff = -0.3 * up.getFrontOffsetZ();
|
||||||
for( int bolts = 0; bolts < 3; bolts++ )
|
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 );
|
||||||
|
|
||||||
@@ -161,12 +163,12 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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();
|
final EnumFacing up = this.getOrientable( world, pos ).getUp();
|
||||||
if( !this.canPlaceAt( w, pos, up.getOpposite() ) )
|
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
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly( Side.CLIENT )
|
||||||
public BlockRenderLayer getBlockLayer()
|
public BlockRenderLayer getBlockLayer()
|
||||||
{
|
{
|
||||||
return BlockRenderLayer.CUTOUT;
|
return BlockRenderLayer.CUTOUT;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ import appeng.api.util.IOrientableBlock;
|
|||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
import appeng.client.render.effects.LightningFX;
|
import appeng.client.render.effects.LightningFX;
|
||||||
import appeng.core.AEConfig;
|
import appeng.core.AEConfig;
|
||||||
import appeng.core.CommonHelper;
|
import appeng.core.AppEng;
|
||||||
import appeng.tile.misc.TileQuartzGrowthAccelerator;
|
import appeng.tile.misc.TileQuartzGrowthAccelerator;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
|
|
||||||
@@ -52,14 +52,13 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
|
|||||||
{
|
{
|
||||||
super( Material.ROCK );
|
super( Material.ROCK );
|
||||||
this.setSoundType( SoundType.METAL );
|
this.setSoundType( SoundType.METAL );
|
||||||
this.setTileEntity( TileQuartzGrowthAccelerator.class );
|
this.setDefaultState( this.getDefaultState().withProperty( POWERED, false ) );
|
||||||
this.setDefaultState( getDefaultState().withProperty( POWERED, false ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos )
|
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();
|
boolean powered = te != null && te.isPowered();
|
||||||
|
|
||||||
return super.getActualState( state, world, pos )
|
return super.getActualState( state, world, pos )
|
||||||
@@ -76,14 +75,14 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
|
|||||||
@Override
|
@Override
|
||||||
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
|
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
|
||||||
{
|
{
|
||||||
if( !AEConfig.instance.enableEffects )
|
if( !AEConfig.instance().isEnableEffects() )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final TileQuartzGrowthAccelerator cga = this.getTileEntity( w, pos );
|
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 d0 = r.nextFloat() - 0.5F;
|
||||||
final double d1 = 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.tile.misc.TileSecurityStation;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
|
|
||||||
|
|
||||||
public class BlockSecurityStation extends AEBaseTileBlock
|
public class BlockSecurityStation extends AEBaseTileBlock
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -49,8 +50,7 @@ public class BlockSecurityStation extends AEBaseTileBlock
|
|||||||
{
|
{
|
||||||
super( Material.IRON );
|
super( Material.IRON );
|
||||||
|
|
||||||
this.setTileEntity( TileSecurityStation.class );
|
this.setDefaultState( this.getDefaultState().withProperty( POWERED, false ) );
|
||||||
this.setDefaultState( getDefaultState().withProperty( POWERED, false ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -69,7 +69,7 @@ public class BlockSecurityStation extends AEBaseTileBlock
|
|||||||
public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos )
|
public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos )
|
||||||
{
|
{
|
||||||
boolean powered = false;
|
boolean powered = false;
|
||||||
TileSecurityStation te = getTileEntity( world, pos );
|
TileSecurityStation te = this.getTileEntity( world, pos );
|
||||||
if( te != null )
|
if( te != null )
|
||||||
{
|
{
|
||||||
powered = te.isActive();
|
powered = te.isActive();
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import appeng.block.AEBaseTileBlock;
|
|||||||
import appeng.helpers.ICustomCollision;
|
import appeng.helpers.ICustomCollision;
|
||||||
import appeng.tile.misc.TileSkyCompass;
|
import appeng.tile.misc.TileSkyCompass;
|
||||||
|
|
||||||
|
|
||||||
public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
|
public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -49,7 +50,6 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
|
|||||||
public BlockSkyCompass()
|
public BlockSkyCompass()
|
||||||
{
|
{
|
||||||
super( Material.CIRCUITS );
|
super( Material.CIRCUITS );
|
||||||
this.setTileEntity( TileSkyCompass.class );
|
|
||||||
this.setLightOpacity( 0 );
|
this.setLightOpacity( 0 );
|
||||||
this.setFullSize( false );
|
this.setFullSize( false );
|
||||||
this.setOpaque( false );
|
this.setOpaque( false );
|
||||||
@@ -58,7 +58,7 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
|
|||||||
@Override
|
@Override
|
||||||
protected BlockStateContainer createBlockState()
|
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
|
@Override
|
||||||
@@ -78,13 +78,13 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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();
|
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.util.math.BlockPos;
|
||||||
import net.minecraft.world.Explosion;
|
import net.minecraft.world.Explosion;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fml.common.registry.EntityRegistry;
|
|
||||||
|
|
||||||
import appeng.block.AEBaseBlock;
|
import appeng.block.AEBaseBlock;
|
||||||
import appeng.core.AppEng;
|
|
||||||
import appeng.entity.EntityIds;
|
|
||||||
import appeng.entity.EntityTinyTNTPrimed;
|
import appeng.entity.EntityTinyTNTPrimed;
|
||||||
import appeng.helpers.ICustomCollision;
|
import appeng.helpers.ICustomCollision;
|
||||||
|
|
||||||
|
|
||||||
public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
|
public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -62,7 +60,9 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
|
|||||||
this.setSoundType( SoundType.GROUND );
|
this.setSoundType( SoundType.GROUND );
|
||||||
this.setHardness( 0F );
|
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
|
@Override
|
||||||
@@ -86,18 +86,19 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
|
|||||||
if( !w.isRemote )
|
if( !w.isRemote )
|
||||||
{
|
{
|
||||||
final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, igniter );
|
final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, igniter );
|
||||||
w.spawnEntityInWorld( primedTinyTNTEntity );
|
w.spawnEntity( primedTinyTNTEntity );
|
||||||
w.playSound( null, primedTinyTNTEntity.posX, primedTinyTNTEntity.posY, primedTinyTNTEntity.posZ, SoundEvents.ENTITY_TNT_PRIMED, SoundCategory.BLOCKS, 1, 1 );
|
w.playSound( null, primedTinyTNTEntity.posX, primedTinyTNTEntity.posY, primedTinyTNTEntity.posZ, SoundEvents.ENTITY_TNT_PRIMED,
|
||||||
|
SoundCategory.BLOCKS, 1, 1 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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 );
|
this.startFuse( world, pos, null );
|
||||||
w.setBlockToAir( pos );
|
world.setBlockToAir( pos );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,9 +141,10 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
|
|||||||
super.onBlockExploded( w, pos, exp );
|
super.onBlockExploded( w, pos, exp );
|
||||||
if( !w.isRemote )
|
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 );
|
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.tile.misc.TileVibrationChamber;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
|
|
||||||
|
|
||||||
public final class BlockVibrationChamber extends AEBaseTileBlock
|
public final class BlockVibrationChamber extends AEBaseTileBlock
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -53,9 +54,8 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
|
|||||||
public BlockVibrationChamber()
|
public BlockVibrationChamber()
|
||||||
{
|
{
|
||||||
super( Material.IRON );
|
super( Material.IRON );
|
||||||
this.setTileEntity( TileVibrationChamber.class );
|
|
||||||
this.setHardness( 4.2F );
|
this.setHardness( 4.2F );
|
||||||
this.setDefaultState( getDefaultState().withProperty( ACTIVE, false ) );
|
this.setDefaultState( this.getDefaultState().withProperty( ACTIVE, false ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -71,7 +71,7 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
|
|||||||
@Override
|
@Override
|
||||||
protected IProperty[] getAEStates()
|
protected IProperty[] getAEStates()
|
||||||
{
|
{
|
||||||
return new IProperty[]{ ACTIVE };
|
return new IProperty[] { ACTIVE };
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -98,7 +98,7 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
|
|||||||
@Override
|
@Override
|
||||||
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
|
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
|
||||||
{
|
{
|
||||||
if( !AEConfig.instance.enableEffects )
|
if( !AEConfig.instance().isEnableEffects() )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
package appeng.block.misc;
|
package appeng.block.misc;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ package appeng.block.networking;
|
|||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
@@ -45,6 +46,7 @@ import net.minecraft.tileentity.TileEntity;
|
|||||||
import net.minecraft.util.BlockRenderLayer;
|
import net.minecraft.util.BlockRenderLayer;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.EnumHand;
|
import net.minecraft.util.EnumHand;
|
||||||
|
import net.minecraft.util.NonNullList;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.RayTraceResult;
|
import net.minecraft.util.math.RayTraceResult;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
@@ -69,9 +71,6 @@ import appeng.client.render.cablebus.CableBusRenderState;
|
|||||||
import appeng.core.Api;
|
import appeng.core.Api;
|
||||||
import appeng.core.AppEng;
|
import appeng.core.AppEng;
|
||||||
import appeng.helpers.AEGlassMaterial;
|
import appeng.helpers.AEGlassMaterial;
|
||||||
import appeng.integration.IntegrationRegistry;
|
|
||||||
import appeng.integration.IntegrationType;
|
|
||||||
import appeng.integration.abstraction.IFMP;
|
|
||||||
import appeng.parts.ICableBusContainer;
|
import appeng.parts.ICableBusContainer;
|
||||||
import appeng.parts.NullCableBusContainer;
|
import appeng.parts.NullCableBusContainer;
|
||||||
import appeng.tile.AEBaseTile;
|
import appeng.tile.AEBaseTile;
|
||||||
@@ -119,7 +118,7 @@ public class BlockCableBus extends AEBaseTileBlock
|
|||||||
@Override
|
@Override
|
||||||
public IBlockState getExtendedState( IBlockState state, IBlockAccess world, BlockPos pos )
|
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 );
|
return ( (IExtendedBlockState) state ).withProperty( RENDER_STATE_PROPERTY, renderState );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,7 +131,7 @@ public class BlockCableBus extends AEBaseTileBlock
|
|||||||
@Override
|
@Override
|
||||||
public void onNeighborChange( final IBlockAccess w, final BlockPos pos, final BlockPos neighbor )
|
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
|
@Override
|
||||||
@@ -238,7 +237,7 @@ public class BlockCableBus extends AEBaseTileBlock
|
|||||||
return sp.facade.getItemStack();
|
return sp.facade.getItemStack();
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return ItemStack.EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -256,9 +255,9 @@ public class BlockCableBus extends AEBaseTileBlock
|
|||||||
ICableBusContainer cb = this.cb( world, target.getBlockPos() );
|
ICableBusContainer cb = this.cb( world, target.getBlockPos() );
|
||||||
|
|
||||||
// Our built-in model has the actual baked sprites we need
|
// 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 ) )
|
if( !( model instanceof CableBusBakedModel ) )
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
@@ -272,9 +271,9 @@ public class BlockCableBus extends AEBaseTileBlock
|
|||||||
TextureAtlasSprite texture = Platform.pickRandom( cableBusModel.getParticleTextures( renderState ) );
|
TextureAtlasSprite texture = Platform.pickRandom( cableBusModel.getParticleTextures( renderState ) );
|
||||||
if( texture != null )
|
if( texture != null )
|
||||||
{
|
{
|
||||||
double x = target.hitVec.xCoord;
|
double x = target.hitVec.x;
|
||||||
double y = target.hitVec.yCoord;
|
double y = target.hitVec.y;
|
||||||
double z = target.hitVec.zCoord;
|
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 );
|
Particle fx = new DestroyFX( world, x, y, z, 0.0D, 0.0D, 0.0D, state ).setBlockPos( target.getBlockPos() ).multipleParticleScaleBy( 0.8F );
|
||||||
fx.setParticleTexture( texture );
|
fx.setParticleTexture( texture );
|
||||||
@@ -291,7 +290,7 @@ public class BlockCableBus extends AEBaseTileBlock
|
|||||||
ICableBusContainer cb = this.cb( world, pos );
|
ICableBusContainer cb = this.cb( world, pos );
|
||||||
|
|
||||||
// Our built-in model has the actual baked sprites we need
|
// 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 dont have the model
|
||||||
if( !( model instanceof CableBusBakedModel ) )
|
if( !( model instanceof CableBusBakedModel ) )
|
||||||
@@ -320,7 +319,8 @@ public class BlockCableBus extends AEBaseTileBlock
|
|||||||
double d0 = (double) pos.getX() + ( (double) j + 0.5D ) / 4.0D;
|
double d0 = (double) pos.getX() + ( (double) j + 0.5D ) / 4.0D;
|
||||||
double d1 = (double) pos.getY() + ( (double) k + 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;
|
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 );
|
particle.setParticleTexture( texture );
|
||||||
effectRenderer.addEffect( particle );
|
effectRenderer.addEffect( particle );
|
||||||
}
|
}
|
||||||
@@ -332,11 +332,11 @@ public class BlockCableBus extends AEBaseTileBlock
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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() )
|
if( Platform.isServer() )
|
||||||
{
|
{
|
||||||
this.cb( w, pos ).onNeighborChanged();
|
this.cb( world, pos ).onNeighborChanged( world, pos, fromPos );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -349,10 +349,6 @@ public class BlockCableBus extends AEBaseTileBlock
|
|||||||
{
|
{
|
||||||
out = ( (TileCableBus) te ).getCableBus();
|
out = ( (TileCableBus) te ).getCableBus();
|
||||||
}
|
}
|
||||||
else if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FMP ) )
|
|
||||||
{
|
|
||||||
out = ( (IFMP) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FMP ) ).getCableContainer( te );
|
|
||||||
}
|
|
||||||
|
|
||||||
return out == null ? NULL_CABLE_BUS : out;
|
return out == null ? NULL_CABLE_BUS : out;
|
||||||
}
|
}
|
||||||
@@ -383,7 +379,7 @@ public class BlockCableBus extends AEBaseTileBlock
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
|
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
@@ -392,8 +388,9 @@ public class BlockCableBus extends AEBaseTileBlock
|
|||||||
{
|
{
|
||||||
noTesrTile = Api.INSTANCE.partHelper().getCombinedInstance( TileCableBus.class );
|
noTesrTile = Api.INSTANCE.partHelper().getCombinedInstance( TileCableBus.class );
|
||||||
this.setTileEntity( noTesrTile );
|
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() )
|
if( Platform.isClient() )
|
||||||
{
|
{
|
||||||
setupTesr();
|
setupTesr();
|
||||||
@@ -404,8 +401,7 @@ public class BlockCableBus extends AEBaseTileBlock
|
|||||||
private static void setupTesr()
|
private static void setupTesr()
|
||||||
{
|
{
|
||||||
tesrTile = Api.INSTANCE.partHelper().getCombinedInstance( TileCableBusTESR.class );
|
tesrTile = Api.INSTANCE.partHelper().getCombinedInstance( TileCableBusTESR.class );
|
||||||
// TODO: Change after transition phase
|
GameRegistry.registerTileEntity( tesrTile, AppEng.MOD_ID.toLowerCase() + ":" + "ClientOnly_TESR_CableBus" );
|
||||||
GameRegistry.registerTileEntityWithAlternatives( tesrTile, AppEng.MOD_ID.toLowerCase() + ":" + "ClientOnly_TESR_CableBus", "ClientOnly_TESR_CableBus" );
|
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer( BlockCableBus.getTesrTile(), new CableBusTESR() );
|
ClientRegistry.bindTileEntitySpecialRenderer( BlockCableBus.getTesrTile(), new CableBusTESR() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import net.minecraft.world.World;
|
|||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
import appeng.tile.networking.TileController;
|
import appeng.tile.networking.TileController;
|
||||||
|
|
||||||
|
|
||||||
public class BlockController extends AEBaseTileBlock
|
public class BlockController extends AEBaseTileBlock
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -49,11 +50,11 @@ public class BlockController extends AEBaseTileBlock
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Controls the rendering of the controller block (connected texture style).
|
* 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,
|
* 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.
|
* and since they are always offline, they do not have the usual sub-states.
|
||||||
*/
|
*/
|
||||||
public enum ControllerRenderType implements IStringSerializable
|
public enum ControllerRenderType implements IStringSerializable
|
||||||
{
|
{
|
||||||
block, column_x, column_y, column_z, inside_a, inside_b;
|
block, column_x, column_y, column_z, inside_a, inside_b;
|
||||||
@@ -73,9 +74,8 @@ public class BlockController extends AEBaseTileBlock
|
|||||||
public BlockController()
|
public BlockController()
|
||||||
{
|
{
|
||||||
super( Material.IRON );
|
super( Material.IRON );
|
||||||
this.setTileEntity( TileController.class );
|
|
||||||
this.setHardness( 6 );
|
this.setHardness( 6 );
|
||||||
this.setDefaultState( getDefaultState()
|
this.setDefaultState( this.getDefaultState()
|
||||||
.withProperty( CONTROLLER_STATE, ControllerBlockState.offline )
|
.withProperty( CONTROLLER_STATE, ControllerBlockState.offline )
|
||||||
.withProperty( CONTROLLER_TYPE, ControllerRenderType.block ) );
|
.withProperty( CONTROLLER_TYPE, ControllerRenderType.block ) );
|
||||||
}
|
}
|
||||||
@@ -89,7 +89,7 @@ public class BlockController extends AEBaseTileBlock
|
|||||||
@Override
|
@Override
|
||||||
protected BlockStateContainer createBlockState()
|
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
|
* 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.
|
* get a rudimentary connected texture feel for the controller based on how it is placed.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings( "deprecation" )
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos )
|
public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos )
|
||||||
{
|
{
|
||||||
@@ -109,9 +110,12 @@ public class BlockController extends AEBaseTileBlock
|
|||||||
int z = pos.getZ();
|
int z = pos.getZ();
|
||||||
|
|
||||||
// Detect whether controllers are on both sides of the x, y, and z axes
|
// 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 xx = this.getTileEntity( world, x - 1, y, z ) instanceof TileController && this.getTileEntity( world, x + 1, y,
|
||||||
final boolean yy = this.getTileEntity( world, x, y - 1, z ) instanceof TileController && this.getTileEntity( world, x, y + 1, z ) instanceof TileController;
|
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 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 )
|
if( xx && !yy && !zz )
|
||||||
{
|
{
|
||||||
@@ -156,6 +160,7 @@ public class BlockController extends AEBaseTileBlock
|
|||||||
return state.getValue( CONTROLLER_STATE ).ordinal();
|
return state.getValue( CONTROLLER_STATE ).ordinal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings( "deprecation" )
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta( final int meta )
|
public IBlockState getStateFromMeta( final int meta )
|
||||||
{
|
{
|
||||||
@@ -169,10 +174,11 @@ public class BlockController extends AEBaseTileBlock
|
|||||||
return BlockRenderLayer.CUTOUT;
|
return BlockRenderLayer.CUTOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings( "deprecation" )
|
||||||
@Override
|
@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 )
|
if( tc != null )
|
||||||
{
|
{
|
||||||
tc.onNeighborChange( false );
|
tc.onNeighborChange( false );
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ package appeng.block.networking;
|
|||||||
|
|
||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
import appeng.helpers.AEGlassMaterial;
|
import appeng.helpers.AEGlassMaterial;
|
||||||
import appeng.tile.networking.TileCreativeEnergyCell;
|
|
||||||
|
|
||||||
public class BlockCreativeEnergyCell extends AEBaseTileBlock
|
public class BlockCreativeEnergyCell extends AEBaseTileBlock
|
||||||
{
|
{
|
||||||
@@ -29,6 +29,5 @@ public class BlockCreativeEnergyCell extends AEBaseTileBlock
|
|||||||
public BlockCreativeEnergyCell()
|
public BlockCreativeEnergyCell()
|
||||||
{
|
{
|
||||||
super( AEGlassMaterial.INSTANCE );
|
super( AEGlassMaterial.INSTANCE );
|
||||||
this.setTileEntity( TileCreativeEnergyCell.class );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,14 +19,12 @@
|
|||||||
package appeng.block.networking;
|
package appeng.block.networking;
|
||||||
|
|
||||||
|
|
||||||
import appeng.tile.networking.TileDenseEnergyCell;
|
|
||||||
|
|
||||||
public class BlockDenseEnergyCell extends BlockEnergyCell
|
public class BlockDenseEnergyCell extends BlockEnergyCell
|
||||||
{
|
{
|
||||||
|
|
||||||
public BlockDenseEnergyCell()
|
public BlockDenseEnergyCell()
|
||||||
{
|
{
|
||||||
this.setTileEntity( TileDenseEnergyCell.class );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ package appeng.block.networking;
|
|||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
import appeng.tile.networking.TileEnergyAcceptor;
|
|
||||||
|
|
||||||
|
|
||||||
public class BlockEnergyAcceptor extends AEBaseTileBlock
|
public class BlockEnergyAcceptor extends AEBaseTileBlock
|
||||||
@@ -31,6 +30,5 @@ public class BlockEnergyAcceptor extends AEBaseTileBlock
|
|||||||
public BlockEnergyAcceptor()
|
public BlockEnergyAcceptor()
|
||||||
{
|
{
|
||||||
super( Material.IRON );
|
super( Material.IRON );
|
||||||
this.setTileEntity( TileEnergyAcceptor.class );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,21 +19,18 @@
|
|||||||
package appeng.block.networking;
|
package appeng.block.networking;
|
||||||
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.minecraft.block.properties.IProperty;
|
import net.minecraft.block.properties.IProperty;
|
||||||
import net.minecraft.block.properties.PropertyInteger;
|
import net.minecraft.block.properties.PropertyInteger;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.util.NonNullList;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
import appeng.helpers.AEGlassMaterial;
|
import appeng.helpers.AEGlassMaterial;
|
||||||
import appeng.tile.networking.TileEnergyCell;
|
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
|
|
||||||
|
|
||||||
@@ -57,15 +54,13 @@ public class BlockEnergyCell extends AEBaseTileBlock
|
|||||||
public BlockEnergyCell()
|
public BlockEnergyCell()
|
||||||
{
|
{
|
||||||
super( AEGlassMaterial.INSTANCE );
|
super( AEGlassMaterial.INSTANCE );
|
||||||
|
|
||||||
this.setTileEntity( TileEnergyCell.class );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
|
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
|
||||||
{
|
{
|
||||||
super.getCheckedSubBlocks( item, tabs, itemStacks );
|
super.getSubBlocks( tabs, itemStacks );
|
||||||
|
|
||||||
final ItemStack charged = new ItemStack( this, 1 );
|
final ItemStack charged = new ItemStack( this, 1 );
|
||||||
final NBTTagCompound tag = Platform.openNbtData( charged );
|
final NBTTagCompound tag = Platform.openNbtData( charged );
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public class BlockEnergyCellRendering extends BlockRenderingCustomizer
|
|||||||
double fillFactor = getFillFactor( is );
|
double fillFactor = getFillFactor( is );
|
||||||
|
|
||||||
int storageLevel = TileEnergyCell.getStorageLevelFromFillFactor( fillFactor );
|
int storageLevel = TileEnergyCell.getStorageLevelFromFillFactor( fillFactor );
|
||||||
return new ModelResourceLocation( baseModel, "fullness=" + storageLevel );
|
return new ModelResourceLocation( this.baseModel, "fullness=" + storageLevel );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -21,14 +21,12 @@ package appeng.block.networking;
|
|||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
import net.minecraft.block.properties.IProperty;
|
import net.minecraft.block.properties.IProperty;
|
||||||
import net.minecraft.block.properties.PropertyEnum;
|
import net.minecraft.block.properties.PropertyEnum;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.util.BlockRenderLayer;
|
import net.minecraft.util.BlockRenderLayer;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.EnumHand;
|
import net.minecraft.util.EnumHand;
|
||||||
@@ -46,6 +44,7 @@ import appeng.helpers.ICustomCollision;
|
|||||||
import appeng.tile.networking.TileWireless;
|
import appeng.tile.networking.TileWireless;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
|
|
||||||
|
|
||||||
public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
|
public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -58,21 +57,19 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
|
|||||||
@Override
|
@Override
|
||||||
public String getName()
|
public String getName()
|
||||||
{
|
{
|
||||||
return name().toLowerCase();
|
return this.name().toLowerCase();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static final PropertyEnum<State> STATE = PropertyEnum.create( "state", State.class );
|
public static final PropertyEnum<State> STATE = PropertyEnum.create( "state", State.class );
|
||||||
|
|
||||||
public BlockWireless()
|
public BlockWireless()
|
||||||
{
|
{
|
||||||
super( AEGlassMaterial.INSTANCE );
|
super( AEGlassMaterial.INSTANCE );
|
||||||
this.setTileEntity( TileWireless.class );
|
|
||||||
this.setLightOpacity( 0 );
|
this.setLightOpacity( 0 );
|
||||||
this.setFullSize( false );
|
this.setFullSize( false );
|
||||||
this.setOpaque( false );
|
this.setOpaque( false );
|
||||||
this.setDefaultState( getDefaultState().withProperty( STATE, State.OFF ) );
|
this.setDefaultState( this.getDefaultState().withProperty( STATE, State.OFF ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -86,7 +83,7 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
|
|||||||
{
|
{
|
||||||
State teState = State.OFF;
|
State teState = State.OFF;
|
||||||
|
|
||||||
TileWireless te = getTileEntity( worldIn, pos );
|
TileWireless te = this.getTileEntity( worldIn, pos );
|
||||||
if( te != null )
|
if( te != null )
|
||||||
{
|
{
|
||||||
if( te.isActive() )
|
if( te.isActive() )
|
||||||
@@ -110,15 +107,11 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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 );
|
final TileWireless tg = this.getTileEntity( w, pos );
|
||||||
if( tg != null )
|
|
||||||
|
if( tg != null && !player.isSneaking() )
|
||||||
{
|
{
|
||||||
if( Platform.isServer() )
|
if( Platform.isServer() )
|
||||||
{
|
{
|
||||||
@@ -126,7 +119,8 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
|
return super.onBlockActivated( w, pos, state, player, hand, side, hitX, hitY, hitZ );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public class CableBusRendering extends BlockRenderingCustomizer
|
|||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
public void customize( IBlockRendering rendering, IItemRendering itemRendering )
|
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.blockColor( new CableBusColor() );
|
||||||
rendering.modelCustomizer( ( loc, model ) -> model );
|
rendering.modelCustomizer( ( loc, model ) -> model );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
package appeng.block.networking;
|
package appeng.block.networking;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ package appeng.block.paint;
|
|||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
@@ -34,6 +33,7 @@ import net.minecraft.creativetab.CreativeTabs;
|
|||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.BlockRenderLayer;
|
import net.minecraft.util.BlockRenderLayer;
|
||||||
|
import net.minecraft.util.NonNullList;
|
||||||
import net.minecraft.util.math.AxisAlignedBB;
|
import net.minecraft.util.math.AxisAlignedBB;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
@@ -49,6 +49,7 @@ import appeng.helpers.Splotch;
|
|||||||
import appeng.tile.misc.TilePaint;
|
import appeng.tile.misc.TilePaint;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
|
|
||||||
|
|
||||||
public class BlockPaint extends AEBaseTileBlock
|
public class BlockPaint extends AEBaseTileBlock
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -58,7 +59,6 @@ public class BlockPaint extends AEBaseTileBlock
|
|||||||
{
|
{
|
||||||
super( new MaterialLiquid( MapColor.AIR ) );
|
super( new MaterialLiquid( MapColor.AIR ) );
|
||||||
|
|
||||||
this.setTileEntity( TilePaint.class );
|
|
||||||
this.setLightOpacity( 0 );
|
this.setLightOpacity( 0 );
|
||||||
this.setFullSize( false );
|
this.setFullSize( false );
|
||||||
this.setOpaque( false );
|
this.setOpaque( false );
|
||||||
@@ -75,7 +75,7 @@ public class BlockPaint extends AEBaseTileBlock
|
|||||||
{
|
{
|
||||||
IExtendedBlockState extState = (IExtendedBlockState) state;
|
IExtendedBlockState extState = (IExtendedBlockState) state;
|
||||||
|
|
||||||
TilePaint te = getTileEntity( world, pos );
|
TilePaint te = this.getTileEntity( world, pos );
|
||||||
|
|
||||||
Collection<Splotch> splotches = Collections.emptyList();
|
Collection<Splotch> splotches = Collections.emptyList();
|
||||||
if( te != null )
|
if( te != null )
|
||||||
@@ -94,13 +94,13 @@ public class BlockPaint extends AEBaseTileBlock
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
|
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AxisAlignedBB getCollisionBoundingBox( final IBlockState state, final World worldIn, final BlockPos pos )
|
public AxisAlignedBB getCollisionBoundingBox( IBlockState blockState, IBlockAccess worldIn, BlockPos pos )
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -112,9 +112,9 @@ public class BlockPaint extends AEBaseTileBlock
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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 )
|
if( tp != null )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
|
|
||||||
package appeng.block.paint;
|
package appeng.block.paint;
|
||||||
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
@@ -26,7 +28,8 @@ import appeng.helpers.Splotch;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renders paint blocks, which render multiple "splotches" that have been applied to the sides of adjacent blocks using a
|
* Renders paint blocks, which render multiple "splotches" that have been applied to the sides of adjacent blocks using
|
||||||
|
* a
|
||||||
* matter cannon with paint balls.
|
* matter cannon with paint balls.
|
||||||
*/
|
*/
|
||||||
class PaintBakedModel implements IBakedModel
|
class PaintBakedModel implements IBakedModel
|
||||||
@@ -63,7 +66,7 @@ class PaintBakedModel implements IBakedModel
|
|||||||
// This is the inventory model which should usually not be used other than in special cases
|
// This is the inventory model which should usually not be used other than in special cases
|
||||||
List<BakedQuad> quads = new ArrayList<>( 1 );
|
List<BakedQuad> quads = new ArrayList<>( 1 );
|
||||||
CubeBuilder builder = new CubeBuilder( this.vertexFormat, quads );
|
CubeBuilder builder = new CubeBuilder( this.vertexFormat, quads );
|
||||||
builder.setTexture( textures[0] );
|
builder.setTexture( this.textures[0] );
|
||||||
builder.addCube( 0, 0, 0, 16, 16, 16 );
|
builder.addCube( 0, 0, 0, 16, 16, 16 );
|
||||||
return quads;
|
return quads;
|
||||||
}
|
}
|
||||||
@@ -78,10 +81,11 @@ class PaintBakedModel implements IBakedModel
|
|||||||
|
|
||||||
List<Splotch> splotches = splotchesState.getSplotches();
|
List<Splotch> splotches = splotchesState.getSplotches();
|
||||||
|
|
||||||
CubeBuilder builder = new CubeBuilder( vertexFormat );
|
CubeBuilder builder = new CubeBuilder( this.vertexFormat );
|
||||||
|
|
||||||
float offsetConstant = 0.001f;
|
float offsetConstant = 0.001f;
|
||||||
for( final Splotch s : splotches) {
|
for( final Splotch s : splotches )
|
||||||
|
{
|
||||||
|
|
||||||
if( s.isLumen() )
|
if( s.isLumen() )
|
||||||
{
|
{
|
||||||
@@ -105,7 +109,7 @@ class PaintBakedModel implements IBakedModel
|
|||||||
pos_x = Math.max( buffer, Math.min( 1.0f - buffer, pos_x ) );
|
pos_x = Math.max( buffer, Math.min( 1.0f - buffer, pos_x ) );
|
||||||
pos_y = Math.max( buffer, Math.min( 1.0f - buffer, pos_y ) );
|
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.setTexture( ico );
|
||||||
builder.setCustomUv( s.getSide().getOpposite(), 0, 0, 16, 16 );
|
builder.setCustomUv( s.getSide().getOpposite(), 0, 0, 16, 16 );
|
||||||
|
|
||||||
@@ -172,7 +176,7 @@ class PaintBakedModel implements IBakedModel
|
|||||||
@Override
|
@Override
|
||||||
public TextureAtlasSprite getParticleTexture()
|
public TextureAtlasSprite getParticleTexture()
|
||||||
{
|
{
|
||||||
return textures[0];
|
return this.textures[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -190,7 +194,6 @@ class PaintBakedModel implements IBakedModel
|
|||||||
static List<ResourceLocation> getRequiredTextures()
|
static List<ResourceLocation> getRequiredTextures()
|
||||||
{
|
{
|
||||||
return ImmutableList.of(
|
return ImmutableList.of(
|
||||||
TEXTURE_PAINT1, TEXTURE_PAINT2, TEXTURE_PAINT3
|
TEXTURE_PAINT1, TEXTURE_PAINT2, TEXTURE_PAINT3 );
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
|
|
||||||
package appeng.block.paint;
|
package appeng.block.paint;
|
||||||
|
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.function.Function;
|
||||||
import com.google.common.base.Function;
|
|
||||||
|
|
||||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
package appeng.block.paint;
|
package appeng.block.paint;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
package appeng.block.paint;
|
package appeng.block.paint;
|
||||||
|
|
||||||
|
|
||||||
@@ -24,7 +25,7 @@ class PaintSplotches
|
|||||||
|
|
||||||
List<Splotch> getSplotches()
|
List<Splotch> getSplotches()
|
||||||
{
|
{
|
||||||
return splotches;
|
return this.splotches;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
package appeng.block.paint;
|
package appeng.block.paint;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ import appeng.block.AEBaseTileBlock;
|
|||||||
import appeng.helpers.ICustomCollision;
|
import appeng.helpers.ICustomCollision;
|
||||||
import appeng.tile.qnb.TileQuantumBridge;
|
import appeng.tile.qnb.TileQuantumBridge;
|
||||||
|
|
||||||
|
|
||||||
public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICustomCollision
|
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 )
|
public BlockQuantumBase( final Material mat )
|
||||||
{
|
{
|
||||||
super( mat );
|
super( mat );
|
||||||
this.setTileEntity( TileQuantumBridge.class );
|
|
||||||
final float shave = 2.0f / 16.0f;
|
final float shave = 2.0f / 16.0f;
|
||||||
this.boundingBox = new AxisAlignedBB( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave );
|
this.boundingBox = new AxisAlignedBB( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave );
|
||||||
this.setLightOpacity( 0 );
|
this.setLightOpacity( 0 );
|
||||||
this.setFullSize( this.setOpaque( false ) );
|
this.setFullSize( this.setOpaque( false ) );
|
||||||
this.setDefaultState( getDefaultState().withProperty( FORMED, false ) );
|
this.setDefaultState( this.getDefaultState().withProperty( FORMED, false ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -65,7 +65,7 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto
|
|||||||
@Override
|
@Override
|
||||||
protected BlockStateContainer createBlockState()
|
protected BlockStateContainer createBlockState()
|
||||||
{
|
{
|
||||||
return new ExtendedBlockState( this, getAEStates(), new IUnlistedProperty[] { FORMED_STATE } );
|
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] { FORMED_STATE } );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -73,7 +73,7 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto
|
|||||||
{
|
{
|
||||||
IExtendedBlockState extState = (IExtendedBlockState) state;
|
IExtendedBlockState extState = (IExtendedBlockState) state;
|
||||||
|
|
||||||
TileQuantumBridge bridge = getTileEntity( world, pos );
|
TileQuantumBridge bridge = this.getTileEntity( world, pos );
|
||||||
if( bridge != null )
|
if( bridge != null )
|
||||||
{
|
{
|
||||||
QnbFormedState formedState = new QnbFormedState( bridge.getAdjacentQuantumBridges(), bridge.isCorner(), bridge.isPowered() );
|
QnbFormedState formedState = new QnbFormedState( bridge.getAdjacentQuantumBridges(), bridge.isCorner(), bridge.isPowered() );
|
||||||
@@ -86,7 +86,7 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto
|
|||||||
@Override
|
@Override
|
||||||
public IBlockState getActualState( IBlockState state, IBlockAccess worldIn, BlockPos pos )
|
public IBlockState getActualState( IBlockState state, IBlockAccess worldIn, BlockPos pos )
|
||||||
{
|
{
|
||||||
TileQuantumBridge bridge = getTileEntity( worldIn, pos );
|
TileQuantumBridge bridge = this.getTileEntity( worldIn, pos );
|
||||||
if( bridge != null )
|
if( bridge != null )
|
||||||
{
|
{
|
||||||
state = state.withProperty( FORMED, bridge.isFormed() );
|
state = state.withProperty( FORMED, bridge.isFormed() );
|
||||||
@@ -101,9 +101,9 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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 )
|
if( bridge != null )
|
||||||
{
|
{
|
||||||
bridge.neighborUpdate();
|
bridge.neighborUpdate();
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ import net.minecraft.world.World;
|
|||||||
|
|
||||||
import appeng.api.util.AEPartLocation;
|
import appeng.api.util.AEPartLocation;
|
||||||
import appeng.client.EffectType;
|
import appeng.client.EffectType;
|
||||||
import appeng.core.CommonHelper;
|
import appeng.core.AppEng;
|
||||||
import appeng.core.sync.GuiBridge;
|
import appeng.core.sync.GuiBridge;
|
||||||
import appeng.helpers.AEGlassMaterial;
|
import appeng.helpers.AEGlassMaterial;
|
||||||
import appeng.tile.qnb.TileQuantumBridge;
|
import appeng.tile.qnb.TileQuantumBridge;
|
||||||
@@ -60,9 +60,9 @@ public class BlockQuantumLinkChamber extends BlockQuantumBase
|
|||||||
{
|
{
|
||||||
if( bridge.hasQES() )
|
if( bridge.hasQES() )
|
||||||
{
|
{
|
||||||
if( CommonHelper.proxy.shouldAddParticles( rand ) )
|
if( AppEng.proxy.shouldAddParticles( rand ) )
|
||||||
{
|
{
|
||||||
CommonHelper.proxy.spawnEffect( EffectType.Energy, w, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, null );
|
AppEng.proxy.spawnEffect( EffectType.Energy, w, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, null );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
|
|
||||||
package appeng.block.qnb;
|
package appeng.block.qnb;
|
||||||
|
|
||||||
|
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
@@ -77,46 +79,47 @@ class QnbFormedBakedModel implements IBakedModel
|
|||||||
// Get the correct base model
|
// Get the correct base model
|
||||||
if( !( state instanceof IExtendedBlockState ) )
|
if( !( state instanceof IExtendedBlockState ) )
|
||||||
{
|
{
|
||||||
return baseModel.getQuads( state, side, rand );
|
return this.baseModel.getQuads( state, side, rand );
|
||||||
}
|
}
|
||||||
|
|
||||||
IExtendedBlockState extendedBlockState = (IExtendedBlockState) state;
|
IExtendedBlockState extendedBlockState = (IExtendedBlockState) state;
|
||||||
QnbFormedState formedState = extendedBlockState.getValue( BlockQuantumBase.FORMED_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 )
|
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();
|
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 );
|
builder.addCube( DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( formedState.isCorner() )
|
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 );
|
builder.addCube( DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX );
|
||||||
|
|
||||||
if( formedState.isPowered() )
|
if( formedState.isPowered() )
|
||||||
{
|
{
|
||||||
builder.setTexture( lightCornerTexture );
|
builder.setTexture( this.lightCornerTexture );
|
||||||
builder.setRenderFullBright( true );
|
builder.setRenderFullBright( true );
|
||||||
for( EnumFacing facing : EnumFacing.values() )
|
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 xOffset = Math.abs( facing.getFrontOffsetX() * 0.01f );
|
||||||
float yOffset = Math.abs( facing.getFrontOffsetY() * 0.01f );
|
float yOffset = Math.abs( facing.getFrontOffsetY() * 0.01f );
|
||||||
float zOffset = Math.abs( facing.getFrontOffsetZ() * 0.01f );
|
float zOffset = Math.abs( facing.getFrontOffsetZ() * 0.01f );
|
||||||
@@ -124,14 +127,13 @@ class QnbFormedBakedModel implements IBakedModel
|
|||||||
builder.setDrawFaces( EnumSet.of( facing ) );
|
builder.setDrawFaces( EnumSet.of( facing ) );
|
||||||
builder.addCube(
|
builder.addCube(
|
||||||
DEFAULT_RENDER_MIN - xOffset, DEFAULT_RENDER_MIN - yOffset, DEFAULT_RENDER_MIN - zOffset,
|
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
|
else
|
||||||
{
|
{
|
||||||
builder.setTexture( ringTexture );
|
builder.setTexture( this.ringTexture );
|
||||||
|
|
||||||
builder.addCube( 0, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, 16, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX );
|
builder.addCube( 0, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, 16, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX );
|
||||||
|
|
||||||
@@ -141,11 +143,12 @@ class QnbFormedBakedModel implements IBakedModel
|
|||||||
|
|
||||||
if( formedState.isPowered() )
|
if( formedState.isPowered() )
|
||||||
{
|
{
|
||||||
builder.setTexture( lightTexture );
|
builder.setTexture( this.lightTexture );
|
||||||
builder.setRenderFullBright( true );
|
builder.setRenderFullBright( true );
|
||||||
for( EnumFacing facing : EnumFacing.values() )
|
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 xOffset = Math.abs( facing.getFrontOffsetX() * 0.01f );
|
||||||
float yOffset = Math.abs( facing.getFrontOffsetY() * 0.01f );
|
float yOffset = Math.abs( facing.getFrontOffsetY() * 0.01f );
|
||||||
float zOffset = Math.abs( facing.getFrontOffsetZ() * 0.01f );
|
float zOffset = Math.abs( facing.getFrontOffsetZ() * 0.01f );
|
||||||
@@ -153,8 +156,7 @@ class QnbFormedBakedModel implements IBakedModel
|
|||||||
builder.setDrawFaces( EnumSet.of( facing ) );
|
builder.setDrawFaces( EnumSet.of( facing ) );
|
||||||
builder.addCube(
|
builder.addCube(
|
||||||
-xOffset, -yOffset, -zOffset,
|
-xOffset, -yOffset, -zOffset,
|
||||||
16 + xOffset, 16 + yOffset, 16 + zOffset
|
16 + xOffset, 16 + yOffset, 16 + zOffset );
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -201,7 +203,7 @@ class QnbFormedBakedModel implements IBakedModel
|
|||||||
@Override
|
@Override
|
||||||
public boolean isAmbientOcclusion()
|
public boolean isAmbientOcclusion()
|
||||||
{
|
{
|
||||||
return baseModel.isAmbientOcclusion();
|
return this.baseModel.isAmbientOcclusion();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -219,25 +221,24 @@ class QnbFormedBakedModel implements IBakedModel
|
|||||||
@Override
|
@Override
|
||||||
public TextureAtlasSprite getParticleTexture()
|
public TextureAtlasSprite getParticleTexture()
|
||||||
{
|
{
|
||||||
return baseModel.getParticleTexture();
|
return this.baseModel.getParticleTexture();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemCameraTransforms getItemCameraTransforms()
|
public ItemCameraTransforms getItemCameraTransforms()
|
||||||
{
|
{
|
||||||
return baseModel.getItemCameraTransforms();
|
return this.baseModel.getItemCameraTransforms();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemOverrideList getOverrides()
|
public ItemOverrideList getOverrides()
|
||||||
{
|
{
|
||||||
return baseModel.getOverrides();
|
return this.baseModel.getOverrides();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<ResourceLocation> getRequiredTextures()
|
public static List<ResourceLocation> getRequiredTextures()
|
||||||
{
|
{
|
||||||
return ImmutableList.of(
|
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;
|
package appeng.block.qnb;
|
||||||
|
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||||
@@ -38,7 +39,7 @@ public class QnbFormedModel implements IModel
|
|||||||
@Override
|
@Override
|
||||||
public IBakedModel bake( IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter )
|
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 );
|
return new QnbFormedBakedModel( format, ringModel, bakedTextureGetter );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
package appeng.block.qnb;
|
package appeng.block.qnb;
|
||||||
|
|
||||||
|
|
||||||
@@ -24,17 +25,17 @@ public class QnbFormedState
|
|||||||
|
|
||||||
public Set<EnumFacing> getAdjacentQuantumBridges()
|
public Set<EnumFacing> getAdjacentQuantumBridges()
|
||||||
{
|
{
|
||||||
return adjacentQuantumBridges;
|
return this.adjacentQuantumBridges;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isCorner()
|
public boolean isCorner()
|
||||||
{
|
{
|
||||||
return corner;
|
return this.corner;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPowered()
|
public boolean isPowered()
|
||||||
{
|
{
|
||||||
return powered;
|
return this.powered;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
package appeng.block.qnb;
|
package appeng.block.qnb;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
package appeng.block.qnb;
|
package appeng.block.qnb;
|
||||||
|
|
||||||
|
|
||||||
@@ -18,6 +19,6 @@ public class QuantumBridgeRendering extends BlockRenderingCustomizer
|
|||||||
{
|
{
|
||||||
rendering.builtInModel( "models/block/qnb/qnb_formed", new QnbFormedModel() );
|
rendering.builtInModel( "models/block/qnb/qnb_formed", new QnbFormedModel() );
|
||||||
// Disable auto rotation
|
// 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.block.state.IBlockState;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.NonNullList;
|
||||||
import net.minecraft.util.math.AxisAlignedBB;
|
import net.minecraft.util.math.AxisAlignedBB;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.Explosion;
|
import net.minecraft.world.Explosion;
|
||||||
@@ -39,6 +39,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
|||||||
import appeng.block.AEBaseBlock;
|
import appeng.block.AEBaseBlock;
|
||||||
import appeng.helpers.ICustomCollision;
|
import appeng.helpers.ICustomCollision;
|
||||||
|
|
||||||
|
|
||||||
public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision
|
public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -53,7 +54,7 @@ public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
|
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,19 +37,19 @@ import appeng.core.sync.GuiBridge;
|
|||||||
import appeng.tile.spatial.TileSpatialIOPort;
|
import appeng.tile.spatial.TileSpatialIOPort;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
|
|
||||||
|
|
||||||
public class BlockSpatialIOPort extends AEBaseTileBlock
|
public class BlockSpatialIOPort extends AEBaseTileBlock
|
||||||
{
|
{
|
||||||
|
|
||||||
public BlockSpatialIOPort()
|
public BlockSpatialIOPort()
|
||||||
{
|
{
|
||||||
super( Material.IRON );
|
super( Material.IRON );
|
||||||
this.setTileEntity( TileSpatialIOPort.class );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
|
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
|
||||||
{
|
{
|
||||||
final TileSpatialIOPort te = this.getTileEntity( w, pos );
|
final TileSpatialIOPort te = this.getTileEntity( world, pos );
|
||||||
if( te != null )
|
if( te != null )
|
||||||
{
|
{
|
||||||
te.updateRedstoneState();
|
te.updateRedstoneState();
|
||||||
|
|||||||
@@ -44,13 +44,12 @@ public class BlockSpatialPylon extends AEBaseTileBlock
|
|||||||
public BlockSpatialPylon()
|
public BlockSpatialPylon()
|
||||||
{
|
{
|
||||||
super( AEGlassMaterial.INSTANCE );
|
super( AEGlassMaterial.INSTANCE );
|
||||||
this.setTileEntity( TileSpatialPylon.class );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected BlockStateContainer createBlockState()
|
protected BlockStateContainer createBlockState()
|
||||||
{
|
{
|
||||||
return new ExtendedBlockState( this, getAEStates(), new IUnlistedProperty[] { STATE } );
|
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] { STATE } );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -58,13 +57,13 @@ public class BlockSpatialPylon extends AEBaseTileBlock
|
|||||||
{
|
{
|
||||||
IExtendedBlockState extState = (IExtendedBlockState) state;
|
IExtendedBlockState extState = (IExtendedBlockState) state;
|
||||||
|
|
||||||
return extState.withProperty( STATE, getDisplayState( world, pos ) );
|
return extState.withProperty( STATE, this.getDisplayState( world, pos ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
|
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
|
||||||
{
|
{
|
||||||
final TileSpatialPylon tsp = this.getTileEntity( w, pos );
|
final TileSpatialPylon tsp = this.getTileEntity( world, pos );
|
||||||
if( tsp != null )
|
if( tsp != null )
|
||||||
{
|
{
|
||||||
tsp.neighborChanged();
|
tsp.neighborChanged();
|
||||||
@@ -84,7 +83,7 @@ public class BlockSpatialPylon extends AEBaseTileBlock
|
|||||||
|
|
||||||
private int getDisplayState( IBlockAccess world, BlockPos pos )
|
private int getDisplayState( IBlockAccess world, BlockPos pos )
|
||||||
{
|
{
|
||||||
TileSpatialPylon te = getTileEntity( world, pos );
|
TileSpatialPylon te = this.getTileEntity( world, pos );
|
||||||
|
|
||||||
if( te == null )
|
if( te == null )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -52,8 +52,7 @@ public class BlockChest extends AEBaseTileBlock
|
|||||||
public BlockChest()
|
public BlockChest()
|
||||||
{
|
{
|
||||||
super( Material.IRON );
|
super( Material.IRON );
|
||||||
this.setTileEntity( TileChest.class );
|
this.setDefaultState( this.getDefaultState().withProperty( SLOT_STATE, DriveSlotState.EMPTY ) );
|
||||||
this.setDefaultState( getDefaultState().withProperty( SLOT_STATE, DriveSlotState.EMPTY ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -73,7 +72,7 @@ public class BlockChest extends AEBaseTileBlock
|
|||||||
{
|
{
|
||||||
DriveSlotState slotState = DriveSlotState.EMPTY;
|
DriveSlotState slotState = DriveSlotState.EMPTY;
|
||||||
|
|
||||||
TileChest te = getTileEntity( worldIn, pos );
|
TileChest te = this.getTileEntity( worldIn, pos );
|
||||||
|
|
||||||
if( te != null )
|
if( te != null )
|
||||||
{
|
{
|
||||||
@@ -109,8 +108,8 @@ public class BlockChest extends AEBaseTileBlock
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
final ItemStack cell = tg.getStackInSlot( 1 );
|
final ItemStack cell = tg.getCell();
|
||||||
if( cell != null )
|
if( !cell.isEmpty() )
|
||||||
{
|
{
|
||||||
final ICellHandler ch = AEApi.instance().registries().cell().getHandler( cell );
|
final ICellHandler ch = AEApi.instance().registries().cell().getHandler( cell );
|
||||||
|
|
||||||
@@ -118,7 +117,7 @@ public class BlockChest extends AEBaseTileBlock
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
p.addChatMessage( PlayerMessages.ChestCannotReadStorageCell.get() );
|
p.sendMessage( PlayerMessages.ChestCannotReadStorageCell.get() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,12 +47,11 @@ import appeng.util.Platform;
|
|||||||
public class BlockDrive extends AEBaseTileBlock
|
public class BlockDrive extends AEBaseTileBlock
|
||||||
{
|
{
|
||||||
|
|
||||||
public static final UnlistedProperty<DriveSlotsState> SLOTS_STATE = new UnlistedProperty<>("drive_slots_state", DriveSlotsState.class);
|
public static final UnlistedProperty<DriveSlotsState> SLOTS_STATE = new UnlistedProperty<>( "drive_slots_state", DriveSlotsState.class );
|
||||||
|
|
||||||
public BlockDrive()
|
public BlockDrive()
|
||||||
{
|
{
|
||||||
super( Material.IRON );
|
super( Material.IRON );
|
||||||
this.setTileEntity( TileDrive.class );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -64,7 +63,7 @@ public class BlockDrive extends AEBaseTileBlock
|
|||||||
@Override
|
@Override
|
||||||
protected BlockStateContainer createBlockState()
|
protected BlockStateContainer createBlockState()
|
||||||
{
|
{
|
||||||
return new ExtendedBlockState( this, getAEStates(), new IUnlistedProperty[] {
|
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] {
|
||||||
SLOTS_STATE,
|
SLOTS_STATE,
|
||||||
FORWARD,
|
FORWARD,
|
||||||
UP
|
UP
|
||||||
@@ -74,7 +73,7 @@ public class BlockDrive extends AEBaseTileBlock
|
|||||||
@Override
|
@Override
|
||||||
public IBlockState getExtendedState( IBlockState state, IBlockAccess world, BlockPos pos )
|
public IBlockState getExtendedState( IBlockState state, IBlockAccess world, BlockPos pos )
|
||||||
{
|
{
|
||||||
TileDrive te = getTileEntity( world, pos );
|
TileDrive te = this.getTileEntity( world, pos );
|
||||||
if( te == null )
|
if( te == null )
|
||||||
{
|
{
|
||||||
return super.getExtendedState( state, world, pos );
|
return super.getExtendedState( state, world, pos );
|
||||||
|
|||||||
@@ -44,13 +44,12 @@ public class BlockIOPort extends AEBaseTileBlock
|
|||||||
public BlockIOPort()
|
public BlockIOPort()
|
||||||
{
|
{
|
||||||
super( Material.IRON );
|
super( Material.IRON );
|
||||||
this.setTileEntity( TileIOPort.class );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
|
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
|
||||||
{
|
{
|
||||||
final TileIOPort te = this.getTileEntity( w, pos );
|
final TileIOPort te = this.getTileEntity( world, pos );
|
||||||
if( te != null )
|
if( te != null )
|
||||||
{
|
{
|
||||||
te.updateRedstoneState();
|
te.updateRedstoneState();
|
||||||
|
|||||||
@@ -47,6 +47,10 @@ import appeng.util.Platform;
|
|||||||
public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
|
public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
|
||||||
{
|
{
|
||||||
|
|
||||||
|
private static final double AABB_OFFSET_BOTTOM = .0625d;
|
||||||
|
private static final double AABB_OFFSET_SIDES = 0;
|
||||||
|
private static final double AABB_OFFSET_TOP = .125d;
|
||||||
|
|
||||||
public enum SkyChestType
|
public enum SkyChestType
|
||||||
{
|
{
|
||||||
STONE, BLOCK
|
STONE, BLOCK
|
||||||
@@ -57,7 +61,6 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
|
|||||||
public BlockSkyChest( final SkyChestType type )
|
public BlockSkyChest( final SkyChestType type )
|
||||||
{
|
{
|
||||||
super( Material.ROCK );
|
super( Material.ROCK );
|
||||||
this.setTileEntity( TileSkyChest.class );
|
|
||||||
this.setOpaque( this.setFullSize( false ) );
|
this.setOpaque( this.setFullSize( false ) );
|
||||||
this.lightOpacity = 0;
|
this.lightOpacity = 0;
|
||||||
this.setHardness( 50 );
|
this.setHardness( 50 );
|
||||||
@@ -71,7 +74,6 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
|
|||||||
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
|
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onActivated( final World w, final BlockPos pos, final EntityPlayer player, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
public boolean onActivated( final World w, final BlockPos pos, final EntityPlayer player, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
||||||
{
|
{
|
||||||
@@ -85,6 +87,21 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final BlockPos pos, final Entity thePlayer, final boolean b )
|
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final BlockPos pos, final Entity thePlayer, final boolean b )
|
||||||
|
{
|
||||||
|
final AxisAlignedBB aabb = this.computeAABB( w, pos );
|
||||||
|
|
||||||
|
return Collections.singletonList( aabb );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
|
||||||
|
{
|
||||||
|
final AxisAlignedBB aabb = this.computeAABB( w, pos );
|
||||||
|
|
||||||
|
out.add( aabb );
|
||||||
|
}
|
||||||
|
|
||||||
|
private AxisAlignedBB computeAABB( final World w, final BlockPos pos )
|
||||||
{
|
{
|
||||||
final TileSkyChest sk = this.getTileEntity( w, pos );
|
final TileSkyChest sk = this.getTileEntity( w, pos );
|
||||||
EnumFacing o = EnumFacing.UP;
|
EnumFacing o = EnumFacing.UP;
|
||||||
@@ -94,17 +111,19 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
|
|||||||
o = sk.getUp();
|
o = sk.getUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
final double offsetX = o.getFrontOffsetX() == 0 ? 0.06 : 0.0;
|
final double offsetX = o.getFrontOffsetX() == 0 ? AABB_OFFSET_BOTTOM : AABB_OFFSET_SIDES;
|
||||||
final double offsetY = o.getFrontOffsetY() == 0 ? 0.06 : 0.0;
|
final double offsetY = o.getFrontOffsetY() == 0 ? AABB_OFFSET_BOTTOM : AABB_OFFSET_SIDES;
|
||||||
final double offsetZ = o.getFrontOffsetZ() == 0 ? 0.06 : 0.0;
|
final double offsetZ = o.getFrontOffsetZ() == 0 ? AABB_OFFSET_BOTTOM : AABB_OFFSET_SIDES;
|
||||||
|
|
||||||
final double sc = 0.06;
|
// x/z needs to be multiplied by -1, thus we simply add not substract.
|
||||||
return Collections.singletonList( new AxisAlignedBB( Math.max( 0.0, offsetX - o.getFrontOffsetX() * sc ), Math.max( 0.0, offsetY - o.getFrontOffsetY() * sc ), Math.max( 0.0, offsetZ - o.getFrontOffsetZ() * sc ), Math.min( 1.0, ( 1.0 - offsetX ) - o.getFrontOffsetX() * sc ), Math.min( 1.0, ( 1.0 - offsetY ) - o.getFrontOffsetY() * sc ), Math.min( 1.0, ( 1.0 - offsetZ ) - o.getFrontOffsetZ() * sc ) ) );
|
final double minX = Math.max( 0.0, offsetX + o.getFrontOffsetX() * AABB_OFFSET_TOP );
|
||||||
}
|
final double minY = Math.max( 0.0, offsetY - o.getFrontOffsetY() * AABB_OFFSET_TOP );
|
||||||
|
final double minZ = Math.max( 0.0, offsetZ + o.getFrontOffsetZ() * AABB_OFFSET_TOP );
|
||||||
|
|
||||||
@Override
|
final double maxX = Math.min( 1.0, ( 1.0 - offsetX ) + o.getFrontOffsetX() * AABB_OFFSET_TOP );
|
||||||
public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
|
final double maxY = Math.min( 1.0, ( 1.0 - offsetY ) - o.getFrontOffsetY() * AABB_OFFSET_TOP );
|
||||||
{
|
final double maxZ = Math.min( 1.0, ( 1.0 - offsetZ ) + o.getFrontOffsetZ() * AABB_OFFSET_TOP );
|
||||||
out.add( new AxisAlignedBB( 0.05, 0.05, 0.05, 0.95, 0.95, 0.95 ) );
|
|
||||||
|
return new AxisAlignedBB( minX, minY, minZ, maxX, maxY, maxZ );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public enum DriveSlotState implements IStringSerializable
|
|||||||
@Override
|
@Override
|
||||||
public String getName()
|
public String getName()
|
||||||
{
|
{
|
||||||
return name;
|
return this.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DriveSlotState fromCellStatus( int cellStatus )
|
public static DriveSlotState fromCellStatus( int cellStatus )
|
||||||
|
|||||||
@@ -37,16 +37,16 @@ public class DriveSlotsState
|
|||||||
|
|
||||||
public DriveSlotState getState( int index )
|
public DriveSlotState getState( int index )
|
||||||
{
|
{
|
||||||
if( index >= slots.length )
|
if( index >= this.slots.length )
|
||||||
{
|
{
|
||||||
return DriveSlotState.EMPTY;
|
return DriveSlotState.EMPTY;
|
||||||
}
|
}
|
||||||
return slots[index];
|
return this.slots[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getSlotCount()
|
public int getSlotCount()
|
||||||
{
|
{
|
||||||
return slots.length;
|
return this.slots.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public class SkyChestRenderingCustomizer extends BlockRenderingCustomizer
|
|||||||
rendering.tesr( new SkyChestTESR() );
|
rendering.tesr( new SkyChestTESR() );
|
||||||
|
|
||||||
// Register a custom non-tesr item model
|
// Register a custom non-tesr item model
|
||||||
String modelName = getModelFromType();
|
String modelName = this.getModelFromType();
|
||||||
ModelResourceLocation model = new ModelResourceLocation( "appliedenergistics2:" + modelName, "inventory" );
|
ModelResourceLocation model = new ModelResourceLocation( "appliedenergistics2:" + modelName, "inventory" );
|
||||||
itemRendering.model( model ).variants( model );
|
itemRendering.model( model ).variants( model );
|
||||||
}
|
}
|
||||||
@@ -54,7 +54,7 @@ public class SkyChestRenderingCustomizer extends BlockRenderingCustomizer
|
|||||||
private String getModelFromType()
|
private String getModelFromType()
|
||||||
{
|
{
|
||||||
final String modelName;
|
final String modelName;
|
||||||
switch( type )
|
switch( this.type )
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
case STONE:
|
case STONE:
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import java.util.List;
|
|||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
@@ -34,7 +35,6 @@ import net.minecraft.creativetab.CreativeTabs;
|
|||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
@@ -42,9 +42,11 @@ import appeng.api.definitions.IBlockDefinition;
|
|||||||
import appeng.block.AEBaseBlock;
|
import appeng.block.AEBaseBlock;
|
||||||
import appeng.block.AEBaseItemBlock;
|
import appeng.block.AEBaseItemBlock;
|
||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
|
import appeng.bootstrap.definitions.TileEntityDefinition;
|
||||||
import appeng.core.AEConfig;
|
import appeng.core.AEConfig;
|
||||||
import appeng.core.AppEng;
|
import appeng.core.AppEng;
|
||||||
import appeng.core.CreativeTab;
|
import appeng.core.CreativeTab;
|
||||||
|
import appeng.core.Registration;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.core.features.ActivityState;
|
import appeng.core.features.ActivityState;
|
||||||
import appeng.core.features.BlockDefinition;
|
import appeng.core.features.BlockDefinition;
|
||||||
@@ -67,12 +69,16 @@ class BlockDefinitionBuilder implements IBlockBuilder
|
|||||||
|
|
||||||
private final List<BiConsumer<Block, Item>> initCallbacks = new ArrayList<>();
|
private final List<BiConsumer<Block, Item>> initCallbacks = new ArrayList<>();
|
||||||
|
|
||||||
|
private final List<BiConsumer<Block, Item>> modelRegCallbacks = new ArrayList<>();
|
||||||
|
|
||||||
private final List<BiConsumer<Block, Item>> postInitCallbacks = new ArrayList<>();
|
private final List<BiConsumer<Block, Item>> postInitCallbacks = new ArrayList<>();
|
||||||
|
|
||||||
private final EnumSet<AEFeature> features = EnumSet.noneOf( AEFeature.class );
|
private final EnumSet<AEFeature> features = EnumSet.noneOf( AEFeature.class );
|
||||||
|
|
||||||
private CreativeTabs creativeTab = CreativeTab.instance;
|
private CreativeTabs creativeTab = CreativeTab.instance;
|
||||||
|
|
||||||
|
private TileEntityDefinition tileEntityDefinition;
|
||||||
|
|
||||||
private boolean disableItem = false;
|
private boolean disableItem = false;
|
||||||
|
|
||||||
private Function<Block, ItemBlock> itemFactory;
|
private Function<Block, ItemBlock> itemFactory;
|
||||||
@@ -91,29 +97,36 @@ class BlockDefinitionBuilder implements IBlockBuilder
|
|||||||
|
|
||||||
if( Platform.isClient() )
|
if( Platform.isClient() )
|
||||||
{
|
{
|
||||||
blockRendering = new BlockRendering();
|
this.blockRendering = new BlockRendering();
|
||||||
itemRendering = new ItemRendering();
|
this.itemRendering = new ItemRendering();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockDefinitionBuilder preInit( BiConsumer<Block, Item> callback )
|
public BlockDefinitionBuilder preInit( BiConsumer<Block, Item> callback )
|
||||||
{
|
{
|
||||||
preInitCallbacks.add( callback );
|
this.preInitCallbacks.add( callback );
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockDefinitionBuilder init( BiConsumer<Block, Item> callback )
|
public BlockDefinitionBuilder init( BiConsumer<Block, Item> callback )
|
||||||
{
|
{
|
||||||
initCallbacks.add( callback );
|
this.initCallbacks.add( callback );
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockDefinitionBuilder modelRegInit( BiConsumer<Block, Item> callback )
|
||||||
|
{
|
||||||
|
this.modelRegCallbacks.add( callback );
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockDefinitionBuilder postInit( BiConsumer<Block, Item> callback )
|
public BlockDefinitionBuilder postInit( BiConsumer<Block, Item> callback )
|
||||||
{
|
{
|
||||||
postInitCallbacks.add( callback );
|
this.postInitCallbacks.add( callback );
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +134,7 @@ class BlockDefinitionBuilder implements IBlockBuilder
|
|||||||
public IBlockBuilder features( AEFeature... features )
|
public IBlockBuilder features( AEFeature... features )
|
||||||
{
|
{
|
||||||
this.features.clear();
|
this.features.clear();
|
||||||
addFeatures( features );
|
this.addFeatures( features );
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,22 +150,29 @@ class BlockDefinitionBuilder implements IBlockBuilder
|
|||||||
{
|
{
|
||||||
if( Platform.isClient() )
|
if( Platform.isClient() )
|
||||||
{
|
{
|
||||||
customizeForClient( callback );
|
this.customizeForClient( callback );
|
||||||
}
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IBlockBuilder tileEntity( TileEntityDefinition tileEntityDefinition )
|
||||||
|
{
|
||||||
|
this.tileEntityDefinition = tileEntityDefinition;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockBuilder useCustomItemModel()
|
public IBlockBuilder useCustomItemModel()
|
||||||
{
|
{
|
||||||
rendering( new BlockRenderingCustomizer()
|
this.rendering( new BlockRenderingCustomizer()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
public void customize( IBlockRendering rendering, IItemRendering itemRendering )
|
public void customize( IBlockRendering rendering, IItemRendering itemRendering )
|
||||||
{
|
{
|
||||||
ModelResourceLocation model = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, registryName ), "inventory" );
|
ModelResourceLocation model = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, BlockDefinitionBuilder.this.registryName ), "inventory" );
|
||||||
itemRendering.model( model ).variants( model );
|
itemRendering.model( model ).variants( model );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
@@ -177,94 +197,108 @@ class BlockDefinitionBuilder implements IBlockBuilder
|
|||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
private void customizeForClient( BlockRenderingCustomizer callback )
|
private void customizeForClient( BlockRenderingCustomizer callback )
|
||||||
{
|
{
|
||||||
callback.customize( blockRendering, itemRendering );
|
callback.customize( this.blockRendering, this.itemRendering );
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings( "unchecked" )
|
@SuppressWarnings( "unchecked" )
|
||||||
@Override
|
@Override
|
||||||
public <T extends IBlockDefinition> T build()
|
public <T extends IBlockDefinition> T build()
|
||||||
{
|
{
|
||||||
if( !AEConfig.instance.areFeaturesEnabled( features ) )
|
if( !AEConfig.instance().areFeaturesEnabled( this.features ) )
|
||||||
{
|
{
|
||||||
return (T) new TileDefinition( registryName, null, null );
|
return (T) new TileDefinition( this.registryName, null, null );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create block and matching item, and set factory name of both
|
// Create block and matching item, and set factory name of both
|
||||||
Block block = blockSupplier.get();
|
Block block = this.blockSupplier.get();
|
||||||
block.setRegistryName( AppEng.MOD_ID, registryName );
|
block.setRegistryName( AppEng.MOD_ID, this.registryName );
|
||||||
|
block.setUnlocalizedName( "appliedenergistics2." + this.registryName );
|
||||||
|
|
||||||
ItemBlock item = constructItemFromBlock( block );
|
ItemBlock item = this.constructItemFromBlock( block );
|
||||||
if( item != null )
|
if( item != null )
|
||||||
{
|
{
|
||||||
item.setRegistryName( AppEng.MOD_ID, registryName );
|
item.setRegistryName( AppEng.MOD_ID, this.registryName );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Register the item and block with the game
|
// Register the item and block with the game
|
||||||
factory.addPreInit( side -> {
|
this.factory.addPreInit( side ->
|
||||||
GameRegistry.register( block );
|
{
|
||||||
|
Registration.addBlockToRegister( block );
|
||||||
if( item != null )
|
if( item != null )
|
||||||
{
|
{
|
||||||
GameRegistry.register( item );
|
Registration.addItemToRegister( item );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
block.setCreativeTab( creativeTab );
|
block.setCreativeTab( this.creativeTab );
|
||||||
block.setUnlocalizedName( "appliedenergistics2." + registryName );
|
|
||||||
|
|
||||||
// Register all extra handlers
|
// Register all extra handlers
|
||||||
preInitCallbacks.forEach( consumer -> factory.addPreInit( side -> consumer.accept( block, item ) ) );
|
this.preInitCallbacks.forEach( consumer -> this.factory.addPreInit( side -> consumer.accept( block, item ) ) );
|
||||||
initCallbacks.forEach( consumer -> factory.addInit( side -> consumer.accept( block, item ) ) );
|
this.initCallbacks.forEach( consumer -> this.factory.addInit( side -> consumer.accept( block, item ) ) );
|
||||||
postInitCallbacks.forEach( consumer -> factory.addPostInit( side -> consumer.accept( block, item ) ) );
|
this.modelRegCallbacks.forEach( consumer -> this.factory.addModelReg( ( side, reg ) -> consumer.accept( block, item ) ) );
|
||||||
|
this.postInitCallbacks.forEach( consumer -> this.factory.addPostInit( side -> consumer.accept( block, item ) ) );
|
||||||
|
|
||||||
|
if( this.tileEntityDefinition != null && block instanceof AEBaseTileBlock )
|
||||||
|
{
|
||||||
|
( (AEBaseTileBlock) block ).setTileEntity( this.tileEntityDefinition.getTileEntityClass() );
|
||||||
|
if( this.tileEntityDefinition.getName() == null )
|
||||||
|
{
|
||||||
|
this.tileEntityDefinition.setName( this.registryName );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if( Platform.isClient() )
|
if( Platform.isClient() )
|
||||||
{
|
{
|
||||||
if( block instanceof AEBaseTileBlock )
|
if( block instanceof AEBaseTileBlock )
|
||||||
{
|
{
|
||||||
AEBaseTileBlock tileBlock = (AEBaseTileBlock) block;
|
AEBaseTileBlock tileBlock = (AEBaseTileBlock) block;
|
||||||
blockRendering.apply( factory, block, tileBlock.getTileEntityClass() );
|
this.blockRendering.apply( this.factory, block, tileBlock.getTileEntityClass() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
blockRendering.apply( factory, block, null );
|
this.blockRendering.apply( this.factory, block, null );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( item != null )
|
if( item != null )
|
||||||
{
|
{
|
||||||
itemRendering.apply( factory, item );
|
this.itemRendering.apply( this.factory, item );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( block instanceof AEBaseTileBlock )
|
if( block instanceof AEBaseTileBlock )
|
||||||
{
|
{
|
||||||
AEBaseTileBlock tileBlock = (AEBaseTileBlock) block;
|
this.factory.addPreInit( side ->
|
||||||
|
{
|
||||||
factory.addPreInit( side -> {
|
AEBaseTile.registerTileItem(
|
||||||
Class<? extends AEBaseTile> tileEntityClass = tileBlock.getTileEntityClass();
|
this.tileEntityDefinition == null ? ( (AEBaseTileBlock) block ).getTileEntityClass() : this.tileEntityDefinition.getTileEntityClass(),
|
||||||
AEBaseTile.registerTileItem( tileEntityClass, new BlockStackSrc( block, 0, ActivityState.Enabled ) );
|
new BlockStackSrc( block, 0, ActivityState.Enabled ) );
|
||||||
|
|
||||||
// TODO: Change after transition phase
|
|
||||||
GameRegistry.registerTileEntityWithAlternatives( tileEntityClass, AppEng.MOD_ID.toLowerCase() + ":" + registryName, registryName );
|
|
||||||
} );
|
} );
|
||||||
|
|
||||||
return (T) new TileDefinition( registryName, (AEBaseTileBlock) block, item );
|
if( this.tileEntityDefinition != null )
|
||||||
|
{
|
||||||
|
this.factory.tileEntityComponent.addTileEntity( this.tileEntityDefinition );
|
||||||
|
}
|
||||||
|
|
||||||
|
return (T) new TileDefinition( this.registryName, (AEBaseTileBlock) block, item );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return (T) new BlockDefinition( registryName, block, item );
|
return (T) new BlockDefinition( this.registryName, block, item );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
private ItemBlock constructItemFromBlock( Block block )
|
private ItemBlock constructItemFromBlock( Block block )
|
||||||
{
|
{
|
||||||
if( disableItem )
|
if( this.disableItem )
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( itemFactory != null )
|
if( this.itemFactory != null )
|
||||||
{
|
{
|
||||||
return itemFactory.apply( block );
|
return this.itemFactory.apply( block );
|
||||||
}
|
}
|
||||||
else if( block instanceof AEBaseBlock )
|
else if( block instanceof AEBaseBlock )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ class BlockRendering implements IBlockRendering
|
|||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
public IBlockRendering modelCustomizer( BiFunction<ModelResourceLocation, IBakedModel, IBakedModel> customizer )
|
public IBlockRendering modelCustomizer( BiFunction<ModelResourceLocation, IBakedModel, IBakedModel> customizer )
|
||||||
{
|
{
|
||||||
modelCustomizer = customizer;
|
this.modelCustomizer = customizer;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,18 +99,18 @@ class BlockRendering implements IBlockRendering
|
|||||||
|
|
||||||
void apply( FeatureFactory factory, Block block, Class<?> tileEntityClass )
|
void apply( FeatureFactory factory, Block block, Class<?> tileEntityClass )
|
||||||
{
|
{
|
||||||
if( tesr != null )
|
if( this.tesr != null )
|
||||||
{
|
{
|
||||||
if( tileEntityClass == null )
|
if( tileEntityClass == null )
|
||||||
{
|
{
|
||||||
throw new IllegalStateException( "Tried to register a TESR for " + block + " even though no tile entity has been specified." );
|
throw new IllegalStateException( "Tried to register a TESR for " + block + " even though no tile entity has been specified." );
|
||||||
}
|
}
|
||||||
factory.addBootstrapComponent( new TesrComponent( tileEntityClass, tesr ) );
|
factory.addBootstrapComponent( new TesrComponent( tileEntityClass, this.tesr ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( modelCustomizer != null )
|
if( this.modelCustomizer != null )
|
||||||
{
|
{
|
||||||
factory.modelOverrideComponent.addOverride( block.getRegistryName().getResourcePath(), modelCustomizer );
|
factory.modelOverrideComponent.addOverride( block.getRegistryName().getResourcePath(), this.modelCustomizer );
|
||||||
}
|
}
|
||||||
else if( block instanceof AEBaseTileBlock )
|
else if( block instanceof AEBaseTileBlock )
|
||||||
{
|
{
|
||||||
@@ -119,16 +119,17 @@ class BlockRendering implements IBlockRendering
|
|||||||
factory.modelOverrideComponent.addOverride( block.getRegistryName().getResourcePath(), ( l, m ) -> new AutoRotatingModel( m ) );
|
factory.modelOverrideComponent.addOverride( block.getRegistryName().getResourcePath(), ( l, m ) -> new AutoRotatingModel( m ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
builtInModels.forEach( factory::addBuiltInModel );
|
// TODO : 1.12
|
||||||
|
this.builtInModels.forEach( factory::addBuiltInModel );
|
||||||
|
|
||||||
if( blockColor != null )
|
if( this.blockColor != null )
|
||||||
{
|
{
|
||||||
factory.addBootstrapComponent( new BlockColorComponent( block, blockColor ) );
|
factory.addBootstrapComponent( new BlockColorComponent( block, this.blockColor ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( stateMapper != null )
|
if( this.stateMapper != null )
|
||||||
{
|
{
|
||||||
factory.addBootstrapComponent( new StateMapperComponent( block, stateMapper ) );
|
factory.addBootstrapComponent( new StateMapperComponent( block, this.stateMapper ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,10 +33,12 @@ import appeng.api.definitions.IItemDefinition;
|
|||||||
import appeng.api.util.AEColor;
|
import appeng.api.util.AEColor;
|
||||||
import appeng.api.util.AEColoredItemDefinition;
|
import appeng.api.util.AEColoredItemDefinition;
|
||||||
import appeng.bootstrap.components.BuiltInModelComponent;
|
import appeng.bootstrap.components.BuiltInModelComponent;
|
||||||
import appeng.bootstrap.components.InitComponent;
|
import appeng.bootstrap.components.IInitComponent;
|
||||||
|
import appeng.bootstrap.components.IModelRegistrationComponent;
|
||||||
|
import appeng.bootstrap.components.IPostInitComponent;
|
||||||
|
import appeng.bootstrap.components.IPreInitComponent;
|
||||||
import appeng.bootstrap.components.ModelOverrideComponent;
|
import appeng.bootstrap.components.ModelOverrideComponent;
|
||||||
import appeng.bootstrap.components.PostInitComponent;
|
import appeng.bootstrap.components.TileEntityComponent;
|
||||||
import appeng.bootstrap.components.PreInitComponent;
|
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.core.features.ActivityState;
|
import appeng.core.features.ActivityState;
|
||||||
import appeng.core.features.ColoredItemDefinition;
|
import appeng.core.features.ColoredItemDefinition;
|
||||||
@@ -57,18 +59,23 @@ public class FeatureFactory
|
|||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
private BuiltInModelComponent builtInModelComponent;
|
private BuiltInModelComponent builtInModelComponent;
|
||||||
|
|
||||||
|
public final TileEntityComponent tileEntityComponent;
|
||||||
|
|
||||||
public FeatureFactory()
|
public FeatureFactory()
|
||||||
{
|
{
|
||||||
this.defaultFeatures = new AEFeature[] { AEFeature.Core };
|
this.defaultFeatures = new AEFeature[] { AEFeature.CORE };
|
||||||
this.bootstrapComponents = new ArrayList<>();
|
this.bootstrapComponents = new ArrayList<>();
|
||||||
|
|
||||||
|
this.tileEntityComponent = new TileEntityComponent();
|
||||||
|
this.bootstrapComponents.add( this.tileEntityComponent );
|
||||||
|
|
||||||
if( Platform.isClient() )
|
if( Platform.isClient() )
|
||||||
{
|
{
|
||||||
modelOverrideComponent = new ModelOverrideComponent();
|
this.modelOverrideComponent = new ModelOverrideComponent();
|
||||||
bootstrapComponents.add( modelOverrideComponent );
|
this.bootstrapComponents.add( this.modelOverrideComponent );
|
||||||
|
|
||||||
builtInModelComponent = new BuiltInModelComponent();
|
this.builtInModelComponent = new BuiltInModelComponent();
|
||||||
bootstrapComponents.add( builtInModelComponent );
|
this.bootstrapComponents.add( this.builtInModelComponent );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,6 +83,7 @@ public class FeatureFactory
|
|||||||
{
|
{
|
||||||
this.defaultFeatures = defaultFeatures.clone();
|
this.defaultFeatures = defaultFeatures.clone();
|
||||||
this.bootstrapComponents = parent.bootstrapComponents;
|
this.bootstrapComponents = parent.bootstrapComponents;
|
||||||
|
this.tileEntityComponent = parent.tileEntityComponent;
|
||||||
if( Platform.isClient() )
|
if( Platform.isClient() )
|
||||||
{
|
{
|
||||||
this.modelOverrideComponent = parent.modelOverrideComponent;
|
this.modelOverrideComponent = parent.modelOverrideComponent;
|
||||||
@@ -85,19 +93,20 @@ public class FeatureFactory
|
|||||||
|
|
||||||
public IBlockBuilder block( String id, Supplier<Block> block )
|
public IBlockBuilder block( String id, Supplier<Block> block )
|
||||||
{
|
{
|
||||||
return new BlockDefinitionBuilder( this, id, block ).features( defaultFeatures );
|
return new BlockDefinitionBuilder( this, id, block ).features( this.defaultFeatures );
|
||||||
}
|
}
|
||||||
|
|
||||||
public IItemBuilder item( String id, Supplier<Item> item )
|
public IItemBuilder item( String id, Supplier<Item> item )
|
||||||
{
|
{
|
||||||
return new ItemDefinitionBuilder( this, id, item ).features( defaultFeatures );
|
return new ItemDefinitionBuilder( this, id, item ).features( this.defaultFeatures );
|
||||||
}
|
}
|
||||||
|
|
||||||
public AEColoredItemDefinition colored( IItemDefinition target, int offset )
|
public AEColoredItemDefinition colored( IItemDefinition target, int offset )
|
||||||
{
|
{
|
||||||
ColoredItemDefinition definition = new ColoredItemDefinition();
|
ColoredItemDefinition definition = new ColoredItemDefinition();
|
||||||
|
|
||||||
target.maybeItem().ifPresent( targetItem -> {
|
target.maybeItem().ifPresent( targetItem ->
|
||||||
|
{
|
||||||
for( final AEColor color : AEColor.VALID_COLORS )
|
for( final AEColor color : AEColor.VALID_COLORS )
|
||||||
{
|
{
|
||||||
final ActivityState state = ActivityState.from( target.isEnabled() );
|
final ActivityState state = ActivityState.from( target.isEnabled() );
|
||||||
@@ -119,17 +128,22 @@ public class FeatureFactory
|
|||||||
this.bootstrapComponents.add( component );
|
this.bootstrapComponents.add( component );
|
||||||
}
|
}
|
||||||
|
|
||||||
void addPreInit( PreInitComponent component )
|
void addPreInit( IPreInitComponent component )
|
||||||
{
|
{
|
||||||
this.bootstrapComponents.add( component );
|
this.bootstrapComponents.add( component );
|
||||||
}
|
}
|
||||||
|
|
||||||
void addInit( InitComponent component )
|
void addInit( IInitComponent component )
|
||||||
{
|
{
|
||||||
this.bootstrapComponents.add( component );
|
this.bootstrapComponents.add( component );
|
||||||
}
|
}
|
||||||
|
|
||||||
void addPostInit( PostInitComponent component )
|
void addModelReg( IModelRegistrationComponent component )
|
||||||
|
{
|
||||||
|
this.bootstrapComponents.add( component );
|
||||||
|
}
|
||||||
|
|
||||||
|
void addPostInit( IPostInitComponent component )
|
||||||
{
|
{
|
||||||
this.bootstrapComponents.add( component );
|
this.bootstrapComponents.add( component );
|
||||||
}
|
}
|
||||||
@@ -137,11 +151,11 @@ public class FeatureFactory
|
|||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
void addBuiltInModel( String path, IModel model )
|
void addBuiltInModel( String path, IModel model )
|
||||||
{
|
{
|
||||||
builtInModelComponent.addModel( path, model );
|
this.builtInModelComponent.addModel( path, model );
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<IBootstrapComponent> getBootstrapComponents()
|
public List<IBootstrapComponent> getBootstrapComponents()
|
||||||
{
|
{
|
||||||
return bootstrapComponents;
|
return this.bootstrapComponents;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import net.minecraft.item.Item;
|
|||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
|
|
||||||
import appeng.api.definitions.IBlockDefinition;
|
import appeng.api.definitions.IBlockDefinition;
|
||||||
|
import appeng.bootstrap.definitions.TileEntityDefinition;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
|
|
||||||
|
|
||||||
@@ -37,6 +38,8 @@ public interface IBlockBuilder
|
|||||||
|
|
||||||
IBlockBuilder init( BiConsumer<Block, Item> callback );
|
IBlockBuilder init( BiConsumer<Block, Item> callback );
|
||||||
|
|
||||||
|
IBlockBuilder modelRegInit( BiConsumer<Block, Item> callback );
|
||||||
|
|
||||||
IBlockBuilder postInit( BiConsumer<Block, Item> callback );
|
IBlockBuilder postInit( BiConsumer<Block, Item> callback );
|
||||||
|
|
||||||
IBlockBuilder features( AEFeature... features );
|
IBlockBuilder features( AEFeature... features );
|
||||||
@@ -45,6 +48,8 @@ public interface IBlockBuilder
|
|||||||
|
|
||||||
IBlockBuilder rendering( BlockRenderingCustomizer callback );
|
IBlockBuilder rendering( BlockRenderingCustomizer callback );
|
||||||
|
|
||||||
|
IBlockBuilder tileEntity( TileEntityDefinition tileEntityDefinition );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Don't register an item for this block.
|
* Don't register an item for this block.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -32,6 +32,10 @@ public interface IBootstrapComponent
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default void modelRegistration( Side side, IModelRegistry registry )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
default void initialize( Side side )
|
default void initialize( Side side )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-8
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of Applied Energistics 2.
|
* This file is part of Applied Energistics 2.
|
||||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
* Copyright (c) 2013 - 2017, AlgorithmX2, All rights reserved.
|
||||||
*
|
*
|
||||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@@ -16,18 +16,24 @@
|
|||||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package appeng.integration.abstraction;
|
package appeng.bootstrap;
|
||||||
|
|
||||||
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||||
import appeng.api.storage.IMEInventory;
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||||
|
import net.minecraft.client.renderer.block.statemap.IStateMapper;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
|
||||||
public interface IDSU
|
public interface IModelRegistry
|
||||||
{
|
{
|
||||||
|
void registerItemVariants( Item item, ResourceLocation... names );
|
||||||
|
|
||||||
IMEInventory getDSU( TileEntity te );
|
void setCustomModelResourceLocation( Item item, int metadata, ModelResourceLocation model );
|
||||||
|
|
||||||
boolean isDSU( TileEntity te );
|
void setCustomMeshDefinition( Item item, ItemMeshDefinition meshDefinition );
|
||||||
|
|
||||||
|
void setCustomStateMapper( Block block, IStateMapper mapper );
|
||||||
}
|
}
|
||||||
@@ -30,13 +30,13 @@ import net.minecraft.block.BlockDispenser;
|
|||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.dispenser.IBehaviorDispenseItem;
|
import net.minecraft.dispenser.IBehaviorDispenseItem;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.core.AEConfig;
|
import appeng.core.AEConfig;
|
||||||
import appeng.core.AppEng;
|
import appeng.core.AppEng;
|
||||||
import appeng.core.CreativeTab;
|
import appeng.core.CreativeTab;
|
||||||
|
import appeng.core.Registration;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.core.features.ItemDefinition;
|
import appeng.core.features.ItemDefinition;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
@@ -57,6 +57,8 @@ class ItemDefinitionBuilder implements IItemBuilder
|
|||||||
|
|
||||||
private final List<Consumer<Item>> initCallbacks = new ArrayList<>();
|
private final List<Consumer<Item>> initCallbacks = new ArrayList<>();
|
||||||
|
|
||||||
|
private final List<Consumer<Item>> modelRegCallbacks = new ArrayList<>();
|
||||||
|
|
||||||
private final List<Consumer<Item>> postInitCallbacks = new ArrayList<>();
|
private final List<Consumer<Item>> postInitCallbacks = new ArrayList<>();
|
||||||
|
|
||||||
private Supplier<IBehaviorDispenseItem> dispenserBehaviorSupplier;
|
private Supplier<IBehaviorDispenseItem> dispenserBehaviorSupplier;
|
||||||
@@ -73,28 +75,28 @@ class ItemDefinitionBuilder implements IItemBuilder
|
|||||||
this.itemSupplier = itemSupplier;
|
this.itemSupplier = itemSupplier;
|
||||||
if( Platform.isClient() )
|
if( Platform.isClient() )
|
||||||
{
|
{
|
||||||
itemRendering = new ItemRendering();
|
this.itemRendering = new ItemRendering();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemDefinitionBuilder preInit( Consumer<Item> callback )
|
public ItemDefinitionBuilder preInit( Consumer<Item> callback )
|
||||||
{
|
{
|
||||||
preInitCallbacks.add( callback );
|
this.preInitCallbacks.add( callback );
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemDefinitionBuilder init( Consumer<Item> callback )
|
public ItemDefinitionBuilder init( Consumer<Item> callback )
|
||||||
{
|
{
|
||||||
initCallbacks.add( callback );
|
this.initCallbacks.add( callback );
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemDefinitionBuilder postInit( Consumer<Item> callback )
|
public ItemDefinitionBuilder postInit( Consumer<Item> callback )
|
||||||
{
|
{
|
||||||
postInitCallbacks.add( callback );
|
this.postInitCallbacks.add( callback );
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,7 +104,7 @@ class ItemDefinitionBuilder implements IItemBuilder
|
|||||||
public IItemBuilder features( AEFeature... features )
|
public IItemBuilder features( AEFeature... features )
|
||||||
{
|
{
|
||||||
this.features.clear();
|
this.features.clear();
|
||||||
addFeatures( features );
|
this.addFeatures( features );
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,7 +127,7 @@ class ItemDefinitionBuilder implements IItemBuilder
|
|||||||
{
|
{
|
||||||
if( Platform.isClient() )
|
if( Platform.isClient() )
|
||||||
{
|
{
|
||||||
customizeForClient( callback );
|
this.customizeForClient( callback );
|
||||||
}
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
@@ -141,44 +143,46 @@ class ItemDefinitionBuilder implements IItemBuilder
|
|||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
private void customizeForClient( ItemRenderingCustomizer callback )
|
private void customizeForClient( ItemRenderingCustomizer callback )
|
||||||
{
|
{
|
||||||
callback.customize( itemRendering );
|
callback.customize( this.itemRendering );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemDefinition build()
|
public ItemDefinition build()
|
||||||
{
|
{
|
||||||
if( !AEConfig.instance.areFeaturesEnabled( features ) )
|
if( !AEConfig.instance().areFeaturesEnabled( this.features ) )
|
||||||
{
|
{
|
||||||
return new ItemDefinition( registryName, null );
|
return new ItemDefinition( this.registryName, null );
|
||||||
}
|
}
|
||||||
|
|
||||||
Item item = itemSupplier.get();
|
Item item = this.itemSupplier.get();
|
||||||
item.setRegistryName( AppEng.MOD_ID, registryName );
|
item.setRegistryName( AppEng.MOD_ID, this.registryName );
|
||||||
|
|
||||||
ItemDefinition definition = new ItemDefinition( registryName, item );
|
ItemDefinition definition = new ItemDefinition( this.registryName, item );
|
||||||
|
|
||||||
item.setUnlocalizedName( "appliedenergistics2." + registryName );
|
item.setUnlocalizedName( "appliedenergistics2." + this.registryName );
|
||||||
item.setCreativeTab( creativeTab );
|
item.setCreativeTab( this.creativeTab );
|
||||||
|
|
||||||
// Register all extra handlers
|
// Register all extra handlers
|
||||||
preInitCallbacks.forEach( consumer -> factory.addPreInit( side -> consumer.accept( item ) ) );
|
this.preInitCallbacks.forEach( consumer -> this.factory.addPreInit( side -> consumer.accept( item ) ) );
|
||||||
initCallbacks.forEach( consumer -> factory.addInit( side -> consumer.accept( item ) ) );
|
this.initCallbacks.forEach( consumer -> this.factory.addInit( side -> consumer.accept( item ) ) );
|
||||||
postInitCallbacks.forEach( consumer -> factory.addPostInit( side -> consumer.accept( item ) ) );
|
this.modelRegCallbacks.forEach( consumer -> this.factory.addModelReg( ( side, reg ) -> consumer.accept( item ) ) );
|
||||||
|
this.postInitCallbacks.forEach( consumer -> this.factory.addPostInit( side -> consumer.accept( item ) ) );
|
||||||
|
|
||||||
// Register custom dispenser behavior if requested
|
// Register custom dispenser behavior if requested
|
||||||
if( dispenserBehaviorSupplier != null )
|
if( this.dispenserBehaviorSupplier != null )
|
||||||
{
|
{
|
||||||
factory.addPostInit( side -> {
|
this.factory.addPostInit( side ->
|
||||||
IBehaviorDispenseItem behavior = dispenserBehaviorSupplier.get();
|
{
|
||||||
|
IBehaviorDispenseItem behavior = this.dispenserBehaviorSupplier.get();
|
||||||
BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject( item, behavior );
|
BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject( item, behavior );
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
factory.addPreInit( side -> GameRegistry.register( item ) );
|
this.factory.addPreInit( side -> Registration.addItemToRegister( item ) );
|
||||||
|
|
||||||
if( Platform.isClient() )
|
if( Platform.isClient() )
|
||||||
{
|
{
|
||||||
itemRendering.apply( factory, item );
|
this.itemRendering.apply( this.factory, item );
|
||||||
}
|
}
|
||||||
|
|
||||||
return definition;
|
return definition;
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ class ItemRendering implements IItemRendering
|
|||||||
{
|
{
|
||||||
if( this.itemMeshDefinition != null )
|
if( this.itemMeshDefinition != null )
|
||||||
{
|
{
|
||||||
factory.addBootstrapComponent( new ItemMeshDefinitionComponent( item, itemMeshDefinition ) );
|
factory.addBootstrapComponent( new ItemMeshDefinitionComponent( item, this.itemMeshDefinition ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !this.itemModels.isEmpty() )
|
if( !this.itemModels.isEmpty() )
|
||||||
@@ -115,7 +115,7 @@ class ItemRendering implements IItemRendering
|
|||||||
factory.addBootstrapComponent( new ItemModelComponent( item, this.itemModels ) );
|
factory.addBootstrapComponent( new ItemModelComponent( item, this.itemModels ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<ResourceLocation> resources = new HashSet<>( variants );
|
Set<ResourceLocation> resources = new HashSet<>( this.variants );
|
||||||
|
|
||||||
// Register a default item model if neither items by meta nor an item mesh definition exist
|
// Register a default item model if neither items by meta nor an item mesh definition exist
|
||||||
if( this.itemMeshDefinition == null && this.itemModels.isEmpty() )
|
if( this.itemMeshDefinition == null && this.itemModels.isEmpty() )
|
||||||
@@ -140,13 +140,14 @@ class ItemRendering implements IItemRendering
|
|||||||
factory.addBootstrapComponent( new ItemModelComponent( item, ImmutableMap.of( 0, model ) ) );
|
factory.addBootstrapComponent( new ItemModelComponent( item, ImmutableMap.of( 0, model ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
builtInModels.forEach( factory::addBuiltInModel );
|
// TODO : 1.12
|
||||||
|
this.builtInModels.forEach( factory::addBuiltInModel );
|
||||||
|
|
||||||
if( !resources.isEmpty() )
|
if( !resources.isEmpty() )
|
||||||
{
|
{
|
||||||
factory.addBootstrapComponent( new ItemVariantsComponent( item, resources ) );
|
factory.addBootstrapComponent( new ItemVariantsComponent( item, resources ) );
|
||||||
}
|
}
|
||||||
else if( !this.itemModels.isEmpty() || itemMeshDefinition != null )
|
else if( !this.itemModels.isEmpty() || this.itemMeshDefinition != null )
|
||||||
{
|
{
|
||||||
// Adding an empty variant list here will prevent Vanilla from trying to load the default item model in this
|
// Adding an empty variant list here will prevent Vanilla from trying to load the default item model in this
|
||||||
// case
|
// case
|
||||||
@@ -158,9 +159,9 @@ class ItemRendering implements IItemRendering
|
|||||||
factory.addBootstrapComponent( new ItemVariantsComponent( item, Collections.emptyList() ) );
|
factory.addBootstrapComponent( new ItemVariantsComponent( item, Collections.emptyList() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( itemColor != null )
|
if( this.itemColor != null )
|
||||||
{
|
{
|
||||||
factory.addBootstrapComponent( new ItemColorComponent( item, itemColor ) );
|
factory.addBootstrapComponent( new ItemColorComponent( item, this.itemColor ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,7 +178,7 @@ class ItemRendering implements IItemRendering
|
|||||||
@Override
|
@Override
|
||||||
protected ModelResourceLocation getModelResourceLocation( IBlockState state )
|
protected ModelResourceLocation getModelResourceLocation( IBlockState state )
|
||||||
{
|
{
|
||||||
return new ModelResourceLocation( registryName, getPropertyString( state.getProperties() ) );
|
return new ModelResourceLocation( this.registryName, this.getPropertyString( state.getProperties() ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user