Compare commits
306 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b82df25c75 | |||
| cc9b33b473 | |||
| 5496b746ea | |||
| f80f623ccf | |||
| cba6c5500f | |||
| bc8268af94 | |||
| 297cd16702 | |||
| 41711e50b9 | |||
| 2bfb8b75e8 | |||
| 58e96aa3de | |||
| 4f07b63b13 | |||
| 905dd6c888 | |||
| ab7f35a9ee | |||
| 6e81f698c0 | |||
| 8ad8ce68b5 | |||
| 644194d0d6 | |||
| 95b27f490c | |||
| 6032c0328e | |||
| e8d554d69d | |||
| 1e15b23506 | |||
| 2ed7a5598a | |||
| 1c05dd5834 | |||
| 632d124359 | |||
| 829c18e2bb | |||
| d3a5be7ed6 | |||
| 217cbf0982 | |||
| 4dd0a4cd96 | |||
| 54c0ce43ea | |||
| bd8f43acbf | |||
| 970630a90d | |||
| 771a944058 | |||
| db1cd8c312 | |||
| 375e1efb15 | |||
| 955fcac92a | |||
| 216e2cb1e3 | |||
| 53f5724657 | |||
| a3269826f9 | |||
| 1a918be658 | |||
| 90130e72aa | |||
| c8f10d92bb | |||
| 548af3c6cc | |||
| 98b9380494 | |||
| bbf4d4a9ce | |||
| 1513ba3f6a | |||
| f03f8ec432 | |||
| e1dcd588b7 | |||
| 8338a7d13e | |||
| b8e685b1b6 | |||
| d84500c5b7 | |||
| a1679c944b | |||
| a3a39201d1 | |||
| d788da687e | |||
| 030e0c6a14 | |||
| 8e4265aa33 | |||
| 80eaa032b9 | |||
| bee9c70497 | |||
| c4fa21c193 | |||
| 8a7450168b | |||
| 7cb641cdc8 | |||
| b5b8050c4c | |||
| e65083b045 | |||
| b61219ef88 | |||
| 4f9fd1b369 | |||
| 630fae3f73 | |||
| 488ef1b544 | |||
| 098ee2f000 | |||
| 04d2b06c0d | |||
| ac48ab02fc | |||
| 9022150e38 | |||
| 65c6d2249a | |||
| 8e7f79a9ea | |||
| 95b48b9438 | |||
| cdd76b7b22 | |||
| 3e2bc0e038 | |||
| eec3e59eea | |||
| e39855b48f | |||
| cdcab7d91c | |||
| 27ad2c2b96 | |||
| 542a2e5d5a | |||
| 3b58f5e8da | |||
| 092afad4a5 | |||
| 6aa810d62a | |||
| 41d98f9944 | |||
| 1b198979fd | |||
| 8d5cc916e0 | |||
| 5abb8bf886 | |||
| 0bed78a144 | |||
| 30940e91ea | |||
| 0f9ac5fdda | |||
| 5e001d86cb | |||
| b13a338948 | |||
| 454404b0c1 | |||
| bb1e191666 | |||
| b72fce97db | |||
| bcc4a732ed | |||
| 52d28fabe3 | |||
| c077840988 | |||
| 8f6510aad4 | |||
| fa8427dcbd | |||
| 7eb09fc4db | |||
| ac528d09ae | |||
| c97165cc63 | |||
| 08ee8f7656 | |||
| 727fcc528f | |||
| a4c468b9cf | |||
| 4ad31f5066 | |||
| f70e97046f | |||
| 3a053d9ebe | |||
| fbaff342e4 | |||
| f0baea3be8 | |||
| fd7e393d23 | |||
| a24ed38e90 | |||
| 15582fd1df | |||
| f9cad0758d | |||
| 406013142e | |||
| 7de90ed0ae | |||
| 8ec8babb6a | |||
| 621910df91 | |||
| 66437897be | |||
| 7414840530 | |||
| 0741e4ae09 | |||
| 87f6a63f47 | |||
| b0950683a1 | |||
| 009cf8ac40 | |||
| 4c272de77f | |||
| 6648d18f00 | |||
| 16b5b5aea2 | |||
| e20697a7d9 | |||
| dc0447d137 | |||
| 577b1fa757 | |||
| 3d69dc9bc4 | |||
| 66c87a2fa2 | |||
| fdab91323c | |||
| 98a8c3d06b | |||
| 458356a2be | |||
| c91b432e09 | |||
| d67d93b343 | |||
| f6f8da28af | |||
| 76fd3c1166 | |||
| 3da881829e | |||
| 90ee7fb15d | |||
| e5e2714273 | |||
| 1534521362 | |||
| 0f8204cd93 | |||
| eb11845a2f | |||
| fe213e5ac5 | |||
| 25c82b2c9f | |||
| d03faae983 | |||
| 76e19874cf | |||
| 1975c3c262 | |||
| 720feb4f16 | |||
| 588579d67f | |||
| 043f6e9919 | |||
| cc7824a0e5 | |||
| a57cd3f580 | |||
| 33f54a1bd6 | |||
| 3008088ad7 | |||
| 198ea9f16e | |||
| d8c5e6a5fa | |||
| fbcf8c4705 | |||
| d67f97cd16 | |||
| 0e2f8a22a2 | |||
| 20fc0e136d | |||
| 7f7495f1df | |||
| e6e858820f | |||
| 4679b0ee61 | |||
| 890eef1803 | |||
| 780ce89ac3 | |||
| e96339dd2b | |||
| b67d7eed82 | |||
| 5ebd8452bf | |||
| ee774cd3f8 | |||
| 0a2f90d115 | |||
| 0f86efa3f5 | |||
| 7398af0e1c | |||
| eb0b304fd9 | |||
| c455ee69b8 | |||
| 820a6bdbd6 | |||
| 7a8499c455 | |||
| 76f17ba53c | |||
| 16a0872d06 | |||
| 49a87f62ce | |||
| c382ab7300 | |||
| 49a6df5bc7 | |||
| 10e050c35b | |||
| b1e249aad0 | |||
| d3bb71d834 | |||
| 3f7051ec8e | |||
| 2f1f19bbb3 | |||
| 4c7f065af3 | |||
| 6c52f31686 | |||
| 3ac7e518b1 | |||
| af85a2bf67 | |||
| c4b4a257f3 | |||
| 4eba3bca5b | |||
| cd78586910 | |||
| 178198b0c6 | |||
| bdf46a6ee2 | |||
| 0be2011645 | |||
| bce500616c | |||
| e022c23c8f | |||
| 61b81fc802 | |||
| b819fe4adb | |||
| 66a797dd7c | |||
| 99c294e948 | |||
| 6529de911a | |||
| 650edae902 | |||
| 78904204cf | |||
| df7ab00c37 | |||
| 5432decf95 | |||
| da5879b667 | |||
| 370fc49357 | |||
| c74aaddbd3 | |||
| 1a4db4b8d7 | |||
| d77d21858e | |||
| 42bfc549be | |||
| c6bdf845a8 | |||
| ccc46e77a3 | |||
| 7e45cf0e37 | |||
| 86dd8193f7 | |||
| 5fff8310d6 | |||
| 1cde7bc933 | |||
| ed9e6dd21c | |||
| 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
|
||||||
|
|
||||||
|
|||||||
+17
-25
@@ -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,12 +40,17 @@ 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
|
||||||
targetCompatibility = JavaVersion.VERSION_1_8
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
|
||||||
|
// ensure everything uses UTF-8 and not some random codepage chosen by gradle
|
||||||
|
compileJava.options.encoding = 'UTF-8'
|
||||||
|
tasks.withType(JavaCompile) {
|
||||||
|
options.encoding = 'UTF-8'
|
||||||
|
}
|
||||||
|
|
||||||
version = aeversion + "-" + aechannel + "-" + aebuild
|
version = aeversion + "-" + aechannel + "-" + aebuild
|
||||||
group = aegroup
|
group = aegroup
|
||||||
archivesBaseName = aebasename
|
archivesBaseName = aebasename
|
||||||
@@ -53,19 +58,21 @@ archivesBaseName = aebasename
|
|||||||
// Add Coremod Manifest
|
// Add Coremod Manifest
|
||||||
jar {
|
jar {
|
||||||
manifest {
|
manifest {
|
||||||
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"
|
|
||||||
|
|
||||||
version = minecraft_version + "-" + forge_version
|
version = minecraft_version + "-" + forge_version
|
||||||
|
|
||||||
replaceIn "AEConfig.java"
|
replaceIn "AEConfig.java"
|
||||||
@@ -82,26 +89,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 +109,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"/>
|
||||||
|
|||||||
+16
-8
@@ -1,4 +1,4 @@
|
|||||||
aeversion=rv4
|
aeversion=rv5
|
||||||
aechannel=alpha
|
aechannel=alpha
|
||||||
aebuild=0
|
aebuild=0
|
||||||
aegroup=appeng
|
aegroup=appeng
|
||||||
@@ -7,18 +7,26 @@ aebasename=appliedenergistics2
|
|||||||
#########################################################
|
#########################################################
|
||||||
# Versions #
|
# Versions #
|
||||||
#########################################################
|
#########################################################
|
||||||
minecraft_version=1.10.2
|
minecraft_version=1.12.2
|
||||||
mcp_mappings=snapshot_20161018
|
mcp_mappings=snapshot_20171003
|
||||||
forge_version=12.18.2.2104
|
forge_version=14.23.0.2491
|
||||||
|
|
||||||
#########################################################
|
#########################################################
|
||||||
# Installable #
|
# Installable #
|
||||||
#########################################################
|
#########################################################
|
||||||
waila_version=1.7.0-B3_1.9.4
|
hwyla_version=1.8.20-B35_1.12
|
||||||
|
|
||||||
#########################################################
|
#########################################################
|
||||||
# Provided APIs #
|
# Provided APIs #
|
||||||
#########################################################
|
#########################################################
|
||||||
jei_version=3.12.7.312
|
jei_version=4.8.0.105
|
||||||
tesla_version=1.10.2-1.2.1.49
|
tesla_version=1.0.61
|
||||||
ic2_version=2.6.96-ex110
|
ic2_version=2.8.19-ex112
|
||||||
|
top_version=1.12-1.4.18-10
|
||||||
|
cofhcore_version=1.12-4.+
|
||||||
|
|
||||||
|
#########################################################
|
||||||
|
# Deployment #
|
||||||
|
#########################################################
|
||||||
|
website_version=1.12.2
|
||||||
|
curse_versions=1.12.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,17 @@ 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}"
|
||||||
|
|
||||||
// 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-1.12:${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"
|
||||||
|
compileOnly "cofh:CoFHCore:${cofhcore_version}:deobf"
|
||||||
|
|
||||||
// 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
|
||||||
|
|||||||
@@ -25,14 +25,13 @@ package appeng.api;
|
|||||||
|
|
||||||
|
|
||||||
import appeng.api.definitions.IDefinitions;
|
import appeng.api.definitions.IDefinitions;
|
||||||
import appeng.api.exceptions.FailedConnection;
|
|
||||||
import appeng.api.features.IRegistryContainer;
|
import appeng.api.features.IRegistryContainer;
|
||||||
import appeng.api.networking.IGridBlock;
|
import appeng.api.networking.IGridHelper;
|
||||||
import appeng.api.networking.IGridConnection;
|
|
||||||
import appeng.api.networking.IGridNode;
|
import appeng.api.networking.IGridNode;
|
||||||
import appeng.api.parts.IPartHelper;
|
import appeng.api.parts.IPartHelper;
|
||||||
import appeng.api.storage.IStorageHelper;
|
import appeng.api.storage.IStorageHelper;
|
||||||
|
|
||||||
|
|
||||||
@AEInjectable
|
@AEInjectable
|
||||||
public interface IAppEngApi
|
public interface IAppEngApi
|
||||||
{
|
{
|
||||||
@@ -42,36 +41,23 @@ public interface IAppEngApi
|
|||||||
IRegistryContainer registries();
|
IRegistryContainer registries();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return helper for working with storage data types.
|
* @return A helper for working with storage data types.
|
||||||
*/
|
*/
|
||||||
IStorageHelper storage();
|
IStorageHelper storage();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return helper for working with grids, and buses.
|
* @return A helper to create {@link IGridNode} and other grid related objects.
|
||||||
|
*/
|
||||||
|
IGridHelper grid();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return A helper for working with grids, and buses.
|
||||||
*/
|
*/
|
||||||
IPartHelper partHelper();
|
IPartHelper partHelper();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return an accessible list of all AE definitions
|
* @return An accessible list of all AE definitions
|
||||||
*/
|
*/
|
||||||
IDefinitions definitions();
|
IDefinitions definitions();
|
||||||
|
|
||||||
/**
|
|
||||||
* create a grid node for your {@link appeng.api.networking.IGridHost}
|
|
||||||
*
|
|
||||||
* @param block grid block
|
|
||||||
*
|
|
||||||
* @return grid node of block
|
|
||||||
*/
|
|
||||||
IGridNode createGridNode( IGridBlock block );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* create a connection between two {@link appeng.api.networking.IGridNode}
|
|
||||||
*
|
|
||||||
* @param a to be connected gridnode
|
|
||||||
* @param b to be connected gridnode
|
|
||||||
*
|
|
||||||
* @throws appeng.api.exceptions.FailedConnection
|
|
||||||
*/
|
|
||||||
IGridConnection createGridConnection( IGridNode a, IGridNode b ) throws FailedConnection;
|
|
||||||
}
|
}
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
/*
|
|
||||||
* The MIT License (MIT)
|
|
||||||
*
|
|
||||||
* Copyright (c) 2013 AlgorithmX2
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
|
||||||
* the Software without restriction, including without limitation the rights to
|
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
* subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package appeng.api.client;
|
|
||||||
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
|
||||||
import net.minecraft.util.EnumFacing;
|
|
||||||
|
|
||||||
|
|
||||||
public interface BakingPipelineElement<F, T>
|
|
||||||
{
|
|
||||||
|
|
||||||
public List<T> pipe( List<F> elements, IBakedModel parent, IBlockState state, EnumFacing side, long rand );
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -26,5 +26,5 @@ package appeng.api.config;
|
|||||||
|
|
||||||
public enum SearchBoxMode
|
public enum SearchBoxMode
|
||||||
{
|
{
|
||||||
AUTOSEARCH, MANUAL_SEARCH, JEI_AUTOSEARCH, JEI_MANUAL_SEARCH
|
AUTOSEARCH, AUTOSEARCH_KEEP, MANUAL_SEARCH, MANUAL_SEARCH_KEEP, JEI_AUTOSEARCH, JEI_AUTOSEARCH_KEEP, JEI_MANUAL_SEARCH, JEI_MANUAL_SEARCH_KEEP
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,29 +33,53 @@ public enum Settings
|
|||||||
{
|
{
|
||||||
LEVEL_EMITTER_MODE( EnumSet.allOf( LevelEmitterMode.class ) ),
|
LEVEL_EMITTER_MODE( EnumSet.allOf( LevelEmitterMode.class ) ),
|
||||||
|
|
||||||
REDSTONE_EMITTER( EnumSet.of( RedstoneMode.HIGH_SIGNAL, RedstoneMode.LOW_SIGNAL ) ), REDSTONE_CONTROLLED( EnumSet.allOf( RedstoneMode.class ) ),
|
REDSTONE_EMITTER( EnumSet.of( RedstoneMode.HIGH_SIGNAL, RedstoneMode.LOW_SIGNAL ) ),
|
||||||
|
|
||||||
|
REDSTONE_CONTROLLED( EnumSet.allOf( RedstoneMode.class ) ),
|
||||||
|
|
||||||
CONDENSER_OUTPUT( EnumSet.allOf( CondenserOutput.class ) ),
|
CONDENSER_OUTPUT( EnumSet.allOf( CondenserOutput.class ) ),
|
||||||
|
|
||||||
POWER_UNITS( EnumSet.allOf( PowerUnits.class ) ), ACCESS( EnumSet.of( AccessRestriction.READ_WRITE, AccessRestriction.READ, AccessRestriction.WRITE ) ),
|
POWER_UNITS( EnumSet.allOf( PowerUnits.class ) ),
|
||||||
|
|
||||||
SORT_DIRECTION( EnumSet.allOf( SortDir.class ) ), SORT_BY( EnumSet.allOf( SortOrder.class ) ),
|
ACCESS( EnumSet.of( AccessRestriction.READ_WRITE, AccessRestriction.READ, AccessRestriction.WRITE ) ),
|
||||||
|
|
||||||
SEARCH_TOOLTIPS( EnumSet.of( YesNo.YES, YesNo.NO ) ), VIEW_MODE( EnumSet.allOf( ViewItems.class ) ), SEARCH_MODE( EnumSet.allOf( SearchBoxMode.class ) ),
|
SORT_DIRECTION( EnumSet.allOf( SortDir.class ) ),
|
||||||
|
|
||||||
ACTIONS( EnumSet.allOf( ActionItems.class ) ), IO_DIRECTION( EnumSet.of( RelativeDirection.LEFT, RelativeDirection.RIGHT ) ),
|
SORT_BY( EnumSet.allOf( SortOrder.class ) ),
|
||||||
|
|
||||||
BLOCK( EnumSet.of( YesNo.YES, YesNo.NO ) ), OPERATION_MODE( EnumSet.allOf( OperationMode.class ) ),
|
SEARCH_TOOLTIPS( EnumSet.of( YesNo.YES, YesNo.NO ) ),
|
||||||
|
|
||||||
FULLNESS_MODE( EnumSet.allOf( FullnessMode.class ) ), CRAFT_ONLY( EnumSet.of( YesNo.YES, YesNo.NO ) ),
|
VIEW_MODE( EnumSet.allOf( ViewItems.class ) ),
|
||||||
|
|
||||||
FUZZY_MODE( EnumSet.allOf( FuzzyMode.class ) ), LEVEL_TYPE( EnumSet.allOf( LevelType.class ) ),
|
SEARCH_MODE( EnumSet.allOf( SearchBoxMode.class ) ),
|
||||||
|
|
||||||
TERMINAL_STYLE( EnumSet.of( TerminalStyle.TALL, TerminalStyle.SMALL ) ), COPY_MODE( EnumSet.allOf( CopyMode.class ) ),
|
ACTIONS( EnumSet.allOf( ActionItems.class ) ),
|
||||||
|
|
||||||
INTERFACE_TERMINAL( EnumSet.of( YesNo.YES, YesNo.NO ) ), CRAFT_VIA_REDSTONE( EnumSet.of( YesNo.YES, YesNo.NO ) ),
|
IO_DIRECTION( EnumSet.of( RelativeDirection.LEFT, RelativeDirection.RIGHT ) ),
|
||||||
|
|
||||||
STORAGE_FILTER( EnumSet.allOf( StorageFilter.class ) ), PLACE_BLOCK( EnumSet.of( YesNo.YES, YesNo.NO ) ),
|
BLOCK( EnumSet.of( YesNo.YES, YesNo.NO ) ),
|
||||||
|
|
||||||
|
OPERATION_MODE( EnumSet.allOf( OperationMode.class ) ),
|
||||||
|
|
||||||
|
FULLNESS_MODE( EnumSet.allOf( FullnessMode.class ) ),
|
||||||
|
|
||||||
|
CRAFT_ONLY( EnumSet.of( YesNo.YES, YesNo.NO ) ),
|
||||||
|
|
||||||
|
FUZZY_MODE( EnumSet.allOf( FuzzyMode.class ) ),
|
||||||
|
|
||||||
|
LEVEL_TYPE( EnumSet.allOf( LevelType.class ) ),
|
||||||
|
|
||||||
|
TERMINAL_STYLE( EnumSet.of( TerminalStyle.TALL, TerminalStyle.SMALL ) ),
|
||||||
|
|
||||||
|
COPY_MODE( EnumSet.allOf( CopyMode.class ) ),
|
||||||
|
|
||||||
|
INTERFACE_TERMINAL( EnumSet.of( YesNo.YES, YesNo.NO ) ),
|
||||||
|
|
||||||
|
CRAFT_VIA_REDSTONE( EnumSet.of( YesNo.YES, YesNo.NO ) ),
|
||||||
|
|
||||||
|
STORAGE_FILTER( EnumSet.allOf( StorageFilter.class ) ),
|
||||||
|
|
||||||
|
PLACE_BLOCK( EnumSet.of( YesNo.YES, YesNo.NO ) ),
|
||||||
|
|
||||||
SCHEDULING_MODE( EnumSet.allOf( SchedulingMode.class ) );
|
SCHEDULING_MODE( EnumSet.allOf( SchedulingMode.class ) );
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public enum TunnelType
|
|||||||
{
|
{
|
||||||
ME, // Network Tunnel
|
ME, // Network Tunnel
|
||||||
IC2_POWER, // EU Tunnel
|
IC2_POWER, // EU 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();
|
||||||
|
|||||||
@@ -38,7 +38,9 @@ public interface IParts
|
|||||||
|
|
||||||
AEColoredItemDefinition cableGlass();
|
AEColoredItemDefinition cableGlass();
|
||||||
|
|
||||||
AEColoredItemDefinition cableDense();
|
AEColoredItemDefinition cableDenseCovered();
|
||||||
|
|
||||||
|
AEColoredItemDefinition cableDenseSmart();
|
||||||
|
|
||||||
AEColoredItemDefinition lumenCableSmart();
|
AEColoredItemDefinition lumenCableSmart();
|
||||||
|
|
||||||
@@ -46,7 +48,7 @@ public interface IParts
|
|||||||
|
|
||||||
AEColoredItemDefinition lumenCableGlass();
|
AEColoredItemDefinition lumenCableGlass();
|
||||||
|
|
||||||
AEColoredItemDefinition lumenCableDense();
|
AEColoredItemDefinition lumenDenseCableSmart();
|
||||||
|
|
||||||
IItemDefinition quartzFiber();
|
IItemDefinition quartzFiber();
|
||||||
|
|
||||||
@@ -76,11 +78,11 @@ public interface IParts
|
|||||||
|
|
||||||
IItemDefinition p2PTunnelItems();
|
IItemDefinition p2PTunnelItems();
|
||||||
|
|
||||||
IItemDefinition p2PTunnelLiquids();
|
IItemDefinition p2PTunnelFluids();
|
||||||
|
|
||||||
// IItemDefinition p2PTunnelEU();
|
IItemDefinition p2PTunnelEU();
|
||||||
|
|
||||||
// IItemDefinition p2PTunnelRF();
|
IItemDefinition p2PTunnelFE();
|
||||||
|
|
||||||
IItemDefinition p2PTunnelLight();
|
IItemDefinition p2PTunnelLight();
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ package appeng.api.exceptions;
|
|||||||
|
|
||||||
public class CoreInaccessibleException extends RuntimeException
|
public class CoreInaccessibleException extends RuntimeException
|
||||||
{
|
{
|
||||||
|
private static final long serialVersionUID = -7434641554655517242L;
|
||||||
|
|
||||||
public CoreInaccessibleException( final String message )
|
public CoreInaccessibleException( final String message )
|
||||||
{
|
{
|
||||||
super( message );
|
super( message );
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ import appeng.api.networking.IGridNode;
|
|||||||
* @version rv3
|
* @version rv3
|
||||||
* @since rv3
|
* @since rv3
|
||||||
*/
|
*/
|
||||||
public class ExistingConnectionException extends FailedConnection
|
public class ExistingConnectionException extends FailedConnectionException
|
||||||
{
|
{
|
||||||
|
|
||||||
private static final long serialVersionUID = 2975450379720353182L;
|
private static final long serialVersionUID = 2975450379720353182L;
|
||||||
|
|||||||
+3
-3
@@ -40,16 +40,16 @@ import appeng.api.networking.IGridNode;
|
|||||||
* @version rv3
|
* @version rv3
|
||||||
* @since rv0
|
* @since rv0
|
||||||
*/
|
*/
|
||||||
public class FailedConnection extends Exception
|
public class FailedConnectionException extends Exception
|
||||||
{
|
{
|
||||||
|
|
||||||
private static final long serialVersionUID = -2544208090248293753L;
|
private static final long serialVersionUID = -2544208090248293753L;
|
||||||
|
|
||||||
public FailedConnection()
|
public FailedConnectionException()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public FailedConnection( String message )
|
public FailedConnectionException( String message )
|
||||||
{
|
{
|
||||||
super( message );
|
super( message );
|
||||||
}
|
}
|
||||||
+4
-2
@@ -19,9 +19,11 @@
|
|||||||
package appeng.api.exceptions;
|
package appeng.api.exceptions;
|
||||||
|
|
||||||
|
|
||||||
public class MissingDefinition extends RuntimeException
|
public class MissingDefinitionException extends RuntimeException
|
||||||
{
|
{
|
||||||
public MissingDefinition( final String message )
|
private static final long serialVersionUID = -6547396584255825761L;
|
||||||
|
|
||||||
|
public MissingDefinitionException( final String message )
|
||||||
{
|
{
|
||||||
super( message );
|
super( message );
|
||||||
}
|
}
|
||||||
+2
-2
@@ -24,12 +24,12 @@
|
|||||||
package appeng.api.exceptions;
|
package appeng.api.exceptions;
|
||||||
|
|
||||||
|
|
||||||
public class MissingIngredientError extends Exception
|
public class MissingIngredientException extends Exception
|
||||||
{
|
{
|
||||||
|
|
||||||
private static final long serialVersionUID = -998858343831371697L;
|
private static final long serialVersionUID = -998858343831371697L;
|
||||||
|
|
||||||
public MissingIngredientError( final String n )
|
public MissingIngredientException( final String n )
|
||||||
{
|
{
|
||||||
super( n );
|
super( n );
|
||||||
}
|
}
|
||||||
+2
-2
@@ -24,12 +24,12 @@
|
|||||||
package appeng.api.exceptions;
|
package appeng.api.exceptions;
|
||||||
|
|
||||||
|
|
||||||
public class ModNotInstalled extends Exception
|
public class ModNotInstalledException extends Exception
|
||||||
{
|
{
|
||||||
|
|
||||||
private static final long serialVersionUID = -9052435206368425494L;
|
private static final long serialVersionUID = -9052435206368425494L;
|
||||||
|
|
||||||
public ModNotInstalled( final String t )
|
public ModNotInstalledException( final String t )
|
||||||
{
|
{
|
||||||
super( t );
|
super( t );
|
||||||
}
|
}
|
||||||
@@ -34,7 +34,7 @@ package appeng.api.exceptions;
|
|||||||
* @version rv3
|
* @version rv3
|
||||||
* @since rv3
|
* @since rv3
|
||||||
*/
|
*/
|
||||||
public class NullNodeConnectionException extends FailedConnection
|
public class NullNodeConnectionException extends FailedConnectionException
|
||||||
{
|
{
|
||||||
|
|
||||||
private static final long serialVersionUID = -2143719383495321764L;
|
private static final long serialVersionUID = -2143719383495321764L;
|
||||||
|
|||||||
+2
-2
@@ -24,12 +24,12 @@
|
|||||||
package appeng.api.exceptions;
|
package appeng.api.exceptions;
|
||||||
|
|
||||||
|
|
||||||
public class RecipeError extends Exception
|
public class RecipeException extends Exception
|
||||||
{
|
{
|
||||||
|
|
||||||
private static final long serialVersionUID = -6602870588617670262L;
|
private static final long serialVersionUID = -6602870588617670262L;
|
||||||
|
|
||||||
public RecipeError( final String n )
|
public RecipeException( final String n )
|
||||||
{
|
{
|
||||||
super( n );
|
super( n );
|
||||||
}
|
}
|
||||||
+2
-2
@@ -24,12 +24,12 @@
|
|||||||
package appeng.api.exceptions;
|
package appeng.api.exceptions;
|
||||||
|
|
||||||
|
|
||||||
public class RegistrationError extends Exception
|
public class RegistrationException extends Exception
|
||||||
{
|
{
|
||||||
|
|
||||||
private static final long serialVersionUID = -6602870588617670263L;
|
private static final long serialVersionUID = -6602870588617670263L;
|
||||||
|
|
||||||
public RegistrationError( final String n )
|
public RegistrationException( final String n )
|
||||||
{
|
{
|
||||||
super( n );
|
super( n );
|
||||||
}
|
}
|
||||||
@@ -34,7 +34,7 @@ package appeng.api.exceptions;
|
|||||||
* @version rv3
|
* @version rv3
|
||||||
* @since rv3
|
* @since rv3
|
||||||
*/
|
*/
|
||||||
public class SecurityConnectionException extends FailedConnection
|
public class SecurityConnectionException extends FailedConnectionException
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 5048714900434215426L;
|
private static final long serialVersionUID = 5048714900434215426L;
|
||||||
private static final String DEFAULT_MESSAGE = "Connection failed due to different security realms.";
|
private static final String DEFAULT_MESSAGE = "Connection failed due to different security realms.";
|
||||||
|
|||||||
@@ -0,0 +1,84 @@
|
|||||||
|
/*
|
||||||
|
* The MIT License (MIT)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2017 AlgorithmX2
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
* this software and associated documentation files (the "Software"), to deal in
|
||||||
|
* the Software without restriction, including without limitation the rights to
|
||||||
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
* subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package appeng.api.features;
|
||||||
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnegative;
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
|
||||||
|
import appeng.api.implementations.items.IAEItemPowerStorage;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A registry to allow mapping {@link Item}s to a specific charge rate when being placed inside a charger.
|
||||||
|
*
|
||||||
|
* The registry is used in favor of an additional method for {@link IAEItemPowerStorage} with a fixed value per item.
|
||||||
|
* This allows more flexibility for other charger like machines to choose their own values when needed.
|
||||||
|
*
|
||||||
|
* There is no guarantee that this is charged per tick, it only represents the value per operation.
|
||||||
|
* By default this is one charging operation every 10 ticks in case of an AE2 charger.
|
||||||
|
*
|
||||||
|
* @author yueh
|
||||||
|
* @version rv5
|
||||||
|
* @since rv5
|
||||||
|
*/
|
||||||
|
public interface IChargerRegistry
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetch a charge rate for a specific item.
|
||||||
|
*
|
||||||
|
* The specific item does not need to have a mapping registered at all.
|
||||||
|
* In this case it will use a default value of 160 AE.
|
||||||
|
*
|
||||||
|
* @param item A {@link Item} implementing {@link IAEItemPowerStorage}.
|
||||||
|
* @return custom rate or default of 160
|
||||||
|
*/
|
||||||
|
@Nonnegative
|
||||||
|
double getChargeRate( @Nonnull Item item );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register a custom charge rate for a specific item.
|
||||||
|
*
|
||||||
|
* Capped at 16000 to avoid extracting too much energy from a network for each operation.
|
||||||
|
* This is done silently without any feedback or exception.
|
||||||
|
* Further the cap is not fixed, it can change at any time in the future should power issues arise.
|
||||||
|
*
|
||||||
|
* @param item A {@link Item} implementing {@link IAEItemPowerStorage}.
|
||||||
|
* @param chargeRate the custom rate, must be > 0, capped to 16000d
|
||||||
|
*/
|
||||||
|
void addChargeRate( @Nonnull Item item, @Nonnegative double chargeRate );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the custom rate for a specific item.
|
||||||
|
*
|
||||||
|
* It will revert to the default value afterwards.
|
||||||
|
*
|
||||||
|
* @param item A {@link Item} implementing {@link IAEItemPowerStorage}.
|
||||||
|
*/
|
||||||
|
void removeChargeRate( @Nonnull Item item );
|
||||||
|
|
||||||
|
}
|
||||||
+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 );
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
/*
|
||||||
|
* The MIT License (MIT)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013 AlgorithmX2
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
* this software and associated documentation files (the "Software"), to deal in
|
||||||
|
* the Software without restriction, including without limitation the rights to
|
||||||
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
* subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package appeng.api.features;
|
||||||
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnegative;
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Builder for a grinder recipe.
|
||||||
|
*
|
||||||
|
* The only default value provided are turns at a value of 8.
|
||||||
|
*
|
||||||
|
* @author yueh
|
||||||
|
* @version rv5
|
||||||
|
* @since rv5
|
||||||
|
*/
|
||||||
|
public interface IGrinderRecipeBuilder
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an grinder recipe with inputs.
|
||||||
|
* Needs to be invoked.
|
||||||
|
*
|
||||||
|
* @param input new input for the recipe
|
||||||
|
*
|
||||||
|
* @return currently used builder
|
||||||
|
*/
|
||||||
|
@Nonnull
|
||||||
|
IGrinderRecipeBuilder withInput( @Nonnull ItemStack input );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an grinder recipe with output.
|
||||||
|
* Needs to be invoked.
|
||||||
|
*
|
||||||
|
* @param output new output for the recipe
|
||||||
|
*
|
||||||
|
* @return currently used builder
|
||||||
|
*/
|
||||||
|
@Nonnull
|
||||||
|
IGrinderRecipeBuilder withOutput( @Nonnull ItemStack output );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an grinder recipe with the first optional output and its chance.
|
||||||
|
*
|
||||||
|
* @param optional new first optional for the recipe
|
||||||
|
* @param chance chance for the first optional output, must be within 0.0 - 1.0
|
||||||
|
*
|
||||||
|
* @return currently used builder
|
||||||
|
*/
|
||||||
|
@Nonnull
|
||||||
|
IGrinderRecipeBuilder withFirstOptional( @Nonnull ItemStack optional, float chance );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an grinder recipe with the second optional output and its chance.
|
||||||
|
*
|
||||||
|
* @param optional new second optional for the recipe
|
||||||
|
* @param chance chance for the second optional output, must be within 0.0 - 1.0
|
||||||
|
*
|
||||||
|
* @return currently used builder
|
||||||
|
*/
|
||||||
|
@Nonnull
|
||||||
|
IGrinderRecipeBuilder withSecondOptional( @Nonnull ItemStack optional, float chance );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an grinder recipe with the amount of turns as cost.
|
||||||
|
*
|
||||||
|
* Defaults to 8 when not called.
|
||||||
|
*
|
||||||
|
* @param turns new turns for the recipe, must be > 0
|
||||||
|
*
|
||||||
|
* @return currently used builder
|
||||||
|
*/
|
||||||
|
@Nonnull
|
||||||
|
IGrinderRecipeBuilder withTurns( @Nonnegative int turns );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Finalizes the process of making the recipe.
|
||||||
|
* Needs to be invoked to fetch grinder recipe.
|
||||||
|
*
|
||||||
|
* @return valid grinder recipe
|
||||||
|
*
|
||||||
|
* @throws IllegalStateException when input is not defined
|
||||||
|
* @throws IllegalStateException when input has no size
|
||||||
|
* @throws IllegalStateException when output is not defined
|
||||||
|
* @throws IllegalStateException when both optionals are not defined
|
||||||
|
* @throws IllegalStateException when process type is not defined
|
||||||
|
*/
|
||||||
|
@Nonnull
|
||||||
|
IGrinderRecipe build();
|
||||||
|
}
|
||||||
@@ -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,63 @@ public interface IGrinderRegistry
|
|||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Current list of registered recipes, you can modify this if you want too.
|
* Extensible way to create a grinder recipe.
|
||||||
|
*
|
||||||
|
* @return builder for grinder recipes
|
||||||
|
*/
|
||||||
|
@Nonnull
|
||||||
|
IGrinderRecipeBuilder builder();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 to the registry.
|
||||||
*
|
|
||||||
* @param in input
|
|
||||||
* @param out output
|
|
||||||
* @param turns amount of turns to turn the input into the output
|
|
||||||
*/
|
*/
|
||||||
void addRecipe( ItemStack in, ItemStack out, int turns );
|
boolean addRecipe( IGrinderRecipe recipe );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* add a new recipe with optional outputs, duplicates will not be added.
|
* Remove the specific from the recipe list.
|
||||||
*
|
*
|
||||||
* @param in input
|
* @param recipe The recipe to be removed.
|
||||||
* @param out output
|
* @return true, if it was removed
|
||||||
* @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 );
|
boolean removeRecipe( @Nonnull IGrinderRecipe recipe );
|
||||||
|
|
||||||
/**
|
|
||||||
* add a new recipe with optional outputs, duplicates will not be added.
|
|
||||||
*
|
|
||||||
* @param in input
|
|
||||||
* @param out output
|
|
||||||
* @param optional optional output
|
|
||||||
* @param chance chance to get the optional output within 0.0 - 1.0
|
|
||||||
* @param optional2 second optional output
|
|
||||||
* @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
|
|
||||||
*/
|
|
||||||
void addRecipe( ItemStack in, ItemStack out, ItemStack optional, float chance, ItemStack optional2, float chance2, int turns );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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 );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,11 +31,19 @@ import net.minecraft.item.ItemStack;
|
|||||||
* Lets you manipulate Inscriber Recipes, by adding or editing existing ones.
|
* Lets you manipulate Inscriber Recipes, by adding or editing existing ones.
|
||||||
*
|
*
|
||||||
* @author thatsIch
|
* @author thatsIch
|
||||||
* @version rv3
|
* @version rv5
|
||||||
* @since rv2
|
* @since rv2
|
||||||
*/
|
*/
|
||||||
public interface IInscriberRegistry
|
public interface IInscriberRegistry
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Extensible way to create an inscriber recipe.
|
||||||
|
*
|
||||||
|
* @return builder for inscriber recipes
|
||||||
|
*/
|
||||||
|
@Nonnull
|
||||||
|
IInscriberRecipeBuilder builder();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An immutable copy of currently registered recipes.
|
* An immutable copy of currently registered recipes.
|
||||||
*
|
*
|
||||||
@@ -65,29 +73,25 @@ public interface IInscriberRegistry
|
|||||||
@Nonnull
|
@Nonnull
|
||||||
Set<ItemStack> getInputs();
|
Set<ItemStack> getInputs();
|
||||||
|
|
||||||
/**
|
|
||||||
* Extensible way to create an inscriber recipe.
|
|
||||||
*
|
|
||||||
* @return builder for inscriber recipes
|
|
||||||
*/
|
|
||||||
@Nonnull
|
|
||||||
IInscriberRecipeBuilder builder();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* add a new recipe the easy way, duplicates will not be added.
|
* add a new recipe the easy way, duplicates will not be added.
|
||||||
* Added recipes will be automatically added to the optionals and inputs.
|
* Added recipes will be automatically added to the optionals and inputs.
|
||||||
*
|
*
|
||||||
* @param recipe new recipe
|
* @param recipe new recipe
|
||||||
*
|
*
|
||||||
|
* @return true, when successfully added
|
||||||
|
*
|
||||||
* @throws IllegalArgumentException if null is added
|
* @throws IllegalArgumentException if null is added
|
||||||
*/
|
*/
|
||||||
void addRecipe( IInscriberRecipe recipe );
|
boolean addRecipe( IInscriberRecipe recipe );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes all equal recipes from the registry.
|
* Removes all equal recipes from the registry.
|
||||||
*
|
*
|
||||||
* @param toBeRemovedRecipe to be removed recipe, can be null, makes just no sense.
|
* @param toBeRemovedRecipe to be removed recipe, can be null, makes just no sense.
|
||||||
|
*
|
||||||
|
* @return true, when successfully removed
|
||||||
*/
|
*/
|
||||||
void removeRecipe( IInscriberRecipe toBeRemovedRecipe );
|
boolean removeRecipe( IInscriberRecipe toBeRemovedRecipe );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 );
|
||||||
}
|
}
|
||||||
@@ -34,7 +34,8 @@ import appeng.api.storage.ICellRegistry;
|
|||||||
/**
|
/**
|
||||||
* @author AlgorithmX2
|
* @author AlgorithmX2
|
||||||
* @author thatsIch
|
* @author thatsIch
|
||||||
* @version rv2
|
* @author yueh
|
||||||
|
* @version rv5
|
||||||
* @since rv0
|
* @since rv0
|
||||||
*/
|
*/
|
||||||
@AEInjectable
|
@AEInjectable
|
||||||
@@ -76,6 +77,11 @@ public interface IRegistryContainer
|
|||||||
*/
|
*/
|
||||||
IInscriberRegistry inscriber();
|
IInscriberRegistry inscriber();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Manage charger via API
|
||||||
|
*/
|
||||||
|
IChargerRegistry charger();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get access to the locatable registry
|
* get access to the locatable registry
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ package appeng.api.implementations.items;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import appeng.api.config.AccessRestriction;
|
import appeng.api.config.AccessRestriction;
|
||||||
|
import appeng.api.config.Actionable;
|
||||||
import appeng.api.networking.energy.IAEPowerStorage;
|
import appeng.api.networking.energy.IAEPowerStorage;
|
||||||
|
|
||||||
|
|
||||||
@@ -42,27 +43,27 @@ public interface IAEItemPowerStorage
|
|||||||
*
|
*
|
||||||
* @return amount unable to be stored
|
* @return amount unable to be stored
|
||||||
*/
|
*/
|
||||||
double injectAEPower( ItemStack is, double amt );
|
double injectAEPower( ItemStack stack, double amount, Actionable mode );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attempt to extract power from the device, it will extract what it can and
|
* Attempt to extract power from the device, it will extract what it can and
|
||||||
* return it.
|
* return it.
|
||||||
*
|
*
|
||||||
* @param amt to be extracted power from device
|
* @param amount to be extracted power from device
|
||||||
*
|
*
|
||||||
* @return what it could extract
|
* @return what it could extract
|
||||||
*/
|
*/
|
||||||
double extractAEPower( ItemStack is, double amt );
|
double extractAEPower( ItemStack stack, double amount, Actionable mode );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the current maximum power ( this can change :P )
|
* @return the current maximum power ( this can change :P )
|
||||||
*/
|
*/
|
||||||
double getAEMaxPower( ItemStack is );
|
double getAEMaxPower( ItemStack stack );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the current AE Power Level, this may exceed getMEMaxPower()
|
* @return the current AE Power Level, this may exceed getMEMaxPower()
|
||||||
*/
|
*/
|
||||||
double getAECurrentPower( ItemStack is );
|
double getAECurrentPower( ItemStack stack );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Control the power flow by telling what the network can do, either add? or
|
* Control the power flow by telling what the network can do, either add? or
|
||||||
@@ -70,5 +71,5 @@ public interface IAEItemPowerStorage
|
|||||||
*
|
*
|
||||||
* @return access restriction of network
|
* @return access restriction of network
|
||||||
*/
|
*/
|
||||||
AccessRestriction getPowerFlow( ItemStack is );
|
AccessRestriction getPowerFlow( ItemStack stack );
|
||||||
}
|
}
|
||||||
@@ -29,6 +29,7 @@ import net.minecraft.item.ItemStack;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import appeng.api.implementations.TransitionResult;
|
import appeng.api.implementations.TransitionResult;
|
||||||
|
import appeng.api.storage.ISpatialDimension;
|
||||||
import appeng.api.util.WorldCoord;
|
import appeng.api.util.WorldCoord;
|
||||||
|
|
||||||
|
|
||||||
@@ -57,7 +58,7 @@ public interface ISpatialStorageCell
|
|||||||
*
|
*
|
||||||
* @return the world for this cell
|
* @return the world for this cell
|
||||||
*/
|
*/
|
||||||
World getWorld( ItemStack is );
|
ISpatialDimension getSpatialDimension();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get the currently stored size.
|
* get the currently stored size.
|
||||||
@@ -69,22 +70,13 @@ public interface ISpatialStorageCell
|
|||||||
WorldCoord getStoredSize( ItemStack is );
|
WorldCoord getStoredSize( ItemStack is );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Minimum coordinates in its world for the storage cell.
|
* get the currently stored Dimension id.
|
||||||
*
|
*
|
||||||
* @param is spatial storage cell
|
* @param is spatial storage cell
|
||||||
*
|
*
|
||||||
* @return minimum coordinate of dimension
|
* @return dimension id or -1
|
||||||
*/
|
*/
|
||||||
WorldCoord getMin( ItemStack is );
|
int getStoredDimensionID( ItemStack is );
|
||||||
|
|
||||||
/**
|
|
||||||
* Maximum coordinates in its world for the storage cell.
|
|
||||||
*
|
|
||||||
* @param is spatial storage cell
|
|
||||||
*
|
|
||||||
* @return maximum coordinate of dimension
|
|
||||||
*/
|
|
||||||
WorldCoord getMax( ItemStack is );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform a spatial swap with the contents of the cell, and the world.
|
* Perform a spatial swap with the contents of the cell, and the world.
|
||||||
@@ -93,9 +85,9 @@ public interface ISpatialStorageCell
|
|||||||
* @param w world of spatial
|
* @param w world of spatial
|
||||||
* @param min min coord
|
* @param min min coord
|
||||||
* @param max max coord
|
* @param max max coord
|
||||||
* @param doTransition transition
|
* @param playerId owner of current grid or -1
|
||||||
*
|
*
|
||||||
* @return result of transition
|
* @return result of transition
|
||||||
*/
|
*/
|
||||||
TransitionResult doSpatialTransition( ItemStack is, World w, WorldCoord min, WorldCoord max, boolean doTransition );
|
TransitionResult doSpatialTransition( ItemStack is, World w, WorldCoord min, WorldCoord max, int playerId );
|
||||||
}
|
}
|
||||||
@@ -23,8 +23,7 @@
|
|||||||
|
|
||||||
package appeng.api.implementations.tiles;
|
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();
|
||||||
}
|
}
|
||||||
|
|||||||
+28
-28
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2013 AlgorithmX2
|
* Copyright (c) 2017 AlgorithmX2
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
* 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
|
* this software and associated documentation files (the "Software"), to deal in
|
||||||
@@ -21,44 +21,44 @@
|
|||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package appeng.api.client;
|
package appeng.api.networking;
|
||||||
|
|
||||||
|
|
||||||
import java.util.List;
|
import appeng.api.exceptions.FailedConnectionException;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
|
||||||
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
|
||||||
import net.minecraft.util.EnumFacing;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: Needs to be moved to an internal class. API is only allowed to contain interfaces and/or data.
|
* A helper responsible for creating new {@link IGridNode}, {@link IGridConnection} or potentially similar tasks.
|
||||||
*
|
*
|
||||||
* @deprecated
|
* @author yueh
|
||||||
|
* @version rv5
|
||||||
|
* @since rv5
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
public interface IGridHelper
|
||||||
public class BakingPipeline<F, T> implements BakingPipelineElement<F, T>
|
|
||||||
{
|
{
|
||||||
|
|
||||||
private final ImmutableList<BakingPipelineElement<?, ?>> pipeline;
|
/**
|
||||||
|
* Create a grid node for your {@link IGridHost}
|
||||||
public BakingPipeline( BakingPipelineElement<?, ?>... pipeline )
|
*
|
||||||
{
|
* The passed {@link IGridBlock} represents the definition for properties like connectable sides.
|
||||||
this.pipeline = ImmutableList.copyOf( pipeline );
|
* Refer to its documentation for further details.
|
||||||
}
|
*
|
||||||
|
* @param block grid block
|
||||||
|
*
|
||||||
|
* @return grid node of block
|
||||||
|
*/
|
||||||
|
IGridNode createGridNode( IGridBlock block );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: fix generics
|
* Create a direct connection between two {@link IGridNode}.
|
||||||
|
*
|
||||||
|
* This will be considered as having a distance of 1, regardless of the location of both nodes.
|
||||||
|
*
|
||||||
|
* @param a to be connected gridnode
|
||||||
|
* @param b to be connected gridnode
|
||||||
|
*
|
||||||
|
* @throws appeng.api.exceptions.FailedConnectionException
|
||||||
*/
|
*/
|
||||||
@Override
|
IGridConnection createGridConnection( IGridNode a, IGridNode b ) throws FailedConnectionException;
|
||||||
public List pipe( List things, IBakedModel parent, IBlockState state, EnumFacing side, long rand )
|
|
||||||
{
|
|
||||||
for( BakingPipelineElement pipe : pipeline )
|
|
||||||
{
|
|
||||||
things = pipe.pipe( things, parent, state, side, rand );
|
|
||||||
}
|
|
||||||
return things;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
package appeng.api.networking.crafting;
|
package appeng.api.networking.crafting;
|
||||||
|
|
||||||
|
|
||||||
import appeng.api.networking.security.BaseActionSource;
|
import appeng.api.networking.security.IActionSource;
|
||||||
import appeng.api.networking.storage.IBaseMonitor;
|
import appeng.api.networking.storage.IBaseMonitor;
|
||||||
import appeng.api.storage.data.IAEItemStack;
|
import appeng.api.storage.data.IAEItemStack;
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ public interface ICraftingCPU extends IBaseMonitor<IAEItemStack>
|
|||||||
/**
|
/**
|
||||||
* @return the action source for the CPU.
|
* @return the action source for the CPU.
|
||||||
*/
|
*/
|
||||||
BaseActionSource getActionSource();
|
IActionSource getActionSource();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the available storage in bytes
|
* @return the available storage in bytes
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import net.minecraft.world.World;
|
|||||||
|
|
||||||
import appeng.api.networking.IGrid;
|
import appeng.api.networking.IGrid;
|
||||||
import appeng.api.networking.IGridCache;
|
import appeng.api.networking.IGridCache;
|
||||||
import appeng.api.networking.security.BaseActionSource;
|
import appeng.api.networking.security.IActionSource;
|
||||||
import appeng.api.storage.data.IAEItemStack;
|
import appeng.api.storage.data.IAEItemStack;
|
||||||
|
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ public interface ICraftingGrid extends IGridCache
|
|||||||
* @return a future which will at an undetermined point in the future get you the {@link ICraftingJob} do not wait
|
* @return a future which will at an undetermined point in the future get you the {@link ICraftingJob} do not wait
|
||||||
* on this, your be waiting forever.
|
* on this, your be waiting forever.
|
||||||
*/
|
*/
|
||||||
Future<ICraftingJob> beginCraftingJob( World world, IGrid grid, BaseActionSource actionSrc, IAEItemStack craftWhat, ICraftingCallback callback );
|
Future<ICraftingJob> beginCraftingJob( World world, IGrid grid, IActionSource actionSrc, IAEItemStack craftWhat, ICraftingCallback callback );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Submit the job to the Crafting system for processing.
|
* Submit the job to the Crafting system for processing.
|
||||||
@@ -82,7 +82,7 @@ public interface ICraftingGrid extends IGridCache
|
|||||||
* {@link ICraftingRequester} methods. if you send null, this object should be discarded after verifying the
|
* {@link ICraftingRequester} methods. if you send null, this object should be discarded after verifying the
|
||||||
* return state.
|
* return state.
|
||||||
*/
|
*/
|
||||||
ICraftingLink submitJob( ICraftingJob job, ICraftingRequester requestingMachine, ICraftingCPU target, boolean prioritizePower, BaseActionSource src );
|
ICraftingLink submitJob( ICraftingJob job, ICraftingRequester requestingMachine, ICraftingCPU target, boolean prioritizePower, IActionSource src );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return list of all the crafting cpus on the grid
|
* @return list of all the crafting cpus on the grid
|
||||||
|
|||||||
@@ -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,7 +24,10 @@
|
|||||||
package appeng.api.networking.energy;
|
package appeng.api.networking.energy;
|
||||||
|
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnegative;
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
import appeng.api.config.Actionable;
|
import appeng.api.config.Actionable;
|
||||||
|
|
||||||
@@ -35,17 +38,91 @@ import appeng.api.config.Actionable;
|
|||||||
public interface IEnergyGridProvider
|
public interface IEnergyGridProvider
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
* internal use only
|
||||||
|
*
|
||||||
|
* Can return a list of providers behind the current.
|
||||||
|
*
|
||||||
|
* An example would be something acting as proxy between different {@link IEnergyGrid}s.
|
||||||
|
*
|
||||||
|
* This can contain duplicate entries, AE will ensure that each provider is only visited once.
|
||||||
|
*
|
||||||
* internal use only
|
* internal use only
|
||||||
*/
|
*/
|
||||||
double extractAEPower( double amt, Actionable mode, Set<IEnergyGrid> seen );
|
@Nonnull
|
||||||
|
Collection<IEnergyGridProvider> providers();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* internal use only
|
* internal use only
|
||||||
|
*
|
||||||
|
* Extracts the requested amount from the provider.
|
||||||
|
*
|
||||||
|
* This should never forward a call to another {@link IEnergyGridProvider}, instead return them via
|
||||||
|
* {@link IEnergyGridProvider#providers()}
|
||||||
|
*
|
||||||
|
* @return the used amount
|
||||||
*/
|
*/
|
||||||
double injectAEPower( double amt, Actionable mode, Set<IEnergyGrid> seen );
|
@Nonnegative
|
||||||
|
double extractProviderPower( @Nonnegative double amt, @Nonnull Actionable mode );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Injects the offered amount into the provider.
|
||||||
|
*
|
||||||
|
* This should never forward a call to another {@link IEnergyGridProvider}, instead return them via
|
||||||
|
* {@link IEnergyGridProvider#providers()}
|
||||||
|
*
|
||||||
|
* internal use only
|
||||||
|
*
|
||||||
|
* @return the leftover amount
|
||||||
|
*/
|
||||||
|
@Nonnegative
|
||||||
|
double injectProviderPower( @Nonnegative double amt, @Nonnull Actionable mode );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* internal use only
|
* internal use only
|
||||||
|
*
|
||||||
|
* Returns the current demand of an provider.
|
||||||
|
*
|
||||||
|
* This should never forward a call to another {@link IEnergyGridProvider}, instead return them via
|
||||||
|
* {@link IEnergyGridProvider#providers()}
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param d the max amount offered, the demand should never exceed it.
|
||||||
|
* @return the total amount demanded
|
||||||
*/
|
*/
|
||||||
double getEnergyDemand( double d, Set<IEnergyGrid> seen );
|
@Nonnegative
|
||||||
|
double getProviderEnergyDemand( @Nonnegative double d );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* internal use only
|
||||||
|
*
|
||||||
|
* AE currently uses this to enqueue the next visited provider.
|
||||||
|
*
|
||||||
|
* There is no guarantee that this works on in a perfect way.
|
||||||
|
* It can be limited to the returns of the past {@link IEnergyGridProvider#providers()}, but not any future one
|
||||||
|
* discovered by visiting further providers.
|
||||||
|
*
|
||||||
|
* E.g. inject into the the lowest one first or extract from the highest one.
|
||||||
|
*
|
||||||
|
* @return the current stored amount.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Nonnegative
|
||||||
|
double getProviderStoredEnergy();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* internal use only
|
||||||
|
*
|
||||||
|
* AE currently uses this to enqueue the next visited provider.
|
||||||
|
*
|
||||||
|
* There is no guarantee that this works on in a perfect way.
|
||||||
|
* It can be limited to the returns of the past {@link IEnergyGridProvider#providers()}, but not any future one
|
||||||
|
* discovered by visiting further providers.
|
||||||
|
*
|
||||||
|
* E.g. inject into the the lowest one first or extract from the highest one.
|
||||||
|
*
|
||||||
|
* @return the maximum amount stored.
|
||||||
|
*/
|
||||||
|
@Nonnegative
|
||||||
|
double getProviderMaxEnergy();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ package appeng.api.networking.events;
|
|||||||
|
|
||||||
|
|
||||||
import appeng.api.storage.IMEMonitor;
|
import appeng.api.storage.IMEMonitor;
|
||||||
import appeng.api.storage.StorageChannel;
|
import appeng.api.storage.IStorageChannel;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -40,9 +40,9 @@ public class MENetworkStorageEvent extends MENetworkEvent
|
|||||||
{
|
{
|
||||||
|
|
||||||
public final IMEMonitor monitor;
|
public final IMEMonitor monitor;
|
||||||
public final StorageChannel channel;
|
public final IStorageChannel channel;
|
||||||
|
|
||||||
public MENetworkStorageEvent( final IMEMonitor o, final StorageChannel chan )
|
public MENetworkStorageEvent( final IMEMonitor o, final IStorageChannel chan )
|
||||||
{
|
{
|
||||||
this.monitor = o;
|
this.monitor = o;
|
||||||
this.channel = chan;
|
this.channel = chan;
|
||||||
|
|||||||
@@ -24,11 +24,10 @@
|
|||||||
package appeng.api.networking.security;
|
package appeng.api.networking.security;
|
||||||
|
|
||||||
|
|
||||||
import appeng.api.networking.IGridHost;
|
|
||||||
import appeng.api.networking.IGridNode;
|
import appeng.api.networking.IGridNode;
|
||||||
|
|
||||||
|
|
||||||
public interface IActionHost extends IGridHost
|
public interface IActionHost
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,77 @@
|
|||||||
|
/*
|
||||||
|
* The MIT License (MIT)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013 AlgorithmX2
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
* this software and associated documentation files (the "Software"), to deal in
|
||||||
|
* the Software without restriction, including without limitation the rights to
|
||||||
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
* subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package appeng.api.networking.security;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The source of any action.
|
||||||
|
*
|
||||||
|
* This can either be a {@link EntityPlayer} or an {@link IActionHost}.
|
||||||
|
*
|
||||||
|
* In most cases this is used for security checks, but can be used to validate the source itself.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface IActionSource
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If present, AE will consider the player being the source for the action.
|
||||||
|
*
|
||||||
|
* This will take precedence over {@link IActionSource#machine()} in any case.
|
||||||
|
*
|
||||||
|
* @return An optional player issuing the action.
|
||||||
|
*/
|
||||||
|
@Nonnull
|
||||||
|
Optional<EntityPlayer> player();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If present, it indicates the {@link IActionHost} of the source.
|
||||||
|
*
|
||||||
|
* Should {@link IActionSource#player()} be absent, it will consider a machine as source.
|
||||||
|
*
|
||||||
|
* It is recommended to include the machine even when a player is present.
|
||||||
|
*
|
||||||
|
* @return An optional machine issuing the action or acting as proxy for a player.
|
||||||
|
*/
|
||||||
|
@Nonnull
|
||||||
|
Optional<IActionHost> machine();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An {@link IActionSource} can have multiple optional contexts.
|
||||||
|
*
|
||||||
|
* It is strongly recommended to limit the uses for absolutely necessary cases.
|
||||||
|
*
|
||||||
|
* Currently there are no public contexts made available by AE.
|
||||||
|
* An example would be the context interfaces use internally to avoid looping items between each other.
|
||||||
|
*/
|
||||||
|
@Nonnull
|
||||||
|
<T> Optional<T> context( @Nonnull Class<T> key );
|
||||||
|
}
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
/*
|
|
||||||
* The MIT License (MIT)
|
|
||||||
*
|
|
||||||
* Copyright (c) 2013 AlgorithmX2
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
|
||||||
* the Software without restriction, including without limitation the rights to
|
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
* subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package appeng.api.networking.security;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO: Consider refactoring.
|
|
||||||
*/
|
|
||||||
public class MachineSource extends BaseActionSource
|
|
||||||
{
|
|
||||||
|
|
||||||
public final IActionHost via;
|
|
||||||
|
|
||||||
public MachineSource( final IActionHost v )
|
|
||||||
{
|
|
||||||
this.via = v;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isMachine()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
/*
|
|
||||||
* The MIT License (MIT)
|
|
||||||
*
|
|
||||||
* Copyright (c) 2013 AlgorithmX2
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
|
||||||
* the Software without restriction, including without limitation the rights to
|
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
* subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package appeng.api.networking.security;
|
|
||||||
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO: Consider refactoring.
|
|
||||||
*/
|
|
||||||
public class PlayerSource extends BaseActionSource
|
|
||||||
{
|
|
||||||
|
|
||||||
public final EntityPlayer player;
|
|
||||||
public final IActionHost via;
|
|
||||||
|
|
||||||
public PlayerSource( final EntityPlayer p, final IActionHost v )
|
|
||||||
{
|
|
||||||
this.player = p;
|
|
||||||
this.via = v;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isPlayer()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -28,7 +28,7 @@ import appeng.api.storage.IMEMonitorHandlerReceiver;
|
|||||||
import appeng.api.storage.data.IAEStack;
|
import appeng.api.storage.data.IAEStack;
|
||||||
|
|
||||||
|
|
||||||
public interface IBaseMonitor<T extends IAEStack>
|
public interface IBaseMonitor<T extends IAEStack<T>>
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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,8 @@
|
|||||||
package appeng.api.networking.storage;
|
package appeng.api.networking.storage;
|
||||||
|
|
||||||
|
|
||||||
import appeng.api.networking.security.BaseActionSource;
|
import appeng.api.networking.security.IActionSource;
|
||||||
import appeng.api.storage.StorageChannel;
|
import appeng.api.storage.IStorageChannel;
|
||||||
import appeng.api.storage.data.IAEStack;
|
import appeng.api.storage.data.IAEStack;
|
||||||
import appeng.api.storage.data.IItemList;
|
import appeng.api.storage.data.IItemList;
|
||||||
|
|
||||||
@@ -50,5 +50,5 @@ public interface IStackWatcherHost
|
|||||||
* @param src action source
|
* @param src action source
|
||||||
* @param chan storage channel
|
* @param chan storage channel
|
||||||
*/
|
*/
|
||||||
void onStackChange( IItemList o, IAEStack fullStack, IAEStack diffStack, BaseActionSource src, StorageChannel chan );
|
void onStackChange( IItemList<?> o, IAEStack<?> fullStack, IAEStack<?> diffStack, IActionSource src, IStorageChannel<?> chan );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,11 +26,11 @@ package appeng.api.networking.storage;
|
|||||||
|
|
||||||
import appeng.api.networking.IGridCache;
|
import appeng.api.networking.IGridCache;
|
||||||
import appeng.api.networking.IGridHost;
|
import appeng.api.networking.IGridHost;
|
||||||
import appeng.api.networking.security.BaseActionSource;
|
import appeng.api.networking.security.IActionSource;
|
||||||
import appeng.api.storage.ICellContainer;
|
import appeng.api.storage.ICellContainer;
|
||||||
import appeng.api.storage.ICellProvider;
|
import appeng.api.storage.ICellProvider;
|
||||||
|
import appeng.api.storage.IStorageChannel;
|
||||||
import appeng.api.storage.IStorageMonitorable;
|
import appeng.api.storage.IStorageMonitorable;
|
||||||
import appeng.api.storage.StorageChannel;
|
|
||||||
import appeng.api.storage.data.IAEStack;
|
import appeng.api.storage.data.IAEStack;
|
||||||
|
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ public interface IStorageGrid extends IGridCache, IStorageMonitorable
|
|||||||
*
|
*
|
||||||
* @param input injected items
|
* @param input injected items
|
||||||
*/
|
*/
|
||||||
void postAlterationOfStoredItems( StorageChannel chan, Iterable<? extends IAEStack> input, BaseActionSource src );
|
void postAlterationOfStoredItems( IStorageChannel<?> chan, Iterable<? extends IAEStack<?>> input, IActionSource src );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to add a cell provider to the storage system
|
* Used to add a cell provider to the storage system
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
+26
-20
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2013 AlgorithmX2
|
* Copyright (c) 2013 - 2015 AlgorithmX2
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
* 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
|
* this software and associated documentation files (the "Software"), to deal in
|
||||||
@@ -21,39 +21,45 @@
|
|||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package appeng.api.storage.data;
|
package appeng.api.parts;
|
||||||
|
|
||||||
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import appeng.api.features.IItemComparison;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Don't cast this... either compare with it, or copy it.
|
* A container to store a collection of {@link ResourceLocation} as models for a part as well as other properties.
|
||||||
*
|
|
||||||
* Don't Implement.
|
|
||||||
*/
|
*/
|
||||||
public interface IAETagCompound
|
public interface IPartModel
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return a copy ( the copy will not be a IAETagCompound, it will be a NBTTagCompound )
|
* 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.
|
||||||
*/
|
*/
|
||||||
NBTTagCompound getNBTTagCompoundCopy();
|
default boolean requireCableConnection()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* compare to other NBTTagCompounds or IAETagCompounds
|
* A collection of {@link ResourceLocation} used as models for a part.
|
||||||
*
|
*
|
||||||
* @param a compared object
|
* @return a collection of models, never null.
|
||||||
*
|
|
||||||
* @return true, if they are the same.
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Nonnull
|
||||||
boolean equals( Object a );
|
default List<ResourceLocation> getModels()
|
||||||
|
{
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the special comparison for this tag
|
|
||||||
*/
|
|
||||||
IItemComparison getSpecialComparison();
|
|
||||||
}
|
}
|
||||||
@@ -26,9 +26,9 @@ package appeng.api.recipes;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import appeng.api.exceptions.MissingIngredientError;
|
import appeng.api.exceptions.MissingIngredientException;
|
||||||
import appeng.api.exceptions.RecipeError;
|
import appeng.api.exceptions.RecipeException;
|
||||||
import appeng.api.exceptions.RegistrationError;
|
import appeng.api.exceptions.RegistrationException;
|
||||||
|
|
||||||
|
|
||||||
public interface ICraftHandler
|
public interface ICraftHandler
|
||||||
@@ -40,15 +40,15 @@ public interface ICraftHandler
|
|||||||
* @param input parsed inputs
|
* @param input parsed inputs
|
||||||
* @param output parsed outputs
|
* @param output parsed outputs
|
||||||
*
|
*
|
||||||
* @throws RecipeError
|
* @throws RecipeException
|
||||||
*/
|
*/
|
||||||
void setup( List<List<IIngredient>> input, List<List<IIngredient>> output ) throws RecipeError;
|
void setup( List<List<IIngredient>> input, List<List<IIngredient>> output ) throws RecipeException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* called when all recipes are parsed, and your required to register your recipe.
|
* called when all recipes are parsed, and your required to register your recipe.
|
||||||
*
|
*
|
||||||
* @throws RegistrationError
|
* @throws RegistrationException
|
||||||
* @throws MissingIngredientError
|
* @throws MissingIngredientException
|
||||||
*/
|
*/
|
||||||
void register() throws RegistrationError, MissingIngredientError;
|
void register() throws RegistrationException, MissingIngredientException;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ package appeng.api.recipes;
|
|||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import appeng.api.exceptions.MissingIngredientError;
|
import appeng.api.exceptions.MissingIngredientException;
|
||||||
import appeng.api.exceptions.RegistrationError;
|
import appeng.api.exceptions.RegistrationException;
|
||||||
|
|
||||||
|
|
||||||
public interface IIngredient
|
public interface IIngredient
|
||||||
@@ -39,10 +39,10 @@ public interface IIngredient
|
|||||||
*
|
*
|
||||||
* @return a single ItemStack for the recipe handler.
|
* @return a single ItemStack for the recipe handler.
|
||||||
*
|
*
|
||||||
* @throws RegistrationError
|
* @throws RegistrationException
|
||||||
* @throws MissingIngredientError
|
* @throws MissingIngredientException
|
||||||
*/
|
*/
|
||||||
ItemStack getItemStack() throws RegistrationError, MissingIngredientError;
|
ItemStack getItemStack() throws RegistrationException, MissingIngredientException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Acquire a list of all the input stacks for the current recipe, this is for handlers that support
|
* Acquire a list of all the input stacks for the current recipe, this is for handlers that support
|
||||||
@@ -50,10 +50,10 @@ public interface IIngredient
|
|||||||
*
|
*
|
||||||
* @return an array of ItemStacks for the recipe handler.
|
* @return an array of ItemStacks for the recipe handler.
|
||||||
*
|
*
|
||||||
* @throws RegistrationError
|
* @throws RegistrationException
|
||||||
* @throws MissingIngredientError
|
* @throws MissingIngredientException
|
||||||
*/
|
*/
|
||||||
ItemStack[] getItemStackSet() throws RegistrationError, MissingIngredientError;
|
ItemStack[] getItemStackSet() throws RegistrationException, MissingIngredientException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If you wish to support air, you must test before getting the ItemStack, or ItemStackSet
|
* If you wish to support air, you must test before getting the ItemStack, or ItemStackSet
|
||||||
@@ -85,8 +85,8 @@ public interface IIngredient
|
|||||||
/**
|
/**
|
||||||
* Bakes the lists in for faster runtime look-ups.
|
* Bakes the lists in for faster runtime look-ups.
|
||||||
*
|
*
|
||||||
* @throws MissingIngredientError
|
* @throws MissingIngredientException
|
||||||
* @throws RegistrationError
|
* @throws RegistrationException
|
||||||
*/
|
*/
|
||||||
void bake() throws RegistrationError, MissingIngredientError;
|
void bake() throws RegistrationException, MissingIngredientException;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import appeng.api.implementations.tiles.IChestOrDrive;
|
import appeng.api.implementations.tiles.IChestOrDrive;
|
||||||
|
import appeng.api.storage.data.IAEStack;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -56,7 +57,7 @@ public interface ICellHandler
|
|||||||
*
|
*
|
||||||
* @return a new IMEHandler for the provided item
|
* @return a new IMEHandler for the provided item
|
||||||
*/
|
*/
|
||||||
IMEInventoryHandler getCellInventory( ItemStack is, ISaveProvider host, StorageChannel channel );
|
<T extends IAEStack<T>> IMEInventoryHandler<T> getCellInventory( ItemStack is, ISaveProvider host, IStorageChannel<T> channel );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the storage cell is planed in an ME Chest and the user tries to open the terminal side, if your item
|
* Called when the storage cell is planed in an ME Chest and the user tries to open the terminal side, if your item
|
||||||
@@ -70,7 +71,7 @@ public interface ICellHandler
|
|||||||
* @param is item
|
* @param is item
|
||||||
* @param chan storage channel
|
* @param chan storage channel
|
||||||
*/
|
*/
|
||||||
void openChestGui( EntityPlayer player, IChestOrDrive chest, ICellHandler cellHandler, IMEInventoryHandler inv, ItemStack is, StorageChannel chan );
|
<T extends IAEStack<T>> void openChestGui( EntityPlayer player, IChestOrDrive chest, ICellHandler cellHandler, IMEInventoryHandler<T> inv, ItemStack is, IStorageChannel<T> chan );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 0 - cell is missing.
|
* 0 - cell is missing.
|
||||||
@@ -86,10 +87,10 @@ public interface ICellHandler
|
|||||||
*
|
*
|
||||||
* @return get the status of the cell based on its contents.
|
* @return get the status of the cell based on its contents.
|
||||||
*/
|
*/
|
||||||
int getStatusForCell( ItemStack is, IMEInventory handler );
|
<T extends IAEStack<T>> int getStatusForCell( ItemStack is, IMEInventory<T> handler );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the ae/t to drain for this storage cell inside a chest/drive.
|
* @return the ae/t to drain for this storage cell inside a chest/drive.
|
||||||
*/
|
*/
|
||||||
double cellIdleDrain( ItemStack is, IMEInventory handler );
|
<T extends IAEStack<T>> double cellIdleDrain( ItemStack is, IMEInventory<T> handler );
|
||||||
}
|
}
|
||||||
@@ -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?
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public interface ICellProvider
|
|||||||
*
|
*
|
||||||
* @return a valid list of handlers, NEVER NULL
|
* @return a valid list of handlers, NEVER NULL
|
||||||
*/
|
*/
|
||||||
List<IMEInventoryHandler> getCellArray( StorageChannel channel );
|
List<IMEInventoryHandler> getCellArray( IStorageChannel<?> channel );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the storage's priority.
|
* the storage's priority.
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ package appeng.api.storage;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import appeng.api.IAppEngApi;
|
import appeng.api.IAppEngApi;
|
||||||
|
import appeng.api.storage.data.IAEStack;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -73,5 +74,5 @@ public interface ICellRegistry
|
|||||||
*
|
*
|
||||||
* @return new IMEInventoryHandler, or null if there isn't one.
|
* @return new IMEInventoryHandler, or null if there isn't one.
|
||||||
*/
|
*/
|
||||||
IMEInventoryHandler getCellInventory( ItemStack is, ISaveProvider host, StorageChannel chan );
|
<T extends IAEStack<T>> IMEInventoryHandler<T> getCellInventory( ItemStack is, ISaveProvider host, IStorageChannel<T> chan );
|
||||||
}
|
}
|
||||||
@@ -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.
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ package appeng.api.storage;
|
|||||||
|
|
||||||
|
|
||||||
import appeng.api.config.Actionable;
|
import appeng.api.config.Actionable;
|
||||||
import appeng.api.networking.security.BaseActionSource;
|
import appeng.api.networking.security.IActionSource;
|
||||||
import appeng.api.storage.data.IAEStack;
|
import appeng.api.storage.data.IAEStack;
|
||||||
import appeng.api.storage.data.IItemList;
|
import appeng.api.storage.data.IItemList;
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ import appeng.api.storage.data.IItemList;
|
|||||||
* If you want to request a stack of an item, you should should determine that prior to requesting the stack from the
|
* If you want to request a stack of an item, you should should determine that prior to requesting the stack from the
|
||||||
* inventory.
|
* inventory.
|
||||||
*/
|
*/
|
||||||
public interface IMEInventory<StackType extends IAEStack>
|
public interface IMEInventory<T extends IAEStack<T>>
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -52,7 +52,7 @@ public interface IMEInventory<StackType extends IAEStack>
|
|||||||
*
|
*
|
||||||
* @return returns the number of items not added.
|
* @return returns the number of items not added.
|
||||||
*/
|
*/
|
||||||
StackType injectItems( StackType input, Actionable type, BaseActionSource src );
|
T injectItems( T input, Actionable type, IActionSource src );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extract the specified item from the ME Inventory
|
* Extract the specified item from the ME Inventory
|
||||||
@@ -62,7 +62,7 @@ public interface IMEInventory<StackType extends IAEStack>
|
|||||||
*
|
*
|
||||||
* @return returns the number of items extracted, null
|
* @return returns the number of items extracted, null
|
||||||
*/
|
*/
|
||||||
StackType extractItems( StackType request, Actionable mode, BaseActionSource src );
|
T extractItems( T request, Actionable mode, IActionSource src );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* request a full report of all available items, storage.
|
* request a full report of all available items, storage.
|
||||||
@@ -71,10 +71,10 @@ public interface IMEInventory<StackType extends IAEStack>
|
|||||||
*
|
*
|
||||||
* @return returns same list that was passed in, is passed out
|
* @return returns same list that was passed in, is passed out
|
||||||
*/
|
*/
|
||||||
IItemList<StackType> getAvailableItems( IItemList<StackType> out );
|
IItemList<T> getAvailableItems( IItemList<T> out );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the type of channel your handler should be part of
|
* @return the type of channel your handler should be part of
|
||||||
*/
|
*/
|
||||||
StorageChannel getChannel();
|
IStorageChannel<T> getChannel();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,9 +32,9 @@ import appeng.api.storage.data.IAEStack;
|
|||||||
* Thin logic layer that can be swapped with different IMEInventory implementations, used to handle features related to
|
* Thin logic layer that can be swapped with different IMEInventory implementations, used to handle features related to
|
||||||
* storage, that are Separate from the storage medium itself.
|
* storage, that are Separate from the storage medium itself.
|
||||||
*
|
*
|
||||||
* @param <StackType>
|
* @param <T>
|
||||||
*/
|
*/
|
||||||
public interface IMEInventoryHandler<StackType extends IAEStack> extends IMEInventory<StackType>
|
public interface IMEInventoryHandler<T extends IAEStack<T>> extends IMEInventory<T>
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -52,7 +52,7 @@ public interface IMEInventoryHandler<StackType extends IAEStack> extends IMEInve
|
|||||||
*
|
*
|
||||||
* @return if its prioritized
|
* @return if its prioritized
|
||||||
*/
|
*/
|
||||||
boolean isPrioritized( StackType input );
|
boolean isPrioritized( T input );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* determine if an item can be accepted and stored.
|
* determine if an item can be accepted and stored.
|
||||||
@@ -61,7 +61,7 @@ public interface IMEInventoryHandler<StackType extends IAEStack> extends IMEInve
|
|||||||
*
|
*
|
||||||
* @return if the item can be added
|
* @return if the item can be added
|
||||||
*/
|
*/
|
||||||
boolean canAccept( StackType input );
|
boolean canAccept( T input );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* determine what the priority of the inventory is.
|
* determine what the priority of the inventory is.
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import appeng.api.storage.data.IAEStack;
|
|||||||
import appeng.api.storage.data.IItemList;
|
import appeng.api.storage.data.IItemList;
|
||||||
|
|
||||||
|
|
||||||
public interface IMEMonitor<T extends IAEStack> extends IMEInventoryHandler<T>, IBaseMonitor<T>
|
public interface IMEMonitor<T extends IAEStack<T>> extends IMEInventoryHandler<T>, IBaseMonitor<T>
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -37,7 +37,7 @@ public interface IMEMonitor<T extends IAEStack> extends IMEInventoryHandler<T>,
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Deprecated
|
@Deprecated
|
||||||
IItemList<T> getAvailableItems( IItemList out );
|
IItemList<T> getAvailableItems( IItemList<T> out );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get access to the full item list of the network, preferred over {@link IMEInventory} .getAvailableItems(...)
|
* Get access to the full item list of the network, preferred over {@link IMEInventory} .getAvailableItems(...)
|
||||||
|
|||||||
@@ -24,12 +24,12 @@
|
|||||||
package appeng.api.storage;
|
package appeng.api.storage;
|
||||||
|
|
||||||
|
|
||||||
import appeng.api.networking.security.BaseActionSource;
|
import appeng.api.networking.security.IActionSource;
|
||||||
import appeng.api.networking.storage.IBaseMonitor;
|
import appeng.api.networking.storage.IBaseMonitor;
|
||||||
import appeng.api.storage.data.IAEStack;
|
import appeng.api.storage.data.IAEStack;
|
||||||
|
|
||||||
|
|
||||||
public interface IMEMonitorHandlerReceiver<StackType extends IAEStack>
|
public interface IMEMonitorHandlerReceiver<T extends IAEStack<T>>
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -46,7 +46,7 @@ public interface IMEMonitorHandlerReceiver<StackType extends IAEStack>
|
|||||||
*
|
*
|
||||||
* @param change done change
|
* @param change done change
|
||||||
*/
|
*/
|
||||||
void postChange( IBaseMonitor<StackType> monitor, Iterable<StackType> change, BaseActionSource actionSource );
|
void postChange( IBaseMonitor<T> monitor, Iterable<T> change, IActionSource actionSource );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* called when the list updates its contents, this is mostly for handling power events.
|
* called when the list updates its contents, this is mostly for handling power events.
|
||||||
|
|||||||
@@ -27,5 +27,5 @@ package appeng.api.storage;
|
|||||||
public interface ISaveProvider
|
public interface ISaveProvider
|
||||||
{
|
{
|
||||||
|
|
||||||
void saveChanges( IMEInventory cellInventory );
|
void saveChanges( IMEInventory<?> cellInventory );
|
||||||
}
|
}
|
||||||
|
|||||||
+16
-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,26 @@
|
|||||||
* 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.api.storage;
|
||||||
|
|
||||||
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.world.World;
|
||||||
import appeng.api.storage.IMEInventory;
|
|
||||||
|
|
||||||
|
|
||||||
public interface IDSU
|
public interface ISpatialDimension
|
||||||
{
|
{
|
||||||
|
World getWorld();
|
||||||
|
|
||||||
IMEInventory getDSU( TileEntity te );
|
int createNewCellDimension( BlockPos contentSize, int playerId );
|
||||||
|
|
||||||
boolean isDSU( TileEntity te );
|
void deleteCellDimension( int cellDimId );
|
||||||
|
|
||||||
|
boolean isCellDimension( int cellDimID );
|
||||||
|
|
||||||
|
int getCellDimensionOwner( int cellDimId );
|
||||||
|
|
||||||
|
BlockPos getCellDimensionOrigin( int cellDimId );
|
||||||
|
|
||||||
|
BlockPos getCellContentSize( int cellDimId );
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
/*
|
||||||
|
* The MIT License (MIT)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013 AlgorithmX2
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
* this software and associated documentation files (the "Software"), to deal in
|
||||||
|
* the Software without restriction, including without limitation the rights to
|
||||||
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
* subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package appeng.api.storage;
|
||||||
|
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
import io.netty.buffer.ByteBuf;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import appeng.api.networking.energy.IEnergySource;
|
||||||
|
import appeng.api.networking.security.IActionSource;
|
||||||
|
import appeng.api.storage.data.IAEItemStack;
|
||||||
|
import appeng.api.storage.data.IAEStack;
|
||||||
|
import appeng.api.storage.data.IItemList;
|
||||||
|
|
||||||
|
|
||||||
|
public interface IStorageChannel<T extends IAEStack<T>>
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new {@link IItemList} of the specific type.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Nonnull
|
||||||
|
IItemList<T> createList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new {@link IAEStack} subtype of the specific object.
|
||||||
|
*
|
||||||
|
* The parameter is unbound to allow a slightly more flexible approach.
|
||||||
|
* But the general intention is about converting an {@link ItemStack} into the corresponding {@link IAEItemStack}.
|
||||||
|
* Another valid case might be to use it instead of {@link IAEStack#copy()}, but this might not be supported by all
|
||||||
|
* types.
|
||||||
|
*
|
||||||
|
* @param input The object to turn into an {@link IAEStack}
|
||||||
|
* @return The converted stack or null
|
||||||
|
*/
|
||||||
|
@Nullable
|
||||||
|
T createStack( @Nonnull Object input );
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param input
|
||||||
|
* @return
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
@Nullable
|
||||||
|
T readFromPacket( @Nonnull ByteBuf input ) throws IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* use energy from energy, to remove request items from cell, at the request of src.
|
||||||
|
*
|
||||||
|
* @param energy to be drained energy source
|
||||||
|
* @param cell cell of requested items
|
||||||
|
* @param request requested items
|
||||||
|
* @param src action source
|
||||||
|
*
|
||||||
|
* @return items that successfully extracted.
|
||||||
|
*/
|
||||||
|
@Nullable
|
||||||
|
T poweredExtraction( @Nonnull IEnergySource energy, @Nonnull IMEInventory<T> cell, @Nonnull T request, @Nonnull IActionSource src );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* use energy from energy, to inject input items into cell, at the request of src
|
||||||
|
*
|
||||||
|
* @param energy to be added energy source
|
||||||
|
* @param cell injected cell
|
||||||
|
* @param input to be injected items
|
||||||
|
* @param src action source
|
||||||
|
*
|
||||||
|
* @return items that failed to insert.
|
||||||
|
*/
|
||||||
|
@Nullable
|
||||||
|
T poweredInsert( @Nonnull IEnergySource energy, @Nonnull IMEInventory<T> cell, @Nonnull T input, @Nonnull IActionSource src );
|
||||||
|
|
||||||
|
}
|
||||||
@@ -24,26 +24,63 @@
|
|||||||
package appeng.api.storage;
|
package appeng.api.storage;
|
||||||
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.util.Collection;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
|
||||||
|
|
||||||
import appeng.api.networking.crafting.ICraftingLink;
|
import appeng.api.networking.crafting.ICraftingLink;
|
||||||
import appeng.api.networking.crafting.ICraftingRequester;
|
import appeng.api.networking.crafting.ICraftingRequester;
|
||||||
import appeng.api.networking.energy.IEnergySource;
|
|
||||||
import appeng.api.networking.security.BaseActionSource;
|
|
||||||
import appeng.api.storage.data.IAEFluidStack;
|
import appeng.api.storage.data.IAEFluidStack;
|
||||||
import appeng.api.storage.data.IAEItemStack;
|
import appeng.api.storage.data.IAEItemStack;
|
||||||
import appeng.api.storage.data.IItemList;
|
import appeng.api.storage.data.IAEStack;
|
||||||
|
|
||||||
|
|
||||||
public interface IStorageHelper
|
public interface IStorageHelper
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register a new storage channel.
|
||||||
|
*
|
||||||
|
* AE2 already provides native channels for {@link IAEItemStack} and {@link IAEFluidStack}.
|
||||||
|
*
|
||||||
|
* Each {@link IAEStack} subtype can only have a single factory instance. Overwriting is not intended.
|
||||||
|
* Each subtype should be a direct one, this might be enforced at any time.
|
||||||
|
*
|
||||||
|
* Channel class and factory instance can be used interchangeable as identifier. In most cases the factory instance
|
||||||
|
* is used as key as having direct access the methods is more beneficial compared to being forced to query the
|
||||||
|
* registry each time.
|
||||||
|
*
|
||||||
|
* Caching the factory instance in a field or local variable is perfectly for performance reasons. But do not use
|
||||||
|
* any AE2 internal field as they can change randomly between releases.
|
||||||
|
*
|
||||||
|
* @param channel The channel type, must be a subtype of {@link IStorageChannel}
|
||||||
|
* @param factory An instance implementing the channel, must be be an instance of channel
|
||||||
|
*/
|
||||||
|
@Nonnull
|
||||||
|
<T extends IAEStack<T>, C extends IStorageChannel<T>> void registerStorageChannel( @Nonnull Class<C> channel, @Nonnull C factory );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetch the factory instance for a specific storage channel.
|
||||||
|
*
|
||||||
|
* Channel must be a direct subtype of {@link IStorageChannel}.
|
||||||
|
*
|
||||||
|
* @throws NullPointerException when fetching an unregistered channel.
|
||||||
|
* @param channel The channel type
|
||||||
|
* @return the factory instance
|
||||||
|
*/
|
||||||
|
@Nonnull
|
||||||
|
<T extends IAEStack<T>, C extends IStorageChannel<T>> C getStorageChannel( @Nonnull Class<C> channel );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An unmodifiable collection of all registered factory instance.
|
||||||
|
*
|
||||||
|
* This is mainly used as helper to let storage grids construct their internal storage for each type.
|
||||||
|
*/
|
||||||
|
@Nonnull
|
||||||
|
Collection<IStorageChannel<? extends IAEStack<?>>> storageChannels();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* load a crafting link from nbt data.
|
* load a crafting link from nbt data.
|
||||||
*
|
*
|
||||||
@@ -53,73 +90,4 @@ public interface IStorageHelper
|
|||||||
*/
|
*/
|
||||||
ICraftingLink loadCraftingLink( NBTTagCompound data, ICraftingRequester req );
|
ICraftingLink loadCraftingLink( NBTTagCompound data, ICraftingRequester req );
|
||||||
|
|
||||||
/**
|
|
||||||
* @param is An ItemStack
|
|
||||||
*
|
|
||||||
* @return a new INSTANCE of {@link IAEItemStack} from a MC {@link ItemStack}
|
|
||||||
*/
|
|
||||||
IAEItemStack createItemStack( ItemStack is );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param is A FluidStack
|
|
||||||
*
|
|
||||||
* @return a new INSTANCE of {@link IAEFluidStack} from a Forge {@link FluidStack}
|
|
||||||
*/
|
|
||||||
IAEFluidStack createFluidStack( FluidStack is );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return a new INSTANCE of {@link IItemList} for items
|
|
||||||
*/
|
|
||||||
IItemList<IAEItemStack> createItemList();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return a new INSTANCE of {@link IItemList} for fluids
|
|
||||||
*/
|
|
||||||
IItemList<IAEFluidStack> createFluidList();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Read a AE Item Stack from a byte stream, returns a AE item stack or null.
|
|
||||||
*
|
|
||||||
* @param input to be loaded data
|
|
||||||
*
|
|
||||||
* @return item based of data
|
|
||||||
*
|
|
||||||
* @throws IOException if file could not be read
|
|
||||||
*/
|
|
||||||
IAEItemStack readItemFromPacket( ByteBuf input ) throws IOException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Read a AE Fluid Stack from a byte stream, returns a AE fluid stack or null.
|
|
||||||
*
|
|
||||||
* @param input to be loaded data
|
|
||||||
*
|
|
||||||
* @return fluid based on data
|
|
||||||
*
|
|
||||||
* @throws IOException if file could not be written
|
|
||||||
*/
|
|
||||||
IAEFluidStack readFluidFromPacket( ByteBuf input ) throws IOException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* use energy from energy, to remove request items from cell, at the request of src.
|
|
||||||
*
|
|
||||||
* @param energy to be drained energy source
|
|
||||||
* @param cell cell of requested items
|
|
||||||
* @param request requested items
|
|
||||||
* @param src action source
|
|
||||||
*
|
|
||||||
* @return items that successfully extracted.
|
|
||||||
*/
|
|
||||||
IAEItemStack poweredExtraction( IEnergySource energy, IMEInventory<IAEItemStack> cell, IAEItemStack request, BaseActionSource src );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* use energy from energy, to inject input items into cell, at the request of src
|
|
||||||
*
|
|
||||||
* @param energy to be added energy source
|
|
||||||
* @param cell injected cell
|
|
||||||
* @param input to be injected items
|
|
||||||
* @param src action source
|
|
||||||
*
|
|
||||||
* @return items that failed to insert.
|
|
||||||
*/
|
|
||||||
IAEItemStack poweredInsert( IEnergySource energy, IMEInventory<IAEItemStack> cell, IAEItemStack input, BaseActionSource src );
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,8 +24,7 @@
|
|||||||
package appeng.api.storage;
|
package appeng.api.storage;
|
||||||
|
|
||||||
|
|
||||||
import appeng.api.storage.data.IAEFluidStack;
|
import appeng.api.storage.data.IAEStack;
|
||||||
import appeng.api.storage.data.IAEItemStack;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -35,13 +34,6 @@ import appeng.api.storage.data.IAEItemStack;
|
|||||||
public interface IStorageMonitorable
|
public interface IStorageMonitorable
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
<T extends IAEStack<T>> IMEMonitor<T> getInventory( IStorageChannel<T> channel );
|
||||||
* Access the item inventory for the monitorable storage.
|
|
||||||
*/
|
|
||||||
IMEMonitor<IAEItemStack> getItemInventory();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Access the fluid inventory for the monitorable storage.
|
|
||||||
*/
|
|
||||||
IMEMonitor<IAEFluidStack> getFluidInventory();
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ package appeng.api.storage;
|
|||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import appeng.api.networking.security.BaseActionSource;
|
import appeng.api.networking.security.IActionSource;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -22,5 +22,5 @@ public interface IStorageMonitorableAccessor
|
|||||||
* @return Null if the network cannot be accessed by the given action source (i.e. security doesn't permit it).
|
* @return Null if the network cannot be accessed by the given action source (i.e. security doesn't permit it).
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
IStorageMonitorable getInventory( BaseActionSource src );
|
IStorageMonitorable getInventory( IActionSource src );
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-15
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2013 AlgorithmX2
|
* Copyright (c) 2017 AlgorithmX2
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
* 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
|
* this software and associated documentation files (the "Software"), to deal in
|
||||||
@@ -21,21 +21,14 @@
|
|||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package appeng.api.networking.security;
|
package appeng.api.storage.channels;
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO: Consider refactoring.
|
import appeng.api.storage.IStorageChannel;
|
||||||
*/
|
import appeng.api.storage.data.IAEFluidStack;
|
||||||
public class BaseActionSource
|
|
||||||
|
|
||||||
|
public interface IFluidStorageChannel extends IStorageChannel<IAEFluidStack>
|
||||||
{
|
{
|
||||||
|
|
||||||
public boolean isPlayer()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isMachine()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* The MIT License (MIT)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2017 AlgorithmX2
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
* this software and associated documentation files (the "Software"), to deal in
|
||||||
|
* the Software without restriction, including without limitation the rights to
|
||||||
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
* subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package appeng.api.storage.channels;
|
||||||
|
|
||||||
|
|
||||||
|
import appeng.api.storage.IStorageChannel;
|
||||||
|
import appeng.api.storage.data.IAEItemStack;
|
||||||
|
|
||||||
|
|
||||||
|
public interface IItemStorageChannel extends IStorageChannel<IAEItemStack>
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -37,7 +37,7 @@ import net.minecraftforge.fluids.FluidStack;
|
|||||||
*
|
*
|
||||||
* Don't Implement.
|
* Don't Implement.
|
||||||
*
|
*
|
||||||
* Construct with Util.createFluidStack( FluidStack )
|
* Construct with AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class).createStack( FluidStack )
|
||||||
*/
|
*/
|
||||||
public interface IAEFluidStack extends IAEStack<IAEFluidStack>
|
public interface IAEFluidStack extends IAEStack<IAEFluidStack>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ import net.minecraft.item.ItemStack;
|
|||||||
*
|
*
|
||||||
* Don't Implement.
|
* Don't Implement.
|
||||||
*
|
*
|
||||||
* Construct with Util.createItemStack( ItemStack )
|
* Construct with AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class).createStack( ItemStack )
|
||||||
*/
|
*/
|
||||||
public interface IAEItemStack extends IAEStack<IAEItemStack>
|
public interface IAEItemStack extends IAEStack<IAEItemStack>
|
||||||
{
|
{
|
||||||
@@ -46,7 +46,7 @@ public interface IAEItemStack extends IAEStack<IAEItemStack>
|
|||||||
*
|
*
|
||||||
* @return new ItemStack
|
* @return new ItemStack
|
||||||
*/
|
*/
|
||||||
ItemStack getItemStack();
|
ItemStack createItemStack();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* is there NBT Data for this item?
|
* is there NBT Data for this item?
|
||||||
@@ -105,4 +105,11 @@ public interface IAEItemStack extends IAEStack<IAEItemStack>
|
|||||||
* @return true if it is the same type (same item, damage, nbt)
|
* @return true if it is the same type (same item, damage, nbt)
|
||||||
*/
|
*/
|
||||||
boolean isSameType( ItemStack stored );
|
boolean isSameType( ItemStack stored );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DO NOT MODIFY THIS STACK! NEVER. If you think about it .. DON'T
|
||||||
|
*
|
||||||
|
* @return definition stack
|
||||||
|
*/
|
||||||
|
ItemStack getDefinition();
|
||||||
}
|
}
|
||||||
@@ -28,13 +28,14 @@ import java.io.IOException;
|
|||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
|
||||||
import appeng.api.config.FuzzyMode;
|
import appeng.api.config.FuzzyMode;
|
||||||
import appeng.api.storage.StorageChannel;
|
import appeng.api.storage.IStorageChannel;
|
||||||
|
|
||||||
|
|
||||||
public interface IAEStack<StackType extends IAEStack>
|
public interface IAEStack<T extends IAEStack<T>>
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -42,7 +43,7 @@ public interface IAEStack<StackType extends IAEStack>
|
|||||||
*
|
*
|
||||||
* @param is added item
|
* @param is added item
|
||||||
*/
|
*/
|
||||||
void add( StackType is );
|
void add( T is );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* number of items in the stack.
|
* number of items in the stack.
|
||||||
@@ -56,7 +57,7 @@ public interface IAEStack<StackType extends IAEStack>
|
|||||||
*
|
*
|
||||||
* @param stackSize , ItemStack.stackSize = N
|
* @param stackSize , ItemStack.stackSize = N
|
||||||
*/
|
*/
|
||||||
StackType setStackSize( long stackSize );
|
T setStackSize( long stackSize );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Same as getStackSize, but for requestable items. ( LP )
|
* Same as getStackSize, but for requestable items. ( LP )
|
||||||
@@ -70,7 +71,7 @@ public interface IAEStack<StackType extends IAEStack>
|
|||||||
*
|
*
|
||||||
* @return basically itemStack.stackSize = N but for setStackSize items.
|
* @return basically itemStack.stackSize = N but for setStackSize items.
|
||||||
*/
|
*/
|
||||||
StackType setCountRequestable( long countRequestable );
|
T setCountRequestable( long countRequestable );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* true, if the item can be crafted.
|
* true, if the item can be crafted.
|
||||||
@@ -84,12 +85,12 @@ public interface IAEStack<StackType extends IAEStack>
|
|||||||
*
|
*
|
||||||
* @param isCraftable can item be crafted
|
* @param isCraftable can item be crafted
|
||||||
*/
|
*/
|
||||||
StackType setCraftable( boolean isCraftable );
|
T setCraftable( boolean isCraftable );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clears, requestable, craftable, and stack sizes.
|
* clears, requestable, craftable, and stack sizes.
|
||||||
*/
|
*/
|
||||||
StackType reset();
|
T reset();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns true, if the item can be crafted, requested, or extracted.
|
* returns true, if the item can be crafted, requested, or extracted.
|
||||||
@@ -173,21 +174,14 @@ public interface IAEStack<StackType extends IAEStack>
|
|||||||
*
|
*
|
||||||
* @return a new Stack, which is copied from the original.
|
* @return a new Stack, which is copied from the original.
|
||||||
*/
|
*/
|
||||||
StackType copy();
|
T copy();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create an empty stack.
|
* create an empty stack.
|
||||||
*
|
*
|
||||||
* @return a new stack, which represents an empty copy of the original.
|
* @return a new stack, which represents an empty copy of the original.
|
||||||
*/
|
*/
|
||||||
StackType empty();
|
T empty();
|
||||||
|
|
||||||
/**
|
|
||||||
* obtain the NBT Data for the item.
|
|
||||||
*
|
|
||||||
* @return nbt data
|
|
||||||
*/
|
|
||||||
IAETagCompound getTagCompound();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return true if the stack is a {@link IAEItemStack}
|
* @return true if the stack is a {@link IAEItemStack}
|
||||||
@@ -202,5 +196,12 @@ public interface IAEStack<StackType extends IAEStack>
|
|||||||
/**
|
/**
|
||||||
* @return ITEM or FLUID
|
* @return ITEM or FLUID
|
||||||
*/
|
*/
|
||||||
StorageChannel getChannel();
|
IStorageChannel<T> getChannel();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns itemstack for display and similar purposes. Always has a count of 1.
|
||||||
|
*
|
||||||
|
* @return itemstack
|
||||||
|
*/
|
||||||
|
ItemStack asItemStackRepresentation();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,9 +34,8 @@ import appeng.api.config.FuzzyMode;
|
|||||||
*
|
*
|
||||||
* Don't Implement.
|
* Don't Implement.
|
||||||
*
|
*
|
||||||
* Construct with Util.createItemList()
|
|
||||||
*/
|
*/
|
||||||
public interface IItemContainer<StackType extends IAEStack>
|
public interface IItemContainer<T extends IAEStack<T>>
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -44,7 +43,7 @@ public interface IItemContainer<StackType extends IAEStack>
|
|||||||
*
|
*
|
||||||
* @param option added stack
|
* @param option added stack
|
||||||
*/
|
*/
|
||||||
void add( StackType option ); // adds stack as is
|
void add( T option ); // adds stack as is
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param i compared item
|
* @param i compared item
|
||||||
@@ -52,14 +51,14 @@ public interface IItemContainer<StackType extends IAEStack>
|
|||||||
* @return a stack equivalent to the stack passed in, but with the correct stack size information, or null if its
|
* @return a stack equivalent to the stack passed in, but with the correct stack size information, or null if its
|
||||||
* not present
|
* not present
|
||||||
*/
|
*/
|
||||||
StackType findPrecise( StackType i );
|
T findPrecise( T i );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param input compared item
|
* @param input compared item
|
||||||
*
|
*
|
||||||
* @return a list of relevant fuzzy matched stacks
|
* @return a list of relevant fuzzy matched stacks
|
||||||
*/
|
*/
|
||||||
Collection<StackType> findFuzzy( StackType input, FuzzyMode fuzzy );
|
Collection<T> findFuzzy( T input, FuzzyMode fuzzy );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return true if there are no items in the list
|
* @return true if there are no items in the list
|
||||||
|
|||||||
@@ -26,15 +26,20 @@ package appeng.api.storage.data;
|
|||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
import appeng.api.storage.IStorageChannel;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a list of items in AE.
|
* Represents a list of items in AE.
|
||||||
*
|
*
|
||||||
* Don't Implement.
|
* Don't Implement.
|
||||||
*
|
*
|
||||||
* Construct with Util.createItemList()
|
* Construct with
|
||||||
|
* - For items: AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class).createList()
|
||||||
|
* - For fluids: AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class).createList()
|
||||||
|
* - Replace with the corresponding {@link IStorageChannel} type for non native channels
|
||||||
*/
|
*/
|
||||||
public interface IItemList<StackType extends IAEStack> extends IItemContainer<StackType>, Iterable<StackType>
|
public interface IItemList<T extends IAEStack<T>> extends IItemContainer<T>, Iterable<T>
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -43,14 +48,14 @@ public interface IItemList<StackType extends IAEStack> extends IItemContainer<St
|
|||||||
*
|
*
|
||||||
* @param option stacktype option
|
* @param option stacktype option
|
||||||
*/
|
*/
|
||||||
void addStorage( StackType option ); // adds a stack as stored
|
void addStorage( T option ); // adds a stack as stored
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* add a stack to the list as craftable, this will merge the stack with an item already in the list if found.
|
* add a stack to the list as craftable, this will merge the stack with an item already in the list if found.
|
||||||
*
|
*
|
||||||
* @param option stacktype option
|
* @param option stacktype option
|
||||||
*/
|
*/
|
||||||
void addCrafting( StackType option );
|
void addCrafting( T option );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* add a stack to the list, stack size is used to add to requestable, this will merge the stack with an item already
|
* add a stack to the list, stack size is used to add to requestable, this will merge the stack with an item already
|
||||||
@@ -58,12 +63,12 @@ public interface IItemList<StackType extends IAEStack> extends IItemContainer<St
|
|||||||
*
|
*
|
||||||
* @param option stacktype option
|
* @param option stacktype option
|
||||||
*/
|
*/
|
||||||
void addRequestable( StackType option ); // adds a stack as requestable
|
void addRequestable( T option ); // adds a stack as requestable
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the first item in the list
|
* @return the first item in the list
|
||||||
*/
|
*/
|
||||||
StackType getFirstItem();
|
T getFirstItem();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the number of items in the list
|
* @return the number of items in the list
|
||||||
@@ -74,7 +79,7 @@ public interface IItemList<StackType extends IAEStack> extends IItemContainer<St
|
|||||||
* allows you to iterate the list.
|
* allows you to iterate the list.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
Iterator<StackType> iterator();
|
Iterator<T> iterator();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* resets stack sizes to 0.
|
* resets stack sizes to 0.
|
||||||
|
|||||||
@@ -47,15 +47,21 @@ 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_COVERED,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Smart Dense Cable, represents a tier 2 block that can carry 32 channels.
|
||||||
|
*/
|
||||||
|
DENSE_SMART;
|
||||||
|
|
||||||
public static final AECableType[] VALIDCABLES = {
|
public static final AECableType[] VALIDCABLES = {
|
||||||
GLASS,
|
GLASS,
|
||||||
COVERED,
|
COVERED,
|
||||||
SMART,
|
SMART,
|
||||||
DENSE
|
DENSE_COVERED,
|
||||||
|
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,32 @@ public abstract class AEBaseBlock extends Block
|
|||||||
return new BlockStateContainer( this, this.getAEStates() );
|
return new BlockStateContainer( this, this.getAEStates() );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected IProperty[] getAEStates()
|
|
||||||
{
|
|
||||||
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 )
|
|
||||||
{
|
|
||||||
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 +133,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 +148,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 +166,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 +182,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 +214,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;
|
||||||
@@ -256,6 +230,7 @@ public abstract class AEBaseBlock extends Block
|
|||||||
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 +253,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,19 +278,6 @@ 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 )
|
|
||||||
{
|
|
||||||
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 )
|
||||||
{
|
{
|
||||||
@@ -329,21 +291,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 +330,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 +337,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 +413,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;
|
||||||
@@ -66,16 +67,15 @@ public class AEBaseItemBlock extends ItemBlock
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
@SuppressWarnings( "unchecked" )
|
public final void addInformation( final ItemStack itemStack, final World world, final List<String> toolTip, final ITooltipFlag advancedTooltips )
|
||||||
public final void addInformation( final ItemStack itemStack, final EntityPlayer player, final List toolTip, final boolean advancedTooltips )
|
|
||||||
{
|
{
|
||||||
this.addCheckedInformation( itemStack, 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 +126,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,13 +23,15 @@ 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;
|
||||||
|
|
||||||
import appeng.api.config.AccessRestriction;
|
import appeng.api.config.AccessRestriction;
|
||||||
|
import appeng.api.config.Actionable;
|
||||||
import appeng.api.config.PowerUnits;
|
import appeng.api.config.PowerUnits;
|
||||||
import appeng.api.definitions.IBlockDefinition;
|
import appeng.api.definitions.IBlockDefinition;
|
||||||
import appeng.api.implementations.items.IAEItemPowerStorage;
|
import appeng.api.implementations.items.IAEItemPowerStorage;
|
||||||
@@ -48,9 +50,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,70 +63,43 @@ 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()
|
|
||||||
{
|
|
||||||
final Block blockID = Block.getBlockFromItem( this );
|
|
||||||
final IBlockDefinition energyCell = Api.INSTANCE.definitions().blocks().energyCell();
|
|
||||||
return energyCell.maybeBlock().map( block -> {
|
|
||||||
if( blockID == block )
|
|
||||||
{
|
|
||||||
return 200000;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return 8 * 200000;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
).orElse( 0 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double injectAEPower( final ItemStack is, double amt )
|
public double injectAEPower( final ItemStack is, double amount, Actionable mode )
|
||||||
{
|
{
|
||||||
double internalCurrentPower = this.getInternal( is );
|
final double internalCurrentPower = this.getInternal( is );
|
||||||
final double internalMaxPower = this.getMaxEnergyCapacity();
|
final double internalMaxPower = this.getAEMaxPower( is );
|
||||||
internalCurrentPower += amt;
|
final double required = internalMaxPower - internalCurrentPower;
|
||||||
if( internalCurrentPower > internalMaxPower )
|
final double overflow = Math.max( 0, amount - required );
|
||||||
|
|
||||||
|
if( mode == Actionable.MODULATE )
|
||||||
{
|
{
|
||||||
amt = internalCurrentPower - internalMaxPower;
|
final double toAdd = Math.min( required, amount );
|
||||||
internalCurrentPower = internalMaxPower;
|
final double newPowerStored = internalCurrentPower + toAdd;
|
||||||
this.setInternal( is, internalCurrentPower );
|
|
||||||
return amt;
|
this.setInternal( is, newPowerStored );
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setInternal( is, internalCurrentPower );
|
return overflow;
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
private double getInternal( final ItemStack is )
|
|
||||||
{
|
|
||||||
final NBTTagCompound nbt = Platform.openNbtData( is );
|
|
||||||
return nbt.getDouble( "internalCurrentPower" );
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setInternal( final ItemStack is, final double amt )
|
|
||||||
{
|
|
||||||
final NBTTagCompound nbt = Platform.openNbtData( is );
|
|
||||||
nbt.setDouble( "internalCurrentPower", amt );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double extractAEPower( final ItemStack is, double amt )
|
public double extractAEPower( final ItemStack is, double amount, Actionable mode )
|
||||||
{
|
{
|
||||||
double internalCurrentPower = this.getInternal( is );
|
final double internalCurrentPower = this.getInternal( is );
|
||||||
if( internalCurrentPower > amt )
|
final double fulfillable = Math.min( amount, internalCurrentPower );
|
||||||
|
|
||||||
|
if( mode == Actionable.MODULATE )
|
||||||
{
|
{
|
||||||
internalCurrentPower -= amt;
|
final double newPowerStored = internalCurrentPower - fulfillable;
|
||||||
this.setInternal( is, internalCurrentPower );
|
|
||||||
return amt;
|
this.setInternal( is, newPowerStored );
|
||||||
}
|
}
|
||||||
|
|
||||||
amt = internalCurrentPower;
|
return fulfillable;
|
||||||
this.setInternal( is, 0 );
|
|
||||||
return amt;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -144,4 +119,34 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
|
|||||||
{
|
{
|
||||||
return AccessRestriction.WRITE;
|
return AccessRestriction.WRITE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private double getMaxEnergyCapacity()
|
||||||
|
{
|
||||||
|
final Block blockID = Block.getBlockFromItem( this );
|
||||||
|
final IBlockDefinition energyCell = Api.INSTANCE.definitions().blocks().energyCell();
|
||||||
|
|
||||||
|
return energyCell.maybeBlock().map( block ->
|
||||||
|
{
|
||||||
|
if( blockID == block )
|
||||||
|
{
|
||||||
|
return 200000;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 8 * 200000;
|
||||||
|
}
|
||||||
|
} ).orElse( 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
private double getInternal( final ItemStack is )
|
||||||
|
{
|
||||||
|
final NBTTagCompound nbt = Platform.openNbtData( is );
|
||||||
|
return nbt.getDouble( "internalCurrentPower" );
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setInternal( final ItemStack is, final double amt )
|
||||||
|
{
|
||||||
|
final NBTTagCompound nbt = Platform.openNbtData( is );
|
||||||
|
nbt.setDouble( "internalCurrentPower", amt );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ public abstract class AEBaseStairBlock extends BlockStairs
|
|||||||
@Override
|
@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
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user