Compare commits

...
Author SHA1 Message Date
Martin Robertz d5c4e9217b update 2024-05-06 18:28:40 +02:00
LuluTheDog 6610499e7c Added GoG Skybox support for all dimensions (#42)
* Added GoG Skybox support for all dimensions

- Added a boolean to toggle the feature to the config
- Added an int array to contain the dimension you would like to recieve the Skybox

-Changed the GoG Skybox render check to include above changes

Basically this allows you to display the Garden of Glass in any dimension you wish, instead of just in the overworld. I like to use this to have the skybox in my personal void dimension.

* Changed dimension ID to HashSet

- Changed the dimension ID handling from int[] to a HashSet of Integers

-Added loadPropIntSet()

Im sorry if there is better ways to handle the loading of the IDs from the file, this is what i was able to come up with, if theres a way to directly save a set to file please do tell
2024-05-06 18:27:49 +02:00
Martin Robertz ebcca54ad4 update 2024-03-24 13:12:23 +01:00
Abdiel Kavash 89237f644a Optimize Alf Portal logic (#49) 2024-03-24 08:17:05 +01:00
Martin Robertz 052041f846 update 2024-03-08 18:24:33 +01:00
Glease 8f1d0abbeb fix elv portal treating lexicon as illegal item (#47) 2024-03-07 11:04:18 +01:00
Martin Robertz d179ee57e9 update 2024-02-21 13:27:26 +01:00
Батьків Нестор-Євген Васильович 1e2c85f898 Bug fix and small refactor (#45) 2024-02-21 13:26:57 +01:00
Батьків Нестор-Євген Васильович f1900cd9b3 The ring of ikoL awakens! (#43)
* moving master block dont reset structure

* Add mirroring

* opsie

* Mirror look

* Mirror final round

* refractor + new hud message

* Cost balancing

* F*ck you idea, you are not my homie now

* Thanks idea, love you

* Thanks Raven

* This should be it
2024-02-18 10:57:54 +01:00
Martin Robertz 398af04ea5 update 2024-02-18 10:50:52 +01:00
Jason Mitchell d5beca8e52 Reduce number of item copies. Backport from 1.12 https://github.com/VazkiiMods/Botania/commit/8595d27f4181f11006586442e42e03988a329c58 (#44) 2024-02-17 16:07:32 -08:00
Raven Szewczyk db3e5b6388 [ci skip] upgraded build system 2024-02-04 19:57:14 +00:00
Martin Robertz 177cb6af04 update bs+deps 2024-01-29 18:44:42 +01:00
Jason Mitchell 0c89751e53 Keep a cache of time uniforms instead of querying them every time (#41) 2024-01-29 18:42:27 +01:00
Martin Robertz 98cb2bb68c update bs+deps 2024-01-17 21:57:17 +01:00
Батьків Нестор-Євген Васильович 7d615a0ceb Clarify some misunderstanding (#39) 2024-01-17 21:56:24 +01:00
Martin Robertz d2be71b4e3 update bs+deps 2024-01-11 23:00:07 +01:00
Raven Szewczyk d03a0c697c [ci skip] upgraded build system 2024-01-08 21:24:18 +00:00
Martin Robertz e8da80454b update bs+deps 2023-11-05 12:50:35 +01:00
Hubry 272075dd51 Fix Alfheim portal storing items not used in recipes (VazkiiMods/Botania#2721)
* Fix VazkiiMods/Botania#2403 (Alfheim portal storing items not used in recipes)

Possibly mitigates VazkiiMods/Botania#2669, as recipe checks are a bit simplified to not
create stack copies posting capability events and the portal will not
check items with no uses more than once.

* Don't teleport bread, Bord.
2023-11-04 19:24:45 +08:00
Martin Robertz 56bd18670f update bs+deps 2023-10-30 08:30:07 +01:00
Ryan Nasers 29f0c6af40 This fixes Botania creative tab breaking and shouldn't affect the ring itself (#34)
* This fixes creative tab breaking and shouldn't affect the ring itself

* Adding change suggest by OneEyeMaker, placed check for tag compound inside of isRingEnabled and isRingBreaking methods.

* Forgot that bit. :)
2023-10-29 21:23:06 +01:00
Ryan Nasers 5ed33dfa4f Adding mushroom bag and minor refactor (#33)
* Refactors flower bag into a generic bag
* Adds a mushroom bag
2023-10-29 21:20:52 +01:00
Dream-MasterXXL 7a74dabcea fix wildcard imports 2023-10-09 23:18:50 +02:00
Dream-MasterXXL 68518a7858 update bs+deps 2023-10-09 22:56:33 +02:00
LewisSaber f83cd1ab0b Made letter purple instead of dark blue 2023-10-06 20:57:28 +02:00
LewisSaber 5595d0377c I love you combuster 2023-10-06 20:57:28 +02:00
LewisSaber 6c4d37a345 compressed 2 keybinds, added tooltip 2023-10-06 20:57:28 +02:00
LewisSaber 77e14f3c8a I love identation I love identation I love identation I love identation I love identation I love identation I love identation 2023-10-06 20:57:28 +02:00
LewisSaber 71e00772b7 identation 2023-10-06 20:57:28 +02:00
LewisSaber cf60696c68 Add keybind to clear selected blocks
also stop selected blocks from drawing with ring turned off
2023-10-06 20:57:28 +02:00
Martin Robertz d24f3facfe update gradle 2023-09-16 20:06:16 +02:00
Батьків Нестор-Євген Васильович 5cdf19daac Add Breaking To Ring Of Loki (#31)
Add Breaking to Ring of Loki
2023-09-16 20:00:47 +02:00
Pyromanc3r 93e6a1f7ba Updated Russian localization (#30)
* Updated Russian localization

The mod is now fully translated

* перевод подправлен

* доп. правки

* доп. правки2
2023-07-22 17:05:54 +02:00
梅天佑 1039b52854 Fixes a dupe with the crafting halos
adds a check that will be redundant for 99% of items (#29)
2023-05-17 22:17:37 +02:00
quentin452 33a26a5059 Fix tps lag in orespawn dimensions caused by the onSpawn methods (#28)
* Fix tps lag introduced by onSpawn methods

Especially in Orespawn dimensions like unstable dimension theses methods destroys tps before

Tested in my modpack

spark profiler before : ~ 13 ms
https://spark.lucko.me/6KkG1Tq4Su

spark profiler after :  ~ 8.5 ms
https://spark.lucko.me/6m2vv9Hb1X

However, originals versions may be more appropriate in some situations where you need to find all players in a given area rather than the closest player.

* Revert "Fix tps lag introduced by onSpawn methods"

This reverts commit 76a23a28db.

* Fix tps lags in orespawn dimension
2023-05-05 20:02:07 +02:00
Dane Strandboge 5ba45cb86d Fix Lexica Botania handling of GT tools (#27)
* fix tool handling in lexicon, improve oredict display

* update buildscript

* fix missed wrapper update, manually fix formatting (since no spotless)
2023-05-01 22:38:21 +02:00
Батьків Нестор-Євген Васильович 2f47326c7f Fix ring of loki range (#26)
Moves the player closer to the target in question so that some items' range safety checks will pass with the ring's extended reach.
2023-04-28 20:16:35 +02:00
Батьків Нестор-Євген Васильович 876b18328d Ring of loki improvement (#25)
* fix deps

* make ring trigger block activation

* remove runtime dep

* AdReSs ReVieW
2023-04-24 20:24:17 +02:00
Martin Robertz 391406e1de update gradle+BS 2023-03-17 19:34:41 +01:00
Zereff06 dfaa6dde5a Mobs not spawning on blocks (#23)
and config to disable this
2023-02-06 21:31:32 +01:00
Raven Szewczyk c14b5d4ddb [ci skip] upgraded build system 2023-01-31 09:51:31 +00:00
Jason Mitchell c90e492a66 [ci skip] Update buildscript to RetroFuturaGradle 2023-01-29 10:49:19 -08:00
AlexCatze 8a5fa6c441 Make flowers enabled by default (#22)
PR like #21 but for flowers. This will helpful to players, who using this fork of botania outside of any modpacks. This will not affect GTNH modpack(and other modpacks) because they are alredy have Botania.cfg. Also in config descripton sayed that this option should be 2 by default: "The quantity of Botania flower patches to generate in the world, defaults to 2, the lower the number the less patches generate.".
2023-01-03 18:11:43 +01:00
AlexCatze 3caf8954ad Make default recipes enabled by default (#21)
As said in description of this option, this is expert option. And, i think, recipes should be enabled by default for non-expert users. Modpack author will disable it, if needed. But it will be hard for common user to adress why there are no recipes.
2023-01-01 13:32:32 +01:00
Maxim 09ccf50fde Fix accidental double toggle of ring of loki (#20) 2022-12-30 00:17:34 +01:00
jss2a98ajandMartin Robertz 54f79398b1 Prevent Botania's bauble item tooltips breaking in some situations (#19)
* Fixed bauble tooltips breaking with certain bindings

Prevents some items tooltips and in-inventory rendering from breaking if the Baubles key is unbound, bound to a mouse button, or an abnormal keyboard key.

* update BS

Co-authored-by: Martin Robertz <dream-master@gmx.net>
2022-12-28 00:45:29 +01:00
Glease 84e758e450 fix memory leak in ManaNetworkHandler 2022-10-19 10:25:10 -07:00
Martin Robertz 751640ccec Merge pull request #17 from Kiwi233/master
Update zh_CN.lang
2022-09-24 12:40:48 +02:00
[Kiwi233] 4013121abf Update zh_CN.lang 2022-09-24 11:29:02 +08:00
Martin Robertz 9be15c8ecd Merge pull request #16 from GTNewHorizons/QuickFixLoki
Fix Loki Ring text being wrong most of the time on servers
2022-09-20 22:58:00 +02:00
BlueWeabo 0c87c31d1d revert to old text get method 2022-09-20 23:37:10 +03:00
BlueWeabo b25ef783b3 remove unneeded variable 2022-09-20 23:24:30 +03:00
BlueWeabo b2b13d9328 FixLokiText 2022-09-20 19:42:57 +03:00
Martin Robertz 9e0c82ce36 Merge pull request #15 from GTNewHorizons/KeybindForRingOfLoki
Adds a keybind to the Ring of Loki
2022-09-15 22:22:52 +02:00
BlueWeabo b002bbdd44 more ordering
think this is the last one
2022-09-15 21:05:02 +03:00
BlueWeabo d33b0cc836 ordering and fixing server crash 2022-09-15 20:35:53 +03:00
BlueWeabo 5d5277c50b add the keybind 2022-09-14 11:06:21 +03:00
Martin Robertz a3345d26d3 Merge pull request #14 from GTNewHorizons/elven-nbt-revert
Revert partial NBT match for elven recipes
2022-08-24 19:27:40 +02:00
miozune 6dce0d9e7b Revert partial NBT match for elven recipes 2022-08-25 02:05:56 +09:00
Martin Robertz 6826c25e30 Merge pull request #13 from GTNewHorizons/worldgen-black-white
Add whitelist and blacklist for generating flowers / mushrooms
2022-08-19 13:22:34 +02:00
Martin Robertz 528a9a4010 Update settings.gradle 2022-08-19 13:19:10 +02:00
miozune c6f94fabc9 updateBuildScript & disableSpotless 2022-08-19 17:53:25 +09:00
miozune 443aa9733b Revert "updateBuildScript & spotlessApply"
This reverts commit 9bf784e82c.
2022-08-19 16:50:37 +09:00
miozune 9bf784e82c updateBuildScript & spotlessApply 2022-08-19 11:52:26 +09:00
miozune 21ce111286 Add whitelist and blacklist for generating flowers / mushrooms 2022-08-19 11:48:24 +09:00
Jason Mitchell 19a4028e94 [ci skip] Migrate github actions to GTNH-Actions-Workflows 2022-07-16 10:47:08 -07:00
Martin Robertz ef026803d4 Merge pull request #12 from GTNewHorizons/terrapick-harvestlevel
Set harvest level for Terra Shatterer based on mana tier
2022-06-29 18:29:41 +02:00
miozune a5e1140a2b Set harvest level for Terra Shatterer based on mana tier 2022-06-29 19:33:23 +09:00
Martin Robertz 8648533ca9 Merge pull request #11 from GTNewHorizons/elven-dummy
Hide dummy recipes from Elven NEI handler
2022-05-25 23:48:58 +02:00
miozune d9042019e5 address reviews 2022-05-04 13:12:36 +09:00
miozune 538256cc45 ic2 maven 2022-05-02 19:37:23 +09:00
miozune 8b85a621e1 Hide dummy recipes from Elven NEI handler 2022-05-02 19:21:37 +09:00
Martin Robertz 12de9b630d Merge pull request #10 from GTNewHorizons/nbt-again
Remove dependency on GTNH fork of NEI
2022-03-05 12:25:56 +01:00
miozune 7102cc427f Remove dependency on GTNH fork of NEI 2022-02-27 12:51:56 +09:00
Martin Robertz 27053bfeab Merge pull request #4 from GTNewHorizons/nbt-nei
Fix irrelevant flowers show up in NEI
2022-02-25 12:17:48 +01:00
Martin Robertz da9019451b Merge pull request #7 from GTNewHorizons/allow-higher-potion-limit
Remove the >127 potion limit for known bugfixing coremods
2022-02-21 17:35:18 +01:00
Marcel '(Com)Buster' Sondaar b8f7f4ee03 Remove the >127 potion limit for known bugfixing coremods 2022-02-20 22:08:13 +01:00
Martin Robertz fe754d3733 Merge pull request #6 from GTNewHorizons/fix-recipe-ordering
Fix recipe ordering
2022-02-20 13:25:00 +01:00
Marcel '(Com)Buster' Sondaar 8c685b42bc Merge branch 'gtnh-master' into fix-recipe-ordering 2022-02-20 12:56:39 +01:00
Marcel '(Com)Buster' Sondaar a7fb7e7b7d Force recipes with catalysts to be on top of the search queue 2022-02-20 01:35:54 +01:00
miozune c0b8fffc40 Fix irrelevant flowers show up in NEI 2022-02-19 12:17:10 +09:00
Martin Robertz 208c74d877 Merge pull request #3 from GTNewHorizons/maven
update and optimize buildscripts
2022-02-13 13:09:54 +01:00
bombcar 74f0f48fd7 update and optimize buildscripts 2022-02-12 21:30:56 -06:00
Jason Mitchell 548ddfff1f update to explicit dependencies 2022-01-19 08:15:02 -08:00
Jason Mitchell c60e696f13 maven publish buildscript update 2022-01-19 08:14:04 -08:00
Martin Robertz 6a9362fa5e Merge pull request #2 from GTNewHorizons/gtnh
Gtnh
2022-01-01 20:01:06 +01:00
(Com)buster ba438bf6bd Fix a NPE crash in the lexicon search
(cherry picked from commit d7aa7e4241d3a694e56c6c55c0375305a9ee7ace)
2022-01-01 18:57:45 +01:00
(Com)buster bd2be73856 Fixes for recipe editing: lÂexicon in general and apothecary oredicting,itemblocks, and API updates in particular
(cherry picked from commit 594b0bb4622e4662ea5fe454396fb55ad90e55b2)
2022-01-01 18:57:32 +01:00
(Com)buster 3527358443 Make the lexica botanica recipe-change proof
(cherry picked from commit 672394cc6d12b7b8edca922468d1f96284ff5088)
2022-01-01 18:57:23 +01:00
Martin Robertz 0ef2be2398 add bat files to ignore list 2022-01-01 18:55:59 +01:00
Martin Robertz fcab91f992 Merge pull request #1 from GTNewHorizons/upgrade-build-script
Upgrade build script
2021-12-10 14:41:29 +01:00
Johann Bernhardt 6e13ea3fd8 Fix server crash 2021-12-10 13:23:02 +01:00
Johann Bernhardt 8a84eb32e4 Remove unused binary 2021-12-10 12:35:03 +01:00
Johann Bernhardt accc2ecbb5 Remove internal update mechanism because the pack is updated by GTNH team 2021-12-10 12:19:07 +01:00
Johann Bernhardt ade0ef263b Stripped copied dependencies and refactored them into gradle dependencies 2021-12-10 12:04:51 +01:00
Johann Bernhardt c0136f3078 Draft for unified build script 2021-12-10 11:53:51 +01:00
DreamMasterXXL f348b53fb7 add(Botania)libs
add Baubles as lib
2020-07-27 19:54:12 +02:00
DreamMasterXXL dfe4d1e849 fix(Batania)gradle
add newer gradle wrapper
update forge version to 1614
update gitignore
2020-07-27 19:49:56 +02:00
Vasco Lavos eb37715da2 Update contributors.properties 2016-08-30 01:03:06 +01:00
Vasco Lavos 86793652a1 Update contributors.properties 2016-08-10 16:56:41 +01:00
Vasco Lavos 980f854518 Update contributors.properties 2016-07-04 21:10:51 +01:00
Vasco Lavos 82cf90ce4c Update contributors.properties 2016-07-04 16:34:36 +01:00
Jonathan Smith 5495271fa2 Merge pull request #1849 from NatsuArashi/patch-3
Update zh_TW.lang
2016-05-18 10:49:15 +01:00
NatsuArashi 588a02f385 Update zh_TW.lang
*部分日本語使用原文
2016-05-18 17:39:27 +08:00
Vasco Lavos da11e497fc Update contributors.properties 2016-04-22 02:41:54 +01:00
Jonathan Smith 3fb76acf57 Merge pull request #1835 from elbo2525/master
Update ja_JP.lang
2016-04-07 09:42:02 +01:00
elbo2525 2471642df7 Update ja_JP.lang 2016-04-07 15:53:52 +09:00
Vasco Lavos e122e5252c Update contributors.properties 2016-04-02 21:39:55 +01:00
Vasco Lavos 66a5c5e578 Merge pull request #1828 from yrsegal/master
Add a color function to the RenderTileFloatingFlower
2016-03-18 02:05:07 +00:00
wiiv fcb394bba3 Better textures. (Take 1) 2016-03-18 01:47:56 +00:00
yrsegal e174144937 Add a color function to the RenderTileFloatingFlower
Derivative classes can use it (allows for rainbow floating flowers)
2016-03-17 21:26:39 -04:00
Vasco Lavos 19e226780d memes 2016-03-12 00:43:33 +00:00
Jonathan Smith 6f6cdf8198 Merge pull request #1823 from NatsuArashi/patch-2
Update zh_TW.lang
2016-03-03 11:58:48 +00:00
NatsuArashi 132584e937 Update zh_TW.lang 2016-03-03 18:10:04 +08:00
Vasco Lavos f8a4018ec7 Build 249 2016-02-25 19:53:29 +00:00
Vasco Lavos 0ee62f53e3 Added back the passive decay time config. 2016-02-25 19:32:36 +00:00
Vasco Lavos fd5606d02d Merge pull request #1775 from the-vindex/master
Added support for StorageDrawers and Deep Storage API
2016-02-25 19:20:13 +00:00
Vasco Lavos 94d94b6c79 Merge pull request #1811 from elbo2525/master
Add ja_JP.lang
2016-02-25 19:20:04 +00:00
Jonathan Smith 52db87735a Merge pull request #1815 from 3TUSK/zh_CN_update
Update zh_CN.lang to latest ver.
2016-02-22 14:07:55 +00:00
Urey.X c9281021b6 Update zh_CN.lang to latest ver.
Also archived the old translation at the end of file.
2016-02-22 08:24:26 -05:00
elbo2525 d5a3a056f5 Add ja_JP.lang 2016-02-21 10:51:46 +09:00
Jonathan Smith 3d5a8aab19 Merge pull request #1810 from NatsuArashi/patch-1
Update zh_TW.lang
2016-02-19 17:14:01 +00:00
NatsuArashi 0c75bc9356 Update zh_TW.lang 2016-02-19 20:32:48 +08:00
TheWhiteWolves b0fe511fc8 Add the Clayconia Petite (X & Z range 2, Y range 1), Closes #1805 2016-02-13 01:09:21 +00:00
Jonathan Smith fc9470777b Merge pull request #1802 from yrsegal/master
Multiparts now work on both the client and the server.
2016-02-11 12:10:36 +00:00
yrsegal a0d0f2ba65 Multiparts now work on both the client and the server. 2016-02-10 16:57:20 -05:00
Vasco Lavos 044e61f73f Merge pull request #1801 from Vazkii/revert-1800-master
Revert "Multiparts now work on both the client and the server."
2016-02-10 21:49:31 +00:00
Vasco Lavos abc7756a9b Revert "Multiparts now work on both the client and the server." 2016-02-10 21:49:26 +00:00
Jonathan Smith c8a01f7da0 Merge pull request #1800 from yrsegal/master
Multiparts now work on both the client and the server.
2016-02-10 21:48:58 +00:00
yrsegal 59b177e231 Multiparts now work on both the client and the server. 2016-02-10 13:51:31 -05:00
Jonathan Smith 27a5991350 Merge pull request #1798 from isochronous/lex-botania-lang_en-corrections
Lexica Botania lang_en corrections
2016-02-10 08:03:22 +00:00
Jeremy McLeod e0023c0566 Corrected spelling & grammar in Lexica Botania for:
- Manastorm Charge
- Teru Teru Bozu
- Mana Blaster
- Rod of the Lands
- Manasteel Equipment
- Terrasteel Armor
- Terra Shatterer
2016-02-09 19:42:56 -05:00
Jonathan Smith 6135f44792 Merge pull request #1788 from isochronous/patch-1
Fixed a typo
2016-02-05 00:08:26 +00:00
Jeremy McLeod 5270f5ea20 Fixed a typo
adjusted != adjacent
2016-02-04 15:20:30 -05:00
Jonathan Smith ea10c48439 Merge pull request #1783 from nekosune/master
Added quartz variants to Ore Dictionary
2016-02-02 22:05:43 +00:00
nekosune 3593d4b759 Added quartz variants to Ore Dictionary 2016-02-02 21:59:03 +00:00
nekosune 9e37f37c53 Added quartz variants to Ore Dictionary 2016-02-02 21:40:38 +00:00
Vasco Lavos f0f372205c Update contributors.properties 2016-02-02 17:35:45 +00:00
Jonathan Smith 7bfeef18a9 Merge pull request #1782 from PikadudeNo1/patch-1
Fixed Marimorphosises having incorrect downward range
2016-02-01 14:55:50 +00:00
Pikadude No. 1 9a60705967 Fixed Marimorphosises having incorrect downward range 2016-02-01 04:45:47 -08:00
Jonathan Smith 0e617e6046 Merge pull request #1781 from howtonotwin/inkwellfix
Newly infused mana inkwells show durability bar
2016-02-01 09:38:19 +00:00
Rasheeq d32ce6c519 Newly infused mana inkwells show durability bar
No more confused players!
Also fixes williewillus/Botania#91.
2016-01-31 20:54:54 -05:00
Jonathan Smith e0293afad0 Merge pull request #1779 from NatsuArashi/patch-15
Update zh_TW.lang
2016-01-29 09:13:18 +00:00
NatsuArashi dfb2ef2a61 Update zh_TW.lang 2016-01-29 16:08:29 +08:00
Vindex f44d846d32 Added support for StorageDrawers and Deep Storage API 2016-01-24 22:44:30 +01:00
TheWhiteWolves 74d4130ba5 Add some default entities from vanilla and botania to the gravity rod blacklist 2016-01-24 17:39:04 +00:00
262 changed files with 9606 additions and 6697 deletions

No files matched your search

+44
View File
@@ -0,0 +1,44 @@
* text eol=lf
*.[jJ][aA][rR] binary
*.[pP][nN][gG] binary
*.[jJ][pP][gG] binary
*.[jJ][pP][eE][gG] binary
*.[gG][iI][fF] binary
*.[tT][iI][fF] binary
*.[tT][iI][fF][fF] binary
*.[iI][cC][oO] binary
*.[sS][vV][gG] text
*.[eE][pP][sS] binary
*.[xX][cC][fF] binary
*.[kK][aA][rR] binary
*.[mM]4[aA] binary
*.[mM][iI][dD] binary
*.[mM][iI][dD][iI] binary
*.[mM][pP]3 binary
*.[oO][gG][gG] binary
*.[rR][aA] binary
*.7[zZ] binary
*.[gG][zZ] binary
*.[tT][aA][rR] binary
*.[tT][gG][zZ] binary
*.[zZ][iI][pP] binary
*.[tT][cC][nN] binary
*.[sS][oO] binary
*.[dD][lL][lL] binary
*.[dD][yY][lL][iI][bB] binary
*.[pP][sS][dD] binary
*.[tT][tT][fF] binary
*.[oO][tT][fF] binary
*.[pP][aA][tT][cC][hH] -text
*.[bB][aA][tT] text eol=crlf
*.[cC][mM][dD] text eol=crlf
*.[pP][sS]1 text eol=crlf
*[aA][uU][tT][oO][gG][eE][nN][eE][rR][aA][tT][eE][dD]* binary
+33
View File
@@ -0,0 +1,33 @@
#!/usr/bin/env bash
RUNDIR="run"
CRASH="crash-reports"
SERVERLOG="server.log"
if [[ -d $RUNDIR/$CRASH ]]; then
echo "Crash reports detected:"
cat $RUNDIR/$CRASH/crash*.txt
exit 1
fi
if grep --quiet "Fatal errors were detected" $SERVERLOG; then
echo "Fatal errors detected:"
cat server.log
exit 1
fi
if grep --quiet "The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED" $SERVERLOG; then
echo "Server force stopped:"
cat server.log
exit 1
fi
if ! grep --quiet -Po '.+Done \(.+\)\! For help, type "help" or "\?"' $SERVERLOG; then
echo "Server didn't finish startup:"
cat server.log
exit 1
fi
echo "No crash reports detected"
exit 0
+13
View File
@@ -0,0 +1,13 @@
name: Build and test
on:
pull_request:
branches: [ master, main ]
push:
branches: [ master, main ]
jobs:
build-and-test:
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/build-and-test.yml@master
secrets: inherit
+14
View File
@@ -0,0 +1,14 @@
name: Release tagged build
on:
push:
tags: [ '*' ]
permissions:
contents: write
jobs:
release-tags:
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/release-tags.yml@master
secrets: inherit
+32 -61
View File
@@ -1,61 +1,32 @@
## Windows
Thumbs.db
## gradle
/.gradle
/build
## ForgeGradle
/run
## eclipse
/.settings
/.metadata
/.classpath
/.project
/eclipse
/bin
## intellij
/out
/.idea
/atlassian-ide-plugin.xml
/*.ipr
/*.iws
/*.iml
## Private Stuffs
/private.properties
## Jars
*.jar
!/gradle/wrapper/gradle-wrapper.jar
!GardenOfGlass.jar
### OSX (adds a lot of garbage)###
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
.gradle
.settings
/.idea/
/.vscode/
/run/
/build/
/eclipse/
.classpath
.project
/bin/
/config/
/crash-reports/
/logs/
options.txt
/saves/
usernamecache.json
banned-ips.json
banned-players.json
eula.txt
ops.json
server.properties
servers.dat
usercache.json
whitelist.json
/out/
*.iml
*.ipr
*.iws
src/main/resources/mixins.*.json
*.bat
*.DS_Store
!gradlew.bat
+3
View File
@@ -0,0 +1,3 @@
# Any Github changes require admin approval
/.github/** @GTNewHorizons/admin
BIN
View File
Binary file not shown.
-2
View File
@@ -1,2 +0,0 @@
sh gradlew
pause
+4 -219
View File
@@ -1,220 +1,5 @@
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
}
//version: 1707058017
plugins {
id 'com.gtnewhorizons.gtnhconvention'
}
repositories {
maven {
name = "chickenbones"
url = "http://chickenbones.net/maven/"
}
}
apply plugin: 'forge'
apply plugin: 'curseforge'
ext.configFile = file('build.properties')
ext.config = parseConfig(configFile)
ext.priv = parseConfig(file('private.properties'))
version = "${config.version}-${config.build_number}"
group = "vazkii.botania" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = config.mod_name
minecraft {
version = "${config.mc_version}-${config.forge_version}"
assetDir = "eclipse/assets"
//This, does the token replacement.
//Though, I reccomend this to be replaced with a token such as @VERSION@
replace 'GRADLE:BUILD', config.build_number
replace 'GRADLE:VERSION', config.version
replaceIn 'LibMisc.java' //I may have missed another file, though I can only find it in here.
}
//This here is for SCP
repositories {
mavenCentral()
}
configurations {
sshAntTask
}
//End of the SCP config
dependencies {
compile files(
'Baubles-deobf.jar'
)
compile "codechicken:CodeChickenLib:1.7.10-1.1.1.109:dev"
compile "codechicken:CodeChickenCore:1.7.10-1.0.2.9:dev"
compile "codechicken:NotEnoughItems:1.7.10-1.0.2.15:dev"
compile "codechicken:ForgeMultipart:1.7.10-1.1.1.320:dev"
//and a bit more for SCP
sshAntTask "org.apache.ant:ant-jsch:1.7.1", "jsch:jsch:0.1.29"
}
processResources {
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand 'version': project.version, 'mcversion': project.minecraft.version
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info', '**/psd/**'
}
}
/**
* These, go outside of the processResources {}* Though, this was added with the NEI intergation commit (8bf4680)
*/
task deobfJar(type: Jar) {
from(sourceSets.main.output)
archiveName = "${baseName} ${version}-deobf.${extension}"
}
artifacts {
archives deobfJar
}
/**
* Increments the buildnumber in your config file, and saves it
*/
task incrementBuildNumber(dependsOn: 'reobf') << {
config.build_number = (config.build_number.toString().toInteger()) + 1
configFile.withWriter {
config.toProperties().store(it, "")
}
file('web/versions.ini').append("\n${version}=${minecraft.version}")
file("${config.dir_repo}/version/${minecraft.version}.txt").write("${version}")
}
// I have no idea what I'm doing
task wtfGradle2(type: Copy) {
from(jar.destinationDir)
into file("${config.dir_output}/wtf")
}
// Seriously, I'm desperate to make this work
task wtfGradle1(type: Delete) {
dependsOn "wtfGradle2"
delete "${config.dir_output}/wtf/${deobfJar.archiveName}"
}
task output(type: Copy) {
dependsOn "wtfGradle1"
from(jar.destinationDir)
into file(config.dir_output)
}
task outputDeobf(type: Copy) {
dependsOn "output"
from(config.dir_output) {
include deobfJar.archiveName
}
into file("${config.dir_output}/deobf")
}
task forgecraft(type: Copy) {
dependsOn "outputDeobf"
from "${config.dir_output}/wtf"
into file(priv.dir_forgecraft)
}
task sort(type: Delete) {
dependsOn "forgecraft"
delete "${config.dir_output}/${deobfJar.archiveName}", "${config.dir_output}/wtf"
}
/**
* This is the upload task from the build.xml
*/
task upload() << {
scp('/files') {
fileset(file: jar.archivePath)
}
scp('/files/deobf') {
fileset(file: deobfJar.archivePath)
}
scp('/') {
fileset(file: 'web/changelog.txt')
fileset(file: 'web/versions.ini')
}
}
/**
* This is deply_web task
*/
task deployWeb << {
scp('/') {
fileset(dir: 'web') //everything from the web directory
}
}
def scp(String dir, Closure antFileset = {}) {
ant {
taskdef(
name: 'scp',
classname: 'org.apache.tools.ant.taskdefs.optional.ssh.Scp',
classpath: configurations.sshAntTask.asPath)
String dirstr = priv.scp_dir + dir
Map scpArgs = [
todir : dirstr,
password : priv.scp_pass,
sftp: true,
trust: 'yes'
]
delegate.scp(scpArgs) {
antFileset.delegate = delegate
antFileset()
}
}
}
def parseConfig(File config) {
config.withReader {
def prop = new Properties()
prop.load(it)
return (new ConfigSlurper().parse(prop))
}
}
jar {
//rename the default output, for some better... sanity with scipts
archiveName = "${baseName} ${version}.${extension}"
}
curse {
apiKey = priv.cfkey
projectId = "225643"
changelog = """
See http://botaniamod.net/changelog.php#${version}
"""
releaseType = "release"
relatedProject 'baubles': 'requiredLibrary'
}
defaultTasks 'clean', 'build', 'sort', 'forgecraft', 'incrementBuildNumber', 'curse', 'upload'
-9
View File
@@ -1,9 +0,0 @@
#
#Fri Jan 08 18:17:27 GMT 2016
version=r1.8
dir_output=../Build Output/Botania/
mc_version=1.7.10
forge_version=10.13.2.1291
dir_repo=./
build_number=249
mod_name=Botania
-55
View File
@@ -1,55 +0,0 @@
# Devs
#vazkii=6
wiiv=marimorphosis
dylangk=munchdew
# Cool People
sl1pg8r=endoflame
direwolf20=thermalily
#wayofflowingtime=fallenKanade
wtfgeeks=daybloom
spitefulfox=tainthistle
gideonseymour=arcaneRose
#pahimar=medumone
# Flower Designers
jadedcat=jadedAmaranthus
pokefenn=hydroangeas
finvaara=bubbell
flaxbeard=kekimurus
# Patrons
devinpath=9
cheriekeks=6
orangeninja1=1
disbedan015=14
djcosmic2=3
utoxin=2
evrlost=10
belathus=1
vicceyr=0
superfortress=3
nematrec=15
pika_craft=3
lanman14444=13
noclassdeffound=9
emba=0
jordsta95=6
kei_kouma=15
megatronp=15
thorantin=6
fletchstudios=6
donaber=4
agamemnom=15
dqmhose=13
fma_winry=2
luckylucyf=14
epiczeus=7
fredfrog1234=15
pjfranke=5
_bloop=0
kgevans=15
l0nekitsune=14
swiftlileagle=14
gryphonn=11
loraanicus=10
+18
View File
@@ -0,0 +1,18 @@
// Add your dependencies here
dependencies {
compile('com.github.GTNewHorizons:Baubles:1.0.4:dev')
compile('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
compileOnly('com.github.GTNewHorizons:Railcraft:9.15.8:api') {transitive=false}
compileOnly('com.github.GTNewHorizons:StorageDrawers:1.13.5-GTNH:api') {transitive=false}
compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.4.8:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.6.0-GTNH:dev')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.39:api') {transitive=false}
compile('com.github.GTNewHorizons:GTNHLib:0.2.11:dev')
compileOnly('curse.maven:cofh-lib-220333:2388748')
compileOnly('curse.maven:minefactory-reloaded-66672:2366150')
}
-1
View File
@@ -1 +0,0 @@
sh gradlew deployWeb
-56
View File
@@ -1,56 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="2">
<profile kind="CleanUpProfile" name="BotaniaCleanup" version="2">
<setting id="cleanup.remove_unused_private_fields" value="true"/>
<setting id="cleanup.always_use_parentheses_in_expressions" value="false"/>
<setting id="cleanup.never_use_blocks" value="false"/>
<setting id="cleanup.remove_unused_private_methods" value="true"/>
<setting id="cleanup.add_missing_deprecated_annotations" value="true"/>
<setting id="cleanup.convert_to_enhanced_for_loop" value="true"/>
<setting id="cleanup.remove_unnecessary_nls_tags" value="true"/>
<setting id="cleanup.sort_members" value="false"/>
<setting id="cleanup.remove_unused_local_variables" value="true"/>
<setting id="cleanup.never_use_parentheses_in_expressions" value="true"/>
<setting id="cleanup.remove_unused_private_members" value="true"/>
<setting id="cleanup.remove_unnecessary_casts" value="true"/>
<setting id="cleanup.make_parameters_final" value="false"/>
<setting id="cleanup.use_this_for_non_static_field_access" value="true"/>
<setting id="cleanup.remove_private_constructors" value="true"/>
<setting id="cleanup.use_blocks" value="false"/>
<setting id="cleanup.always_use_this_for_non_static_method_access" value="false"/>
<setting id="cleanup.remove_trailing_whitespaces_all" value="true"/>
<setting id="cleanup.always_use_this_for_non_static_field_access" value="false"/>
<setting id="cleanup.use_this_for_non_static_field_access_only_if_necessary" value="true"/>
<setting id="cleanup.add_default_serial_version_id" value="false"/>
<setting id="cleanup.make_type_abstract_if_missing_method" value="false"/>
<setting id="cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class" value="true"/>
<setting id="cleanup.make_variable_declarations_final" value="false"/>
<setting id="cleanup.add_missing_nls_tags" value="false"/>
<setting id="cleanup.format_source_code" value="false"/>
<setting id="cleanup.qualify_static_method_accesses_with_declaring_class" value="false"/>
<setting id="cleanup.add_missing_override_annotations" value="true"/>
<setting id="cleanup.remove_unused_private_types" value="true"/>
<setting id="cleanup.add_missing_methods" value="false"/>
<setting id="cleanup.make_local_variable_final" value="true"/>
<setting id="cleanup.correct_indentation" value="true"/>
<setting id="cleanup.add_missing_override_annotations_interface_methods" value="true"/>
<setting id="cleanup.remove_unused_imports" value="true"/>
<setting id="cleanup.remove_trailing_whitespaces_ignore_empty" value="false"/>
<setting id="cleanup.make_private_fields_final" value="true"/>
<setting id="cleanup.add_generated_serial_version_id" value="true"/>
<setting id="cleanup.organize_imports" value="true"/>
<setting id="cleanup.remove_trailing_whitespaces" value="true"/>
<setting id="cleanup.sort_members_all" value="false"/>
<setting id="cleanup.use_blocks_only_for_return_and_throw" value="false"/>
<setting id="cleanup.add_missing_annotations" value="true"/>
<setting id="cleanup.use_parentheses_in_expressions" value="true"/>
<setting id="cleanup.qualify_static_field_accesses_with_declaring_class" value="false"/>
<setting id="cleanup.use_this_for_non_static_method_access_only_if_necessary" value="true"/>
<setting id="cleanup.use_this_for_non_static_method_access" value="true"/>
<setting id="cleanup.qualify_static_member_accesses_through_instances_with_declaring_class" value="true"/>
<setting id="cleanup.add_serial_version_id" value="false"/>
<setting id="cleanup.format_source_code_changes_only" value="false"/>
<setting id="cleanup.qualify_static_member_accesses_with_declaring_class" value="true"/>
<setting id="cleanup.always_use_blocks" value="true"/>
</profile>
</profiles>
-20
View File
@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><templates><template autoinsert="false" context="gettercomment_context" deleted="false" description="Comment for getter method" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name="gettercomment"/><template autoinsert="false" context="settercomment_context" deleted="false" description="Comment for setter method" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.settercomment" name="settercomment"/><template autoinsert="false" context="constructorcomment_context" deleted="false" description="Comment for created constructors" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name="constructorcomment"/><template autoinsert="false" context="filecomment_context" deleted="false" description="Comment for created Java files" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.filecomment" name="filecomment">/**
* This class was created by &lt;Vazkii&gt;. It's distributed as
* part of the ${project_name} Mod. Get the Source Code in github:
* https://github.com/Vazkii/${project_name}
*
* ${project_name} is Open Source and distributed under the
* ${project_name} License: http://botaniamod.net/license.php
*
* File Created @ [${date}, ${time} (GMT)]
*/</template><template autoinsert="false" context="typecomment_context" deleted="false" description="Comment for created types" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.typecomment" name="typecomment"/><template autoinsert="false" context="fieldcomment_context" deleted="false" description="Comment for fields" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name="fieldcomment"/><template autoinsert="false" context="methodcomment_context" deleted="false" description="Comment for non-overriding methods" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name="methodcomment"/><template autoinsert="false" context="overridecomment_context" deleted="false" description="Comment for overriding methods" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name="overridecomment"/><template autoinsert="false" context="delegatecomment_context" deleted="false" description="Comment for delegate methods" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name="delegatecomment"/><template autoinsert="true" context="newtype_context" deleted="false" description="Newly created files" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.newtype" name="newtype">${filecomment}
${package_declaration}
${typecomment}
${type_declaration}</template><template autoinsert="true" context="classbody_context" deleted="false" description="Code in new class type bodies" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.classbody" name="classbody">
</template><template autoinsert="true" context="interfacebody_context" deleted="false" description="Code in new interface type bodies" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name="interfacebody">
</template><template autoinsert="true" context="enumbody_context" deleted="false" description="Code in new enum type bodies" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.enumbody" name="enumbody">
</template><template autoinsert="true" context="annotationbody_context" deleted="false" description="Code in new annotation type bodies" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name="annotationbody">
</template><template autoinsert="true" context="catchblock_context" deleted="false" description="Code in new catch blocks" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.catchblock" name="catchblock">// ${todo} Auto-generated catch block
${exception_var}.printStackTrace();</template><template autoinsert="false" context="methodbody_context" deleted="false" description="Code in created method stubs" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.methodbody" name="methodbody"/><template autoinsert="true" context="constructorbody_context" deleted="false" description="Code in created constructor stubs" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name="constructorbody">${body_statement}
// ${todo} Auto-generated constructor stub</template><template autoinsert="true" context="getterbody_context" deleted="false" description="Code in created getters" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.getterbody" name="getterbody">return ${field};</template><template autoinsert="true" context="setterbody_context" deleted="false" description="Code in created setters" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.setterbody" name="setterbody">${field} = ${param};</template></templates>
+192
View File
@@ -0,0 +1,192 @@
# ExampleMod tag to use as Blowdryer (Spotless, etc.) settings version, leave empty to disable.
# LOCAL to test local config updates.
gtnh.settings.blowdryerTag = 0.2.0
# Human-readable mod name, available for mcmod.info population.
modName = Botania
# Case-sensitive identifier string, available for mcmod.info population and used for automatic mixin JSON generation.
# Conventionally lowercase.
modId = Botania
# Root package of the mod, used to find various classes in other properties,
# mcmod.info substitution, enabling assertions in run tasks, etc.
modGroup = vazkii.botania
# Whether to use modGroup as the maven publishing group.
# Due to a history of using JitPack, the default is com.github.GTNewHorizons for all mods.
useModGroupForPublishing = false
# Updates your build.gradle and settings.gradle automatically whenever an update is available.
autoUpdateBuildScript = false
# Version of Minecraft to target
minecraftVersion = 1.7.10
# Version of Minecraft Forge to target
forgeVersion = 10.13.4.1614
# Specify an MCP channel for dependency deobfuscation and the deobfParams task.
channel = stable
# Specify an MCP mappings version for dependency deobfuscation and the deobfParams task.
mappingsVersion = 12
# Defines other MCP mappings for dependency deobfuscation.
remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/
# Select a default username for testing your mod. You can always override this per-run by running
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
developmentEnvironmentUserName = Developer
# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8.
# See https://github.com/bsideup/jabel for details on how this works.
enableModernJavaSyntax = false
# Enables injecting missing generics into the decompiled source code for a better coding experience.
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
enableGenericInjection = false
# Generate a class with a String field for the mod version named as defined below.
# If generateGradleTokenClass is empty or not missing, no such class will be generated.
# If gradleTokenVersion is empty or missing, the field will not be present in the class.
generateGradleTokenClass =
# Name of the token containing the project's current version to generate/replace.
gradleTokenVersion = GRADLETOKEN_VERSION
# [DEPRECATED] Mod ID replacement token.
gradleTokenModId =
# [DEPRECATED] Mod name replacement token.
gradleTokenModName =
# [DEPRECATED] Mod Group replacement token.
gradleTokenGroupName =
# [DEPRECATED]
# Multiple source files can be defined here by providing a comma-separated list: Class1.java,Class2.java,Class3.java
# public static final String VERSION = "GRADLETOKEN_VERSION";
# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's
# version in @Mod([...], version = VERSION, [...]).
# Leave these properties empty to skip individual token replacements.
replaceGradleTokenInFile = LibMisc.java
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
# leave this property empty.
# Example value: (apiPackage = api) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.api
apiPackage = api
# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/
# There can be multiple files in a space-separated list.
# Example value: mymodid_at.cfg nei_at.cfg
accessTransformersFile = botania_at.cfg
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
usesMixins = false
# Adds some debug arguments like verbose output and class export.
usesMixinDebug = false
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
mixinPlugin =
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
mixinsPackage =
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
# This parameter is for legacy compatibility only
# Example value: (coreModClass = asm.FMLPlugin) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.asm.FMLPlugin
coreModClass =
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
containsMixinsAndOrCoreModOnly = false
# Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins.
forceEnableMixins = false
# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated into your jar. It is your
# responsibility to check the license and request permission for distribution if required.
usesShadowedDependencies = false
# If disabled, won't remove unused classes from shadowed dependencies. Some libraries use reflection to access
# their own classes, making the minimization unreliable.
minimizeShadowedDependencies = true
# If disabled, won't rename the shadowed classes.
relocateShadowedDependencies = true
# Adds the GTNH maven, CurseMaven, Modrinth, and some more well-known 1.7.10 repositories.
includeWellKnownRepositories = true
# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven.
# Authenticate with the MAVEN_USER and MAVEN_PASSWORD environment variables.
# If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle.
usesMavenPublishing = true
# Maven repository to publish the mod to.
# mavenPublishUrl = https\://nexus.gtnewhorizons.com/repository/releases/
# Publishing to Modrinth requires you to set the MODRINTH_TOKEN environment variable to your current Modrinth API token.
#
# The project's ID on Modrinth. Can be either the slug or the ID.
# Leave this empty if you don't want to publish to Modrinth.
modrinthProjectId =
# The project's relations on Modrinth. You can use this to refer to other projects on Modrinth.
# Syntax: scope1-type1:name1;scope2-type2:name2;...
# Where scope can be one of [required, optional, incompatible, embedded],
# type can be one of [project, version],
# and the name is the Modrinth project or version slug/id of the other mod.
# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true
modrinthRelations =
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
#
# The project's numeric ID on CurseForge. You can find this in the About Project box.
# Leave this empty if you don't want to publish on CurseForge.
curseForgeProjectId =
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
# Syntax: type1:name1;type2:name2;...
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
# and the name is the CurseForge project slug of the other mod.
# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
curseForgeRelations =
# Optional parameter to customize the produced artifacts. Use this to preserve artifact naming when migrating older
# projects. New projects should not use this parameter.
# customArchiveBaseName =
# Optional parameter to have the build automatically fail if an illegal version is used.
# This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'.
# The check is ONLY performed if the version is a git tag.
# Note: the specified string must be escaped, so e.g. 1\\.1\\.\\d+ instead of 1\.1\.\d+
# versionPattern =
# Uncomment to prevent the source code from being published.
# noPublishedSources = true
# Uncomment this to disable Spotless checks.
# This should only be uncommented to keep it easier to sync with upstream/other forks.
# That is, if there is no other active fork/upstream, NEVER change this.
disableSpotless = true
# Uncomment this to disable Checkstyle checks (currently wildcard import check).
# disableCheckstyle = true
# Override the IDEA build type. Valid values are: "" (leave blank, do not override), "idea" (force use native IDEA build), "gradle"
# (force use delegated build).
# This is meant to be set in $HOME/.gradle/gradle.properties.
# e.g. add "systemProp.org.gradle.project.ideaOverrideBuildType=idea" will override the build type to be native build.
# WARNING: If you do use this option, it will overwrite whatever you have in your existing projects. This might not be what you want!
# Usually there is no need to uncomment this here as other developers do not necessarily use the same build type as you.
# ideaOverrideBuildType = idea
# Whether IDEA should run spotless checks when pressing the Build button.
# This is meant to be set in $HOME/.gradle/gradle.properties.
# ideaCheckSpotlessOnBuild = true
Binary file not shown.
+7 -6
View File
@@ -1,6 +1,7 @@
#Mon Oct 27 18:34:11 EDT 2014
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.1-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+205 -118
View File
@@ -1,162 +1,249 @@
#!/usr/bin/env bash
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Attempt to set APP_HOME
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
MAX_FD=maximum
warn ( ) {
warn () {
echo "$*"
}
} >&2
die ( ) {
die () {
echo
echo "$*"
echo
exit 1
}
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"
Vendored
+92
View File
@@ -0,0 +1,92 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
+2
View File
@@ -0,0 +1,2 @@
before_install:
- ./gradlew setupCIWorkspace
-4
View File
@@ -1,4 +0,0 @@
scp_dir=
scp_pass=
cfkey=
dir_forgecraft=../Build Output/Botania/
+22
View File
@@ -0,0 +1,22 @@
repositories {
maven {
name 'GTNH Maven'
url 'http://jenkins.usrv.eu:8081/nexus/content/groups/public/'
allowInsecureProtocol
}
maven {
name 'ic2'
url 'https://maven.ic2.player.to/'
url 'https://maven2.ic2.player.to/'
metadataSources {
mavenPom()
artifact()
}
}
maven {
url 'https://cursemaven.com'
}
maven {
url 'https://jitpack.io'
}
}
+23
View File
@@ -0,0 +1,23 @@
pluginManagement {
repositories {
maven {
// RetroFuturaGradle
name "GTNH Maven"
url "https://nexus.gtnewhorizons.com/repository/public/"
mavenContent {
includeGroup("com.gtnewhorizons")
includeGroupByRegex("com\\.gtnewhorizons\\..+")
}
}
gradlePluginPortal()
mavenCentral()
mavenLocal()
}
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.22'
}
@@ -1,60 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.core;
import java.lang.reflect.Method;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public final class BCLog {
public static final Logger logger = LogManager.getLogger("BuildCraft");
/**
* Deactivate constructor
*/
private BCLog() {
}
public static void initLog() {
logger.info("Starting BuildCraft " + getVersion());
logger.info("Copyright (c) SpaceToad, 2011-2015");
logger.info("http://www.mod-buildcraft.com");
}
public static void logErrorAPI(String mod, Throwable error, Class<?> classFile) {
StringBuilder msg = new StringBuilder(mod);
msg.append(" API error, please update your mods. Error: ").append(error);
StackTraceElement[] stackTrace = error.getStackTrace();
if (stackTrace.length > 0) {
msg.append(", ").append(stackTrace[0]);
}
logger.log(Level.ERROR, msg.toString());
if (classFile != null) {
msg = new StringBuilder(mod);
msg.append(" API error: ").append(classFile.getSimpleName()).append(" is loaded from ").append(classFile.getProtectionDomain().getCodeSource().getLocation());
logger.log(Level.ERROR, msg.toString());
}
}
public static String getVersion() {
try {
Class<?> clazz = Class.forName("buildcraft.core.Version");
Method method = clazz.getDeclaredMethod("getVersion");
return String.valueOf(method.invoke(null));
} catch (Exception e) {
return "UNKNOWN VERSION";
}
}
}
@@ -1,115 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.core;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
/**
* This class is a comparable container for integer block positions.
*/
public class BlockIndex implements Comparable<BlockIndex> {
public int x;
public int y;
public int z;
public BlockIndex() {
}
/**
* Creates an index for a block located on x, y. z
*/
public BlockIndex(int x, int y, int z) {
this.x = x;
this.y = y;
this.z = z;
}
public BlockIndex(NBTTagCompound c) {
this.x = c.getInteger("i");
this.y = c.getInteger("j");
this.z = c.getInteger("k");
}
public BlockIndex(Entity entity) {
x = (int) Math.floor(entity.posX);
y = (int) Math.floor(entity.posY);
z = (int) Math.floor(entity.posZ);
}
public BlockIndex(TileEntity entity) {
this(entity.xCoord, entity.yCoord, entity.zCoord);
}
/**
* Provides a deterministic and complete ordering of block positions.
*/
@Override
public int compareTo(BlockIndex o) {
if (o.x < x) {
return 1;
} else if (o.x > x) {
return -1;
} else if (o.z < z) {
return 1;
} else if (o.z > z) {
return -1;
} else if (o.y < y) {
return 1;
} else if (o.y > y) {
return -1;
} else {
return 0;
}
}
public void writeTo(NBTTagCompound c) {
c.setInteger("i", x);
c.setInteger("j", y);
c.setInteger("k", z);
}
public Block getBlock(World world) {
return world.getBlock(x, y, z);
}
@Override
public String toString() {
return "{" + x + ", " + y + ", " + z + "}";
}
@Override
public boolean equals(Object obj) {
if (obj instanceof BlockIndex) {
BlockIndex b = (BlockIndex) obj;
return b.x == x && b.y == y && b.z == z;
}
return false;
}
@Override
public int hashCode() {
return (x * 37 + y) * 37 + z;
}
public boolean nextTo(BlockIndex blockIndex) {
return (Math.abs(blockIndex.x - x) <= 1 && blockIndex.y == y && blockIndex.z == z)
|| (blockIndex.x == x && Math.abs(blockIndex.y - y) <= 1 && blockIndex.z == z)
|| (blockIndex.x == x && blockIndex.y == y && Math.abs(blockIndex.z - z) <= 1);
}
}
@@ -1,45 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.core;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
import net.minecraft.block.Block;
import net.minecraft.world.World;
public final class BuildCraftAPI {
public static ICoreProxy proxy;
public static final Set<Block> softBlocks = new HashSet<Block>();
public static final HashMap<String, IWorldProperty> worldProperties = new HashMap<String, IWorldProperty>();
/**
* Deactivate constructor
*/
private BuildCraftAPI() {
}
public static IWorldProperty getWorldProperty(String name) {
return worldProperties.get(name);
}
public static void registerWorldProperty(String name, IWorldProperty property) {
if (worldProperties.containsKey(name)) {
BCLog.logger.warn("The WorldProperty key '" + name + "' is being overidden with " + property.getClass().getSimpleName() + "!");
}
worldProperties.put(name, property);
}
public static boolean isSoftBlock(World world, int x, int y, int z) {
return worldProperties.get("soft").get(world, x, y, z);
}
}
@@ -1,201 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.core;
import java.util.Locale;
import java.util.Random;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public enum EnumColor {
BLACK,
RED,
GREEN,
BROWN,
BLUE,
PURPLE,
CYAN,
LIGHT_GRAY,
GRAY,
PINK,
LIME,
YELLOW,
LIGHT_BLUE,
MAGENTA,
ORANGE,
WHITE;
public static final EnumColor[] VALUES = values();
public static final String[] DYES = {
"dyeBlack",
"dyeRed",
"dyeGreen",
"dyeBrown",
"dyeBlue",
"dyePurple",
"dyeCyan",
"dyeLightGray",
"dyeGray",
"dyePink",
"dyeLime",
"dyeYellow",
"dyeLightBlue",
"dyeMagenta",
"dyeOrange",
"dyeWhite"};
public static final String[] NAMES = {
"Black",
"Red",
"Green",
"Brown",
"Blue",
"Purple",
"Cyan",
"LightGray",
"Gray",
"Pink",
"Lime",
"Yellow",
"LightBlue",
"Magenta",
"Orange",
"White"};
public static final int[] DARK_HEX = {
0x2D2D2D,
0xA33835,
0x394C1E,
0x5C3A24,
0x3441A2,
0x843FBF,
0x36809E,
0x888888,
0x444444,
0xE585A0,
0x3FAA36,
0xCFC231,
0x7F9AD1,
0xFF64FF,
0xFF6A00,
0xFFFFFF};
public static final int[] LIGHT_HEX = {
0x181414,
0xBE2B27,
0x007F0E,
0x89502D,
0x253193,
0x7e34bf,
0x299799,
0xa0a7a7,
0x7A7A7A,
0xD97199,
0x39D52E,
0xFFD91C,
0x66AAFF,
0xD943C6,
0xEA7835,
0xe4e4e4};
@SideOnly(Side.CLIENT)
private static IIcon[] brushIcons;
public int getDarkHex() {
return DARK_HEX[ordinal()];
}
public int getLightHex() {
return LIGHT_HEX[ordinal()];
}
public static EnumColor fromId(int id) {
if (id < 0 || id >= VALUES.length) {
return WHITE;
}
return VALUES[id];
}
public static EnumColor fromDye(String dyeTag) {
for (int id = 0; id < DYES.length; id++) {
if (DYES[id].equals(dyeTag)) {
return VALUES[id];
}
}
return null;
}
public static EnumColor fromName(String name) {
for (int id = 0; id < NAMES.length; id++) {
if (NAMES[id].equals(name)) {
return VALUES[id];
}
}
return null;
}
public static EnumColor getRand() {
return VALUES[new Random().nextInt(VALUES.length)];
}
public EnumColor getNext() {
EnumColor next = VALUES[(ordinal() + 1) % VALUES.length];
return next;
}
public EnumColor getPrevious() {
EnumColor previous = VALUES[(ordinal() + VALUES.length - 1) % VALUES.length];
return previous;
}
public EnumColor inverse() {
return EnumColor.VALUES[15 - ordinal()];
}
public String getTag() {
return "color." + name().replace("_", ".").toLowerCase(Locale.ENGLISH);
}
public String getBasicTag() {
return name().replace("_", ".").toLowerCase(Locale.ENGLISH);
}
public String getName() {
return NAMES[ordinal()];
}
public String getLocalizedName() {
return StatCollector.translateToLocal(getTag());
}
public String getDye() {
return DYES[ordinal()];
}
@Override
public String toString() {
String s = name().replace("_", " ");
String[] words = s.split(" ");
StringBuilder b = new StringBuilder();
for (String word : words) {
b.append(word.charAt(0)).append(word.substring(1).toLowerCase(Locale.ENGLISH)).append(" ");
}
return b.toString().trim();
}
public static void setIconArray(IIcon[] icons) {
brushIcons = icons;
}
@SideOnly(Side.CLIENT)
public IIcon getIcon() {
return brushIcons [ordinal()];
}
}
@@ -1,31 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.core;
/**
* To be implemented by TileEntities able to provide a square area on the world, typically BuildCraft markers.
*/
public interface IAreaProvider {
int xMin();
int yMin();
int zMin();
int xMax();
int yMax();
int zMax();
/**
* Remove from the world all objects used to define the area.
*/
void removeFromWorld();
}
@@ -1,23 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.core;
public interface IBox extends IZone {
IBox expand(int amount);
IBox contract(int amount);
Position pMin();
Position pMax();
void createLaserData();
}
@@ -1,18 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.core;
import java.lang.ref.WeakReference;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.WorldServer;
public interface ICoreProxy {
WeakReference<EntityPlayer> getBuildCraftPlayer(WorldServer world);
}
@@ -1,31 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.core;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public interface IIconProvider {
/**
* @param iconIndex
*/
@SideOnly(Side.CLIENT)
IIcon getIcon(int iconIndex);
/**
* A call for the provider to register its Icons. This may be called multiple times but should only be executed once per provider
* @param iconRegister
*/
@SideOnly(Side.CLIENT)
void registerIcons(IIconRegister iconRegister);
}
@@ -1,32 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.core;
import net.minecraft.item.ItemStack;
public interface IInvSlot {
/**
* Returns the slot number of the underlying Inventory.
*
* @return the slot number
*/
int getIndex();
boolean canPutStackInSlot(ItemStack stack);
boolean canTakeStackFromSlot(ItemStack stack);
boolean isItemValidForSlot(ItemStack stack);
ItemStack decreaseStackInSlot(int amount);
ItemStack getStackInSlot();
void setStackInSlot(ItemStack stack);
}
@@ -1,8 +0,0 @@
package buildcraft.api.core;
import net.minecraft.nbt.NBTTagCompound;
public interface INBTStoreable {
void readFromNBT(NBTTagCompound tag);
void writeToNBT(NBTTagCompound tag);
}
@@ -1,10 +0,0 @@
package buildcraft.api.core;
import java.util.List;
/**
* To be implemented by TileEntities able to provide a path on the world, typically BuildCraft path markers.
*/
public interface IPathProvider {
List<BlockIndex> getPath();
}
@@ -1,30 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.api.core;
import io.netty.buffer.ByteBuf;
/**
* Implemented by classes representing serializable packet state
*/
public interface ISerializable {
/**
* Serializes the state to the stream
*
* @param data
*/
void writeData(ByteBuf data);
/**
* Deserializes the state from the stream
*
* @param data
*/
void readData(ByteBuf data);
}
@@ -1,17 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.core;
import net.minecraft.world.World;
public interface IWorldProperty {
boolean get(World world, int x, int y, int z);
void clear();
}
@@ -1,23 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.core;
import java.util.Random;
public interface IZone {
double distanceTo(BlockIndex index);
double distanceToSquared(BlockIndex index);
boolean contains(double x, double y, double z);
BlockIndex getRandomBlockIndex(Random rand);
}
@@ -1,43 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.core;
import java.util.Arrays;
public final class JavaTools {
private JavaTools(){
}
public static <T> T[] concat(T[] first, T[] second) {
T[] result = Arrays.copyOf(first, first.length + second.length);
System.arraycopy(second, 0, result, first.length, second.length);
return result;
}
public static int[] concat(int[] first, int[] second) {
int[] result = Arrays.copyOf(first, first.length + second.length);
System.arraycopy(second, 0, result, first.length, second.length);
return result;
}
public static float[] concat(float[] first, float[] second) {
float[] result = Arrays.copyOf(first, first.length + second.length);
System.arraycopy(second, 0, result, first.length, second.length);
return result;
}
public static String surroundWithQuotes(String stringToSurroundWithQuotes) {
return String.format("\"%s\"", stringToSurroundWithQuotes);
}
public static String stripSurroundingQuotes(String stringToStripQuotes) {
return stringToStripQuotes.replaceAll("^\"|\"$", "");
}
}
@@ -1,200 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.core;
import io.netty.buffer.ByteBuf;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
public class Position implements ISerializable {
public double x, y, z;
public ForgeDirection orientation;
public Position() {
x = 0;
y = 0;
z = 0;
orientation = ForgeDirection.UNKNOWN;
}
public Position(double ci, double cj, double ck) {
x = ci;
y = cj;
z = ck;
orientation = ForgeDirection.UNKNOWN;
}
public Position(double ci, double cj, double ck, ForgeDirection corientation) {
x = ci;
y = cj;
z = ck;
orientation = corientation;
if (orientation == null) {
orientation = ForgeDirection.UNKNOWN;
}
}
public Position(Position p) {
x = p.x;
y = p.y;
z = p.z;
orientation = p.orientation;
}
public Position(NBTTagCompound nbttagcompound) {
readFromNBT(nbttagcompound);
}
public Position(TileEntity tile) {
x = tile.xCoord;
y = tile.yCoord;
z = tile.zCoord;
orientation = ForgeDirection.UNKNOWN;
}
public Position(BlockIndex index) {
x = index.x;
y = index.y;
z = index.z;
orientation = ForgeDirection.UNKNOWN;
}
public void moveRight(double step) {
switch (orientation) {
case SOUTH:
x = x - step;
break;
case NORTH:
x = x + step;
break;
case EAST:
z = z + step;
break;
case WEST:
z = z - step;
break;
default:
}
}
public void moveLeft(double step) {
moveRight(-step);
}
public void moveForwards(double step) {
switch (orientation) {
case UP:
y = y + step;
break;
case DOWN:
y = y - step;
break;
case SOUTH:
z = z + step;
break;
case NORTH:
z = z - step;
break;
case EAST:
x = x + step;
break;
case WEST:
x = x - step;
break;
default:
}
}
public void moveBackwards(double step) {
moveForwards(-step);
}
public void moveUp(double step) {
switch (orientation) {
case SOUTH:
case NORTH:
case EAST:
case WEST:
y = y + step;
break;
default:
}
}
public void moveDown(double step) {
moveUp(-step);
}
public void writeToNBT(NBTTagCompound nbttagcompound) {
if (orientation == null) {
orientation = ForgeDirection.UNKNOWN;
}
nbttagcompound.setDouble("i", x);
nbttagcompound.setDouble("j", y);
nbttagcompound.setDouble("k", z);
nbttagcompound.setByte("orientation", (byte) orientation.ordinal());
}
public void readFromNBT(NBTTagCompound nbttagcompound) {
x = nbttagcompound.getDouble("i");
y = nbttagcompound.getDouble("j");
z = nbttagcompound.getDouble("k");
orientation = ForgeDirection.values() [nbttagcompound.getByte("orientation")];
}
@Override
public String toString() {
return "{" + x + ", " + y + ", " + z + "}";
}
public Position min(Position p) {
return new Position(p.x > x ? x : p.x, p.y > y ? y : p.y, p.z > z ? z : p.z);
}
public Position max(Position p) {
return new Position(p.x < x ? x : p.x, p.y < y ? y : p.y, p.z < z ? z : p.z);
}
public boolean isClose(Position newPosition, float f) {
double dx = x - newPosition.x;
double dy = y - newPosition.y;
double dz = z - newPosition.z;
double sqrDis = dx * dx + dy * dy + dz * dz;
return !(sqrDis > f * f);
}
@Override
public void readData(ByteBuf stream) {
x = stream.readDouble();
y = stream.readDouble();
z = stream.readDouble();
orientation = ForgeDirection.getOrientation(stream.readByte());
}
@Override
public void writeData(ByteBuf stream) {
stream.writeDouble(x);
stream.writeDouble(y);
stream.writeDouble(z);
stream.writeByte(orientation.ordinal());
}
@Override
public int hashCode() {
return (51 * (int) x) + (13 * (int) y) + (int) z;
}
}
@@ -1,85 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.core;
import net.minecraft.world.World;
public class SafeTimeTracker {
private long lastMark = Long.MIN_VALUE;
private long duration = -1;
private long randomRange = 0;
private long lastRandomDelay = 0;
private long internalDelay = 1;
/**
* @deprecated should use constructors with parameters instead
*/
public SafeTimeTracker () {
}
public SafeTimeTracker (long delay) {
internalDelay = delay;
}
/**
* In many situations, it is a bad idea to have all objects of the same
* kind to be waiting for the exact same amount of time, as that can lead
* to some situation where they're all synchronized and got to work all
* at the same time. When created with a random range, the mark that is set
* when reaching the expect delay will be added with a random number
* between [0, range[, meaning that the event will take between 0 and range
* more tick to run.
*/
public SafeTimeTracker (long delay, long random) {
internalDelay = delay;
randomRange = random;
}
public boolean markTimeIfDelay(World world) {
return markTimeIfDelay(world, internalDelay);
}
/**
* Return true if a given delay has passed since last time marked was called
* successfully.
*
* @deprecated should use the constructor with a delay instead, and call
* this function without a parameter
*/
public boolean markTimeIfDelay(World world, long delay) {
if (world == null) {
return false;
}
long currentTime = world.getTotalWorldTime();
if (currentTime < lastMark) {
lastMark = currentTime;
return false;
} else if (lastMark + delay + lastRandomDelay <= currentTime) {
duration = currentTime - lastMark;
lastMark = currentTime;
lastRandomDelay = (int) (Math.random() * randomRange);
return true;
} else {
return false;
}
}
public long durationOfLastDelay() {
return duration > 0 ? duration : 0;
}
public void markTime(World world) {
lastMark = world.getTotalWorldTime();
}
}
@@ -1,134 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.core;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidStack;
/**
* This class is used whenever stacks needs to be stored as keys.
*/
public final class StackKey {
public final ItemStack stack;
public final FluidStack fluidStack;
public StackKey(FluidStack fluidStack) {
this(null, fluidStack);
}
public StackKey(ItemStack stack) {
this(stack, null);
}
public StackKey(ItemStack stack, FluidStack fluidStack) {
this.stack = stack;
this.fluidStack = fluidStack;
}
public static StackKey stack(Item item, int amount, int damage) {
return new StackKey(new ItemStack(item, amount, damage));
}
public static StackKey stack(Block block, int amount, int damage) {
return new StackKey(new ItemStack(block, amount, damage));
}
public static StackKey stack(Item item) {
return new StackKey(new ItemStack(item, 1, 0));
}
public static StackKey stack(Block block) {
return new StackKey(new ItemStack(block, 1, 0));
}
public static StackKey stack(ItemStack itemStack) {
return new StackKey(itemStack);
}
public static StackKey fluid(Fluid fluid, int amount) {
return new StackKey(new FluidStack(fluid, amount));
}
public static StackKey fluid(Fluid fluid) {
return new StackKey(new FluidStack(fluid, FluidContainerRegistry.BUCKET_VOLUME));
}
public static StackKey fluid(FluidStack fluidStack) {
return new StackKey(fluidStack);
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || o.getClass() != StackKey.class) {
return false;
}
StackKey k = (StackKey) o;
if ((stack == null ^ k.stack == null) || (fluidStack == null ^ k.fluidStack == null)) {
return false;
}
if (stack != null) {
if (stack.getItem() != k.stack.getItem() ||
stack.getHasSubtypes() && stack.getItemDamage() != k.stack.getItemDamage() ||
!objectsEqual(stack.getTagCompound(), k.stack.getTagCompound())) {
return false;
}
}
if (fluidStack != null) {
if (fluidStack.getFluid().getID() != k.fluidStack.getFluid().getID() ||
fluidStack.amount != k.fluidStack.amount ||
!objectsEqual(fluidStack.tag, k.fluidStack.tag)) {
return false;
}
}
return true;
}
@Override
public int hashCode() {
int result = 7;
if (stack != null) {
result = 31 * result + stack.getItem().hashCode();
result = 31 * result + stack.getItemDamage();
result = 31 * result + objectHashCode(stack.getTagCompound());
}
result = 31 * result + 7;
if (fluidStack != null) {
result = 31 * result + fluidStack.getFluid().getID();
result = 31 * result + fluidStack.amount;
result = 31 * result + objectHashCode(fluidStack.tag);
}
return result;
}
private boolean objectsEqual(Object o1, Object o2) {
if (o1 == null && o2 == null) {
return true;
} else if (o1 == null || o2 == null) {
return false;
} else {
return o1.equals(o2);
}
}
private int objectHashCode(Object o) {
return o != null ? o.hashCode() : 0;
}
public StackKey copy() {
return new StackKey(stack != null ? stack.copy() : null,
fluidStack != null ? fluidStack.copy() : null);
}
}
@@ -1,12 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
@API(apiVersion = "1.5", owner = "BuildCraft|Core", provides = "BuildCraftAPI|core")
package buildcraft.api.core;
import cpw.mods.fml.common.API;
@@ -1,32 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.api.core.render;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.common.util.ForgeDirection;
/*
* This interface designates a block as a state machine responsible for culling
* For implementation details look into FakeBlock implementation
*/
public interface ICullable {
//Side Rendering States
//They are used to effectively cull obstructed sides while processing facades.
//Make sure your implementation is correct otherwise expect FPS drop
void setRenderSide(ForgeDirection side, boolean render);
void setRenderAllSides();
boolean shouldSideBeRendered(IBlockAccess blockAccess, int x, int y, int z, int side);
void setRenderMask(int mask);
}
@@ -1,7 +0,0 @@
package buildcraft.api.core.render;
import net.minecraft.util.IIcon;
public interface ITextureStateManager {
void set(IIcon icon);
}
@@ -1,22 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.api.core.render;
import net.minecraft.block.Block;
import net.minecraft.util.IIcon;
public interface ITextureStates extends ICullable {
ITextureStateManager getTextureState();
IIcon getIcon(int side, int meta);
Block getBlock();
}
@@ -1,64 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.gates;
import java.util.List;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import buildcraft.api.statements.IActionInternal;
import buildcraft.api.statements.IStatement;
import buildcraft.api.statements.IStatementParameter;
import buildcraft.api.statements.ITriggerInternal;
public abstract class GateExpansionController {
public final IGateExpansion type;
public final TileEntity pipeTile;
public GateExpansionController(IGateExpansion type, TileEntity pipeTile) {
this.pipeTile = pipeTile;
this.type = type;
}
public IGateExpansion getType() {
return type;
}
public boolean isActive() {
return false;
}
public void tick(IGate gate) {
}
public void startResolution() {
}
public boolean resolveAction(IStatement action, int count) {
return false;
}
public boolean isTriggerActive(IStatement trigger, IStatementParameter[] parameters) {
return false;
}
public void addTriggers(List<ITriggerInternal> list) {
}
public void addActions(List<IActionInternal> list) {
}
public void writeToNBT(NBTTagCompound nbt) {
}
public void readFromNBT(NBTTagCompound nbt) {
}
}
@@ -1,66 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.gates;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import com.google.common.collect.HashBiMap;
import net.minecraft.item.ItemStack;
public final class GateExpansions {
private static final Map<String, IGateExpansion> expansions = new HashMap<String, IGateExpansion>();
private static final ArrayList<IGateExpansion> expansionIDs = new ArrayList<IGateExpansion>();
private static final Map<IGateExpansion, ItemStack> recipes = HashBiMap.create();
private GateExpansions() {
}
public static void registerExpansion(IGateExpansion expansion) {
registerExpansion(expansion.getUniqueIdentifier(), expansion);
}
public static void registerExpansion(String identifier, IGateExpansion expansion) {
expansions.put(identifier, expansion);
expansionIDs.add(expansion);
}
public static void registerExpansion(IGateExpansion expansion, ItemStack addedRecipe) {
registerExpansion(expansion.getUniqueIdentifier(), expansion);
recipes.put(expansion, addedRecipe);
}
public static IGateExpansion getExpansion(String identifier) {
return expansions.get(identifier);
}
public static Set<IGateExpansion> getExpansions() {
Set<IGateExpansion> set = new HashSet<IGateExpansion>();
set.addAll(expansionIDs);
return set;
}
public static Map<IGateExpansion, ItemStack> getRecipesForPostInit() {
return recipes;
}
// The code below is used by networking.
public static IGateExpansion getExpansionByID(int id) {
return expansionIDs.get(id);
}
public static int getExpansionID(IGateExpansion expansion) {
return expansionIDs.indexOf(expansion);
}
}
@@ -1,32 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.gates;
import java.util.List;
import buildcraft.api.statements.IStatement;
import buildcraft.api.statements.IStatementParameter;
import buildcraft.api.statements.StatementSlot;
import buildcraft.api.statements.containers.ISidedStatementContainer;
import buildcraft.api.transport.IPipe;
public interface IGate extends ISidedStatementContainer {
@Deprecated
void setPulsing(boolean pulse);
IPipe getPipe();
List<IStatement> getTriggers();
List<IStatement> getActions();
List<StatementSlot> getActiveActions();
List<IStatementParameter> getTriggerParameters(int index);
List<IStatementParameter> getActionParameters(int index);
}
@@ -1,30 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.gates;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
public interface IGateExpansion {
String getUniqueIdentifier();
String getDisplayName();
GateExpansionController makeController(TileEntity pipeTile);
void registerBlockOverlay(IIconRegister iconRegister);
void registerItemOverlay(IIconRegister iconRegister);
IIcon getOverlayBlock();
IIcon getOverlayItem();
}
@@ -1,12 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
@API(apiVersion = "4.1", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|gates")
package buildcraft.api.gates;
import cpw.mods.fml.common.API;
@@ -1,13 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.statements;
public class ActionState {
}
@@ -1,16 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.statements;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
public interface IActionExternal extends IStatement {
void actionActivate(TileEntity target, ForgeDirection side, IStatementContainer source, IStatementParameter[] parameters);
}
@@ -1,15 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.statements;
public interface IActionInternal extends IStatement {
void actionActivate(IStatementContainer source, IStatementParameter[] parameters);
}
@@ -1,28 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.statements;
import java.util.Collection;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
public interface IActionProvider {
/**
* Returns the list of actions that are available from the statement container holding the
* gate.
*/
Collection<IActionInternal> getInternalActions(IStatementContainer container);
/**
* Returns the list of actions available to a gate next to the given block.
*/
Collection<IActionExternal> getExternalActions(ForgeDirection side, TileEntity tile);
}
@@ -1,13 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.statements;
public interface IActionReceptor {
void actionActivated(IStatement statement, IStatementParameter[] parameters);
}
@@ -1,16 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.statements;
import java.util.List;
public interface IOverrideDefaultStatements {
List<ITriggerExternal> overrideTriggers();
List<IActionExternal> overrideActions();
}
@@ -1,56 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.statements;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public interface IStatement {
/**
* Every statement needs a unique tag, it should be in the format of
* "&lt;modid&gt;:&lt;name&gt;.
*
* @return the unique id
*/
String getUniqueTag();
@SideOnly(Side.CLIENT)
IIcon getIcon();
@SideOnly(Side.CLIENT)
void registerIcons(IIconRegister iconRegister);
/**
* Return the maximum number of parameter this statement can have, 0 if none.
*/
int maxParameters();
/**
* Return the minimum number of parameter this statement can have, 0 if none.
*/
int minParameters();
/**
* Return the statement description in the UI
*/
String getDescription();
/**
* Create parameters for the statement.
*/
IStatementParameter createParameter(int index);
/**
* This returns the statement after a left rotation. Used in particular in
* blueprints orientation.
*/
IStatement rotateLeft();
}
@@ -1,19 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.statements;
import net.minecraft.tileentity.TileEntity;
/**
* This is implemented by objects containing Statements, such as
* Gates and TileEntities.
*/
public interface IStatementContainer {
TileEntity getTile();
}
@@ -1,59 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.statements;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.IIcon;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public interface IStatementParameter {
/**
* Every parameter needs a unique tag, it should be in the format of
* "&lt;modi&gt;:&lt;name&gt;".
*
* @return the unique id
*/
String getUniqueTag();
@SideOnly(Side.CLIENT)
IIcon getIcon();
ItemStack getItemStack();
/**
* Something that is initially unintuitive: you HAVE to
* keep your icons as static variables, due to the fact
* that every IStatementParameter is instantiated upon creation,
* in opposition to IStatements which are singletons (due to the
* fact that they, unlike Parameters, store no additional data)
*/
@SideOnly(Side.CLIENT)
void registerIcons(IIconRegister iconRegister);
/**
* Return the parameter description in the UI
*/
String getDescription();
void onClick(IStatementContainer source, IStatement stmt, ItemStack stack, StatementMouseClick mouse);
void readFromNBT(NBTTagCompound compound);
void writeToNBT(NBTTagCompound compound);
/**
* This returns the parameter after a left rotation. Used in particular in
* blueprints orientation.
*/
IStatementParameter rotateLeft();
}
@@ -1,18 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.statements;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
public interface ITriggerExternal extends IStatement {
boolean isTriggerActive(TileEntity target, ForgeDirection side, IStatementContainer source, IStatementParameter[] parameters);
}
@@ -1,17 +0,0 @@
package buildcraft.api.statements;
import net.minecraftforge.common.util.ForgeDirection;
/**
* This interface can be used by tiles to override external trigger
* behaviour.
*
* Please use wisely.
*/
public interface ITriggerExternalOverride {
public enum Result {
TRUE, FALSE, IGNORE
}
Result override(ForgeDirection side, IStatementContainer source, IStatementParameter[] parameters);
}
@@ -1,15 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.statements;
public interface ITriggerInternal extends IStatement {
boolean isTriggerActive(IStatementContainer source, IStatementParameter[] parameters);
}
@@ -1,28 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.statements;
import java.util.Collection;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
public interface ITriggerProvider {
/**
* Returns the list of triggers that are available from the object holding the gate.
*/
Collection<ITriggerInternal> getInternalTriggers(IStatementContainer container);
/**
* Returns the list of triggers available to a gate next to the given block.
*/
Collection<ITriggerExternal> getExternalTriggers(ForgeDirection side, TileEntity tile);
}
@@ -1,182 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.statements;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.tileentity.TileEntity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraftforge.common.util.ForgeDirection;
public final class StatementManager {
public static Map<String, IStatement> statements = new HashMap<String, IStatement>();
public static Map<String, Class<? extends IStatementParameter>> parameters = new HashMap<String, Class<? extends IStatementParameter>>();
private static List<ITriggerProvider> triggerProviders = new LinkedList<ITriggerProvider>();
private static List<IActionProvider> actionProviders = new LinkedList<IActionProvider>();
/**
* Deactivate constructor
*/
private StatementManager() {
}
public static void registerTriggerProvider(ITriggerProvider provider) {
if (provider != null && !triggerProviders.contains(provider)) {
triggerProviders.add(provider);
}
}
public static void registerActionProvider(IActionProvider provider) {
if (provider != null && !actionProviders.contains(provider)) {
actionProviders.add(provider);
}
}
public static void registerStatement(IStatement statement) {
statements.put(statement.getUniqueTag(), statement);
}
public static void registerParameterClass(Class<? extends IStatementParameter> param) {
parameters.put(createParameter(param).getUniqueTag(), param);
}
@Deprecated
public static void registerParameterClass(String name, Class<? extends IStatementParameter> param) {
parameters.put(name, param);
}
public static List<ITriggerExternal> getExternalTriggers(ForgeDirection side, TileEntity entity) {
List<ITriggerExternal> result;
if (entity instanceof IOverrideDefaultStatements) {
result = ((IOverrideDefaultStatements) entity).overrideTriggers();
if (result != null) {
return result;
}
}
result = new LinkedList<ITriggerExternal>();
for (ITriggerProvider provider : triggerProviders) {
Collection<ITriggerExternal> toAdd = provider.getExternalTriggers(side, entity);
if (toAdd != null) {
for (ITriggerExternal t : toAdd) {
if (!result.contains(t)) {
result.add(t);
}
}
}
}
return result;
}
public static List<IActionExternal> getExternalActions(ForgeDirection side, TileEntity entity) {
List<IActionExternal> result = new LinkedList<IActionExternal>();
if (entity instanceof IOverrideDefaultStatements) {
result = ((IOverrideDefaultStatements) entity).overrideActions();
if (result != null) {
return result;
} else {
result = new LinkedList<IActionExternal>();
}
}
for (IActionProvider provider : actionProviders) {
Collection<IActionExternal> toAdd = provider.getExternalActions(side, entity);
if (toAdd != null) {
for (IActionExternal t : toAdd) {
if (!result.contains(t)) {
result.add(t);
}
}
}
}
return result;
}
public static List<ITriggerInternal> getInternalTriggers(IStatementContainer container) {
List<ITriggerInternal> result = new LinkedList<ITriggerInternal>();
for (ITriggerProvider provider : triggerProviders) {
Collection<ITriggerInternal> toAdd = provider.getInternalTriggers(container);
if (toAdd != null) {
for (ITriggerInternal t : toAdd) {
if (!result.contains(t)) {
result.add(t);
}
}
}
}
return result;
}
public static List<IActionInternal> getInternalActions(IStatementContainer container) {
List<IActionInternal> result = new LinkedList<IActionInternal>();
for (IActionProvider provider : actionProviders) {
Collection<IActionInternal> toAdd = provider.getInternalActions(container);
if (toAdd != null) {
for (IActionInternal t : toAdd) {
if (!result.contains(t)) {
result.add(t);
}
}
}
}
return result;
}
public static IStatementParameter createParameter(String kind) {
return createParameter(parameters.get(kind));
}
private static IStatementParameter createParameter(Class<? extends IStatementParameter> param) {
try {
return param.newInstance();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
return null;
}
/**
* Generally, this function should be called by every mod implementing
* the Statements API ***as a container*** (that is, adding its own gates)
* on the client side from a given Item of choice.
*/
@SideOnly(Side.CLIENT)
public static void registerIcons(IIconRegister register) {
for (IStatement statement : statements.values()) {
statement.registerIcons(register);
}
for (Class<? extends IStatementParameter> parameter : parameters.values()) {
createParameter(parameter).registerIcons(register);
}
}
}
@@ -1,27 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.statements;
public final class StatementMouseClick {
private int button;
private boolean shift;
public StatementMouseClick(int button, boolean shift) {
this.button = button;
this.shift = shift;
}
public boolean isShift() {
return shift;
}
public int getButton() {
return button;
}
}
@@ -1,88 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.statements;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.IIcon;
public class StatementParameterItemStack implements IStatementParameter {
protected ItemStack stack;
@Override
public IIcon getIcon() {
return null;
}
@Override
public ItemStack getItemStack() {
return stack;
}
@Override
public void onClick(IStatementContainer source, IStatement stmt, ItemStack stack, StatementMouseClick mouse) {
if (stack != null) {
this.stack = stack.copy();
this.stack.stackSize = 1;
} else {
this.stack = null;
}
}
@Override
public void writeToNBT(NBTTagCompound compound) {
if (stack != null) {
NBTTagCompound tagCompound = new NBTTagCompound();
stack.writeToNBT(tagCompound);
compound.setTag("stack", tagCompound);
}
}
@Override
public void readFromNBT(NBTTagCompound compound) {
stack = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("stack"));
}
@Override
public boolean equals(Object object) {
if (object instanceof StatementParameterItemStack) {
StatementParameterItemStack param = (StatementParameterItemStack) object;
return ItemStack.areItemStacksEqual(stack, param.stack)
&& ItemStack.areItemStackTagsEqual(stack, param.stack);
} else {
return false;
}
}
@Override
public String getDescription() {
if (stack != null) {
return stack.getDisplayName();
} else {
return "";
}
}
@Override
public String getUniqueTag() {
return "buildcraft:stack";
}
@Override
public void registerIcons(IIconRegister iconRegister) {
}
@Override
public IStatementParameter rotateLeft() {
return this;
}
}
@@ -1,36 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.api.statements;
public class StatementSlot {
public IStatement statement;
public IStatementParameter[] parameters;
@Override
public boolean equals(Object o) {
if (o == null || !(o instanceof StatementSlot)) {
return false;
}
StatementSlot s = (StatementSlot) o;
if (s.statement != statement || parameters.length != s.parameters.length) {
return false;
}
for (int i = 0; i < parameters.length; i++) {
IStatementParameter p1 = parameters[i];
IStatementParameter p2 = s.parameters[i];
if (p1 == null && p2 != null) {
return false;
}
if (!(p1.equals(p2))) {
return false;
}
}
return true;
}
}
@@ -1,19 +0,0 @@
package buildcraft.api.statements.containers;
import net.minecraftforge.common.util.ForgeDirection;
public interface IRedstoneStatementContainer {
/**
* Get the redstone input from a given side.
* @param side The side - use "UNKNOWN" for maximum input.
* @return The redstone input, from 0 to 15.
*/
int getRedstoneInput(ForgeDirection side);
/**
* Set the redstone input for a given side.
* @param side The side - use "UNKNOWN" for all sides.
* @return Whether the set was successful.
*/
boolean setRedstoneOutput(ForgeDirection side, int value);
}
@@ -1,12 +0,0 @@
package buildcraft.api.statements.containers;
import net.minecraftforge.common.util.ForgeDirection;
import buildcraft.api.statements.IStatementContainer;
/**
* Created by asie on 3/14/15.
*/
public interface ISidedStatementContainer extends IStatementContainer {
ForgeDirection getSide();
}
@@ -1,12 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
@API(apiVersion = "1.1", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|statements")
package buildcraft.api.statements;
import cpw.mods.fml.common.API;
@@ -1,23 +0,0 @@
package buildcraft.api.transport;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import buildcraft.api.core.EnumColor;
public interface IInjectable {
boolean canInjectItems(ForgeDirection from);
/**
* Offers an ItemStack for 3addition to the pipe. Will be rejected if the
* pipe doesn't accept items from that side.
*
* @param stack ItemStack offered for addition. Do not manipulate this!
* @param doAdd If false no actual addition should take place. Implementors
* should simulate.
* @param from Orientation the ItemStack is offered from.
* @param color The color of the item to be added to the pipe, or null for no color.
* @return Amount of items used from the passed stack.
*/
int injectItem(ItemStack stack, boolean doAdd, ForgeDirection from, EnumColor color);
}
@@ -1,16 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.api.transport;
/**
* To be implemented by the real item pipe in Transport mod, but leaves knowledge for classes that do not have direct dependency on transport.
*/
public interface IItemPipe {
}
@@ -1,25 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.transport;
import net.minecraftforge.common.util.ForgeDirection;
import buildcraft.api.gates.IGate;
public interface IPipe {
IPipeTile getTile();
IGate getGate(ForgeDirection side);
boolean hasGate(ForgeDirection side);
boolean isWired(PipeWire wire);
boolean isWireActive(PipeWire wire);
}
@@ -1,29 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.transport;
import net.minecraftforge.common.util.ForgeDirection;
public interface IPipeConnection {
enum ConnectOverride {
CONNECT, DISCONNECT, DEFAULT
}
/**
* Allows you to override pipe connection logic.
*
* @param type
* @param with
* @return CONNECT to force a connection, DISCONNECT to force no connection,
* and DEFAULT to let the pipe decide.
*/
ConnectOverride overridePipeConnection(IPipeTile.PipeType type, ForgeDirection with);
}
@@ -1,62 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.transport;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import buildcraft.api.core.EnumColor;
import buildcraft.api.transport.pluggable.PipePluggable;
public interface IPipeTile extends IInjectable {
enum PipeType {
ITEM, FLUID, POWER, STRUCTURE
}
PipeType getPipeType();
World getWorld();
int x();
int y();
int z();
/**
* True if the pipe is connected to the block/pipe in the specific direction
*
* @param with
* @return true if connect
*/
boolean isPipeConnected(ForgeDirection with);
Block getNeighborBlock(ForgeDirection dir);
TileEntity getNeighborTile(ForgeDirection dir);
IPipe getNeighborPipe(ForgeDirection dir);
IPipe getPipe();
int getPipeColor();
PipePluggable getPipePluggable(ForgeDirection direction); // Now in IPluggableProvider
boolean hasPipePluggable(ForgeDirection direction); // Now in IPluggableProvider
boolean hasBlockingPluggable(ForgeDirection direction);
void scheduleNeighborChange();
void scheduleRenderUpdate();
// For compatibility with BC 6.2.x and below
int injectItem(ItemStack stack, boolean doAdd, ForgeDirection from, EnumColor color);
@Deprecated // Now in IInjectable
int injectItem(ItemStack stack, boolean doAdd, ForgeDirection from);
}
@@ -1,17 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.transport;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
public interface IStripesActivator {
void sendItem(ItemStack itemStack, ForgeDirection direction);
void dropItem(ItemStack itemStack, ForgeDirection direction);
}
@@ -1,28 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.transport;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public interface IStripesHandler {
enum StripesHandlerType {
ITEM_USE,
BLOCK_BREAK
}
StripesHandlerType getType();
boolean shouldHandle(ItemStack stack);
boolean handle(World world, int x, int y, int z, ForgeDirection direction,
ItemStack stack, EntityPlayer player, IStripesActivator activator);
}
@@ -1,12 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.transport;
public interface IStripesPipe extends IPipe, IStripesActivator {
}
@@ -1,78 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.transport;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.minecraft.world.World;
import buildcraft.api.transport.pluggable.PipePluggable;
public abstract class PipeManager {
public static List<IStripesHandler> stripesHandlers = new ArrayList<IStripesHandler>();
public static ArrayList<Class<? extends PipePluggable>> pipePluggables = new ArrayList<Class<? extends PipePluggable>>();
private static Map<String, Class<? extends PipePluggable>> pipePluggableNames =
new HashMap<String, Class<? extends PipePluggable>>();
private static Map<Class<? extends PipePluggable>, String> pipePluggableByNames =
new HashMap<Class<? extends PipePluggable>, String>();
private static Map<IStripesHandler, Integer> stripesHandlerPriorities =
new HashMap<IStripesHandler, Integer>();
@Deprecated
public static boolean canExtractItems(Object extractor, World world, int i, int j, int k) {
return true;
}
@Deprecated
public static boolean canExtractFluids(Object extractor, World world, int i, int j, int k) {
return true;
}
@Deprecated
public static void registerStripesHandler(IStripesHandler handler) {
registerStripesHandler(handler, 0);
}
/**
* Register a Stripes Pipe handler.
* @param handler The handler.
* @param priority The priority - 0 is normal, higher numbers have higher priority.
*/
public static void registerStripesHandler(IStripesHandler handler, int priority) {
stripesHandlers.add(handler);
stripesHandlerPriorities.put(handler, priority);
Collections.sort(stripesHandlers, new Comparator<IStripesHandler>() {
@Override
public int compare(IStripesHandler o1, IStripesHandler o2) {
return stripesHandlerPriorities.get(o2) - stripesHandlerPriorities.get(o1);
}
});
}
public static void registerPipePluggable(Class<? extends PipePluggable> pluggable, String name) {
pipePluggables.add(pluggable);
pipePluggableNames.put(name, pluggable);
pipePluggableByNames.put(pluggable, name);
}
public static Class<?> getPluggableByName(String pluggableName) {
return pipePluggableNames.get(pluggableName);
}
public static String getPluggableName(Class<? extends PipePluggable> aClass) {
return pipePluggableByNames.get(aClass);
}
}
@@ -1,74 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.transport;
import java.util.Locale;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public enum PipeWire {
RED, BLUE, GREEN, YELLOW;
public static Item item;
public static final PipeWire[] VALUES = values();
public PipeWire reverse() {
switch (this) {
case RED:
return YELLOW;
case BLUE:
return GREEN;
case GREEN:
return BLUE;
default:
return RED;
}
}
public String getTag() {
return name().toLowerCase(Locale.ENGLISH) + "PipeWire";
}
public String getColor() {
String name = this.toString().toLowerCase(Locale.ENGLISH);
char first = Character.toUpperCase(name.charAt(0));
return first + name.substring(1);
}
public ItemStack getStack() {
return getStack(1);
}
public ItemStack getStack(int qty) {
if (item == null) {
return null;
} else {
return new ItemStack(item, qty, ordinal());
}
}
public boolean isPipeWire(ItemStack stack) {
if (stack == null) {
return false;
} else if (stack.getItem() != item) {
return false;
} else {
return stack.getItemDamage() == ordinal();
}
}
public static PipeWire fromOrdinal(int ordinal) {
if (ordinal < 0 || ordinal >= VALUES.length) {
return RED;
} else {
return VALUES[ordinal];
}
}
}
@@ -1,12 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
@API(apiVersion = "4.1", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|transport")
package buildcraft.api.transport;
import cpw.mods.fml.common.API;
@@ -1,13 +0,0 @@
package buildcraft.api.transport.pluggable;
import net.minecraft.block.Block;
public interface IFacadePluggable {
Block getCurrentBlock();
int getCurrentMetadata();
boolean isTransparent();
boolean isHollow();
}
@@ -1,9 +0,0 @@
package buildcraft.api.transport.pluggable;
import net.minecraftforge.common.util.ForgeDirection;
import buildcraft.api.transport.IPipe;
public interface IPipePluggableDynamicRenderer {
void renderPluggable(IPipe pipe, ForgeDirection side, PipePluggable pipePluggable, double x, double y, double z);
}
@@ -1,10 +0,0 @@
package buildcraft.api.transport.pluggable;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import buildcraft.api.transport.IPipe;
public interface IPipePluggableItem {
PipePluggable createPipePluggable(IPipe pipe, ForgeDirection side, ItemStack stack);
}
@@ -1,13 +0,0 @@
package buildcraft.api.transport.pluggable;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraftforge.common.util.ForgeDirection;
import buildcraft.api.core.render.ITextureStates;
import buildcraft.api.transport.IPipe;
public interface IPipePluggableRenderer {
void renderPluggable(RenderBlocks renderblocks, IPipe pipe, ForgeDirection side,
PipePluggable pipePluggable, ITextureStates blockStateMachine,
int renderPass, int x, int y, int z);
}
@@ -1,67 +0,0 @@
/**
* Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* The BuildCraft API is distributed under the terms of the MIT License.
* Please check the contents of the license, which should be located
* as "LICENSE.API" in the BuildCraft source code distribution.
*/
package buildcraft.api.transport.pluggable;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraftforge.common.util.ForgeDirection;
import buildcraft.api.core.INBTStoreable;
import buildcraft.api.core.ISerializable;
import buildcraft.api.transport.IPipeTile;
/**
* An IPipePluggable MUST have an empty constructor for client-side
* rendering!
*/
public abstract class PipePluggable implements INBTStoreable, ISerializable {
public abstract ItemStack[] getDropItems(IPipeTile pipe);
public void update(IPipeTile pipe, ForgeDirection direction) {
}
public void onAttachedPipe(IPipeTile pipe, ForgeDirection direction) {
validate(pipe, direction);
}
public void onDetachedPipe(IPipeTile pipe, ForgeDirection direction) {
invalidate();
}
public abstract boolean isBlocking(IPipeTile pipe, ForgeDirection direction);
public void invalidate() {
}
public void validate(IPipeTile pipe, ForgeDirection direction) {
}
public boolean isSolidOnSide(IPipeTile pipe, ForgeDirection direction) {
return false;
}
public abstract AxisAlignedBB getBoundingBox(ForgeDirection side);
@SideOnly(Side.CLIENT)
public abstract IPipePluggableRenderer getRenderer();
@SideOnly(Side.CLIENT)
public IPipePluggableDynamicRenderer getDynamicRenderer() {
return null;
}
public boolean requiresRenderUpdate(PipePluggable old) {
return true;
}
}
@@ -1,21 +0,0 @@
package cofh.api.energy;
import net.minecraftforge.common.util.ForgeDirection;
/**
* Implement this interface on TileEntities which should connect to energy transportation blocks. This is intended for blocks which generate energy but do not
* accept it; otherwise just use IEnergyHandler.
*
* Note that {@link IEnergyHandler} is an extension of this.
*
* @author King Lemming
*
*/
public interface IEnergyConnection {
/**
* Returns TRUE if the TileEntity can connect on a given side.
*/
boolean canConnectEnergy(ForgeDirection from);
}
@@ -1,38 +0,0 @@
package cofh.api.energy;
import net.minecraftforge.common.util.ForgeDirection;
/**
* Implement this interface on Tile Entities which should receive energy, generally storing it in one or more internal {@link IEnergyStorage} objects.
* <p>
* A reference implementation is provided {@link TileEnergyHandler}.
*
* @author King Lemming
*
*/
public interface IEnergyReceiver extends IEnergyConnection {
/**
* Add energy to an IEnergyReceiver, internal distribution is left entirely to the IEnergyReceiver.
*
* @param from
* Orientation the energy is received from.
* @param maxReceive
* Maximum amount of energy to receive.
* @param simulate
* If TRUE, the charge will only be simulated.
* @return Amount of energy that was (or would have been, if simulated) received.
*/
int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate);
/**
* Returns the amount of energy currently stored.
*/
int getEnergyStored(ForgeDirection from);
/**
* Returns the maximum amount of energy that can be stored.
*/
int getMaxEnergyStored(ForgeDirection from);
}
@@ -1,49 +0,0 @@
/*
* ******************************************************************************
* Copyright 2011-2015 CovertJaguar
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.md for details.
* ***************************************************************************
*/
package mods.railcraft.api.core.items;
import com.mojang.authlib.GameProfile;
import net.minecraft.entity.item.EntityMinecart;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
/**
* This interface should be implemented by any cart item,
* but it is generally optional.
*
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface IMinecartItem
{
/**
* Controls whether this cart item can be placed by the Cart and Train Dispensers.
*
* Generally, you can ignore the placeCart() function if this returns false.
*
* @param cart
* @return true if it can be placed, false otherwise
*/
public boolean canBePlacedByNonPlayer(ItemStack cart);
/**
* Places a cart at the specified location.
*
* Implementing this function is optional.
*
* @param owner the name of the player placing the cart or "[MyMod]" with the brackets
* @param cart An ItemStack that contains the cart
* @param world The World
* @param i x-Coord
* @param j y-Coord
* @param k z-Coord
* @return the cart placed or null if failed
*/
public EntityMinecart placeCart(GameProfile owner, ItemStack cart, World world, int i, int j, int k);
}
-22
View File
@@ -1,22 +0,0 @@
package thaumcraft.api;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
/**
*
* @author Azanor
*
* Equipped head slot items that extend this class will be able to perform most functions that
* goggles of revealing can apart from view nodes which is handled by IRevealer.
*
*/
public interface IGoggles {
/*
* If this method returns true things like block essentia contents will be shown.
*/
public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player);
}
@@ -1,22 +0,0 @@
package thaumcraft.api;
import net.minecraft.item.ItemStack;
/**
*
* @author Azanor
*
* Armor or bauble slot items that implement this interface can provide runic shielding.
* Recharging, hardening, etc. is handled internally by thaumcraft.
*
*/
public interface IRunicArmor {
/**
* returns how much charge this item can provide. This is the base shielding value - any hardening is stored and calculated internally.
*/
public int getRunicCharge(ItemStack itemstack);
}
@@ -1,14 +0,0 @@
package thaumcraft.api;
/**
*
* @author Azanor
*
* Interface used to identify scribing tool items used in research table
*
*/
public interface IScribeTools {
}
@@ -1,19 +0,0 @@
package thaumcraft.api.crafting;
import net.minecraft.world.World;
/**
*
* @author Azanor
*
* Blocks that implement this interface act as infusion crafting stabilisers like candles and skulls
*
*/
public interface IInfusionStabiliser {
/**
* returns true if the block can stabilise things
*/
public boolean canStabaliseInfusion(World world, int x, int y, int z);
}
@@ -1,22 +0,0 @@
package thaumcraft.api.nodes;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
/**
*
* @author Azanor
*
* Equipped head slot items that extend this class will make nodes visible in world.
*
*/
public interface IRevealer {
/*
* If this method returns true the nodes will be visible.
*/
public boolean showNodes(ItemStack itemstack, EntityLivingBase player);
}
@@ -443,8 +443,9 @@ public final class BotaniaAPI {
* @see BotaniaAPI#registerManaInfusionRecipe
*/
public static RecipeManaInfusion registerManaAlchemyRecipe(ItemStack output, Object input, int mana) {
RecipeManaInfusion recipe = registerManaInfusionRecipe(output, input, mana);
RecipeManaInfusion recipe = new RecipeManaInfusion(output, input, mana);
recipe.setAlchemy(true);
manaInfusionRecipes.add(0, recipe);
return recipe;
}
@@ -454,8 +455,9 @@ public final class BotaniaAPI {
* @see BotaniaAPI#registerManaInfusionRecipe
*/
public static RecipeManaInfusion registerManaConjurationRecipe(ItemStack output, Object input, int mana) {
RecipeManaInfusion recipe = registerManaInfusionRecipe(output, input, mana);
RecipeManaInfusion recipe = new RecipeManaInfusion(output, input, mana);
recipe.setConjuration(true);
manaInfusionRecipes.add(0, recipe);
return recipe;
}
@@ -25,6 +25,7 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.util.ForgeDirection;
import vazkii.botania.api.BotaniaAPI;
public final class CorporeaHelper {
@@ -123,22 +124,15 @@ public final class CorporeaHelper {
* The deeper level function that use a List< IInventory > should be
* called instead if the context for this exists to avoid having to get the value again.
*/
public static Map<IInventory, Integer> getInventoriesWithItemInNetwork(ItemStack stack, List<IInventory> inventories, boolean checkNBT) {
Map<IInventory, Integer> countMap = new HashMap();
for(IInventory inv : inventories) {
int count = 0;
for(int i = 0; i < inv.getSizeInventory(); i++) {
if(!isValidSlot(inv, i))
continue;
ItemStack stackAt = inv.getStackInSlot(i);
if(stacksMatch(stack, stackAt, checkNBT))
count += stackAt.stackSize;
public static Map<IInventory, Integer> getInventoriesWithItemInNetwork(ItemStack stack,List<IInventory> inventories, boolean checkNBT) {
Map<IInventory, Integer> countMap = new HashMap<IInventory, Integer>();
List<IWrappedInventory> wrappedInventories = BotaniaAPI.internalHandler.wrapInventory(inventories);
for (IWrappedInventory inv : wrappedInventories) {
CorporeaRequest request = new CorporeaRequest(stack, checkNBT, -1);
inv.countItems(request);
if (request.foundItems > 0) {
countMap.put(inv.getWrappedObject(), request.foundItems);
}
if(count > 0)
countMap.put(inv, count);
}
return countMap;
@@ -167,62 +161,41 @@ public final class CorporeaHelper {
* The "matcher" parameter has to be an ItemStack or a String, if the first it'll check if the
* two stacks are similar using the "checkNBT" parameter, else it'll check if the name of the item
* equals or matches (case a regex is passed in) the matcher string.
* <br><br>
* When requesting counting of items, individual stacks may exceed maxStackSize for
* purposes of counting huge amounts.
*/
public static List<ItemStack> requestItem(Object matcher, int itemCount, ICorporeaSpark spark, boolean checkNBT, boolean doit) {
List<ItemStack> stacks = new ArrayList();
List<ItemStack> stacks = new ArrayList<ItemStack>();
CorporeaRequestEvent event = new CorporeaRequestEvent(matcher, itemCount, spark, checkNBT, doit);
if(MinecraftForge.EVENT_BUS.post(event))
return stacks;
List<IInventory> inventories = getInventoriesOnNetwork(spark);
Map<ICorporeaInterceptor, ICorporeaSpark> interceptors = new HashMap();
List<IWrappedInventory> inventoriesW = BotaniaAPI.internalHandler.wrapInventory(inventories);
Map<ICorporeaInterceptor, ICorporeaSpark> interceptors = new HashMap<ICorporeaInterceptor, ICorporeaSpark>();
lastRequestMatches = 0;
lastRequestExtractions = 0;
CorporeaRequest request = new CorporeaRequest(matcher, checkNBT, itemCount);
for(IWrappedInventory inv : inventoriesW) {
ICorporeaSpark invSpark = inv.getSpark();
int count = itemCount;
for(IInventory inv : inventories) {
boolean removedAny = false;
ICorporeaSpark invSpark = getSparkForInventory(inv);
if(inv instanceof ICorporeaInterceptor) {
ICorporeaInterceptor interceptor = (ICorporeaInterceptor) inv;
Object originalInventory = inv.getWrappedObject();
if(originalInventory instanceof ICorporeaInterceptor) {
ICorporeaInterceptor interceptor = (ICorporeaInterceptor) originalInventory;
interceptor.interceptRequest(matcher, itemCount, invSpark, spark, stacks, inventories, doit);
interceptors.put(interceptor, invSpark);
}
for(int i = inv.getSizeInventory() - 1; i >= 0; i--) {
if(!isValidSlot(inv, i))
continue;
ItemStack stackAt = inv.getStackInSlot(i);
if(matcher instanceof ItemStack ? stacksMatch((ItemStack) matcher, stackAt, checkNBT) : matcher instanceof String ? stacksMatch(stackAt, (String) matcher) : false) {
int rem = Math.min(stackAt.stackSize, count == -1 ? stackAt.stackSize : count);
if(rem > 0) {
ItemStack copy = stackAt.copy();
if(rem < copy.stackSize)
copy.stackSize = rem;
stacks.add(copy);
}
lastRequestMatches += stackAt.stackSize;
lastRequestExtractions += rem;
if(doit && rem > 0) {
inv.decrStackSize(i, rem);
removedAny = true;
if(invSpark != null)
invSpark.onItemExtracted(stackAt);
}
if(count != -1)
count -= rem;
}
if(doit) {
stacks.addAll(inv.extractItems(request));
} else {
stacks.addAll(inv.countItems(request));
}
if(removedAny)
inv.markDirty();
}
lastRequestMatches = request.foundItems;
lastRequestExtractions = request.extractedItems;
for(ICorporeaInterceptor interceptor : interceptors.keySet())
interceptor.interceptRequestLast(matcher, itemCount, interceptors.get(interceptor), spark, stacks, inventories, doit);
@@ -0,0 +1,26 @@
/**
* This class was created by <Vindex>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under the
* Botania License: http://botaniamod.net/license.php
*
*/
package vazkii.botania.api.corporea;
public class CorporeaRequest {
public Object matcher;
public boolean checkNBT;
public int count;
public int foundItems = 0;
public int extractedItems = 0;
public CorporeaRequest(Object matcher, boolean checkNBT, int count) {
super();
this.matcher = matcher;
this.checkNBT = checkNBT;
this.count = count;
}
}
@@ -0,0 +1,57 @@
/**
* This class was created by <Vindex>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under the
* Botania License: http://botaniamod.net/license.php
*
*/
package vazkii.botania.api.corporea;
import java.util.List;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
/**
* This interface wraps IInventory corporea works with in order to provide
* compatibility with different storage mods.
*
*/
public interface IWrappedInventory {
/**
* Break encapsulation and exposes original inventory.
*/
IInventory getWrappedObject();
/**
* Counts items in the inventory matching the request
*
* @param request
* - specifies what should be found
* @return List of ItemStack, individual stacks may exceed maxStackSize for
* purposes of counting huge amounts. To get final count requestor
* should sum stackSize of all stacks.
*/
List<ItemStack> countItems(CorporeaRequest request);
/**
* Convenience method for accessing spark over inventory
*/
ICorporeaSpark getSpark();
/**
* Extracts items matching request from the inventory.<br/>
* {@link CorporeaRequest#count} is updated to reflect how many items are
* yet to be extracted.<br/>
* {@link CorporeaRequest#foundItems} and
* {@link CorporeaRequest#extractedItems} are updated to reflect how many
* items were found and extracted.
*
* @param request
* @return List of ItemStacks to be delivered to the destination.
*/
List<ItemStack> extractItems(CorporeaRequest request);
}
@@ -26,6 +26,7 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import vazkii.botania.api.boss.IBotaniaBoss;
import vazkii.botania.api.corporea.IWrappedInventory;
import vazkii.botania.api.lexicon.LexiconPage;
import vazkii.botania.api.lexicon.multiblock.MultiblockSet;
import vazkii.botania.api.recipe.RecipeBrew;
@@ -226,4 +227,9 @@ public class DummyMethodHandler implements IInternalMethodHandler {
// NO-OP
}
@Override
public List<IWrappedInventory> wrapInventory(List<IInventory> inventories) {
return null;
}
}
Loaded 100 of 262 files, more files were not shown because too many files have changed in this diff. Show more