Compare commits

...
171 Commits
Author SHA1 Message Date
Vincent Lee eb7a6aee50 Tweak the bandaid 2016-01-23 23:55:05 -06:00
Vincent Lee 5104ff52d6 Tweak to bandaid 2016-01-23 23:13:59 -06:00
Vincent Lee aee5b8c0c2 Revert "Giant annoying message to see where this happens"
This reverts commit 08fa70e25c.
2016-01-23 22:45:43 -06:00
Vincent Lee 08fa70e25c Giant annoying message to see where this happens 2016-01-23 22:41:20 -06:00
Vincent Lee ac72a5a660 Attempt number 991298 to patch the stupid client crash 2016-01-23 22:36:49 -06:00
Vincent Lee 400bf95a44 Fix some lingering GoG worldgen and rendering issues. Closes #8. 2016-01-23 16:56:30 -06:00
Vincent Lee ba3d9ff9f8 Update garden of glass 2016-01-23 16:44:34 -06:00
Vincent Lee b3a140b8dd Temporary bandaid for thaumcraft brew integration. Closes #69. 2016-01-23 12:50:47 -06:00
Vincent Lee fabedeb31a Bump forge version, improve brewery JEI integration 2016-01-23 12:22:33 -06:00
Vincent Lee 2a738209b7 Revert "Tentative fix for multiblock transparency"
This reverts commit 03cfbfa73e.
2016-01-22 23:47:41 -06:00
Vincent Lee 03cfbfa73e Tentative fix for multiblock transparency 2016-01-22 23:28:46 -06:00
Vincent Lee eece9a08c1 Actually commit spreader blockstate json 2016-01-22 23:20:04 -06:00
Vincent Lee e5ee04113f placeholder model for spreader so it shows in JEI. make monocle use blockstates like it should 2016-01-22 22:32:02 -06:00
Vincent Lee 4bf8fd3b98 Remove some unused states from tiny potato 2016-01-22 21:18:54 -06:00
Vincent Lee 09fb64982a A bunch of more baubles 2016-01-22 20:42:12 -06:00
Vincent Lee b012f5152d Fix fab pools not being special snowflakes (colors same between all) 2016-01-21 23:14:45 -06:00
Vincent Lee 540baa4152 A little debug thign 2016-01-21 23:06:24 -06:00
Vincent Lee 77cd24b58a Merge upstream 2016-01-21 22:04:45 -06:00
Vincent Lee 98620bb1c5 Serverside the distributor. Closes #63 2016-01-21 21:30:22 -06:00
Vincent Lee 071bcefa6f Anotehr hoepful bandaid for all the clientside crashes 2016-01-21 21:23:23 -06:00
Vincent Lee 2a077adb6f Safeguard in the smartmodels. Closes #66 2016-01-21 21:21:26 -06:00
Vincent Lee 3d821e5da4 Fix some recipes not taking vanilla prismarine. closes #62 2016-01-21 21:16:00 -06:00
TheWhiteWolves 275729d54e Popped a null check in onEquipped() to ensure player isn't null, hopefully helps with Issue #1757 2016-01-21 23:13:41 +00:00
TheWhiteWolves adc06dc6ce Added a blacklist to the Rod of the Shaded Mesa 2016-01-21 22:46:02 +00:00
Vincent Lee 5991387f22 Actually close #59 2016-01-20 21:35:14 -06:00
Vincent Lee d0e4e436ad MOve recipes to init and remove thaumcraft after requirement. CLoses #53 2016-01-20 19:52:38 -06:00
Vincent Lee 27be487b7e Add a gradlew.bat. Closes #56 2016-01-20 19:15:46 -06:00
Vincent Lee 36976e6321 Fix divining rod looking up blocks with no item form in the OD. CLoses #57 2016-01-20 19:12:22 -06:00
Vincent Lee a6d89e3d4d Fix thorn chakram impact crash. Closes #59 2016-01-20 19:08:48 -06:00
Vincent Lee ab3bc85f20 Fix magic missile crash. closes #54 2016-01-20 19:07:29 -06:00
Jonathan Smith d8a46650ee Merge pull request #1762 from NatsuArashi/patch-14
Update zh_TW.lang
2016-01-19 14:26:26 +00:00
NatsuArashi 177c5b1d1b Update zh_TW.lang
FIX SOMETHING...?
2016-01-19 19:31:17 +08:00
Vincent Lee ebf399edaa Most body based cosmetic baubles 2016-01-18 17:08:31 -06:00
Vincent Lee 4448a6a498 Blood, ice, lava, super lava pendants and itemfinder bauble renders 2016-01-18 15:41:55 -06:00
Vincent Lee a13d6fca53 Sideonly some things 2016-01-18 15:16:48 -06:00
Vincent Lee fef9f1b406 Flugel tiara bauble render 2016-01-18 15:12:57 -06:00
Vincent Lee 86ce88f068 Diva charm and golden laurel baubles render 2016-01-18 14:55:28 -06:00
Vincent Lee 9b2fa9de65 Monocle baubles render 2016-01-18 14:11:21 -06:00
Vincent Lee f87e2373f8 Tiny planet bauble render 2016-01-18 13:22:54 -06:00
Vincent Lee 4df1d500ed Remove unnecessary face from creative pool item json 2016-01-18 12:45:52 -06:00
Vincent Lee cec10471fb Fix two multiblock crashes, closes #48 2016-01-18 12:15:56 -06:00
Vincent Lee 177f50ca61 Bandaid for more client chunk unload crashes >.> 2016-01-18 11:45:07 -06:00
Vincent Lee e184394f55 Fix mana tablets and terrasteel helm will rendering 2016-01-18 11:30:13 -06:00
Vincent Lee eb28396d98 Fully fix contributor fanciness renders. Fix mana gun not being held like a tool in third person 2016-01-18 10:31:05 -06:00
Jonathan Smith 089c8c674c Merge pull request #1760 from Eladkay/patch-3
Fixed license link in FAQ page.
2016-01-18 16:14:45 +00:00
Eladkay 2df3b356fd Fixed license link in FAQ page.
If issue is not obvious: https://gyazo.com/c4657c529a337f37a3c67925e8e5e61e
2016-01-18 15:00:17 +02:00
Vincent Lee dda3151b73 Fix piston lens not working properly. Serverside some of the other lenses where safe 2016-01-17 17:30:01 -06:00
Vincent Lee 4e5cb59ebe Fix crash and possible desync in flash lens. Closes #47 2016-01-17 16:41:37 -06:00
Vincent Lee fef0857603 Desert, forest, fungal apothecary textures 2016-01-17 16:31:01 -06:00
TheWhiteWolves a6896f250f bump API version 2016-01-17 14:51:51 +00:00
TheWhiteWolves d431207eec Change to use API version of disposable blocks and implement semi-disposable 2016-01-17 14:51:39 +00:00
TheWhiteWolves c0e7353192 Move disposable blocks list to API and add hook and semi disposable list 2016-01-17 14:50:50 +00:00
Vincent Lee 8922ad5362 Use the non-insane calendar API 2016-01-16 18:38:22 -06:00
Vincent Lee be2b66dddf Partially restore bauble rendering. Everything is probably in the wrong place, but should render. 2016-01-16 18:25:31 -06:00
Vincent Lee 6e870f4e79 Remove some leftover debug messages 2016-01-16 16:57:51 -06:00
Vincent Lee 4d4ba74ac1 Fix ender air bottle event handler not being registered, closes #44 2016-01-16 16:56:17 -06:00
Vincent Lee 5e3345a1d7 Fix terra pick and elementium shovel not working correctly. Closes #43 2016-01-16 13:37:18 -06:00
Vincent Lee 568ee043df God dammit 2016-01-16 12:33:05 -06:00
Jonathan Smith f2eea3ce92 Merge pull request #1754 from blacksmithgu/swapper-sides
Bugfix followup - Block swappers use sidedness to control concurrency
2016-01-16 11:19:02 +00:00
Vincent Lee a615538289 Stop spamming packets when done digesting 2016-01-16 02:07:18 -06:00
Vincent Lee 7907d1d582 Fix passives decaying directly into nothing instead of a dead bush 2016-01-16 01:57:31 -06:00
Vincent Lee 46900df6cb Serverside gourmaryllis 2016-01-16 01:42:07 -06:00
Vincent Lee 1d8c536139 Fix pool minecart rendery fully 2016-01-15 21:48:29 -06:00
Vincent Lee eb028d6c05 Fully fix mana pool models 2016-01-15 21:20:49 -06:00
Michael Brenan 24cf30a29e Bugfix followup - Block swappers use sidedness to control concurrency 2016-01-15 18:28:06 -06:00
Jonathan Smith 5bc520368d Merge pull request #1752 from blacksmithgu/patch-1749
Fix #1749 - Mana Tablets no longer lose durability in storage drawer
2016-01-15 21:28:32 +00:00
Vincent Lee 406f89a968 Cleanup, implement some easter egg models I missed 2016-01-15 14:14:10 -06:00
Vincent Lee 2c15b6150c Lots of MOP guards. closes #41 2016-01-15 11:27:32 -06:00
Vincent Lee bee13337ad Made laputa shard save string block id's instead of integer id's. Also, a possible fix for #40 2016-01-15 10:56:23 -06:00
Michael Brenan 54f1dd0478 Fix #1749 - Mana Tablets no longer lose durability in storage drawer 2016-01-15 03:26:31 -06:00
Jonathan Smith b7c0c12e5b Merge pull request #1750 from blacksmithgu/swapper-concurrency
Add preemptive bugfix - Swappers now threadsafe
2016-01-15 09:09:26 +00:00
Michael Brenan 5438138c93 Add preemptive bugfix - Swappers now threadsafe 2016-01-14 22:56:01 -06:00
Vincent Lee 98e28a0967 Made some things one sided only 2016-01-14 22:44:50 -06:00
Vincent Lee 4a4e583aa8 Fix wonky petal apothecary collision 2016-01-14 21:53:18 -06:00
Vincent Lee 300b1926de Possible fix for #38 2016-01-14 17:20:05 -06:00
Vincent Lee 3818d2879d no longer register gaia tesr onto vanilla skulls 2016-01-14 16:47:48 -06:00
Vincent Lee e12163f70c Merge upstream 2016-01-14 16:40:14 -06:00
Vincent Lee dcb236607d Fix hopperhock placing items one block too far away. Closes #39 2016-01-14 12:08:57 -06:00
Vincent Lee 08de553593 No longer use the raw potion array, use potio registry 2016-01-14 11:54:08 -06:00
Jonathan Smith f6bf6589ad Merge pull request #1743 from yrsegal/master
IslandTypes can now be added by addons
2016-01-14 16:59:20 +00:00
Jonathan Smith da43dd8ca0 Merge pull request #1748 from blacksmithgu/patch-1722
Hotfix #1722 - Allow client to control sash speedup and slowdown
2016-01-14 16:55:01 +00:00
Jonathan Smith fdd1ad8d4e Merge pull request #1747 from blacksmithgu/patch-1726
Fix #1726 - Accessories on other players now render in the proper position
2016-01-14 16:54:53 +00:00
Jonathan Smith d4dd4cf42f Merge pull request #1746 from blacksmithgu/gaia-head
Clean up common/item/ItemGaiaHead.java
2016-01-14 16:54:46 +00:00
Michael Brenan 0595397943 Hotfix #1722 - Allow client to control sash speedup and slowdown 2016-01-13 23:07:47 -06:00
Michael Brenan d0faf3c3c6 Fix #1726 - Accessories on other players now render in the proper position 2016-01-13 22:53:21 -06:00
Vincent Lee b01e9dfed7 Staging changes would be a good idea. Also fix possible potion crash 2016-01-13 17:14:12 -06:00
yrsegal cbac5fbb32 IslandTypes can now be added by addons 2016-01-13 17:44:47 -05:00
Michael Brenan f5210997ca Clean up common/item/ItemGaiaHead.java 2016-01-13 16:21:47 -06:00
Vincent Lee 4b7608fc2a Add nag that this is unofficial right now 2016-01-13 14:13:19 -06:00
Vincent Lee 103efe9c7b Destitch cocoon texmap 2016-01-13 12:54:02 -06:00
Vincent Lee 1402e2a50a Start work on destitching apothecary texmaps 2016-01-13 12:37:15 -06:00
Vincent Lee c8d9764fe3 Read atlas size dynamically 2016-01-13 10:59:10 -06:00
Jonathan Smith d3055c4c4d Merge pull request #1742 from blacksmithgu/patch-1700
Fix #1700 - Terra Axe strictly follow 32 block range and leaf logic
2016-01-13 12:24:40 +00:00
Jonathan Smith c94df0bf67 Merge pull request #1738 from blacksmithgu/master
Fix #1728 - Grass seeds will not spread to dirt/grass blocks under other blocks
2016-01-13 12:24:32 +00:00
Michael Brenan 4abb2cdd89 Fix #1700 - Terra Axe strictly follow 32 block range and leaf logic 2016-01-13 03:42:32 -06:00
Jonathan Smith cabcab80e2 Merge pull request #1739 from blacksmithgu/patch-1724
Fix #1724 - Slabs and snow don't prevent Rod of Shifting Crust replacement
2016-01-13 09:36:21 +00:00
Vincent Lee 3e19a84b6d Fix terra shatterer tooltip darkening screen. Closes #37 2016-01-13 00:42:32 -06:00
Vincent Lee a30887d6f9 Debug thing for me, to dump the texture atlas 2016-01-13 00:02:18 -06:00
Vincent Lee 80bd63be0b Bunch of TE particle textures. Fix a bellows crash and teru teru bozu not working with sunflower 2016-01-12 23:27:36 -06:00
Vincent Lee 6c9a01978a Cocoon of caprice model 2016-01-12 15:04:08 -06:00
Vincent Lee 19e387f359 Fix off by one in forest drum meta to state 2016-01-12 13:58:19 -06:00
Vincent Lee f799f7bc32 Revert "Trying to render AO pool"
This reverts commit d8a74e2e44.
2016-01-12 12:00:29 -06:00
Jonathan Smith a2f1776245 Merge pull request #1735 from yrsegal/master
Make baubles able to IBlockProvide
2016-01-12 12:59:05 +00:00
yrsegal c20247b680 Baubles now able to IBlockProvide
This allows for things like Botanical Addons’ Toolbelt to provide from
the tools in them while worn.
2016-01-12 07:47:30 -05:00
Jonathan Smith a7000e8a47 Add Material.gourd to Axe materials.
Closes #1732. 

Allows use of the quickest mining tool for items with Material.gourd (Pumpkins, Melons, etc.)
2016-01-12 12:12:20 +00:00
Michael Brenan ac88d0627a Fix #1724 - Slabs and snow prevent Rod of Shifting Crust replacement 2016-01-12 01:32:15 -06:00
Vincent Lee d8a74e2e44 Trying to render AO pool 2016-01-11 20:06:59 -06:00
Michael Brenan cbcc49b896 Fix #1728 - Pasture seed grass spreading obeys grass block growth rules 2016-01-11 18:28:01 -06:00
Vincent Lee 30578abfb4 Merge pull request #36 from GirafiStudios/MC18
Fixed special named Tiny Potatoes. (Besides Ible)
2016-01-11 17:14:30 -06:00
GirafiStudios a172a325e1 Fixed named Tiny Potatoes rendering (Besides Ible) 2016-01-11 23:45:43 +01:00
Vincent Lee 64e3a96651 I is retarded 2016-01-11 14:25:00 -06:00
Vincent Lee 94d72161a9 Revert mesher lambdas 2016-01-11 14:10:11 -06:00
Vincent Lee 8e7f1cfac1 Temporary java 8 reobfuscation fix closes #33. 2016-01-11 11:23:46 -06:00
Vincent Lee f3cce3d24e Global safety checks for blockstates while chunks are unloading 2016-01-10 22:53:21 -06:00
Vincent Lee 84204db587 Fix ender air bottle render, move to java 8, giant import cleanup 2016-01-10 18:16:30 -06:00
Vincent Lee 404d99445e Sleeves render on spreaders again. Closes #6 2016-01-09 23:35:18 -06:00
Vincent Lee f3f055a58e More 2016-01-09 21:26:43 -06:00
Vincent Lee e142561799 Model cleanup 2016-01-09 21:22:37 -06:00
Vincent Lee 14a7f6b14b COrrect Crafty crate models 2016-01-09 21:01:50 -06:00
Vincent Lee a6899a9f40 Special flower lighting crash 2016-01-09 19:31:58 -06:00
Vincent Lee 57398723a4 Cleanup 2016-01-09 19:05:37 -06:00
Vincent Lee 4345bd9728 More blockstate guards in TE and blockstate conversions 2016-01-09 19:01:31 -06:00
Vincent Lee 1c14dcf8ff Fix pylon crash 2016-01-09 18:37:12 -06:00
Vincent Lee 7615d0b893 Fix recipes for 1.9 purpur not being registered 2016-01-09 17:49:59 -06:00
Vasco Lavos b7975401b3 Merge pull request #1727 from yrsegal/master
Make CanFit (IFlowerComponent) affect items fitting into petal apothecary
2016-01-09 22:36:57 +00:00
yrsegal f641e165b0 actually call canFit 2016-01-09 17:35:14 -05:00
Vincent Lee 568ed80ede Allow platform to render other smart models 2016-01-09 00:03:04 -06:00
Vincent Lee c3dce97e0d Fix pylon and pool rendering in multiblock. Closes #25 2016-01-08 23:03:30 -06:00
Vincent Lee 61b8616008 Fix double flowers not dropping from both halves. Closes #24 2016-01-08 20:34:55 -06:00
Vincent Lee f61d47f2dc Some cleanup, fix wand of the forest minor bugs. Closes #22 2016-01-08 19:53:28 -06:00
Vincent Lee 9e16c4490b Rename RenderEventHandler, restore flugel tiara extra renders, and fix sparkles renderirng too low. Closes #21 2016-01-08 19:10:28 -06:00
Vincent Lee b4df8ce418 Full platform models. Fix bore lens crash and add copyleft headers to some things 2016-01-08 18:47:31 -06:00
Jonathan Smith 7e5974cd7c Merge pull request #1721 from AlterAkima/patch-2
Brew related pages
2016-01-08 21:33:08 +00:00
Vincent Lee 84d0c75605 Fix lighting, AO is still broken 2016-01-08 14:56:16 -06:00
Vincent Lee 9c3a042089 pool tesr now uses baked model 2016-01-08 14:14:17 -06:00
Vincent Lee a1aa50b532 Merge upstream release 248 2016-01-08 12:34:51 -06:00
Vincent Lee 972943a9ac Updates to internal handler and icons 2016-01-08 12:33:49 -06:00
Vasco Lavos 6374b01762 Build 248 2016-01-08 18:22:07 +00:00
Vincent Lee a4a77fb20f Merge upstream 2016-01-08 12:00:01 -06:00
Vincent Lee 3a54166954 Revert "Tentatively change relics to use UUID. Still use playernames for display" due to a better solution being merged upstream.
This reverts commit 0687f56c32.
2016-01-08 11:29:03 -06:00
Patric Alexandre 753a03b291 Brew relataded pages 2016-01-08 14:04:34 -03:00
Vasco Lavos bf55ee4a60 Fixed the Hopperhock calling inventory methods on the client side, and thus, crashing when used alongside a BetterStorage Crate. 2016-01-08 14:41:05 +00:00
Vasco Lavos 68ea0b213e Fixed alternate grass types not breaking faster with a shovel and not being able to sustain sugar cane. Closes #1711 2016-01-08 14:35:06 +00:00
Vasco Lavos 6b66163958 Fixed the Ring of Odin Fire Resistance config not changing its extinguish behaviour. 2016-01-08 14:32:29 +00:00
Vasco Lavos c8517f565b Fixed Mana Flashes not having a lexicon binding. Closes #1719 2016-01-08 14:30:55 +00:00
Vasco Lavos 8268c79353 New name 2016-01-08 14:27:53 +00:00
Vasco Lavos c00bb80529 Merge pull request #1712 from Lazersmoke/18-oredictstonefix
Add oredict support 1.8 stone recipes, closes #1660
2016-01-08 14:22:48 +00:00
Vincent Lee cd77b41d31 Incense plate converted to json 2016-01-07 21:19:39 -06:00
Vincent Lee 20b5743221 Safety guards for blockstates, remove all useless casts 2016-01-07 19:55:54 -06:00
Vincent Lee e58eb1b345 Fix alfportal derp 2016-01-07 17:03:28 -06:00
Vincent Lee 064fd20edb Mana flash and water bowl items 2016-01-07 16:56:03 -06:00
Vincent Lee 85102dea89 Mana inkwell item model. Pylon models fully working 2016-01-07 14:32:38 -06:00
Vincent Lee baf14c361b Fix third person render 2016-01-07 11:59:22 -06:00
Vincent Lee 3b7d7628cf Derp 2016-01-07 11:46:36 -06:00
Vincent Lee 8155dc3059 Life imbuer model complete 2016-01-07 11:35:41 -06:00
Vincent Lee 0494c0eba2 Generify stuff, fix gaia head render, hourglass inventory model 2016-01-07 10:32:51 -06:00
Vincent Lee 12dfecb8ac Add a bunch of dirty, dirty tesr item hook items. Also fix fabulous mana pool leaking its fabulousness 2016-01-07 08:52:58 -06:00
Vincent Lee 92aaa9f70a Spreader turntable model 2016-01-06 21:40:18 -06:00
Vincent Lee 929860f8fa Partial claw model. Fix cell block being a debug floating island. Fix a pure daisy oredict bug by checking for drops instead of state 2016-01-06 20:56:25 -06:00
Vincent Lee 383cd059cc Fix hourglass having inverted redstone power. How come no one caught this?! 2016-01-06 20:16:22 -06:00
Vasco Lavos b108af404f Update contributors.properties 2016-01-06 22:23:28 +00:00
Jonathan Smith d7f94bfc00 Merge pull request #1715 from yrsegal/master
Make the render color for camo blocks work with meta
2016-01-05 16:30:26 +00:00
yrsegal 69eac1f12e Make the render color for camo blocks work with meta
before, blocks which required meta colors for determining their render
color would use the meta of the Platform itself
2016-01-04 19:39:50 -05:00
Jonathan Smith 0cd4722c1c Merge pull request #1710 from Lazersmoke/pane-lighting
Added light to all panes, closing #1697
2016-01-04 10:14:52 +00:00
Jonathan Smith e89322083d Merge pull request #1713 from Lazersmoke/lens-recipe-fix
Fixes mana lens dyeing, closing #1708
2016-01-04 10:14:21 +00:00
Sam Quinn f9ce3676e1 Fixes mana lens dyeing, closing #1708
Fixes having extra items beyond a dye and a lens messing everything up
2016-01-02 22:48:51 -06:00
Sam Quinn 17ddae20af Add oredict support 1.8 stone recipes, closes #1660
the code was copy-pastaed from the addStairsAndSlabs helper function to
hack in oredict support, feel free to just add it to the helper function
if you want though. Looking at other Botania code, this is what comes to
mind though.

see #1703
There is also a very big problem that I marked with a comment that says
"very big problem", where on many many different stone types (end,
metamorph, 1.8) the recipe for stone bricks and for chisled is the same,
so usually you can't craft chisled.

sorry for long commit message
2016-01-02 21:38:26 -06:00
Sam Quinn 124f8bb173 Added light to all panes, closing #1697
All the full glass blocks had lightning, so now these can too!
2016-01-02 20:14:44 -06:00
Vasco Lavos 820c042f40 Update contributors.properties 2016-01-02 23:42:17 +00:00
Vasco Lavos 0f9bc9fc53 Merge pull request #1706 from Lazersmoke/patch-7
Removed references to Excaliber
2016-01-01 16:43:58 +00:00
Sam Quinn 9036e24365 Removed references to Excaliber
The Excalibru doesn't even exist anymore, so it doesn't make sense to talk about it in contributing, as you should be working with latest version anyway
2016-01-01 09:52:51 -06:00
569 changed files with 4509 additions and 3256 deletions

No files matched your search

BIN
View File
Binary file not shown.
-1
View File
@@ -10,7 +10,6 @@ Anyways, vanilla removed it from their method so we follow suit.
* Multiblock system reworked to use states and blockposes
* Magnet blacklist still uses metas instead of states because they need to support the short maxvalue wildcard.
* Now includes a way for addons to pass the Botania loader the models they want to use to render their subtile with
* IRelic changed to use UUIDs
* Removed icon methods from SubTileSignature
-- Other --
+5
View File
@@ -77,6 +77,11 @@ dependencies {
sshAntTask "org.apache.ant:ant-jsch:1.7.1", "jsch:jsch:0.1.29"
}
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
processResources {
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
+4 -4
View File
@@ -1,9 +1,9 @@
#
#Wed Dec 30 00:21:06 GMT 2015
#Fri Jan 08 18:17:27 GMT 2016
version=r1.8
dir_output=../Build Output/Botania/
dir_repo=./
forge_version=11.15.0.1656
forge_version=11.15.0.1715
mc_version=1.8.9
build_number=248
dir_repo=./
build_number=249
mod_name=Botania
-2
View File
@@ -11,7 +11,6 @@ Hey there. Looks like you want to contribute with an issue. Great. Here's what y
The following "bugs" are not accepted:
* Intended Behaviour
* The e in Excaliber
* Double tall flowers need be harvested with shears to not clutter the inventory
* Already fixed but people keep reporting it for some reason
* Wearing a Ring of Loki or Ring of the Aesir shows a wireframe below bedrock
@@ -23,7 +22,6 @@ The following "bugs" are not accepted:
* Mana Bursts get destroyed on Cauldron by the ClearLagg plugin (add botania:manaBurst to the ClearLagg blacklist)
* Force Relays destroy blocks when used very fast (Can't fix due to the nature of the block)
* Terrasteel crafting won't start (make sure your checkerboard is correct, there's Livingrock under the plate)
* The speed tooltip on Excaliber scales with the Sharpness enchant (Vanilla bug)
* The Horn of the Canopy doesn't break Thaumcraft leaves (Thaumcraft doesn't use the typical class or material)
* Some Baubles don't work properly on LAN (Baubles bug)
+2
View File
@@ -51,3 +51,5 @@ _bloop=0
kgevans=15
l0nekitsune=14
swiftlileagle=14
gryphonn=11
loraanicus=10
Vendored Executable
+90
View File
@@ -0,0 +1,90 @@
@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
@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=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
: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 %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="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!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
@@ -18,9 +18,14 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import net.minecraft.block.*;
import net.minecraft.block.BlockCarpet;
import net.minecraft.block.BlockColored;
import net.minecraft.block.BlockStainedGlass;
import net.minecraft.block.BlockStainedGlassPane;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.EnumDyeColor;
@@ -62,34 +67,38 @@ import net.minecraftforge.fml.common.Loader;
public final class BotaniaAPI {
private static List<LexiconCategory> categories = new ArrayList<LexiconCategory>();
private static List<LexiconEntry> allEntries = new ArrayList<LexiconEntry>();
private static List<LexiconCategory> categories = new ArrayList<>();
private static List<LexiconEntry> allEntries = new ArrayList<>();
public static Map<String, KnowledgeType> knowledgeTypes = new HashMap<String, KnowledgeType>();
public static Map<String, KnowledgeType> knowledgeTypes = new HashMap<>();
public static Map<String, Brew> brewMap = new LinkedHashMap<String, Brew>();
public static List<String> disposableBlocks = new ArrayList<String>();
public static List<String> semiDisposableBlocks = new ArrayList<String>();
public static List<RecipePetals> petalRecipes = new ArrayList<RecipePetals>();
public static List<RecipePureDaisy> pureDaisyRecipes = new ArrayList<RecipePureDaisy>();
public static List<RecipeManaInfusion> manaInfusionRecipes = new ArrayList<RecipeManaInfusion>();
public static List<RecipeRuneAltar> runeAltarRecipes = new ArrayList<RecipeRuneAltar>();
public static List<RecipeElvenTrade> elvenTradeRecipes = new ArrayList<RecipeElvenTrade>();
public static List<RecipeBrew> brewRecipes = new ArrayList<RecipeBrew>();
public static List<RecipeManaInfusion> miniFlowerRecipes = new ArrayList<RecipeManaInfusion>();
public static List<RecipePetals> petalRecipes = new ArrayList<>();
public static List<RecipePureDaisy> pureDaisyRecipes = new ArrayList<>();
public static List<RecipeManaInfusion> manaInfusionRecipes = new ArrayList<>();
public static List<RecipeRuneAltar> runeAltarRecipes = new ArrayList<>();
public static List<RecipeElvenTrade> elvenTradeRecipes = new ArrayList<>();
public static List<RecipeBrew> brewRecipes = new ArrayList<>();
public static List<RecipeManaInfusion> miniFlowerRecipes = new ArrayList<>();
private static BiMap<String, Class<? extends SubTileEntity>> subTiles = HashBiMap.<String, Class<? extends SubTileEntity>> create();
private static Map<Class<? extends SubTileEntity>, SubTileSignature> subTileSignatures = new HashMap<Class<? extends SubTileEntity>, SubTileSignature>();
private static Map<Class<? extends SubTileEntity>, SubTileSignature> subTileSignatures = new HashMap<>();
public static Set<String> subtilesForCreativeMenu = new LinkedHashSet();
public static Map<String, String> subTileMods = new HashMap<String, String>();
public static Map<String, String> subTileMods = new HashMap<>();
public static BiMap<String, String> miniFlowers = HashBiMap.<String, String> create();
public static Map<String, Integer> oreWeights = new HashMap<String, Integer>();
public static Map<String, Integer> oreWeightsNether = new HashMap<String, Integer>();
public static Map<String, Integer> oreWeights = new HashMap<>();
public static Map<String, Integer> oreWeightsNether = new HashMap<>();
public static Map<Item, Block> seeds = new HashMap();
public static Set<Item> looniumBlacklist = new LinkedHashSet<Item>();
public static Map<Block, PropertyEnum<EnumDyeColor>> paintableBlocks = new LinkedHashMap<Block, PropertyEnum<EnumDyeColor>>();
public static Set<String> magnetBlacklist = new LinkedHashSet<String>();
public static Set<Item> looniumBlacklist = new LinkedHashSet<>();
public static Map<Block, PropertyEnum<EnumDyeColor>> paintableBlocks = new LinkedHashMap<>();
public static Set<String> magnetBlacklist = new LinkedHashSet<>();
public static Set<Class<? extends Entity>> gravityRodBlacklist = new LinkedHashSet<Class<? extends Entity>>();
public static ArmorMaterial manasteelArmorMaterial = EnumHelper.addArmorMaterial("MANASTEEL", "manasteel", 16, new int[] { 2, 6, 5, 2 }, 18);
@@ -241,6 +250,16 @@ public final class BotaniaAPI {
registerPaintableBlock(Blocks.stained_hardened_clay, BlockColored.COLOR);
registerPaintableBlock(Blocks.wool, BlockColored.COLOR);
registerPaintableBlock(Blocks.carpet, BlockCarpet.COLOR);
registerDisposableBlock("dirt"); // Vanilla
registerDisposableBlock("sand"); // Vanilla
registerDisposableBlock("gravel"); // Vanilla
registerDisposableBlock("cobblestone"); // Vanilla
registerDisposableBlock("netherrack"); // Vanilla
registerSemiDisposableBlock("stoneAndesite"); // Vanilla
registerSemiDisposableBlock("stoneBasalt"); // Vanilla
registerSemiDisposableBlock("stoneDiorite"); // Vanilla
registerSemiDisposableBlock("stoneGranite"); // Vanilla
}
/**
@@ -280,6 +299,21 @@ public final class BotaniaAPI {
return fallbackBrew;
}
/*
* Registers a Block as disposable using its Ore Dictionary Name.
*/
public static void registerDisposableBlock(String oreDictName) {
disposableBlocks.add(oreDictName);
}
/*
* Registers a Block as semi disposable using its Ore Dictionary Name.
* This means it will not be trashed when sneaking.
*/
public static void registerSemiDisposableBlock(String oreDictName) {
semiDisposableBlocks.add(oreDictName);
}
/**
* Registers a paintableBlock and returns it.
* You must also provide the PropertyEnum that this block uses to express its color
@@ -290,6 +324,22 @@ public final class BotaniaAPI {
return paintable;
}
/*
* Blacklists an Entity from being affected by the Rod of the Shaded Mesa.
* Pass in the class for the Entity, e.g. EntityCow.class
*/
public static void blacklistEntityFromGravityRod(Class entity) {
gravityRodBlacklist.add(entity);
}
/*
* Checks if the provided Entity is contained in the Blacklist.
* Pass in the class for the Entity, e.g. entity.getClass()
*/
public static boolean isEntityBlacklistedFromGravityRod(Class entity) {
return gravityRodBlacklist.contains(entity);
}
/**
* Blacklists an item from being pulled by the Ring of Magnetization.
* Short.MAX_VALUE can be used as the stack's damage for a wildcard.
@@ -1,11 +1,16 @@
package vazkii.botania.api;
import com.google.common.base.Preconditions;
import com.google.common.collect.Maps;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.LoaderState;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import vazkii.botania.api.subtile.SubTileEntity;
import vazkii.botania.api.item.IFloatingFlower;
import java.util.Collections;
import java.util.Map;
/**
@@ -14,31 +19,31 @@ import java.util.Map;
@SideOnly(Side.CLIENT)
public final class BotaniaAPIClient {
public static final Map<String, ModelResourceLocation> queuedBlockModels = Maps.newHashMap();
public static final Map<String, ModelResourceLocation> queuedItemModels = Maps.newHashMap();
private static final Map<String, ModelResourceLocation> subtileBlockModels = Maps.newHashMap();
private static final Map<String, ModelResourceLocation> subtileItemModels = Maps.newHashMap();
private static final Map<IFloatingFlower.IslandType, ModelResourceLocation> islandTypeModels = Maps.newHashMap();
/**
* Register your model for the given subtile class here.
* Call this DURING PREINIT. Calling it anytime after blockModels have already baked does not guarantee that your model will work.
* Your model json must specify key "tintindex" in all the faces it wants tint applied.
* Tint is applied whenever a player recolors the flower using floral dye
* todo 1.8.8 move this elsewhere or otherwise make it fit better with the rest of the subtile registration process
*
* @param subTileName The String ID of the subtile
* @param model A path to a blockstate json and variant to be used for this subtile
* @param itemModel A path to a blockstate json and variant to be used for this subtile's item form
*/
public static void registerSubtileModel(String subTileName, ModelResourceLocation model, ModelResourceLocation itemModel) {
queuedBlockModels.put(subTileName, model);
queuedItemModels.put(subTileName, itemModel);
Preconditions.checkState(Loader.instance().isInState(LoaderState.PREINITIALIZATION));
subtileBlockModels.put(subTileName, model);
subtileItemModels.put(subTileName, itemModel);
}
/**
* Register your model for the given subtile class here.
* Call this DURING PREINIT. Calling it anytime after blockModels have already baked does not guarantee that your model will work.
* Call this DURING PREINIT.
* Your model json must specify key "tintindex" in all the faces it wants tint applied.
* Tint is applied whenever a player recolors the flower using floral dye
* todo 1.8.8 move this elsewhere or otherwise make it fit better with the rest of the subtile registration process
*
* @param subTileName The String ID of the subtile
* @param model A path to a blockstate json and variant to be used the block. The item model will be drawn from the same blockstate json, from variant "inventory"
@@ -56,6 +61,38 @@ public final class BotaniaAPIClient {
registerSubtileModel(BotaniaAPI.getSubTileStringMapping(clazz), model, itemModel);
}
/**
* @return An immutable and live view of the registered subtile block model map
*/
public static Map<String, ModelResourceLocation> getRegisteredSubtileBlockModels() {
return Collections.unmodifiableMap(subtileBlockModels);
}
/**
* @return An immutable and live view of the registered subtile item model map
*/
public static Map<String, ModelResourceLocation> getRegisteredSubtileItemModels() {
return Collections.unmodifiableMap(subtileItemModels);
}
/**
* Registers your model for island type islandType here.
* Call this DURING PREINIT.
* @param islandType The islandtype to register
* @param model The variant within a blockstate json to use as the islandtype's model
*/
public static void registerIslandTypeModel(IFloatingFlower.IslandType islandType, ModelResourceLocation model) {
Preconditions.checkState(Loader.instance().isInState(LoaderState.PREINITIALIZATION));
islandTypeModels.put(islandType, model);
}
/**
* @return An immutable and live view of the registered island type model map
*/
public static Map<IFloatingFlower.IslandType, ModelResourceLocation> getRegisteredIslandTypeModels() {
return Collections.unmodifiableMap(islandTypeModels);
}
private BotaniaAPIClient() {}
}
@@ -33,7 +33,7 @@ public final class CorporeaHelper {
private static final List<IInventory> empty = Collections.unmodifiableList(new ArrayList());
private static final WeakHashMap<List<ICorporeaSpark>, List<IInventory>> cachedNetworks = new WeakHashMap();
private static final List<ICorporeaAutoCompleteController> autoCompleteControllers = new ArrayList<ICorporeaAutoCompleteController>();
private static final List<ICorporeaAutoCompleteController> autoCompleteControllers = new ArrayList<>();
private static final Pattern patternControlCode = Pattern.compile("(?i)\\u00A7[0-9A-FK-OR]");
@@ -13,8 +13,7 @@ package vazkii.botania.api.internal;
import java.util.List;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
@@ -134,13 +133,13 @@ public class DummyMethodHandler implements IInternalMethodHandler {
}
@Override
public TextureAtlasSprite getSubTileIconForName(String name) {
return null; //todo 1.8 return Blocks.red_flower.getIcon(0, 0);
public ModelResourceLocation getSubTileBlockModelForName(String name) {
return new ModelResourceLocation("builtin/missing", "missing");
}
@Override
public void registerBasicSignatureIcons(String name, TextureMap map) {
// NO-OP
public ModelResourceLocation getSubTileItemModelForName(String name) {
return new ModelResourceLocation("builtin/missing", "missing");
}
@Override
@@ -13,8 +13,7 @@ package vazkii.botania.api.internal;
import java.util.List;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
@@ -85,10 +84,11 @@ public interface IInternalMethodHandler {
public String getStackSubTileKey(ItemStack stack);
// todo 1.8 evaluate need for these two
public TextureAtlasSprite getSubTileIconForName(String name);
@SideOnly(Side.CLIENT)
public ModelResourceLocation getSubTileBlockModelForName(String name);
public void registerBasicSignatureIcons(String name, TextureMap map);
@SideOnly(Side.CLIENT)
public ModelResourceLocation getSubTileItemModelForName(String name);
public boolean shouldForceCheck();
@@ -10,13 +10,9 @@
*/
package vazkii.botania.api.item;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.event.RenderPlayerEvent;
import org.lwjgl.opengl.GL11;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -37,7 +33,7 @@ public interface IBaubleRender {
* has a cosmetic bauble attached to it.
*/
@SideOnly(Side.CLIENT)
public void onPlayerBaubleRender(ItemStack stack, RenderPlayerEvent event, RenderType type);
public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks);
/**
* A few helper methods for the render.
@@ -54,7 +50,7 @@ public interface IBaubleRender {
}
public static void translateToHeadLevel(EntityPlayer player) {
GlStateManager.translate(0, -player.getDefaultEyeHeight() + (player.isSneaking() ? 0.0625 : 0), 0);
GlStateManager.translate(0, -player.getDefaultEyeHeight() + (player.isSneaking() ? 0.25 : 0), 0);
}
}
@@ -0,0 +1,63 @@
/**
* This class was created by <Vazkii>. 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
*
* File Created @ [Nov 17, 2014, 6:05:18 PM (GMT)]
*/
package vazkii.botania.api.item;
import net.minecraft.item.ItemStack;
import java.util.HashMap;
public interface IFloatingFlower {
public ItemStack getDisplayStack();
public IslandType getIslandType();
public void setIslandType(IslandType type);
public class IslandType {
private static HashMap<String, IslandType> registry = new HashMap<String, IslandType>();
public static final IslandType GRASS = new IslandType("GRASS");
public static final IslandType PODZOL = new IslandType("PODZOL");
public static final IslandType MYCEL = new IslandType("MYCEL");
public static final IslandType SNOW = new IslandType("SNOW");
public static final IslandType DRY = new IslandType("DRY");
public static final IslandType GOLDEN = new IslandType("GOLDEN");
public static final IslandType VIVID = new IslandType("VIVID");
public static final IslandType SCORCHED = new IslandType("SCORCHED");
public static final IslandType INFUSED = new IslandType("INFUSED");
public static final IslandType MUTATED = new IslandType("MUTATED");
/**
* Instantiates and registers a new floating flower island type
* Note that you need to register the model for this island type, see BotaniaAPIClient
* @param name The name of this floating flower island type
*/
public IslandType(String name) {
if (registry.containsKey(name)) throw new IllegalArgumentException(name+" already registered!");
this.typeName = name;
registry.put(name, this);
}
public final String typeName;
public static IslandType ofType(String typeStr) {
IslandType type = registry.get(typeStr);
return type == null ? GRASS : type;
}
@Override
public String toString() {
return this.typeName;
}
}
}
@@ -13,8 +13,6 @@ package vazkii.botania.api.item;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement;
import java.util.UUID;
/**
* An item that implements this counts as a Relic item. This is purely for interaction
* and other mod items should not implement this interface.
@@ -22,14 +20,14 @@ import java.util.UUID;
public interface IRelic {
/**
* Binds to the player UUID passed in.
* Binds to the player name passed in.
*/
public void bindToUuid(UUID playerName, ItemStack stack);
public void bindToUsername(String playerName, ItemStack stack);
/**
* Gets the UUID of the person this relic is bound to.
* Gets the username of the person this relic is bound to.
*/
public UUID getSoulbindUuid(ItemStack stack);
public String getSoulbindUsername(ItemStack stack);
/**
* Sets the achievement that this relic binds to.
@@ -25,14 +25,15 @@ public class TinyPotatoRenderEvent extends Event {
public final String name;
public final double x, y, z;
public final float partTicks;
public final int destroyStage;
public TinyPotatoRenderEvent(TileEntity tile, String name, double x, double y, double z, float partTicks) {
public TinyPotatoRenderEvent(TileEntity tile, String name, double x, double y, double z, float partTicks, int destroyStage) {
this.tile = tile;
this.name = name;
this.x = x;
this.y = y;
this.z = z;
this.partTicks = partTicks;
this.destroyStage = destroyStage;
}
}
}
@@ -20,7 +20,7 @@ public class LexiconCategory implements Comparable<LexiconCategory> {
private static int count = 0;
public final String unlocalizedName;
public final List<LexiconEntry> entries = new ArrayList<LexiconEntry>();
public final List<LexiconEntry> entries = new ArrayList<>();
private final int sortingId;
private ResourceLocation icon;
private int priority = 5;
@@ -27,7 +27,7 @@ public class LexiconEntry implements Comparable<LexiconEntry> {
private KnowledgeType type = BotaniaAPI.basicKnowledge;
public List<LexiconPage> pages = new ArrayList<LexiconPage>();
public List<LexiconPage> pages = new ArrayList<>();
private boolean priority = false;
private ItemStack icon = null;
@@ -12,7 +12,6 @@ package vazkii.botania.api.lexicon.multiblock;
import java.util.*;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
@@ -33,7 +32,7 @@ public class Multiblock {
public BlockPos maxPos = BlockPos.ORIGIN;
public BlockPos offPos = BlockPos.ORIGIN;
public HashMap<BlockPos, MultiblockComponent> locationCache = new HashMap<BlockPos, MultiblockComponent>();
public HashMap<BlockPos, MultiblockComponent> locationCache = new HashMap<>();
/**
* Adds a multiblock component to this multiblock. The component's x y z
@@ -125,7 +124,7 @@ public class Multiblock {
* orientations.
*/
public Map<EnumFacing, Multiblock> createRotations() {
Map<EnumFacing, Multiblock> ret = new EnumMap<EnumFacing, Multiblock>(EnumFacing.class);
Map<EnumFacing, Multiblock> ret = new EnumMap<>(EnumFacing.class);
ret.put(EnumFacing.SOUTH, this);
@@ -12,7 +12,6 @@ package vazkii.botania.api.lexicon.multiblock;
import net.minecraft.entity.Entity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.MathHelper;
import java.util.Collections;
import java.util.Map;
@@ -10,7 +10,6 @@
*/
package vazkii.botania.api.lexicon.multiblock.component;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
@@ -58,7 +57,7 @@ public class MultiblockComponent {
}
public boolean matches(World world, BlockPos pos) {
return world.getBlockState(pos) == state; // todo 1.8?
return world.getBlockState(pos) == state;
}
public ItemStack[] getMaterials() {
@@ -0,0 +1,24 @@
package vazkii.botania.api.lexicon.multiblock.component;
import net.minecraft.block.Block;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
// Multiblock component that only compares blocks, not blockstates
public class StateInsensitiveComponent extends MultiblockComponent {
public StateInsensitiveComponent(BlockPos relPos, Block block) {
super(relPos, block.getDefaultState(), false, null);
}
@Override
public boolean matches(World world, BlockPos pos) {
return world.getBlockState(pos).getBlock() == this.getBlockState().getBlock();
}
@Override
public MultiblockComponent copy() {
return new StateInsensitiveComponent(getRelativePosition(), getBlockState().getBlock());
}
}
@@ -13,6 +13,8 @@ package vazkii.botania.api.mana;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
/**
* A block that implements this can provide an IIcon (block icons only)
@@ -21,6 +23,7 @@ import net.minecraft.world.World;
*/
public interface IPoolOverlayProvider {
@SideOnly(Side.CLIENT)
public TextureAtlasSprite getIcon(World world, BlockPos pos);
}
@@ -1,4 +1,4 @@
@API(owner = "Botania", apiVersion = "75", provides = "BotaniaAPI")
@API(owner = "Botania", apiVersion = "76", provides = "BotaniaAPI")
package vazkii.botania.api;
import net.minecraftforge.fml.common.API;
@@ -44,7 +44,7 @@ public class RecipePureDaisy {
if(input instanceof Block)
return state.getBlock() == input;
ItemStack stack = new ItemStack(state.getBlock(), 1, state.getBlock().getMetaFromState(state));
ItemStack stack = new ItemStack(state.getBlock(), 1, state.getBlock().damageDropped(state));
String oredict = (String) input;
return isOreDict(stack, oredict);
}
@@ -8,7 +8,6 @@
*/
package vazkii.botania.api.state;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import net.minecraft.block.BlockRailBase;
import net.minecraft.block.BlockRailPowered;
@@ -16,8 +15,10 @@ import net.minecraft.block.BlockRotatedPillar;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.util.EnumFacing;
import vazkii.botania.api.item.IFloatingFlower;
import vazkii.botania.api.state.enums.*;
/**
@@ -25,9 +26,16 @@ import vazkii.botania.api.state.enums.*;
*/
public class BotaniaStateProps {
/** The property for specialFlower **/
/** Unlisted properties **/
public static final PropertyString SUBTILE_ID = new PropertyString("subtile_id");
// The property for specialFlower subtile id
public static final PropertyObject<String> SUBTILE_ID = new PropertyObject<>("subtile_id", String.class);
// The property for floating flower island type
public static final PropertyObject<IFloatingFlower.IslandType> ISLAND_TYPE = new PropertyObject<>("islandtype", IFloatingFlower.IslandType.class);
// The property for platform held blockstate id
public static final PropertyObject<IBlockState> HELD_STATE = new PropertyObject<>("held_state", IBlockState.class);
/** Common properties to all blocks to use **/
@@ -61,12 +69,9 @@ public class BotaniaStateProps {
public static final PropertyEnum<FutureStoneVariant> FUTURESTONE_VARIANT = PropertyEnum.create("variant", FutureStoneVariant.class);
// Block18StoneWall
public static final PropertyEnum<FutureStoneVariant> FUTURESTONEWALL_VARIANT = PropertyEnum.create("variant", FutureStoneVariant.class, new Predicate<FutureStoneVariant>() {
@Override
public boolean apply(FutureStoneVariant variant) {
// Just the four kinds (no polished, chiseled, etc.)
return variant.ordinal() >= 0 && variant.ordinal() <= 3;
}
public static final PropertyEnum<FutureStoneVariant> FUTURESTONEWALL_VARIANT = PropertyEnum.create("variant", FutureStoneVariant.class, variant -> {
// Just the four kinds (no polished, chiseled, etc.)
return variant.ordinal() >= 0 && variant.ordinal() <= 3;
});
// BlockAlfPortal
@@ -85,12 +90,7 @@ public class BotaniaStateProps {
public static final PropertyEnum<BiomeBrickVariant> BIOMEBRICK_VARIANT = PropertyEnum.create("variant", BiomeBrickVariant.class);
// BlockBiomeStoneWall
public static final PropertyEnum<BiomeStoneVariant> BIOMESTONEWALL_VARIANT = PropertyEnum.create("variant", BiomeStoneVariant.class, new Predicate<BiomeStoneVariant>() {
@Override
public boolean apply(BiomeStoneVariant input) {
return input.getName().contains("cobble");
}
});
public static final PropertyEnum<BiomeStoneVariant> BIOMESTONEWALL_VARIANT = PropertyEnum.create("variant", BiomeStoneVariant.class, input -> input.getName().contains("cobble"));
// BlockCustomBrick
public static final PropertyEnum<CustomBrickVariant> CUSTOMBRICK_VARIANT = PropertyEnum.create("variant", CustomBrickVariant.class);
@@ -116,35 +116,21 @@ public class BotaniaStateProps {
// BlockLivingRock
public static final PropertyEnum<LivingRockVariant> LIVINGROCK_VARIANT = PropertyEnum.create("variant", LivingRockVariant.class);
// BlockModDoubleFlower
public static final PropertyEnum<EnumDyeColor> DOUBLEFLOWER_VARIANT_1 = PropertyEnum.create("variant", EnumDyeColor.class, new Predicate<EnumDyeColor>() {
@Override
public boolean apply(EnumDyeColor input) {
// White to gray
return input.ordinal() >= 0 && input.ordinal() <= 7;
}
});
// BlockModDoubleFlower (white to gray)
public static final PropertyEnum<EnumDyeColor> DOUBLEFLOWER_VARIANT_1 = PropertyEnum.create("variant", EnumDyeColor.class, input -> input.ordinal() >= 0 && input.ordinal() <= 7);
public static final PropertyEnum<EnumDyeColor> DOUBLEFLOWER_VARIANT_2 = PropertyEnum.create("variant", EnumDyeColor.class, new Predicate<EnumDyeColor>() {
@Override
public boolean apply(EnumDyeColor input) {
// Silver to black
return input.ordinal() >= 8 && input.ordinal() <= 15;
}
});
// (silver to black)
public static final PropertyEnum<EnumDyeColor> DOUBLEFLOWER_VARIANT_2 = PropertyEnum.create("variant", EnumDyeColor.class, input -> input.ordinal() >= 8 && input.ordinal() <= 15);
// BlockOpenCrate
public static final PropertyEnum<CrateVariant> CRATE_VARIANT = PropertyEnum.create("variant", CrateVariant.class);
public static final PropertyEnum<CratePattern> CRATE_PATTERN = PropertyEnum.create("pattern", CratePattern.class);
// BlockPavement
public static final PropertyEnum<EnumDyeColor> PAVEMENT_COLOR = PropertyEnum.create("color", EnumDyeColor.class, new Predicate<EnumDyeColor>() {
@Override
public boolean apply(EnumDyeColor color) {
return color == EnumDyeColor.WHITE || color == EnumDyeColor.BLACK
|| color == EnumDyeColor.BLUE || color == EnumDyeColor.RED
|| color == EnumDyeColor.YELLOW || color == EnumDyeColor.GREEN;
}
});
public static final PropertyEnum<EnumDyeColor> PAVEMENT_COLOR = PropertyEnum.create("color", EnumDyeColor.class, color ->
color == EnumDyeColor.WHITE || color == EnumDyeColor.BLACK
|| color == EnumDyeColor.BLUE || color == EnumDyeColor.RED
|| color == EnumDyeColor.YELLOW || color == EnumDyeColor.GREEN);
// BlockPlatform
public static final PropertyEnum<PlatformVariant> PLATFORM_VARIANT = PropertyEnum.create("variant", PlatformVariant.class);
@@ -167,9 +153,6 @@ public class BotaniaStateProps {
// BlockStorage
public static final PropertyEnum<StorageVariant> STORAGE_VARIANT = PropertyEnum.create("variant", StorageVariant.class);
// BlockTinyPotato
public static final PropertyEnum<PotatoVariant> POTATO_VARIANT = PropertyEnum.create("variant", PotatoVariant.class);
private BotaniaStateProps() {}
}
@@ -0,0 +1,46 @@
package vazkii.botania.api.state;
import com.google.common.base.Function;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import net.minecraftforge.common.property.IUnlistedProperty;
// Generic base class for unlisted properties
public class PropertyObject<T> implements IUnlistedProperty<T> {
private final String name;
private final Class<T> clazz;
private final Predicate<T> validator;
private final Function<T, String> stringFunction;
public PropertyObject(String name, Class<T> clazz, Predicate<T> validator, Function<T, String> stringFunction) {
this.name = name;
this.clazz = clazz;
this.validator = validator;
this.stringFunction = stringFunction;
}
public PropertyObject(String name, Class<T> clazz) {
this(name, clazz, Predicates.alwaysTrue(), Object::toString);
}
@Override
public String getName() {
return name;
}
@Override
public boolean isValid(T value) {
return validator.apply(value);
}
@Override
public Class<T> getType() {
return clazz;
}
@Override
public String valueToString(T value) {
return stringFunction.apply(value);
}
}
@@ -1,40 +0,0 @@
/**
* This class was created by <williewillus>. 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.state;
import net.minecraftforge.common.property.IUnlistedProperty;
public class PropertyString implements IUnlistedProperty<String> {
private final String name;
public PropertyString(String name) {
this.name = name;
}
@Override
public String getName() {
return name;
}
@Override
public boolean isValid(String value) {
return true;
}
@Override
public Class<String> getType() {
return String.class;
}
@Override
public String valueToString(String value) {
return value;
}
}
@@ -12,10 +12,17 @@ import net.minecraft.util.IStringSerializable;
import java.util.Locale;
public enum PotatoVariant implements IStringSerializable {
DEFAULT,
HALLOWEEN,
GRAYSCALE;
public enum CratePattern implements IStringSerializable {
NONE,
CRAFTY_1_1,
CRAFTY_2_2,
CRAFTY_1_2,
CRAFTY_2_1,
CRAFTY_1_3,
CRAFTY_3_1,
CRAFTY_2_3,
CRAFTY_3_2,
CRAFTY_DONUT;
@Override
public String getName() {
@@ -10,13 +10,12 @@
*/
package vazkii.botania.api.subtile;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -94,11 +93,19 @@ public class SubTileEntity {
}
/**
* Gets the icon for this SubTileEntity, this is a block icon.
* Gets the block model path for this subtile
*/
@SideOnly(Side.CLIENT) // todo 1.8 reevaluate need
public TextureAtlasSprite getIcon() {
return BotaniaAPI.internalHandler.getSubTileIconForName(getUnlocalizedName());
@SideOnly(Side.CLIENT)
public ModelResourceLocation getBlockModel() {
return BotaniaAPI.internalHandler.getSubTileBlockModelForName(getUnlocalizedName());
}
/**
* Gets the item model path for this subtile
*/
@SideOnly(Side.CLIENT)
public ModelResourceLocation getItemModel() {
return BotaniaAPI.internalHandler.getSubTileItemModelForName(getUnlocalizedName());
}
/**
@@ -206,7 +206,7 @@ public class SubTileFunctional extends SubTileEntity {
}
public boolean isValidBinding() {
return linkedPool != null && !linkedPool.isInvalid() && supertile.getWorld().getTileEntity(linkedPool.getPos()) == linkedPool;
return supertile.getWorld().isBlockLoaded(linkedPool.getPos(), false) && linkedPool != null && !linkedPool.isInvalid() && supertile.getWorld().getTileEntity(linkedPool.getPos()) == linkedPool;
}
@Override
@@ -11,7 +11,6 @@
package vazkii.botania.api.subtile;
import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
@@ -101,7 +100,7 @@ public class SubTileGenerating extends SubTileEntity {
if(passive && muhBalance > 0 && passiveDecayTicks > muhBalance) {
supertile.getWorld().playAuxSFX(2001, supertile.getPos(), Block.getIdFromBlock(supertile.getBlockType()));
if(supertile.getWorld().getBlockState(supertile.getPos().down()).getBlock().isSideSolid(supertile.getWorld(), supertile.getPos().down(), EnumFacing.DOWN))
if(supertile.getWorld().getBlockState(supertile.getPos().down()).getBlock().isSideSolid(supertile.getWorld(), supertile.getPos().down(), EnumFacing.UP))
supertile.getWorld().setBlockState(supertile.getPos(), Blocks.deadbush.getDefaultState());
else supertile.getWorld().setBlockToAir(supertile.getPos());
}
@@ -12,8 +12,6 @@ package vazkii.botania.api.subtile.signature;
import java.util.List;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -56,7 +56,7 @@ public class SimpleWikiProvider implements IWikiProvider {
ItemStack stack = block.getPickBlock(pos, world, bPos, null);
if(stack == null || stack.getItem() == null)
stack = new ItemStack(block, 1, block.getMetaFromState(world.getBlockState(bPos)));
stack = new ItemStack(block, 1, block.getDamageValue(world, bPos));
if(stack.getItem() == null)
return null;
@@ -10,23 +10,18 @@
*/
package vazkii.botania.client.core.handler;
import java.awt.Color;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraftforge.client.event.RenderPlayerEvent;
import org.lwjgl.opengl.GL11;
import vazkii.botania.api.item.IBaubleRender;
import vazkii.botania.api.item.IBaubleRender.Helper;
import vazkii.botania.api.item.IBaubleRender.RenderType;
@@ -39,38 +34,37 @@ import baubles.common.container.InventoryBaubles;
import baubles.common.lib.PlayerHandler;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
public final class BaubleRenderHandler {
public final class BaubleRenderHandler implements LayerRenderer<EntityPlayer> {
@SubscribeEvent
public void onPlayerRender(RenderPlayerEvent.Specials.Post event) {
if(!ConfigHandler.renderBaubles || event.entityLiving.getActivePotionEffect(Potion.invisibility) != null)
@Override
public void doRenderLayer(EntityPlayer player, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) {
if(!ConfigHandler.renderBaubles || player.getActivePotionEffect(Potion.invisibility) != null)
return;
EntityPlayer player = event.entityPlayer;
InventoryBaubles inv = PlayerHandler.getPlayerBaubles(player);
dispatchRenders(inv, event, RenderType.BODY);
dispatchRenders(inv, player, RenderType.BODY, partialTicks);
if(inv.getStackInSlot(3) != null)
renderManaTablet(event);
renderManaTablet(player);
float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * event.partialRenderTick;
float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * event.partialRenderTick;
float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * event.partialRenderTick;
float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * partialTicks;
float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * partialTicks;
float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * partialTicks;
GlStateManager.pushMatrix();
GlStateManager.rotate(yawOffset, 0, -1, 0);
GlStateManager.rotate(yaw - 270, 0, 1, 0);
GlStateManager.rotate(pitch, 0, 0, 1);
dispatchRenders(inv, event, RenderType.HEAD);
dispatchRenders(inv, player, RenderType.HEAD, partialTicks);
ItemStack helm = player.inventory.armorItemInSlot(3);
if(helm != null && helm.getItem() instanceof ItemTerrasteelHelm)
ItemTerrasteelHelm.renderOnPlayer(helm, event);
ItemTerrasteelHelm.renderOnPlayer(helm, player);
GlStateManager.popMatrix();
}
private void dispatchRenders(InventoryBaubles inv, RenderPlayerEvent event, RenderType type) {
private void dispatchRenders(InventoryBaubles inv, EntityPlayer player, RenderType type, float partialTicks) {
for(int i = 0; i < inv.getSizeInventory(); i++) {
ItemStack stack = inv.getStackInSlot(i);
if(stack != null) {
@@ -87,8 +81,9 @@ public final class BaubleRenderHandler {
ItemStack cosmetic = attachable.getCosmeticItem(stack);
if(cosmetic != null) {
GlStateManager.pushMatrix();
GL11.glColor3ub(((byte) 255), ((byte) 255), ((byte) 255)); // Some of the baubles use this so we must restore it manually as well
GlStateManager.color(1F, 1F, 1F, 1F);
((IBaubleRender) cosmetic.getItem()).onPlayerBaubleRender(cosmetic, event, type);
((IBaubleRender) cosmetic.getItem()).onPlayerBaubleRender(cosmetic, player, type, partialTicks);
GlStateManager.popMatrix();
continue;
}
@@ -96,29 +91,33 @@ public final class BaubleRenderHandler {
if(item instanceof IBaubleRender) {
GlStateManager.pushMatrix();
GL11.glColor3ub(((byte) 255), ((byte) 255), ((byte) 255)); // Some of the baubles use this so we must restore it manually as well
GlStateManager.color(1F, 1F, 1F, 1F);
((IBaubleRender) stack.getItem()).onPlayerBaubleRender(stack, event, type);
((IBaubleRender) stack.getItem()).onPlayerBaubleRender(stack, player, type, partialTicks);
GlStateManager.popMatrix();
}
}
}
}
private void renderManaTablet(RenderPlayerEvent event) {
EntityPlayer player = event.entityPlayer;
private void renderManaTablet(EntityPlayer player) {
boolean renderedOne = false;
for(int i = 0; i < player.inventory.getSizeInventory(); i++) {
ItemStack stack = player.inventory.getStackInSlot(i);
if(stack != null && stack.getItem() == ModItems.manaTablet) {
Item item = stack.getItem();
GlStateManager.pushMatrix();
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
Helper.rotateIfSneaking(event.entityPlayer);
boolean armor = event.entityPlayer.getCurrentArmor(1) != null;
GlStateManager.rotate(180F, 1F, 0F, 0F);
GlStateManager.rotate(90F, 0F, 1F, 0F);
GlStateManager.translate(-0.25F, -0.85F, renderedOne ? armor ? 0.2F : 0.28F : armor ? -0.3F : -0.25F);
GlStateManager.scale(0.5F, 0.5F, 0.5F);
Helper.rotateIfSneaking(player);
boolean armor = player.getCurrentArmor(1) != null;
GlStateManager.rotate(90, 0, 1, 0);
GlStateManager.rotate(90, 1, 0, 0);
if (renderedOne)
GlStateManager.translate(0F, armor ? 0.20F : 0.18F, -0.25F);
else
GlStateManager.translate(0F, armor ? -0.39F : -0.35F, -0.25F);
GlStateManager.scale(0.75F, 0.75F, 0.75F);
GlStateManager.color(1F, 1F, 1F);
int light = 15728880;
@@ -135,5 +134,8 @@ public final class BaubleRenderHandler {
}
}
@Override
public boolean shouldCombineTextures() {
return false;
}
}
@@ -18,19 +18,14 @@ import java.util.Properties;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.settings.GameSettings.Options;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EnumPlayerModelParts;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.event.RenderPlayerEvent;
import org.lwjgl.opengl.GL11;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.item.IBaubleRender.Helper;
@@ -39,9 +34,7 @@ import vazkii.botania.client.core.helper.IconHelper;
import vazkii.botania.client.core.helper.ShaderHelper;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.core.version.VersionChecker;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
import vazkii.botania.common.item.material.ItemManaResource;
import net.minecraftforge.fml.common.FMLLog;
public final class ContributorFancinessHandler implements LayerRenderer<EntityPlayer> {
@@ -55,6 +48,15 @@ public final class ContributorFancinessHandler implements LayerRenderer<EntityPl
public void doRenderLayer(EntityPlayer player, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) {
String name = player.getDisplayName().getUnformattedText();
float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * partialTicks;
float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * partialTicks;
float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * partialTicks;
GlStateManager.pushMatrix();
GlStateManager.rotate(yawOffset, 0, -1, 0);
GlStateManager.rotate(yaw - 270, 0, 1, 0);
GlStateManager.rotate(pitch, 0, 0, 1);
if(name.equals("Vazkii") || name.equals("_phi")) {
if(phi)
renderPhiFlower(player);
@@ -67,6 +69,8 @@ public final class ContributorFancinessHandler implements LayerRenderer<EntityPl
name = name.toLowerCase();
if(player.isWearing(EnumPlayerModelParts.CAPE) && flowerMap != null && flowerMap.containsKey(name))
renderFlower(player, flowerMap.get(name));
GlStateManager.popMatrix();
}
@Override
@@ -101,7 +105,7 @@ public final class ContributorFancinessHandler implements LayerRenderer<EntityPl
private static void renderTwintails(EntityPlayer player, float partialTicks) {
GlStateManager.pushMatrix();
TextureAtlasSprite icon = RenderEventHandler.INSTANCE.tailIcon;
TextureAtlasSprite icon = MiscellaneousIcons.INSTANCE.tailIcon;
float f = icon.getMinU();
float f1 = icon.getMaxU();
float f2 = icon.getMinV();
@@ -109,12 +113,12 @@ public final class ContributorFancinessHandler implements LayerRenderer<EntityPl
Helper.translateToHeadLevel(player);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
GlStateManager.color(1F, 1F, 1F, 1F);
//GlStateManager.rotate(90F, 0F, 1F, 0F); todo 1.8 refine
GlStateManager.rotate(90F, 0F, 1F, 0F);
GlStateManager.translate(0, 1.62, 0);
float t = 0.13F;
GlStateManager.translate(t, -0.5F, -0.1F);
if(player.motionY < 0)
GlStateManager.rotate((float) player.motionY * 20F, -1F, 0F, 0F);
GlStateManager.rotate((float) player.motionY * 20F, 1F, 0F, 0F);
float r = -18F + (float) Math.sin((ClientTickHandler.ticksInGame + partialTicks) * 0.05F) * 2F;
GlStateManager.rotate(r, 0F, 0F, 1F);
@@ -132,7 +136,7 @@ public final class ContributorFancinessHandler implements LayerRenderer<EntityPl
private static void renderPhiFlower(EntityPlayer player) {
GlStateManager.pushMatrix();
TextureAtlasSprite icon = RenderEventHandler.INSTANCE.phiFlowerIcon;
TextureAtlasSprite icon = MiscellaneousIcons.INSTANCE.phiFlowerIcon;
float f = icon.getMinU();
float f1 = icon.getMaxU();
float f2 = icon.getMinV();
@@ -142,27 +146,26 @@ public final class ContributorFancinessHandler implements LayerRenderer<EntityPl
GlStateManager.rotate(180F, 1F, 0F, 0F);
GlStateManager.translate(-0.4F, 0.1F, -0.25F);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
// todo 1.8 refine
// GlStateManager.rotate(90F, 0F, 1F, 0F);
GlStateManager.rotate(90F, 0F, 1F, 0F);
GlStateManager.scale(0.4F, 0.4F, 0.4F);
GlStateManager.translate(0.70F, -3.5F, 0.125F);
// GlStateManager.rotate(20F, 1F, 0F, 0F);
GlStateManager.translate(-1F, -3.5F, 0.125F);
GlStateManager.rotate(20F, 1F, 0F, 0F);
IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F);
GlStateManager.popMatrix();
}
private static void renderGoldfish(EntityPlayer player) {
GlStateManager.pushMatrix();
TextureAtlasSprite icon = RenderEventHandler.INSTANCE.goldfishIcon;
TextureAtlasSprite icon = MiscellaneousIcons.INSTANCE.goldfishIcon;
float f = icon.getMinU();
float f1 = icon.getMaxU();
float f2 = icon.getMinV();
float f3 = icon.getMaxV();
Helper.rotateIfSneaking(player);
GlStateManager.rotate(180F, 0F, 0F, 1F);
GlStateManager.translate(-0.75F, 0.5F, 0F);
GlStateManager.rotate(90F, 0F, 1F, 0F);
GlStateManager.scale(0.4F, 0.4F, 0.4F);
GlStateManager.translate(1.2F, 0.5F, 0F);
GlStateManager.translate(-0.5F, 1.6F, 0F);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F);
GlStateManager.popMatrix();
@@ -173,7 +176,8 @@ public final class ContributorFancinessHandler implements LayerRenderer<EntityPl
Helper.translateToHeadLevel(player);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
GlStateManager.rotate(-90, 1, 0, 0);
GlStateManager.translate(0, 0, 1.22); // todo 1.8 refine
GlStateManager.translate(0, 0, 1.22);
GlStateManager.rotate(90, 0, 0, 1);
ShaderHelper.useShader(ShaderHelper.gold);
Minecraft.getMinecraft().getRenderItem().renderItemModelForEntity(flower, player, ItemCameraTransforms.TransformType.THIRD_PERSON);
ShaderHelper.releaseShader();
@@ -21,7 +21,6 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiChat;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatComponentText;
@@ -39,23 +38,17 @@ public class CorporeaAutoCompleteHandler {
boolean isAutoCompleted = false;
String originalString = "";
List<CompletionData> completions = new ArrayList<CompletionData>();
List<CompletionData> completions = new ArrayList<>();
int position;
static TreeSet<String> itemNames = new TreeSet<String>(
new Comparator<String>() {
@Override
public int compare(String arg0, String arg1) {
return arg0.compareToIgnoreCase(arg1);
}
});
static TreeSet<String> itemNames = new TreeSet<>(String::compareToIgnoreCase);
private boolean tabLastTick = false;
public static void updateItemList() {
itemNames.clear();
Iterator<Item> iterator = Item.itemRegistry.iterator();
ArrayList<ItemStack> curList = new ArrayList<ItemStack>();
ArrayList<ItemStack> curList = new ArrayList<>();
while(iterator.hasNext()) {
Item item = iterator.next();
@@ -146,7 +139,7 @@ public class CorporeaAutoCompleteHandler {
if(s.isEmpty())
return new ArrayList();
TreeSet<CompletionData> result = new TreeSet<CompletionData>();
TreeSet<CompletionData> result = new TreeSet<>();
String[] words = s.split(" ");
int i = words.length - 1;
String curPrefix = words[i];
@@ -156,11 +149,11 @@ public class CorporeaAutoCompleteHandler {
if(i >= 0)
curPrefix = words[i] + " " + curPrefix;
}
return new ArrayList<CompletionData>(result);
return new ArrayList<>(result);
}
private List<CompletionData> getNamesStartingWith(String prefix) {
ArrayList<CompletionData> result = new ArrayList<CompletionData>();
ArrayList<CompletionData> result = new ArrayList<>();
int length = prefix.length();
SortedSet<String> after = itemNames.tailSet(prefix);
for(String str : after) {
@@ -12,6 +12,8 @@ package vazkii.botania.client.core.handler;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
@@ -28,6 +30,8 @@ import vazkii.botania.common.core.handler.ManaNetworkHandler;
import vazkii.botania.common.lib.LibMisc;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import java.util.UUID;
public final class DebugHandler {
private static final String PREFIX = EnumChatFormatting.GREEN + "[Botania] " + EnumChatFormatting.RESET;
@@ -42,7 +46,16 @@ public final class DebugHandler {
version = "N/A";
event.left.add(PREFIX + "pS: " + ParticleRenderDispatcher.sparkleFxCount + ", pFS: " + ParticleRenderDispatcher.fakeSparkleFxCount + ", pW: " + ParticleRenderDispatcher.wispFxCount + ", pDIW: " + ParticleRenderDispatcher.depthIgnoringWispFxCount + ", pLB: " + ParticleRenderDispatcher.lightningCount);
event.left.add(PREFIX + "netColl: " + ManaNetworkHandler.instance.getAllCollectorsInWorld(world).size() + ", netPool: " + ManaNetworkHandler.instance.getAllPoolsInWorld(world).size() + ", rv: " + version);
event.left.add(PREFIX + "(CLIENT) netColl: " + ManaNetworkHandler.instance.getAllCollectorsInWorld(world).size() + ", netPool: " + ManaNetworkHandler.instance.getAllPoolsInWorld(world).size() + ", rv: " + version);
if (Minecraft.getMinecraft().isIntegratedServerRunning()) {
UUID id = Minecraft.getMinecraft().thePlayer.getUniqueID();
Entity ent = Minecraft.getMinecraft().getIntegratedServer().getEntityFromUuid(id);
if (ent != null) {
World serverWorld = Minecraft.getMinecraft().getIntegratedServer().getEntityFromUuid(id).worldObj;
event.left.add(PREFIX + String.format("(INTEGRATED SERVER DIM %d) netColl : %d, netPool: %d", serverWorld.provider.getDimensionId(), ManaNetworkHandler.instance.getAllCollectorsInWorld(serverWorld).size(), ManaNetworkHandler.instance.getAllPoolsInWorld(serverWorld).size()));
}
}
if(GuiScreen.isCtrlKeyDown() && GuiScreen.isShiftKeyDown()) {
event.left.add(PREFIX + "Config Context");
@@ -21,7 +21,6 @@ import net.minecraft.client.gui.GuiChat;
import net.minecraft.client.gui.GuiIngame;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
@@ -36,7 +35,6 @@ import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.lexicon.ILexicon;
@@ -102,9 +100,9 @@ public final class HUDHandler {
profiler.startSection("botania-hud");
MovingObjectPosition pos = mc.objectMouseOver;
if(pos != null && pos.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
Block block = mc.theWorld.getBlockState(pos.getBlockPos()).getBlock();
TileEntity tile = mc.theWorld.getTileEntity(pos.getBlockPos());
if(pos != null) {
Block block = pos.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK ? mc.theWorld.getBlockState(pos.getBlockPos()).getBlock() : null;
TileEntity tile = pos.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK ? mc.theWorld.getTileEntity(pos.getBlockPos()) : null;
if(equippedStack != null) {
if(pos != null && equippedStack.getItem() == ModItems.twigWand) {
@@ -115,7 +113,7 @@ public final class HUDHandler {
((IWandHUD) block).renderHUD(mc, event.resolution, mc.theWorld, pos.getBlockPos());
profiler.endSection();
}
} else if(pos != null && equippedStack.getItem() instanceof ILexicon)
} else if(block != null && equippedStack.getItem() instanceof ILexicon)
drawLexiconHUD(mc.thePlayer.getCurrentEquippedItem(), block, pos, event.resolution);
if(tile != null && tile instanceof TilePool)
renderPoolRecipeHUD(event.resolution, (TilePool) tile, equippedStack);
@@ -16,13 +16,11 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -177,11 +177,11 @@ public class LightningHandler {
public static class LightningBolt {
public ArrayList<Segment> segments = new ArrayList<Segment>();
public ArrayList<Segment> segments = new ArrayList<>();
public Vector3 start;
public Vector3 end;
BlockPos target;
HashMap<Integer, Integer> splitparents = new HashMap<Integer, Integer>();
HashMap<Integer, Integer> splitparents = new HashMap<>();
public double length;
public int numsegments0;
@@ -198,7 +198,7 @@ public class LightningHandler {
private World world;
private Entity source;
public static ConcurrentLinkedQueue<LightningBolt> boltlist = new ConcurrentLinkedQueue<LightningBolt>();
public static ConcurrentLinkedQueue<LightningBolt> boltlist = new ConcurrentLinkedQueue<>();
public float speed = 1.5F;
public static final int fadetime = 20;
@@ -350,7 +350,7 @@ public class LightningHandler {
return;
ArrayList<Segment> oldsegments = segments;
segments = new ArrayList<Segment>();
segments = new ArrayList<>();
Segment prev = null;
@@ -431,7 +431,7 @@ public class LightningHandler {
}
private void calculateCollisionAndDiffs() {
HashMap<Integer, Integer> lastactivesegment = new HashMap<Integer, Integer>();
HashMap<Integer, Integer> lastactivesegment = new HashMap<>();
Collections.sort(segments, new SegmentSorter());
@@ -1,26 +1,50 @@
/**
* This class was created by <williewillus>. 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.client.core.handler;
import com.google.common.collect.Maps;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.statemap.DefaultStateMapper;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.launchwrapper.Launch;
import net.minecraftforge.client.event.ModelBakeEvent;
import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.event.CommandEvent;
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.apache.commons.lang3.text.WordUtils;
import org.lwjgl.BufferUtils;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import vazkii.botania.client.core.helper.IconHelper;
import vazkii.botania.client.model.FloatingFlowerModel;
import vazkii.botania.client.model.PlatformModel;
import vazkii.botania.client.model.PylonItemModel;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.integration.buildcraft.TriggerManaLevel;
import vazkii.botania.common.item.ItemSparkUpgrade;
import vazkii.botania.common.item.equipment.bauble.ItemFlightTiara;
import vazkii.botania.common.item.relic.ItemKingKey;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.nio.IntBuffer;
import java.util.Map;
public class RenderEventHandler {
public class MiscellaneousIcons {
public static final RenderEventHandler INSTANCE = new RenderEventHandler();
public static final MiscellaneousIcons INSTANCE = new MiscellaneousIcons();
public TextureAtlasSprite
alfPortalTex,
@@ -36,19 +60,31 @@ public class RenderEventHandler {
corporeaIconStar,
sparkWorldIcon,
manaDetectorIcon,
runeAltarTriggerIcon;
runeAltarTriggerIcon,
terrasteelHelmWillIcon;
public TextureAtlasSprite[] sparkUpgradeIcons;
public TextureAtlasSprite[] kingKeyWeaponIcons;
public Map<TriggerManaLevel.State, TextureAtlasSprite> manaLevelTriggerIcons = Maps.newEnumMap(TriggerManaLevel.State.class);
public TextureAtlasSprite[] tiaraWingIcons;
// begin dank_memes todo 1.8 if I can figure out how to render arbitrary baked models then these will no longer be needed
// begin dank_memes
public TextureAtlasSprite tailIcon = null;
public TextureAtlasSprite phiFlowerIcon = null;
public TextureAtlasSprite goldfishIcon = null;
public TextureAtlasSprite nerfBatIcon = null;
// end dank_memes
// Icons for baubles that don't render their own model on the player
public TextureAtlasSprite
bloodPendantChain,
bloodPendantGem,
snowflakePendantGem,
itemFinderGem,
pyroclastGem,
crimsonGem;
@SubscribeEvent
public void onModelBake(ModelBakeEvent evt) {
// BlockSpecialFlower
@@ -65,11 +101,16 @@ public class RenderEventHandler {
evt.modelRegistry.putObject(new ModelResourceLocation("botania:miniIsland", "inventory"), FloatingFlowerModel.INSTANCE);
evt.modelRegistry.putObject(new ModelResourceLocation("botania:floatingSpecialFlower", "normal"), FloatingFlowerModel.INSTANCE);
evt.modelRegistry.putObject(new ModelResourceLocation("botania:floatingSpecialFlower", "inventory"), FloatingFlowerModel.INSTANCE);
// Pylon item model
evt.modelRegistry.putObject(new ModelResourceLocation("botania:pylon", "inventory"), new PylonItemModel());
// Platforms
evt.modelRegistry.putObject(new ModelResourceLocation("botania:platform", "normal"), new PlatformModel());
}
@SubscribeEvent
public void onTextureStitch(TextureStitchEvent.Pre evt) {
System.out.println("CALLING TEXTURE STITCH");
alfPortalTex = IconHelper.forName(evt.map, "alfheimPortalInside", "blocks");
lightRelayWorldIcon = IconHelper.forName(evt.map, "lightRelay1", "blocks");
lightRelayWorldIconRed = IconHelper.forName(evt.map, "lightRelay3", "blocks");
@@ -103,7 +144,64 @@ public class RenderEventHandler {
for (TriggerManaLevel.State s : TriggerManaLevel.State.values()) {
manaLevelTriggerIcons.put(s, IconHelper.forName(evt.map, "triggers/mana" + WordUtils.capitalizeFully(s.name()), "items"));
}
tiaraWingIcons = new TextureAtlasSprite[ItemFlightTiara.WING_TYPES];
for (int i = 0; i < tiaraWingIcons.length; i++) {
tiaraWingIcons[i] = IconHelper.forName(evt.map, "flightTiara" + (i + 1), "items");
}
terrasteelHelmWillIcon = IconHelper.forName(evt.map, "willFlame", "items");
bloodPendantChain = IconHelper.forName(evt.map, "bloodPendant2", "items");
bloodPendantGem = IconHelper.forName(evt.map, "bloodPendant3", "items");
snowflakePendantGem = IconHelper.forName(evt.map, "icePendantGem", "items");
itemFinderGem = IconHelper.forName(evt.map, "itemFinderGem", "items");
pyroclastGem = IconHelper.forName(evt.map, "lavaPendantGem", "items");
crimsonGem = IconHelper.forName(evt.map, "superLavaPendantGem", "items");
}
private RenderEventHandler() {}
@SubscribeEvent
public void dumpAtlas(ArrowLooseEvent evt) {
if (!evt.entityPlayer.worldObj.isRemote || !((Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment")))
return;
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
int width = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH);
int height = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_HEIGHT);
System.out.printf("Atlas is %d wide by %d tall%n", width, height);
int pixels = width * height;
IntBuffer buffer = BufferUtils.createIntBuffer(pixels);
int[] pixelValues = new int[pixels];
GL11.glPixelStorei(GL11.GL_PACK_ALIGNMENT, 1);
GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1);
GL11.glGetTexImage(GL11.GL_TEXTURE_2D, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, buffer);
buffer.get(pixelValues);
BufferedImage bufferedimage = new BufferedImage(width, height, 2);
for (int k = 0; k < height; ++k)
{
for (int l = 0; l < width; ++l)
{
bufferedimage.setRGB(l, k, pixelValues[k * width + l]);
}
}
File mcFolder = Minecraft.getMinecraft().mcDataDir;
File result = new File(mcFolder, "atlas.png");
try {
ImageIO.write(bufferedimage, "png", result);
} catch (IOException e) {
e.printStackTrace();
}
}
private MiscellaneousIcons() {}
}
@@ -12,11 +12,13 @@ import com.google.common.collect.ImmutableList;
import net.minecraft.block.Block;
import net.minecraft.block.BlockDoublePlant;
import net.minecraft.block.BlockFlower;
import net.minecraft.block.BlockSkull;
import net.minecraft.block.BlockSlab;
import net.minecraft.block.BlockWall;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemMeshDefinition;
import net.minecraft.client.renderer.ItemModelMesher;
import net.minecraft.client.renderer.block.statemap.StateMap;
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
import net.minecraft.client.resources.IReloadableResourceManager;
@@ -32,7 +34,10 @@ import net.minecraftforge.client.model.ModelLoaderRegistry;
import net.minecraftforge.client.model.obj.OBJLoader;
import net.minecraftforge.fml.common.registry.GameData;
import vazkii.botania.api.BotaniaAPIClient;
import vazkii.botania.client.render.SpecialFlowerModel;
import vazkii.botania.api.item.IFloatingFlower;
import vazkii.botania.api.state.enums.PlatformVariant;
import vazkii.botania.api.state.enums.SpreaderVariant;
import vazkii.botania.client.model.SpecialFlowerModel;
import vazkii.botania.api.state.BotaniaStateProps;
import vazkii.botania.api.state.enums.AltGrassVariant;
import vazkii.botania.api.state.enums.AltarVariant;
@@ -97,15 +102,25 @@ import vazkii.botania.common.block.subtile.generating.SubTileNightshade;
import vazkii.botania.common.block.subtile.generating.SubTileRafflowsia;
import vazkii.botania.common.block.subtile.generating.SubTileSpectrolus;
import vazkii.botania.common.block.subtile.generating.SubTileThermalily;
import vazkii.botania.common.block.tile.TileAvatar;
import vazkii.botania.common.block.tile.TileBrewery;
import vazkii.botania.common.block.tile.TileGaiaHead;
import vazkii.botania.common.block.tile.TileHourglass;
import vazkii.botania.common.block.tile.TileTeruTeruBozu;
import vazkii.botania.common.block.tile.corporea.TileCorporeaCrystalCube;
import vazkii.botania.common.block.tile.corporea.TileCorporeaIndex;
import vazkii.botania.common.block.tile.mana.TileBellows;
import vazkii.botania.common.block.tile.mana.TilePump;
import vazkii.botania.common.item.ItemManaGun;
import vazkii.botania.common.item.ItemSpawnerMover;
import vazkii.botania.common.item.ItemTwigWand;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.item.brew.ItemBrewBase;
import vazkii.botania.common.item.equipment.bauble.ItemFlightTiara;
import vazkii.botania.common.item.equipment.bauble.ItemMagnetRing;
import vazkii.botania.common.item.equipment.tool.terrasteel.ItemTerraPick;
import vazkii.botania.common.item.relic.ItemInfiniteFruit;
import vazkii.botania.common.item.rod.ItemTornadoRod;
import vazkii.botania.common.lib.LibBlockNames;
import vazkii.botania.common.lib.LibItemNames;
import vazkii.botania.common.lib.LibMisc;
@@ -117,9 +132,7 @@ import java.util.Locale;
public final class ModelHandler {
// Very hardocode-y right now. Will be refactored after things work.
// In addition, many of the jsons currently use the vanilla format (simple and verified bug-free).
// Once things settle down, we'll move to forge jsons, which will drastically cut down on the number of json files
// todo reorganize, alphabetize
public static void registerModels() {
ModelLoaderRegistry.registerLoader(SpecialFlowerModel.Loader.INSTANCE);
OBJLoader.instance.addDomain(LibMisc.MOD_ID.toLowerCase(Locale.ROOT));
@@ -143,6 +156,7 @@ public final class ModelHandler {
registerAltars();
registerQuartzBlocks();
registerLuminizers();
registerPools();
/** Normal Items **/
registerStandardItems();
@@ -154,151 +168,163 @@ public final class ModelHandler {
registerBrews();
/** Special Item Meshers **/
// Cannot use lambdas directly yet because FG/SS can't reobfuscate them, need a dummy wrapper
// See https://github.com/MinecraftForge/ForgeGradle/issues/314.
ModelLoader.registerItemVariants(elementiumShears,
new ModelResourceLocation("botania:elementiumShears", "inventory"),
new ModelResourceLocation("botania:dammitReddit", "inventory"));
ModelLoader.setCustomMeshDefinition(elementiumShears, MesherWrapper.of(stack ->
stack.getDisplayName().equalsIgnoreCase("dammit reddit")
? new ModelResourceLocation("botania:dammitReddit", "inventory")
: new ModelResourceLocation("botania:elementiumShears", "inventory")));
ModelLoader.registerItemVariants(grassHorn,
new ModelResourceLocation("botania:grassHorn0", "inventory"),
new ModelResourceLocation("botania:grassHorn1", "inventory"),
new ModelResourceLocation("botania:grassHorn2", "inventory"),
new ModelResourceLocation("botania:vuvuzela", "inventory"));
ModelLoader.setCustomMeshDefinition(grassHorn, MesherWrapper.of(stack ->
stack.getDisplayName().toLowerCase().contains("vuvuzela")
? new ModelResourceLocation("botania:vuvuzela", "inventory")
: new ModelResourceLocation("botania:grassHorn" + stack.getMetadata(), "inventory")));
ModelLoader.registerItemVariants(infiniteFruit,
new ModelResourceLocation("botania:infiniteFruit", "inventory"),
new ModelResourceLocation("botania:infiniteFruitBoot", "inventory"));
ModelLoader.setCustomMeshDefinition(infiniteFruit, MesherWrapper.of(stack ->
ItemInfiniteFruit.isBoot(stack)
? new ModelResourceLocation("botania:infiniteFruitBoot", "inventory")
: new ModelResourceLocation("botania:infiniteFruit", "inventory")));
ModelLoader.registerItemVariants(magnetRing,
new ModelResourceLocation("botania:magnetRingOn", "inventory"),
new ModelResourceLocation("botania:magnetRingOff", "inventory"));
ModelLoader.setCustomMeshDefinition(magnetRing, MesherWrapper.of(stack ->
ItemMagnetRing.getCooldown(stack) <= 0
? new ModelResourceLocation("botania:magnetRingOn", "inventory")
: new ModelResourceLocation("botania:magnetRingOff", "inventory")));
ModelLoader.registerItemVariants(magnetRingGreater,
new ModelResourceLocation("botania:magnetRingGreaterOn", "inventory"),
new ModelResourceLocation("botania:magnetRingGreaterOff", "inventory"));
ModelLoader.setCustomMeshDefinition(magnetRingGreater, MesherWrapper.of(stack ->
ItemMagnetRing.getCooldown(stack) <= 0
? new ModelResourceLocation("botania:magnetRingGreaterOn", "inventory")
: new ModelResourceLocation("botania:magnetRingGreaterOff", "inventory")));
ModelLoader.registerItemVariants(manaGun,
new ModelResourceLocation("botania:manaGun", "inventory"),
new ModelResourceLocation("botania:manaGunClip", "inventory"),
new ModelResourceLocation("botania:desuGun", "inventory"),
new ModelResourceLocation("botania:desuGunClip", "inventory"));
ModelLoader.setCustomMeshDefinition(manaGun, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
String name;
if (((ItemManaGun) manaGun).isSugoiKawaiiDesuNe(stack)) {
name = ItemManaGun.hasClip(stack) ? "botania:desuGunClip" : "botania:desuGun";
} else {
name = ItemManaGun.hasClip(stack) ? "botania:manaGunClip": "botania:manaGun";
}
return new ModelResourceLocation(name, "inventory");
}
});
ModelLoader.setCustomMeshDefinition(manaGun, MesherWrapper.of(stack -> {
String name = ((ItemManaGun) manaGun).isSugoiKawaiiDesuNe(stack) ? "botania:desuGun" : "botania:manaGun";
return new ModelResourceLocation(name + (ItemManaGun.hasClip(stack) ? "Clip" : ""), "inventory");
}));
ModelLoader.registerItemVariants(tornadoRod,
new ModelResourceLocation("botania:tornadoRod", "inventory"),
new ModelResourceLocation("botania:tornadoRod_flying", "inventory"));
ModelLoader.setCustomMeshDefinition(tornadoRod, MesherWrapper.of(stack ->
((ItemTornadoRod) ModItems.tornadoRod).isFlying(stack)
? new ModelResourceLocation("botania:tornadoRod_flying", "inventory")
: new ModelResourceLocation("botania:tornadoRod", "inventory")));
ModelLoader.registerItemVariants(twigWand,
new ModelResourceLocation("botania:twigWand", "inventory"),
new ModelResourceLocation("botania:twigWand_bind", "inventory"));
ModelLoader.setCustomMeshDefinition(twigWand, MesherWrapper.of(stack -> {
String path = "botania:twigWand";
return new ModelResourceLocation(path + (ItemTwigWand.getBindMode(stack) ? "_bind" : ""), "inventory");
}));
ModelLoader.registerItemVariants(manaCookie,
new ModelResourceLocation("botania:manaCookie", "inventory"),
new ModelResourceLocation("botania:totalBiscuit", "inventory"));
ModelLoader.setCustomMeshDefinition(manaCookie, MesherWrapper.of(stack ->
stack.getDisplayName().toLowerCase().equals("totalbiscuit")
? new ModelResourceLocation("botania:totalBiscuit", "inventory")
: new ModelResourceLocation("botania:manaCookie", "inventory")));
ModelLoader.registerItemVariants(manaweaveBoots,
new ModelResourceLocation("botania:manaweaveBoots", "inventory"),
new ModelResourceLocation("botania:manaweaveBootsHoliday", "inventory"));
ModelLoader.setCustomMeshDefinition(manaweaveBoots, MesherWrapper.of(stack ->
ClientProxy.jingleTheBells
? new ModelResourceLocation("botania:manaweaveBootsHoliday", "inventory")
: new ModelResourceLocation("botania:manaweaveBoots", "inventory")));
ModelLoader.registerItemVariants(manaweaveChest,
new ModelResourceLocation("botania:manaweaveChest", "inventory"),
new ModelResourceLocation("botania:manaweaveChestHoliday", "inventory"));
ModelLoader.setCustomMeshDefinition(manaweaveChest, MesherWrapper.of(stack ->
ClientProxy.jingleTheBells
? new ModelResourceLocation("botania:manaweaveChestHoliday", "inventory")
: new ModelResourceLocation("botania:manaweaveChest", "inventory")));
ModelLoader.registerItemVariants(manaweaveHelm,
new ModelResourceLocation("botania:manaweaveHelm", "inventory"),
new ModelResourceLocation("botania:manaweaveHelmHoliday", "inventory"));
ModelLoader.setCustomMeshDefinition(manaweaveHelm, MesherWrapper.of(stack ->
ClientProxy.jingleTheBells
? new ModelResourceLocation("botania:manaweaveHelmHoliday", "inventory")
: new ModelResourceLocation("botania:manaweaveHelm", "inventory")));
ModelLoader.registerItemVariants(manaweaveLegs,
new ModelResourceLocation("botania:manaweaveLegs", "inventory"),
new ModelResourceLocation("botania:manaweaveLegsHoliday", "inventory"));
ModelLoader.setCustomMeshDefinition(manaweaveLegs, MesherWrapper.of(stack ->
ClientProxy.jingleTheBells
? new ModelResourceLocation("botania:manaweaveLegsHoliday", "inventory")
: new ModelResourceLocation("botania:manaweaveLegs", "inventory")));
ModelLoader.registerItemVariants(manasteelSword,
new ModelResourceLocation("botania:manasteelSword", "inventory"),
new ModelResourceLocation("botania:elucidator", "inventory"));
ModelLoader.setCustomMeshDefinition(manasteelSword, MesherWrapper.of(stack ->
"the elucidator".equals(stack.getDisplayName().toLowerCase().trim())
? new ModelResourceLocation("botania:elucidator", "inventory")
: new ModelResourceLocation("botania:manasteelSword", "inventory")));
ModelLoader.registerItemVariants(spawnerMover,
new ModelResourceLocation("botania:spawnerMover", "inventory"),
new ModelResourceLocation("botania:spawnerMoverFull", "inventory"));
ModelLoader.setCustomMeshDefinition(spawnerMover, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
if (ItemSpawnerMover.hasData(stack)) {
return new ModelResourceLocation("botania:spawnerMover", "inventory");
} else {
return new ModelResourceLocation("botania:spawnerMoverFull", "inventory");
}
}
});
ModelLoader.setCustomMeshDefinition(spawnerMover, MesherWrapper.of(stack -> new ModelResourceLocation("botania:spawnerMover" + (ItemSpawnerMover.hasData(stack) ? "Full" : ""), "inventory")));
ModelLoader.registerItemVariants(terraPick,
new ModelResourceLocation("botania:terraPick", "inventory"),
new ModelResourceLocation("botania:terraPickEnabled", "inventory"),
new ModelResourceLocation("botania:terraPickTipped", "inventory"),
new ModelResourceLocation("botania:terraPickTippedEnabled", "inventory"));
ModelLoader.setCustomMeshDefinition(terraPick, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
String name = "botania:terraPick";
if (ItemTerraPick.isTipped(stack)) {
name += "Tipped";
}
if (ItemTerraPick.isEnabled(stack)) {
name += "Enabled";
}
return new ModelResourceLocation(name, "inventory");
ModelLoader.setCustomMeshDefinition(terraPick, MesherWrapper.of(stack -> {
String name = "botania:terraPick";
if (ItemTerraPick.isTipped(stack)) {
name += "Tipped";
}
});
ModelLoader.registerItemVariants(infiniteFruit,
new ModelResourceLocation("botania:infiniteFruit", "inventory"),
new ModelResourceLocation("botania:infiniteFruitBoot", "inventory"));
ModelLoader.setCustomMeshDefinition(infiniteFruit, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
return ItemInfiniteFruit.isBoot(stack) ? new ModelResourceLocation("botania:infiniteFruitBoot", "inventory")
: new ModelResourceLocation("botania:infiniteFruit", "inventory");
if (ItemTerraPick.isEnabled(stack)) {
name += "Enabled";
}
});
ModelLoader.registerItemVariants(manasteelSword,
new ModelResourceLocation("botania:manasteelSword", "inventory"),
new ModelResourceLocation("botania:elucidator", "inventory"));
ModelLoader.setCustomMeshDefinition(manasteelSword, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
return "the elucidator".equals(stack.getDisplayName().toLowerCase().trim()) ? new ModelResourceLocation("botania:elucidator", "inventory")
: new ModelResourceLocation("botania:manasteelSword", "inventory");
}
});
ModelLoader.registerItemVariants(magnetRing,
new ModelResourceLocation("botania:magnetRingOn", "inventory"),
new ModelResourceLocation("botania:magnetRingOff", "inventory"));
ModelLoader.setCustomMeshDefinition(magnetRing, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
return ItemMagnetRing.getCooldown(stack) <= 0 ? new ModelResourceLocation("botania:magnetRingOn", "inventory")
: new ModelResourceLocation("botania:magnetRingOff", "inventory");
}
});
ModelLoader.registerItemVariants(magnetRingGreater,
new ModelResourceLocation("botania:magnetRingGreaterOn", "inventory"),
new ModelResourceLocation("botania:magnetRingGreaterOff", "inventory"));
ModelLoader.setCustomMeshDefinition(magnetRingGreater, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
return ItemMagnetRing.getCooldown(stack) <= 0 ? new ModelResourceLocation("botania:magnetRingGreaterOn", "inventory")
: new ModelResourceLocation("botania:magnetRingGreaterOff", "inventory");
}
});
ModelLoader.registerItemVariants(manaweaveBoots,
new ModelResourceLocation("botania:manaweaveBoots", "inventory"),
new ModelResourceLocation("botania:manaweaveBootsHoliday", "inventory"));
ModelLoader.setCustomMeshDefinition(manaweaveBoots, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
return ClientProxy.jingleTheBells ? new ModelResourceLocation("botania:manaweaveBootsHoliday", "inventory")
: new ModelResourceLocation("botania:manaweaveBoots", "inventory");
}
});
ModelLoader.registerItemVariants(manaweaveChest,
new ModelResourceLocation("botania:manaweaveChest", "inventory"),
new ModelResourceLocation("botania:manaweaveChestHoliday", "inventory"));
ModelLoader.setCustomMeshDefinition(manaweaveChest, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
return ClientProxy.jingleTheBells ? new ModelResourceLocation("botania:manaweaveChestHoliday", "inventory")
: new ModelResourceLocation("botania:manaweaveChest", "inventory");
}
});
ModelLoader.registerItemVariants(manaweaveHelm,
new ModelResourceLocation("botania:manaweaveHelm", "inventory"),
new ModelResourceLocation("botania:manaweaveHelmHoliday", "inventory"));
ModelLoader.setCustomMeshDefinition(manaweaveHelm, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
return ClientProxy.jingleTheBells ? new ModelResourceLocation("botania:manaweaveHelmHoliday", "inventory")
: new ModelResourceLocation("botania:manaweaveHelm", "inventory");
}
});
ModelLoader.registerItemVariants(manaweaveLegs,
new ModelResourceLocation("botania:manaweaveLegs", "inventory"),
new ModelResourceLocation("botania:manaweaveLegsHoliday", "inventory"));
ModelLoader.setCustomMeshDefinition(manaweaveLegs, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
return ClientProxy.jingleTheBells ? new ModelResourceLocation("botania:manaweaveLegsHoliday", "inventory")
: new ModelResourceLocation("botania:manaweaveLegs", "inventory");
}
});
return new ModelResourceLocation(name, "inventory");
}));
}
private static void registerSubtiles() {
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.GRASS, new ModelResourceLocation("botania:miniIsland", "variant=grass"));
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.PODZOL, new ModelResourceLocation("botania:miniIsland", "variant=podzol"));
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.MYCEL, new ModelResourceLocation("botania:miniIsland", "variant=mycel"));
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.SNOW, new ModelResourceLocation("botania:miniIsland", "variant=snow"));
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.DRY, new ModelResourceLocation("botania:miniIsland", "variant=dry"));
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.GOLDEN, new ModelResourceLocation("botania:miniIsland", "variant=golden"));
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.VIVID, new ModelResourceLocation("botania:miniIsland", "variant=vivid"));
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.SCORCHED, new ModelResourceLocation("botania:miniIsland", "variant=scorched"));
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.INFUSED, new ModelResourceLocation("botania:miniIsland", "variant=infused"));
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.MUTATED, new ModelResourceLocation("botania:miniIsland", "variant=mutated"));
BotaniaAPIClient.registerSubtileModel(SubTileManastar.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_MANASTAR));
BotaniaAPIClient.registerSubtileModel(SubTilePureDaisy.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_PUREDAISY));
@@ -357,79 +383,86 @@ public final class ModelHandler {
}
private static void registerStandardBlocks() {
registerItemModel(ModBlocks.manaGlass);
registerItemModel(ModBlocks.elfGlass);
registerItemModel(ModBlocks.runeAltar);
registerItemModel(ModBlocks.pistonRelay);
registerItemModel(ModBlocks.distributor);
registerItemModel(ModBlocks.starfield);
registerItemModel(ModBlocks.specialFlower);
registerItemModel(ModBlocks.dirtPath);
registerItemModel(ModBlocks.felPumpkin);
registerItemModel(ModBlocks.ghostRail);
registerItemModel(ModBlocks.shimmerrock);
registerItemModel(ModBlocks.shimmerwoodPlanks);
registerItemModel(ModBlocks.manaVoid);
registerItemModel(ModBlocks.alchemyCatalyst);
registerItemModel(ModBlocks.conjurationCatalyst);
registerItemModel(ModBlocks.reedBlock);
registerItemModel(ModBlocks.alfPortal);
registerItemModel(ModBlocks.bifrost);
registerItemModel(ModBlocks.bifrostPerm);
registerItemModel(ModBlocks.enderEye);
registerItemModel(ModBlocks.tinyPlanet);
registerItemModel(ModBlocks.thatch);
registerItemModel(ModBlocks.blazeBlock);
registerItemModel(ModBlocks.forestEye);
registerItemModel(ModBlocks.seaLamp);
registerItemModel(ModBlocks.cacophonium);
registerItemModel(ModBlocks.cellBlock);
registerItemModel(ModBlocks.conjurationCatalyst);
registerItemModel(ModBlocks.cocoon);
registerItemModel(ModBlocks.corporeaFunnel);
registerItemModel(ModBlocks.corporeaInterceptor);
registerItemModel(ModBlocks.corporeaRetainer);
registerItemModel(ModBlocks.dirtPath);
registerItemModel(ModBlocks.distributor);
registerItemModel(ModBlocks.elfGlass);
registerItemModel(ModBlocks.enchantedSoil);
registerItemModel(ModBlocks.enchanter);
registerItemModel(ModBlocks.enderEye);
registerItemModel(ModBlocks.felPumpkin);
registerItemModel(ModBlocks.floatingSpecialFlower);
registerItemModel(ModBlocks.forestEye);
registerItemModel(ModBlocks.ghostRail);
registerItemModel(ModBlocks.incensePlate);
registerItemModel(ModBlocks.lightLauncher);
registerItemModel(ModBlocks.manaBomb);
registerItemModel(ModBlocks.manaDetector);
registerItemModel(ModBlocks.manaFlame);
registerItemModel(ModBlocks.manaGlass);
registerItemModel(ModBlocks.manaVoid);
registerItemModel(ModBlocks.prism);
registerItemModel(ModBlocks.pistonRelay);
registerItemModel(ModBlocks.redStringComparator);
registerItemModel(ModBlocks.redStringContainer);
registerItemModel(ModBlocks.redStringDispenser);
registerItemModel(ModBlocks.redStringComparator);
registerItemModel(ModBlocks.redStringFertilizer);
registerItemModel(ModBlocks.redStringInterceptor);
registerItemModel(ModBlocks.redStringRelay);
registerItemModel(ModBlocks.floatingSpecialFlower);
registerItemModel(ModBlocks.sparkChanger);
registerItemModel(ModBlocks.terraPlate);
registerItemModel(ModBlocks.corporeaRetainer);
registerItemModel(ModBlocks.corporeaInterceptor);
registerItemModel(ModBlocks.corporeaFunnel);
registerItemModel(ModBlocks.lightLauncher);
registerItemModel(ModBlocks.manaDetector);
registerItemModel(ModBlocks.manaBomb);
registerItemModel(ModBlocks.reedBlock);
registerItemModel(ModBlocks.rfGenerator);
registerItemModel(ModBlocks.alfPortal);
registerItemModel(ModBlocks.root);
registerItemModel(ModBlocks.cacophonium);
registerItemModel(ModBlocks.runeAltar);
registerItemModel(ModBlocks.seaLamp);
registerItemModel(ModBlocks.shimmerrock);
registerItemModel(ModBlocks.shimmerwoodPlanks);
registerItemModel(ModBlocks.sparkChanger);
registerItemModel(ModBlocks.spawnerClaw);
registerItemModel(ModBlocks.specialFlower);
registerItemModel(ModBlocks.starfield);
registerItemModel(ModBlocks.thatch);
registerItemModel(ModBlocks.terraPlate);
registerItemModel(ModBlocks.tinyPlanet);
registerItemModel(ModBlocks.tinyPotato);
registerItemModel(ModBlocks.turntable);
// Register all metas to variant inventory, so the smartmodel can take over from there. See MiscellaneousIcons
registerItemModelAllMeta(Item.getItemFromBlock(ModBlocks.floatingFlower), EnumDyeColor.values().length);
registerItemModelAllMeta(Item.getItemFromBlock(ModBlocks.pylon), PylonVariant.values().length);
// Item models which all use the same base model and recolored by render layer
registerItemModelAllMeta(Item.getItemFromBlock(ModBlocks.unstableBlock), EnumDyeColor.values().length);
registerItemModelAllMeta(Item.getItemFromBlock(ModBlocks.petalBlock), EnumDyeColor.values().length);
registerItemModelAllMeta(Item.getItemFromBlock(ModBlocks.manaBeacon), EnumDyeColor.values().length);
registerItemModelAllMeta(Item.getItemFromBlock(ModBlocks.petalBlock), EnumDyeColor.values().length);
registerItemModelAllMeta(Item.getItemFromBlock(ModBlocks.unstableBlock), EnumDyeColor.values().length);
// Blocks which share models with their item, and have only one variant to switch over
registerVariantsDefaulted(ModBlocks.altGrass, AltGrassVariant.class, "variant");
registerVariantsDefaulted(ModBlocks.storage, StorageVariant.class, "variant");
registerVariantsDefaulted(ModBlocks.pylon, PylonVariant.class, "variant");
registerVariantsDefaulted(ModFluffBlocks.biomeStoneA, BiomeStoneVariant.class, "variant");
registerVariantsDefaulted(ModFluffBlocks.biomeStoneB, BiomeBrickVariant.class, "variant");
registerVariantsDefaulted(ModBlocks.customBrick, CustomBrickVariant.class, "variant");
registerVariantsDefaulted(ModBlocks.endStoneBrick, EndBrickVariant.class, "variant");
registerVariantsDefaulted(ModBlocks.dreamwood, LivingWoodVariant.class, "variant");
registerVariantsDefaulted(ModBlocks.forestDrum, DrumVariant.class, "variant");
registerVariantsDefaulted(ModBlocks.livingrock, LivingRockVariant.class, "variant");
registerVariantsDefaulted(ModBlocks.livingwood, LivingWoodVariant.class, "variant");
registerVariantsDefaulted(ModBlocks.dreamwood, LivingWoodVariant.class, "variant");
registerVariantsDefaulted(ModFluffBlocks.stone, FutureStoneVariant.class, "variant");
registerVariantsDefaulted(ModFluffBlocks.biomeStoneA, BiomeStoneVariant.class, "variant");
registerVariantsDefaulted(ModFluffBlocks.biomeStoneB, BiomeBrickVariant.class, "variant");
registerVariantsDefaulted(ModBlocks.endStoneBrick, EndBrickVariant.class, "variant");
registerVariantsDefaulted(ModBlocks.openCrate, CrateVariant.class, "variant");
registerVariantsDefaulted(ModBlocks.customBrick, CustomBrickVariant.class, "variant");
registerVariantsDefaulted(ModBlocks.openCrate, CrateVariant.class, "pattern=none,variant");
registerVariantsDefaulted(ModBlocks.platform, PlatformVariant.class, "variant");
registerVariantsDefaulted(ModBlocks.prismarine, PrismarineVariant.class, "variant");
registerVariantsDefaulted(ModBlocks.pool, PoolVariant.class, "variant");
registerVariantsDefaulted(ModBlocks.spreader, SpreaderVariant.class, "variant");
// todo 1.8 this is temporary until animation API is done, currnetly item model textures will not match true spreader texture
registerVariantsDefaulted(ModFluffBlocks.stone, FutureStoneVariant.class, "variant");
registerVariantsDefaulted(ModBlocks.storage, StorageVariant.class, "variant");
}
private static void registerStandardItems() {
@@ -437,7 +470,6 @@ public final class ModelHandler {
registerItemModel(blackLotus);
registerItemModel(blackLotus, 1);
registerItemModel(lexicon);
registerItemModel(manaCookie);
registerItemModel(manasteelHelm);
registerItemModel(manasteelHelmRevealing);
@@ -459,7 +491,6 @@ public final class ModelHandler {
registerItemModel(elementiumPick);
registerItemModel(elementiumShovel);
registerItemModel(elementiumAxe);
registerItemModel(elementiumShears);
registerItemModel(elementiumSword);
registerItemModel(terrasteelHelm);
@@ -473,7 +504,6 @@ public final class ModelHandler {
registerItemModel(starSword);
registerItemModel(thunderSword);
registerItemModel(glassPick);
registerItemModel(twigWand);
registerItemModel(flowerBag);
registerItemModel(fertilizer);
@@ -493,9 +523,6 @@ public final class ModelHandler {
registerItemModel(smeltRod);
registerItemModel(exchangeRod);
registerItemModel(tornadoRod);
ModelLoader.registerItemVariants(tornadoRod, new ModelResourceLocation("botania:tornadoRod_flying", "inventory"));
registerItemModel(openBucket);
registerItemModel(bloodPendant);
registerItemModel(manaTablet);
@@ -554,7 +581,8 @@ public final class ModelHandler {
registerItemModel(flightTiara);
registerItemModel(divaCharm);
registerItemModel(manaMirror);
// magnet ring and greater version - custom mesher
registerItemModel(manaInkwell);
registerItemModel(waterBowl);
registerItemModelAllMeta(flightTiara, ItemFlightTiara.WING_TYPES);
registerItemModelAllMeta(laputaShard, 20);
@@ -571,19 +599,41 @@ public final class ModelHandler {
registerItemModelMetas(blackHoleTalisman, LibItemNames.BLACK_HOLE_TALISMAN, 2);
registerItemModelMetas(slimeBottle, LibItemNames.SLIME_BOTTLE, 2);
registerItemModelMetas(grassSeeds, LibItemNames.GRASS_SEEDS, 9);
registerItemModelMetas(quartz, LibItemNames.QUARTZ, 8);
registerItemModelMetas(quartz, LibItemNames.QUARTZ, 7);
registerItemModelMetas(cosmetic, LibItemNames.COSMETIC, 32);
registerItemModelMetas(craftPattern, LibItemNames.CRAFT_PATTERN, 9);
registerItemModelMetas(virus, LibItemNames.VIRUS, 2);
registerItemModelMetas(grassHorn, LibItemNames.GRASS_HORN, 3);
}
// Only for models that absolutely can't be converted to JSON. Use VERY sparingly
@SuppressWarnings("deprecation")
private static void registerTESRItems() {
registerItemModel(ModBlocks.avatar);
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.avatar), 0, TileAvatar.class);
registerItemModel(ModBlocks.bellows); // todo await animation api
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.bellows), 0, TileBellows.class);
registerItemModel(ModBlocks.brewery);
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.brewery), 0, TileBrewery.class);
registerItemModel(ModBlocks.corporeaCrystalCube);
registerItemModel(ModBlocks.corporeaIndex);
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.corporeaCrystalCube), 0, TileCorporeaCrystalCube.class);
registerItemModel(ModBlocks.corporeaIndex); // todo json maybe? await animation api
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.corporeaIndex), 0, TileCorporeaIndex.class);
registerItemModel(ModItems.gaiaHead);
ForgeHooksClient.registerTESRItemStack(ModItems.gaiaHead, 0, TileGaiaHead.class);
registerItemModel(ModBlocks.hourglass); // todo json maybe?
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.hourglass), 0, TileHourglass.class);
registerItemModel(ModBlocks.pump); // todo await animation api
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.pump), 0, TilePump.class);
registerItemModel(ModBlocks.teruTeruBozu);
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.teruTeruBozu), 0, TileTeruTeruBozu.class);
}
private static void registerManaResources() {
@@ -636,29 +686,23 @@ public final class ModelHandler {
ModelLoader.registerItemVariants(brewFlask, new ModelResourceLocation("botania:flask1_" + i, "inventory"));
}
ModelLoader.setCustomMeshDefinition(brewFlask, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
int swigsTaken = 6 - ((ItemBrewBase) brewFlask).getSwigsLeft(stack);
return new ModelResourceLocation("botania:flask1_" + swigsTaken, "inventory");
}
});
ModelLoader.setCustomMeshDefinition(brewFlask, MesherWrapper.of(stack -> {
int swigsTaken = 6 - ((ItemBrewBase) brewFlask).getSwigsLeft(stack);
return new ModelResourceLocation("botania:flask1_" + swigsTaken, "inventory");
}));
for (int i = 0; i < 4; i++) {
ModelLoader.registerItemVariants(brewVial, new ModelResourceLocation("botania:vial1_" + i, "inventory"));
}
ModelLoader.setCustomMeshDefinition(brewVial, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
int swigsTaken = 4 - ((ItemBrewBase) brewVial).getSwigsLeft(stack);
return new ModelResourceLocation("botania:vial1_" + swigsTaken, "inventory");
}
});
ModelLoader.setCustomMeshDefinition(brewVial, MesherWrapper.of(stack -> {
int swigsTaken = 4 - ((ItemBrewBase) brewVial).getSwigsLeft(stack);
return new ModelResourceLocation("botania:vial1_" + swigsTaken, "inventory");
}));
}
private static void registerStateMappers() {
// Override for floating flowers
// Override to let smartmodels work, see RenderEventHandler
ModelLoader.setCustomStateMapper(ModBlocks.floatingSpecialFlower, new StateMapperBase() {
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
@@ -673,23 +717,28 @@ public final class ModelHandler {
}
});
ModelLoader.setCustomStateMapper(ModBlocks.platform, new StateMapperBase() {
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
return new ModelResourceLocation("botania:platform", "normal");
}
});
// Ignore vanilla facing, variant in double flower
ModelLoader.setCustomStateMapper(ModBlocks.doubleFlower1, (new StateMap.Builder()).ignore(BlockDoublePlant.VARIANT, BlockDoublePlant.field_181084_N).build());
ModelLoader.setCustomStateMapper(ModBlocks.doubleFlower2, (new StateMap.Builder()).ignore(BlockDoublePlant.VARIANT, BlockDoublePlant.field_181084_N).build());
// Ignore color in unstable cube, mana beacon, and petals (handled by color multiplier)
// Ignore color in unstable cube, mana beacon, special flower, and petals (handled by color multiplier)
ModelLoader.setCustomStateMapper(ModBlocks.unstableBlock, (new StateMap.Builder()).ignore(BotaniaStateProps.COLOR).build());
ModelLoader.setCustomStateMapper(ModBlocks.manaBeacon, (new StateMap.Builder()).ignore(BotaniaStateProps.COLOR).build());
ModelLoader.setCustomStateMapper(ModBlocks.petalBlock, (new StateMap.Builder()).ignore(BotaniaStateProps.COLOR).build());
ModelLoader.setCustomStateMapper(ModBlocks.specialFlower, (new StateMap.Builder()).ignore(BotaniaStateProps.COLOR, ((BlockFlower) ModBlocks.specialFlower).getTypeProperty()).build());
// Ignore vanilla variant in flowers
ModelLoader.setCustomStateMapper(ModBlocks.flower, (new StateMap.Builder()).ignore(((BlockFlower) ModBlocks.flower).getTypeProperty()).build());
ModelLoader.setCustomStateMapper(ModBlocks.shinyFlower, (new StateMap.Builder()).ignore(((BlockFlower) ModBlocks.shinyFlower).getTypeProperty()).build());
ModelLoader.setCustomStateMapper(ModBlocks.buriedPetals, (new StateMap.Builder()).ignore(((BlockFlower) ModBlocks.buriedPetals).getTypeProperty()).build());
// Ignore in special flower to suppress errors (handled in custom statemapper in BlockSpecialFlower
ModelLoader.setCustomStateMapper(ModBlocks.specialFlower, (new StateMap.Builder()).ignore(BotaniaStateProps.COLOR, ((BlockFlower) ModBlocks.specialFlower).getTypeProperty()).build());
// Ignore vanilla variant in walls
ModelLoader.setCustomStateMapper(ModFluffBlocks.biomeStoneWall, (new StateMap.Builder()).ignore(BlockWall.VARIANT).build());
ModelLoader.setCustomStateMapper(ModFluffBlocks.dreamwoodWall, (new StateMap.Builder()).ignore(BlockWall.VARIANT).build());
@@ -750,6 +799,14 @@ public final class ModelHandler {
for (Block b : otherFullSlabs) {
ModelLoader.setCustomStateMapper(b, (new StateMap.Builder()).ignore(BlockModSlab.DUMMY, BlockSlab.HALF).build());
}
// Ignore everything in TESR items to suppress missing model errors
ModelLoader.setCustomStateMapper(ModBlocks.avatar, new StateMap.Builder().ignore(BotaniaStateProps.CARDINALS).build());
ModelLoader.setCustomStateMapper(ModBlocks.bellows, new StateMap.Builder().ignore(BotaniaStateProps.CARDINALS).build());
ModelLoader.setCustomStateMapper(ModBlocks.brewery, new StateMap.Builder().ignore(BotaniaStateProps.POWERED).build());
ModelLoader.setCustomStateMapper(ModBlocks.gaiaHead, new StateMap.Builder().ignore(BlockSkull.FACING, BlockSkull.NODROP).build());
ModelLoader.setCustomStateMapper(ModBlocks.hourglass, new StateMap.Builder().ignore(BotaniaStateProps.POWERED).build());
ModelLoader.setCustomStateMapper(ModBlocks.pump, new StateMap.Builder().ignore(BotaniaStateProps.CARDINALS).build());
}
private static void registerMushrooms() {
@@ -981,6 +1038,21 @@ public final class ModelHandler {
}
}
private static void registerPools() {
Item item = Item.getItemFromBlock(ModBlocks.pool);
String name = GameData.getBlockRegistry().getNameForObject(ModBlocks.pool).toString();
for (PoolVariant v : PoolVariant.values()) {
if (v == PoolVariant.CREATIVE) {
// Special case to have mana water layer
ModelLoader.registerItemVariants(item, new ModelResourceLocation(name, "inventory_creative"));
ModelLoader.setCustomModelResourceLocation(item, v.ordinal(), new ModelResourceLocation(name, "inventory_creative"));
} else {
ModelLoader.registerItemVariants(item, new ModelResourceLocation(name, "variant=" + v.getName()));
ModelLoader.setCustomModelResourceLocation(item, v.ordinal(), new ModelResourceLocation(name, "variant=" + v.getName()));
}
}
}
private static <T extends Enum<T> & IStringSerializable> void registerVariantsDefaulted(Block b, Class<T> enumclazz, String variantHeader) {
Item item = Item.getItemFromBlock(b);
for (T e : enumclazz.getEnumConstants()) {
@@ -1029,4 +1101,19 @@ public final class ModelHandler {
private ModelHandler() {}
private interface MesherWrapper extends ItemMeshDefinition {
static MesherWrapper of(MesherWrapper w) {
return w;
}
ModelResourceLocation getLocation(ItemStack stack);
@Override
default ModelResourceLocation getModelLocation(ItemStack stack) {
return getLocation(stack);
}
}
}
@@ -10,7 +10,6 @@
*/
package vazkii.botania.client.core.handler;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity;
@@ -10,17 +10,15 @@
*/
package vazkii.botania.client.core.handler;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BlockRendererDispatcher;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.resources.model.IBakedModel;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.util.*;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@@ -51,11 +49,15 @@ public final class MultiblockRenderHandler {
public static int dimension;
static {
//todo 1.8 remove when fixed by forge
// todo 1.8.8 temporary shim, because cannot renderBlockBrightness directly, see MinecraftForge issue 2353
IMultiblockRenderHook.renderHooks.put(ModBlocks.pylon, new IMultiblockRenderHook() {
@Override
public void renderBlockForMultiblock(IBlockAccess world, Multiblock mb, IBlockState state, MultiblockComponent comp, float alpha) {
IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelForState(state);
// Steal itemstack model since it has the proper group visibilities configured
ItemStack stack = new ItemStack(ModBlocks.pylon, 1, state.getBlock().getMetaFromState(state));
IBakedModel model = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(stack);
GlStateManager.scale(0.65F, 0.65, 0.65F);
GlStateManager.translate(0.5F, -0.75F, 0.5F);
Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightness(model, state, 1.0F, false);
}
@@ -64,12 +66,27 @@ public final class MultiblockRenderHandler {
return true;
}
});
// TODO also a temporary shim for same reason as above
IMultiblockRenderHook.renderHooks.put(ModBlocks.pool, new IMultiblockRenderHook() {
@Override
public void renderBlockForMultiblock(IBlockAccess world, Multiblock mb, IBlockState state, MultiblockComponent comp, float alpha) {
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelForState(ModBlocks.pool.getDefaultState());
Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightness(model, ModBlocks.pool.getDefaultState(), 1.0F, false);
}
@Override
public boolean needsTranslate(IBlockState state) {
return true;
}
});
}
public static void setMultiblock(MultiblockSet set) {
currentMultiblock = set;
anchor = null;
angle = EnumFacing.DOWN;
angle = EnumFacing.SOUTH;
Minecraft mc = Minecraft.getMinecraft();
if(mc.theWorld != null)
@@ -21,7 +21,6 @@ import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
@@ -191,7 +190,7 @@ public final class TooltipAdditionDisplayHandler {
String rank = StatCollector.translateToLocal("botania.rank" + level).replaceAll("&", "\u00a7");
GL11.glPushAttrib(GL11.GL_LIGHTING);
GlStateManager.disableLighting();
GL11.glDisable(GL11.GL_LIGHTING);
font.drawStringWithShadow(rank, mouseX + offx, mouseY - offy - 12, 0xFFFFFF);
if(!ss) {
rank = StatCollector.translateToLocal("botania.rank" + (level + 1)).replaceAll("&", "\u00a7");
@@ -17,7 +17,6 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.item.ItemStack;
@@ -14,7 +14,8 @@ import java.awt.Desktop;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.util.Calendar;
import java.time.LocalDateTime;
import java.time.Month;
import java.util.Map;
import net.minecraft.block.Block;
@@ -28,7 +29,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemRecord;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntitySkull;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.MovingObjectPosition;
@@ -55,7 +55,7 @@ import vazkii.botania.client.core.handler.LightningHandler;
import vazkii.botania.client.core.handler.ModelHandler;
import vazkii.botania.client.core.handler.MultiblockRenderHandler;
import vazkii.botania.client.core.handler.PersistentVariableHelper;
import vazkii.botania.client.core.handler.RenderEventHandler;
import vazkii.botania.client.core.handler.MiscellaneousIcons;
import vazkii.botania.client.core.handler.SubTileRadiusRenderHandler;
import vazkii.botania.client.core.handler.TooltipHandler;
import vazkii.botania.client.core.helper.ShaderHelper;
@@ -72,6 +72,7 @@ import vazkii.botania.client.render.entity.RenderManaStorm;
import vazkii.botania.client.render.entity.RenderPinkWither;
import vazkii.botania.client.render.entity.RenderPixie;
import vazkii.botania.client.render.entity.RenderPoolMinecart;
import vazkii.botania.client.render.entity.RenderSnowballStack;
import vazkii.botania.client.render.entity.RenderSpark;
import vazkii.botania.client.render.entity.RenderThornChakram;
import vazkii.botania.client.render.tile.RenderTileAlfPortal;
@@ -95,7 +96,6 @@ import vazkii.botania.client.render.tile.RenderTileRedString;
import vazkii.botania.client.render.tile.RenderTileRuneAltar;
import vazkii.botania.client.render.tile.RenderTileSkullOverride;
import vazkii.botania.client.render.tile.RenderTileSparkChanger;
import vazkii.botania.client.render.tile.RenderTileSpawnerClaw;
import vazkii.botania.client.render.tile.RenderTileSpreader;
import vazkii.botania.client.render.tile.RenderTileStarfield;
import vazkii.botania.client.render.tile.RenderTileTerraPlate;
@@ -110,13 +110,13 @@ import vazkii.botania.common.block.tile.TileCocoon;
import vazkii.botania.common.block.tile.TileEnchanter;
import vazkii.botania.common.block.tile.TileFloatingFlower;
import vazkii.botania.common.block.tile.TileFloatingSpecialFlower;
import vazkii.botania.common.block.tile.TileGaiaHead;
import vazkii.botania.common.block.tile.TileHourglass;
import vazkii.botania.common.block.tile.TileIncensePlate;
import vazkii.botania.common.block.tile.TileLightRelay;
import vazkii.botania.common.block.tile.TilePylon;
import vazkii.botania.common.block.tile.TileRuneAltar;
import vazkii.botania.common.block.tile.TileSparkChanger;
import vazkii.botania.common.block.tile.TileSpawnerClaw;
import vazkii.botania.common.block.tile.TileStarfield;
import vazkii.botania.common.block.tile.TileTerraPlate;
import vazkii.botania.common.block.tile.TileTeruTeruBozu;
@@ -178,14 +178,17 @@ public class ClientProxy extends CommonProxy {
super.preInit(event);
MinecraftForge.EVENT_BUS.register(RenderEventHandler.INSTANCE);
MinecraftForge.EVENT_BUS.register(MiscellaneousIcons.INSTANCE);
ModelHandler.registerModels();
initRenderers();
}
@Override
public void init(FMLInitializationEvent event) {
super.init(event);
initAuxiliaryRender();
ModChallenges.init();
MinecraftForge.EVENT_BUS.register(new ClientTickHandler());
@@ -194,7 +197,6 @@ public class ClientProxy extends CommonProxy {
if(ConfigHandler.boundBlockWireframe)
MinecraftForge.EVENT_BUS.register(new BoundTileRenderer());
MinecraftForge.EVENT_BUS.register(new TooltipHandler());
MinecraftForge.EVENT_BUS.register(new BaubleRenderHandler());
MinecraftForge.EVENT_BUS.register(new DebugHandler());
MinecraftForge.EVENT_BUS.register(new SubTileRadiusRenderHandler());
MinecraftForge.EVENT_BUS.register(new MultiblockRenderHandler());
@@ -207,14 +209,13 @@ public class ClientProxy extends CommonProxy {
new VersionChecker().init();
if(ConfigHandler.enableSeasonalFeatures) {
Calendar calendar = Calendar.getInstance();
if((calendar.get(2) == 11 && calendar.get(5) >= 16) || (calendar.get(2) == 0 && calendar.get(5) <= 2))
LocalDateTime now = LocalDateTime.now();
if ((now.getMonth() == Month.DECEMBER && now.getDayOfMonth() >= 16) || (now.getMonth() == Month.JANUARY && now.getDayOfMonth() <= 2))
jingleTheBells = true;
if(calendar.get(2) == 9)
if(now.getMonth() == Month.OCTOBER)
dootDoot = true;
}
initRenderers();
}
@Override
@@ -224,65 +225,6 @@ public class ClientProxy extends CommonProxy {
}
private void initRenderers() {
// LibRenderIDs.idAltar = RenderingRegistry.getNextAvailableRenderId();
// LibRenderIDs.idSpecialFlower = RenderingRegistry.getNextAvailableRenderId();
// LibRenderIDs.idSpreader = RenderingRegistry.getNextAvailableRenderId();
// LibRenderIDs.idPool = RenderingRegistry.getNextAvailableRenderId();
// LibRenderIDs.idPylon = RenderingRegistry.getNextAvailableRenderId();
// LibRenderIDs.idMiniIsland = RenderingRegistry.getNextAvailableRenderId();
// LibRenderIDs.idTinyPotato = RenderingRegistry.getNextAvailableRenderId();
// LibRenderIDs.idSpawnerClaw = RenderingRegistry.getNextAvailableRenderId();
// LibRenderIDs.idBrewery = RenderingRegistry.getNextAvailableRenderId();
// LibRenderIDs.idCorporeaIndex = RenderingRegistry.getNextAvailableRenderId();
// LibRenderIDs.idPump = RenderingRegistry.getNextAvailableRenderId();
// LibRenderIDs.idDoubleFlower = RenderingRegistry.getNextAvailableRenderId();
// LibRenderIDs.idCorporeaCrystalCybe = RenderingRegistry.getNextAvailableRenderId();
// LibRenderIDs.idIncensePlate = RenderingRegistry.getNextAvailableRenderId();
// LibRenderIDs.idHourglass = RenderingRegistry.getNextAvailableRenderId();
// LibRenderIDs.idCocoon = RenderingRegistry.getNextAvailableRenderId();
// LibRenderIDs.idLightRelay = RenderingRegistry.getNextAvailableRenderId();
// LibRenderIDs.idBellows = RenderingRegistry.getNextAvailableRenderId();
// LibRenderIDs.idTeruTeruBozu = RenderingRegistry.getNextAvailableRenderId();
// LibRenderIDs.idAvatar = RenderingRegistry.getNextAvailableRenderId();
//
// RenderSpecialFlower specialFlowerRender = new RenderSpecialFlower(LibRenderIDs.idSpecialFlower);
// RenderingRegistry.registerBlockHandler(new RenderAltar());
// RenderingRegistry.registerBlockHandler(specialFlowerRender);
// RenderingRegistry.registerBlockHandler(new RenderSpreader());
// RenderingRegistry.registerBlockHandler(new RenderPool());
// RenderingRegistry.registerBlockHandler(new RenderPylon());
// RenderingRegistry.registerBlockHandler(new RenderFloatingFlower());
// RenderingRegistry.registerBlockHandler(new RenderTinyPotato());
// RenderingRegistry.registerBlockHandler(new RenderSpawnerClaw());
// RenderingRegistry.registerBlockHandler(new RenderBrewery());
// RenderingRegistry.registerBlockHandler(new RenderCorporeaIndex());
// RenderingRegistry.registerBlockHandler(new RenderPump());
// RenderingRegistry.registerBlockHandler(new RenderDoubleFlower());
// RenderingRegistry.registerBlockHandler(new RenderCorporeaCrystalCube());
// RenderingRegistry.registerBlockHandler(new RenderIncensePlate());
// RenderingRegistry.registerBlockHandler(new RenderHourglass());
// RenderingRegistry.registerBlockHandler(new RenderCocoon());
// RenderingRegistry.registerBlockHandler(new RenderBellows());
// RenderingRegistry.registerBlockHandler(new RenderTeruTeruBozu());
// RenderingRegistry.registerBlockHandler(new RenderAvatar());
// IMultiblockRenderHook.renderHooks.put(ModBlocks.flower, specialFlowerRender);
// IMultiblockRenderHook.renderHooks.put(ModBlocks.shinyFlower, specialFlowerRender);
// RenderTransparentItem renderTransparentItem = new RenderTransparentItem();
// RenderFloatingFlowerItem renderFloatingFlower = new RenderFloatingFlowerItem();
// RenderBow renderBow = new RenderBow();
//
// MinecraftForgeClient.registerItemRenderer(ModItems.lens, new RenderLens());
// if(ConfigHandler.lexicon3dModel)
// MinecraftForgeClient.registerItemRenderer(ModItems.lexicon, new RenderLexicon());
// MinecraftForgeClient.registerItemRenderer(ModItems.glassPick, renderTransparentItem);
// MinecraftForgeClient.registerItemRenderer(ModItems.spark, renderTransparentItem);
// MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.floatingFlower), renderFloatingFlower);
// MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.floatingSpecialFlower), renderFloatingFlower);
// MinecraftForgeClient.registerItemRenderer(ModItems.livingwoodBow, renderBow);
// MinecraftForgeClient.registerItemRenderer(ModItems.crystalBow, renderBow);
RenderTileFloatingFlower renderTileFloatingFlower = new RenderTileFloatingFlower();
ClientRegistry.bindTileEntitySpecialRenderer(TileAltar.class, new RenderTileAltar());
ClientRegistry.bindTileEntitySpecialRenderer(TileSpreader.class, new RenderTileSpreader());
@@ -294,7 +236,7 @@ public class ClientProxy extends CommonProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileFloatingFlower.class, renderTileFloatingFlower);
ClientRegistry.bindTileEntitySpecialRenderer(TileFloatingSpecialFlower.class, renderTileFloatingFlower);
ClientRegistry.bindTileEntitySpecialRenderer(TileTinyPotato.class, new RenderTileTinyPotato());
ClientRegistry.bindTileEntitySpecialRenderer(TileSpawnerClaw.class, new RenderTileSpawnerClaw());
// ClientRegistry.bindTileEntitySpecialRenderer(TileSpawnerClaw.class, new RenderTileSpawnerClaw());
ClientRegistry.bindTileEntitySpecialRenderer(TileStarfield.class, new RenderTileStarfield());
ClientRegistry.bindTileEntitySpecialRenderer(TileBrewery.class, new RenderTileBrewery());
ClientRegistry.bindTileEntitySpecialRenderer(TileTerraPlate.class, new RenderTileTerraPlate());
@@ -309,31 +251,37 @@ public class ClientProxy extends CommonProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileCocoon.class, new RenderTileCocoon());
ClientRegistry.bindTileEntitySpecialRenderer(TileLightRelay.class, new RenderTileLightRelay());
ClientRegistry.bindTileEntitySpecialRenderer(TileBellows.class, new RenderTileBellows());
// todo 1.8.8 awaiting forge issue ClientRegistry.bindTileEntitySpecialRenderer(TileGaiaHead.class, new RenderTileSkullOverride());
ClientRegistry.bindTileEntitySpecialRenderer(TileGaiaHead.class, new RenderTileSkullOverride());
ClientRegistry.bindTileEntitySpecialRenderer(TileTeruTeruBozu.class, new RenderTileTeruTeruBozu());
ClientRegistry.bindTileEntitySpecialRenderer(TileAvatar.class, new RenderTileAvatar());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySkull.class, new RenderTileSkullOverride());
RenderingRegistry.registerEntityRenderingHandler(EntityPixie.class, RenderPixie::new);
RenderingRegistry.registerEntityRenderingHandler(EntityDoppleganger.class, RenderDoppleganger::new);
RenderingRegistry.registerEntityRenderingHandler(EntitySpark.class, RenderSpark::new);
RenderingRegistry.registerEntityRenderingHandler(EntityThornChakram.class, RenderThornChakram::new);
RenderingRegistry.registerEntityRenderingHandler(EntityCorporeaSpark.class, RenderCorporeaSpark::new);
RenderingRegistry.registerEntityRenderingHandler(EntityPoolMinecart.class, RenderPoolMinecart::new);
RenderingRegistry.registerEntityRenderingHandler(EntityPinkWither.class, RenderPinkWither::new);
RenderingRegistry.registerEntityRenderingHandler(EntityManaStorm.class, RenderManaStorm::new);
RenderingRegistry.registerEntityRenderingHandler(EntityBabylonWeapon.class, RenderBabylonWeapon::new);
RenderingRegistry.registerEntityRenderingHandler(EntityPixie.class, new RenderPixie());
RenderingRegistry.registerEntityRenderingHandler(EntityVineBall.class, new RenderSnowball<EntityVineBall>(Minecraft.getMinecraft().getRenderManager(), ModItems.vineBall, Minecraft.getMinecraft().getRenderItem()));
RenderingRegistry.registerEntityRenderingHandler(EntityDoppleganger.class, new RenderDoppleganger(Minecraft.getMinecraft().getRenderManager()));
RenderingRegistry.registerEntityRenderingHandler(EntitySpark.class, new RenderSpark(Minecraft.getMinecraft().getRenderManager()));
RenderingRegistry.registerEntityRenderingHandler(EntityThornChakram.class, new RenderThornChakram(Minecraft.getMinecraft().getRenderManager()));
RenderingRegistry.registerEntityRenderingHandler(EntityCorporeaSpark.class, new RenderCorporeaSpark(Minecraft.getMinecraft().getRenderManager()));
RenderingRegistry.registerEntityRenderingHandler(EntityEnderAirBottle.class, new RenderSnowball<EntityEnderAirBottle>(Minecraft.getMinecraft().getRenderManager(), ModItems.manaResource, Minecraft.getMinecraft().getRenderItem()));
RenderingRegistry.registerEntityRenderingHandler(EntityPoolMinecart.class, new RenderPoolMinecart(Minecraft.getMinecraft().getRenderManager()));
RenderingRegistry.registerEntityRenderingHandler(EntityPinkWither.class, new RenderPinkWither(Minecraft.getMinecraft().getRenderManager()));
RenderingRegistry.registerEntityRenderingHandler(EntityManaStorm.class, new RenderManaStorm(Minecraft.getMinecraft().getRenderManager()));
RenderingRegistry.registerEntityRenderingHandler(EntityBabylonWeapon.class, new RenderBabylonWeapon(Minecraft.getMinecraft().getRenderManager()));
RenderingRegistry.registerEntityRenderingHandler(EntityVineBall.class, renderManager -> new RenderSnowball(renderManager, ModItems.vineBall, Minecraft.getMinecraft().getRenderItem()));
RenderingRegistry.registerEntityRenderingHandler(EntityEnderAirBottle.class, renderManager -> new RenderSnowballStack(renderManager, new ItemStack(ModItems.manaResource, 1, 15), Minecraft.getMinecraft().getRenderItem()));
ShaderHelper.initShaders();
}
private void initAuxiliaryRender() {
Map<String, RenderPlayer> skinMap = Minecraft.getMinecraft().getRenderManager().getSkinMap();
RenderPlayer render = skinMap.get("default");
RenderPlayer render;
render = skinMap.get("default");
render.addLayer(new ContributorFancinessHandler());
render.addLayer(new BaubleRenderHandler());
render = skinMap.get("slim");
render.addLayer(new ContributorFancinessHandler());
render.addLayer(new BaubleRenderHandler());
}
@Override
@@ -447,9 +395,6 @@ public class ClientProxy extends CommonProxy {
if((int) Math.floor(MathHelper.pointDistancePlane(xp, zp, x, z)) == (iradius - 1))
mb.addComponent(new AnyComponent(new BlockPos(xp - x, 1, zp - z), block.getDefaultState()));
if((int) Math.floor(MathHelper.pointDistancePlane(xp, zp, x, z)) == iradius - 1)
mb.addComponent(new AnyComponent(new BlockPos(xp - x, 1, zp - z), block.getDefaultState()));
}
MultiblockRenderHandler.setMultiblock(mb.makeSet());
@@ -53,6 +53,7 @@ public class FXSparkle extends EntityFX {
particleRed = red;
particleGreen = green;
particleBlue = blue;
particleAlpha = 0.5F; // So MC renders us on the alpha layer, value not actually used
particleGravity = 0;
motionX = motionY = motionZ = 0;
particleScale *= size;
@@ -20,7 +20,6 @@ import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
@@ -51,6 +50,7 @@ public class FXWisp extends EntityFX {
particleRed = red;
particleGreen = green;
particleBlue = blue;
particleAlpha = 0.5F; // So MC renders us on the alpha layer, value not actually used
particleGravity = 0;
motionX = motionY = motionZ = 0;
particleScale *= size;
@@ -10,7 +10,6 @@
*/
package vazkii.botania.client.gui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.achievement.GuiAchievements;
import net.minecraft.stats.StatFileWriter;
@@ -15,7 +15,6 @@ import java.util.List;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
@@ -23,8 +22,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.common.block.ModBlocks;
@@ -17,8 +17,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.lib.LibResources;
public class GuiBaubleBox extends InventoryEffectRenderer {
@@ -17,8 +17,6 @@ import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;
// This is pretty much a copypasta of GuiCrafting >_>
public class GuiCraftingHalo extends GuiContainer {
@@ -13,14 +13,10 @@ package vazkii.botania.client.gui.lexicon;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import vazkii.botania.client.challenge.Challenge;
import vazkii.botania.client.challenge.ModChallenges;
import vazkii.botania.client.core.handler.ClientTickHandler;
@@ -409,7 +409,7 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IPa
@Override
public GuiLexicon copy() {
GuiLexiconEntry gui = new GuiLexiconEntry(entry, this.parent); // todo 1.8 recheck last param (was new GuiScreen())
GuiLexiconEntry gui = new GuiLexiconEntry(entry, this.parent);
gui.page = page;
gui.setTitle();
return gui;
@@ -19,7 +19,6 @@ import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -27,8 +26,6 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.lexicon.ILexicon;
@@ -110,7 +107,6 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented {
buttonList.add(leftButton = new GuiButtonPage(13, left, top + guiHeight - 10, false));
buttonList.add(rightButton = new GuiButtonPage(14, left + guiWidth - 18, top + guiHeight - 10, true));
// todo 1.8 verify componentID
searchField = new GuiTextField(15, fontRendererObj, left + guiWidth / 2 + 28, top + guiHeight + 6, 200, 10);
searchField.setCanLoseFocus(false);
searchField.setFocused(true);
@@ -18,8 +18,6 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.client.gui.lexicon.GuiLexicon;
@@ -17,8 +17,6 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.client.gui.lexicon.GuiLexicon;
@@ -16,13 +16,9 @@ import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import vazkii.botania.client.challenge.Challenge;
public class GuiButtonChallengeIcon extends GuiButtonLexicon {
@@ -18,8 +18,6 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.client.gui.lexicon.GuiLexicon;
@@ -15,14 +15,11 @@ import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.common.item.ModItems;
@@ -13,13 +13,11 @@ package vazkii.botania.client.gui.lexicon.button;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.core.handler.PersistentVariableHelper;
@@ -88,7 +86,7 @@ public class GuiButtonInvisible extends GuiButtonLexicon {
key = format.charAt(1);
for(EnumChatFormatting ecf : EnumChatFormatting.class.getEnumConstants())
if(ecf.toString().indexOf(ecf.toString().length() - 1) == key) { // todo 1.8 recheck (want last char of code)
if(ecf.toString().indexOf(ecf.toString().length() - 1) == key) {
if(ecf.ordinal() > 15)
ecf = EnumChatFormatting.BLACK;
color = LibMisc.CONTROL_CODE_COLORS[ecf.ordinal()];
@@ -18,8 +18,6 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.client.gui.lexicon.GuiLexicon;
@@ -18,8 +18,6 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.client.gui.lexicon.GuiLexicon;
@@ -16,8 +16,6 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.client.gui.lexicon.GuiLexicon;
@@ -18,8 +18,6 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.client.gui.lexicon.GuiLexicon;
@@ -18,8 +18,6 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.core.handler.PersistentVariableHelper;
import vazkii.botania.client.core.helper.RenderHelper;
@@ -18,8 +18,6 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.client.gui.lexicon.GuiLexicon;
@@ -18,6 +18,7 @@ import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import vazkii.botania.common.item.ModItems;
import javax.annotation.Nonnull;
import java.util.Collection;
@@ -74,7 +75,8 @@ public class BreweryRecipeCategory implements IRecipeCategory {
}
int index = 1, posX = 60;
for (Object o : wrapper.getInputs()) {
for (int i = 1; i < wrapper.getInputs().size(); i++) {
Object o = wrapper.getInputs().get(i);
recipeLayout.getItemStacks().init(index, true, posX, 6);
if (o instanceof ItemStack) {
recipeLayout.getItemStacks().set(index, ((ItemStack) o));
@@ -86,7 +88,7 @@ public class BreweryRecipeCategory implements IRecipeCategory {
}
recipeLayout.getItemStacks().init(7, false, 87, 41);
recipeLayout.getItemStacks().set(7, wrapper.getOutputs().get(0));
recipeLayout.getItemStacks().set(7, wrapper.getOutputs());
}
}
@@ -15,7 +15,6 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.OreDictionary;
import vazkii.botania.api.recipe.RecipeBrew;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.item.ModItems;
import javax.annotation.Nonnull;
@@ -24,11 +23,11 @@ import java.util.List;
public class BreweryRecipeWrapper implements IRecipeWrapper {
private final List input;
private final ItemStack output;
private final List<ItemStack> output;
public BreweryRecipeWrapper(RecipeBrew recipeBrew) {
ImmutableList.Builder builder = ImmutableList.builder();
builder.add(new ItemStack(ModItems.vial));
builder.add(ImmutableList.of(new ItemStack(ModItems.vial, 1, 0), new ItemStack(ModItems.vial, 1, 1)));
for (Object o : recipeBrew.getInputs()) {
if (o instanceof ItemStack) {
builder.add(o);
@@ -39,7 +38,7 @@ public class BreweryRecipeWrapper implements IRecipeWrapper {
}
input = builder.build();
output = recipeBrew.getOutput(new ItemStack(ModItems.vial)).copy();
output = ImmutableList.of(recipeBrew.getOutput(new ItemStack(ModItems.vial)).copy(), recipeBrew.getOutput(new ItemStack(ModItems.vial, 1, 1)).copy());
}
@Override
@@ -49,7 +48,7 @@ public class BreweryRecipeWrapper implements IRecipeWrapper {
@Override
public List<ItemStack> getOutputs() {
return ImmutableList.of(output);
return output;
}
@Override
@@ -24,7 +24,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.core.handler.RenderEventHandler;
import vazkii.botania.client.core.handler.MiscellaneousIcons;
import javax.annotation.Nonnull;
import java.util.Collection;
@@ -71,7 +71,7 @@ public class ElvenTradeRecipeCategory implements IRecipeCategory {
@Override
public void drawAnimations(Minecraft minecraft) {
minecraft.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
TextureAtlasSprite sprite = RenderEventHandler.INSTANCE.alfPortalTex;
TextureAtlasSprite sprite = MiscellaneousIcons.INSTANCE.alfPortalTex;
Tessellator tess = Tessellator.getInstance();
WorldRenderer wr = tess.getWorldRenderer();
wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
@@ -20,8 +20,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
import vazkii.botania.common.lib.LibBlockNames;
import javax.annotation.Nonnull;
import java.awt.*;
@@ -10,7 +10,6 @@ package vazkii.botania.client.integration.jei.puredaisy;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IDrawableStatic;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.recipe.IRecipeCategory;
import mezz.jei.api.recipe.IRecipeWrapper;
@@ -8,11 +8,8 @@
*/
package vazkii.botania.client.model;
import com.google.common.base.Function;
import com.google.common.collect.HashBasedTable;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import com.google.common.collect.Maps;
import com.google.common.collect.Table;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
@@ -36,18 +33,19 @@ import net.minecraftforge.client.model.pipeline.IVertexConsumer;
import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad;
import net.minecraftforge.client.model.pipeline.VertexTransformer;
import net.minecraftforge.common.property.IExtendedBlockState;
import org.apache.commons.lang3.tuple.Pair;
import net.minecraftforge.fml.common.FMLLog;
import vazkii.botania.api.BotaniaAPIClient;
import vazkii.botania.api.state.BotaniaStateProps;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.decor.BlockFloatingFlower;
import vazkii.botania.common.block.decor.IFloatingFlower;
import vazkii.botania.api.item.IFloatingFlower;
import vazkii.botania.common.item.block.ItemBlockFloatingSpecialFlower;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
import javax.vecmath.Vector3f;
import javax.vecmath.Vector4f;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
public class FloatingFlowerModel implements ISmartItemModel, ISmartBlockModel, IResourceManagerReloadListener {
@@ -81,12 +79,14 @@ public class FloatingFlowerModel implements ISmartItemModel, ISmartBlockModel, I
@Override
public IBakedModel handleBlockState(IBlockState state) {
IFloatingFlower.IslandType islandType = state.getValue(BlockFloatingFlower.ISLAND_TYPE);
if (state.getBlock() != ModBlocks.floatingSpecialFlower && state.getBlock() != ModBlocks.floatingFlower)
return Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel();
IExtendedBlockState realState = ((IExtendedBlockState) state);
IFloatingFlower.IslandType islandType = realState.getValue(BotaniaStateProps.ISLAND_TYPE);
String identifier;
if (state.getBlock() == ModBlocks.floatingSpecialFlower) {
// Magic flower
IExtendedBlockState realState = ((IExtendedBlockState) state);
identifier = realState.getValue(BotaniaStateProps.SUBTILE_ID);
} else {
// Mundane flower
@@ -96,13 +96,14 @@ public class FloatingFlowerModel implements ISmartItemModel, ISmartBlockModel, I
return getModel(islandType, identifier);
}
// Get the model for this islandtype + flower type combination. If it's not cached already, generate it.
private CompositeBakedModel getModel(IFloatingFlower.IslandType islandType, String identifier) {
ModelManager modelManager = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getModelManager();
if (CACHE.contains(islandType, identifier)) {
return CACHE.get(islandType, identifier);
} else {
IBakedModel islandModel = modelManager.getModel(new ModelResourceLocation("botania:miniIsland", "variant=" + islandType.getName()));
IBakedModel islandModel = modelManager.getModel(BotaniaAPIClient.getRegisteredIslandTypeModels().get(islandType));
IBakedModel flowerModel;
if (identifier.startsWith(MUNDANE_PREFIX)) {
@@ -114,6 +115,7 @@ public class FloatingFlowerModel implements ISmartItemModel, ISmartBlockModel, I
// Enhance!
CompositeBakedModel model = new CompositeBakedModel(flowerModel, islandModel);
FMLLog.info("[Botania]: Cached floating flower model for islandtpye %s and flowertype %s", islandType, identifier);
CACHE.put(islandType, identifier, model);
return model;
}
@@ -163,9 +165,7 @@ public class FloatingFlowerModel implements ISmartItemModel, ISmartBlockModel, I
}
for (EnumFacing e : EnumFacing.VALUES) {
genBuilder.addAll(Iterables.transform(flower.getFaceQuads(e), new Function<BakedQuad, BakedQuad>() {
@Override public BakedQuad apply(BakedQuad input) { return transform(input, transform); }
}));
genBuilder.addAll(flower.getFaceQuads(e).stream().map(input -> transform(input, transform)).collect(Collectors.toList()));
}
// Add island quads
@@ -177,59 +177,35 @@ public class FloatingFlowerModel implements ISmartItemModel, ISmartBlockModel, I
genQuads = genBuilder.build();
}
@Override
public List<BakedQuad> getGeneralQuads() {
// Forward all to flower model
@Override public List<BakedQuad> getGeneralQuads() {
return genQuads;
}
@Override
public List<BakedQuad> getFaceQuads(EnumFacing p_177551_1_) { return ImmutableList.of(); }
@Override
public boolean isAmbientOcclusion() {
@Override public List<BakedQuad> getFaceQuads(EnumFacing p_177551_1_) { return ImmutableList.of(); }
@Override public boolean isAmbientOcclusion() {
return base.isAmbientOcclusion();
}
@Override
public boolean isGui3d() {
@Override public boolean isGui3d() {
return true;
}
@Override
public boolean isBuiltInRenderer() {
@Override public boolean isBuiltInRenderer() {
return base.isBuiltInRenderer();
}
@Override
public TextureAtlasSprite getParticleTexture() {
@Override public TextureAtlasSprite getParticleTexture() {
return base.getParticleTexture();
}
@Override
public ItemCameraTransforms getItemCameraTransforms() {
@Override public ItemCameraTransforms getItemCameraTransforms() {
return base.getItemCameraTransforms();
}
}
@Override
public List<BakedQuad> getFaceQuads(EnumFacing p_177551_1_) { return ImmutableList.of(); }
@Override
public List<BakedQuad> getGeneralQuads() { return ImmutableList.of(); }
@Override
public boolean isAmbientOcclusion() { return false; }
@Override
public boolean isGui3d() { return true; }
@Override
public boolean isBuiltInRenderer() { return false; }
@Override
public TextureAtlasSprite getParticleTexture() { return null; }
@Override
public ItemCameraTransforms getItemCameraTransforms() { return ItemCameraTransforms.DEFAULT; }
// Dummy results
@Override public List<BakedQuad> getFaceQuads(EnumFacing p_177551_1_) { return ImmutableList.of(); }
@Override public List<BakedQuad> getGeneralQuads() { return ImmutableList.of(); }
@Override public boolean isAmbientOcclusion() { return false; }
@Override public boolean isGui3d() { return true; }
@Override public boolean isBuiltInRenderer() { return false; }
@Override public TextureAtlasSprite getParticleTexture() { return null; }
@Override public ItemCameraTransforms getItemCameraTransforms() { return ItemCameraTransforms.DEFAULT; }
}
@@ -14,7 +14,6 @@ import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.GlStateManager;
import org.lwjgl.opengl.GL11;
public class ModelBellows extends ModelBase {
@@ -14,7 +14,6 @@ import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.GlStateManager;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.render.tile.RenderTileBrewery;
@@ -51,13 +50,14 @@ public class ModelBrewery extends ModelBase {
float f = 1F / 16F;
float offset = (float) Math.sin(time / 40) * 0.1F + 0.05F;
int plates = render.brewery.getSizeInventory() - 1;
boolean hasTile = render.brewery != null;
int plates = hasTile ? render.brewery.getSizeInventory() - 1 : 7;
float deg = (float) time / 16F;
float polerot = -deg * 25F;
GlStateManager.translate(0F, offset, 0F);
GlStateManager.rotate(polerot, 0F, 1F, 0F);
if(render.brewery.getStackInSlot(0) != null) {
if(hasTile && render.brewery.getStackInSlot(0) != null) {
GlStateManager.rotate(180F, 1F, 0F, 0F);
GlStateManager.translate(0, -0.45, 0);
//GlStateManager.translate(-1F / 8F, -0.5F, 1F / 128F);
@@ -80,7 +80,7 @@ public class ModelBrewery extends ModelBase {
offset1 = 0F;
GlStateManager.translate(0F, offset1, 0F);
if(render.brewery.getStackInSlot(i + 1) != null) {
if(hasTile && render.brewery.getStackInSlot(i + 1) != null) {
float rot = Plate.rotateAngleY * 180F / (float) Math.PI;
float transX = 0.3125F;
float transY = 1.06F;
@@ -17,10 +17,10 @@ import net.minecraft.client.model.ModelRenderer;
public class ModelPump extends ModelBase{
private ArrayList<ModelRenderer> parts = new ArrayList<ModelRenderer>();
private ArrayList<ModelRenderer> parts = new ArrayList<>();
private ArrayList<ModelRenderer> innerRing = new ArrayList<ModelRenderer>();
private ArrayList<ModelRenderer> outerRing = new ArrayList<ModelRenderer>();
private ArrayList<ModelRenderer> innerRing = new ArrayList<>();
private ArrayList<ModelRenderer> outerRing = new ArrayList<>();
public ModelPump() {
textureWidth = 64;
@@ -14,14 +14,13 @@ import com.google.common.base.Function;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.crash.CrashReport;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ReportedException;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.Attributes;
@@ -51,44 +50,38 @@ public class ModelPylon implements IPylonModel {
private IFlexibleBakedModel gaiaRingsAndPanes;
private IFlexibleBakedModel gaiaGems;
private static final Function<ResourceLocation, TextureAtlasSprite> TEXTUREGETTER = new Function<ResourceLocation, TextureAtlasSprite>() {
@Override
public TextureAtlasSprite apply(ResourceLocation input) {
return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(input.toString());
}
};
private static final Function<ResourceLocation, TextureAtlasSprite> TEXTUREGETTER = input -> Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(input.toString());
private static final Set<String> GROUP_NAMES = ImmutableSet.of("Crystal", "Crystal_Ring", "Ring_Panel01", "Ring_Panel02",
"Ring_Panel03", "Ring_Panel04", "Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04");
public ModelPylon() {
try {
// Load the OBJ
OBJModel model = ((OBJModel) OBJLoader.instance.loadModel(new ResourceLocation("botania:models/block/pylon.obj")));
// Apply the texture and flip the v's of the model
IModel manaModel = ((OBJModel) model.retexture(ImmutableMap.of("#pylon", "botania:model/pylon"))).process(ImmutableMap.of("flip-v", "true"));
IModel naturaModel = ((OBJModel) model.retexture(ImmutableMap.of("#pylon", "botania:model/pylon1"))).process(ImmutableMap.of("flip-v", "true"));
IModel gaiaModel = ((OBJModel) model.retexture(ImmutableMap.of("#pylon", "botania:model/pylon2"))).process(ImmutableMap.of("flip-v", "true"));
// Turn off all except "Crystal"
manaCrystal = manaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal_Ring", "Ring_Panel01", "Ring_Panel02",
"Ring_Panel03", "Ring_Panel04", "Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
naturaCrystal = naturaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal_Ring", "Ring_Panel01", "Ring_Panel02",
"Ring_Panel03", "Ring_Panel04", "Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
gaiaCrystal = gaiaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal_Ring", "Ring_Panel01", "Ring_Panel02",
"Ring_Panel03", "Ring_Panel04", "Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
// All groups are off by default
// (OBJState constructor is derp, so the boolean condition is inverted - pass false to turn on a group)
// Turn off all except "Crystal_Ring", and "Ring_Panel0x"
manaRingsAndPanes = manaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal", "Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
naturaRingsAndPanes = naturaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal", "Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
gaiaRingsAndPanes = gaiaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal", "Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
// Turn on "Crystal"
manaCrystal = manaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
naturaCrystal = naturaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
gaiaCrystal = gaiaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
// Turn off all except "Ring_Gem0x"
manaGems = manaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal", "Crystal_Ring", "Ring_Panel01", "Ring_Panel02",
"Ring_Panel03", "Ring_Panel04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
naturaGems = naturaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal", "Crystal_Ring", "Ring_Panel01", "Ring_Panel02",
"Ring_Panel03", "Ring_Panel04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
gaiaGems = gaiaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal", "Crystal_Ring", "Ring_Panel01", "Ring_Panel02",
"Ring_Panel03", "Ring_Panel04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
// Turn on "Crystal_Ring", and "Ring_Panel0x"
manaRingsAndPanes = manaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal_Ring", "Ring_Panel01", "Ring_Panel02", "Ring_Panel03", "Ring_Panel04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
naturaRingsAndPanes = naturaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal_Ring", "Ring_Panel01", "Ring_Panel02", "Ring_Panel03", "Ring_Panel04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
gaiaRingsAndPanes = gaiaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal_Ring", "Ring_Panel01", "Ring_Panel02", "Ring_Panel03", "Ring_Panel04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
// Turn on "Ring_Gem0x"
manaGems = manaModel.bake(new OBJModel.OBJState(ImmutableList.of("Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
naturaGems = naturaModel.bake(new OBJModel.OBJState(ImmutableList.of("Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
gaiaGems = gaiaModel.bake(new OBJModel.OBJState(ImmutableList.of("Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
} catch (IOException e) {
throw new ReportedException(new CrashReport("Error making pylon submodels for TESR!", e));
}
@@ -105,20 +98,24 @@ public class ModelPylon implements IPylonModel {
@Override
public void renderRing(PylonVariant variant) {
GlStateManager.disableLighting();
switch (variant) {
case MANA: renderModel(manaRingsAndPanes); break;
case NATURA: renderModel(naturaRingsAndPanes); break;
case GAIA: renderModel(gaiaRingsAndPanes); break;
}
GlStateManager.enableLighting();
}
@Override
public void renderGems(PylonVariant variant) {
GlStateManager.disableLighting();
switch (variant) {
case MANA: renderModel(manaGems); break;
case NATURA: renderModel(naturaGems); break;
case GAIA: renderModel(gaiaGems); break;
}
GlStateManager.enableLighting();
}
private void renderModel(IFlexibleBakedModel model)
@@ -0,0 +1,65 @@
/**
* This class was created by <williewillus>. 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.client.model;
import com.google.common.collect.ImmutableList;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.resources.model.IBakedModel;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumWorldBlockLayer;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.client.model.ISmartBlockModel;
import net.minecraftforge.common.property.IExtendedBlockState;
import vazkii.botania.api.state.BotaniaStateProps;
import java.util.List;
public class PlatformModel implements ISmartBlockModel {
@Override
public IBakedModel handleBlockState(IBlockState state) {
EnumWorldBlockLayer layer = MinecraftForgeClient.getRenderLayer();
IBlockState heldState = ((IExtendedBlockState) state).getValue(BotaniaStateProps.HELD_STATE);
Minecraft mc = Minecraft.getMinecraft();
if (heldState == null && layer == EnumWorldBlockLayer.SOLID) {
// No camo
ModelResourceLocation path = new ModelResourceLocation("botania:platform", "variant=" + state.getValue(BotaniaStateProps.PLATFORM_VARIANT).getName());
return mc.getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getModel(path);
} else if (heldState != null){
if (heldState.getBlock().canRenderInLayer(layer)) {
// Steal camo's model
IBakedModel model = mc.getBlockRendererDispatcher().getBlockModelShapes().getModelForState(heldState);
if (model instanceof ISmartBlockModel) {
// Their model can be smart too
model = ((ISmartBlockModel) model).handleBlockState(heldState);
}
return model;
}
}
return this; // This smart model has no quads as seen below, so nothing actually renders
}
@Override public List<BakedQuad> getFaceQuads(EnumFacing p_177551_1_) { return ImmutableList.of(); }
@Override public List<BakedQuad> getGeneralQuads() { return ImmutableList.of(); }
@Override public boolean isAmbientOcclusion() { return true; }
@Override public boolean isGui3d() { return true;}
@Override public boolean isBuiltInRenderer() { return false; }
@Override public TextureAtlasSprite getParticleTexture() { return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite("botania:blocks/livingwood0"); }
@Override public ItemCameraTransforms getItemCameraTransforms() { return ItemCameraTransforms.DEFAULT; }
}
@@ -0,0 +1,134 @@
/**
* This class was created by <williewillus>. 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.client.model;
import com.google.common.base.Function;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.client.resources.model.IBakedModel;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.Attributes;
import net.minecraftforge.client.model.IFlexibleBakedModel;
import net.minecraftforge.client.model.IModel;
import net.minecraftforge.client.model.IPerspectiveAwareModel;
import net.minecraftforge.client.model.ISmartItemModel;
import net.minecraftforge.client.model.TRSRTransformation;
import net.minecraftforge.client.model.obj.OBJLoader;
import net.minecraftforge.client.model.obj.OBJModel;
import net.minecraftforge.fml.common.FMLLog;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.logging.log4j.Level;
import javax.vecmath.Matrix4f;
import javax.vecmath.Vector3f;
import java.io.IOException;
import java.util.List;
public class PylonItemModel implements ISmartItemModel {
private IBakedModel mana;
private IBakedModel natura;
private IBakedModel gaia;
private boolean cached = false;
@Override
public IBakedModel handleItemState(ItemStack stack) {
if (!cached) {
cacheModels();
}
switch (stack.getItemDamage()) {
case 2: return gaia;
case 1: return natura;
case 0: return mana;
default:
return Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel();
}
}
private void cacheModels() {
// Load the OBJ
OBJModel model = null;
try {
model = ((OBJModel) OBJLoader.instance.loadModel(new ResourceLocation("botania:models/block/pylon.obj")));
} catch (IOException e) {
FMLLog.log(Level.ERROR, "[Botania]: Error loading pylon item model, substituting missing model");
mana = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel();
natura = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel();
gaia = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel();
cached = true;
return;
}
// Apply the texture and flip the v's of the model
IModel manaModel = ((OBJModel) model.retexture(ImmutableMap.of("#pylon", "botania:model/pylon"))).process(ImmutableMap.of("flip-v", "true"));
IModel naturaModel = ((OBJModel) model.retexture(ImmutableMap.of("#pylon", "botania:model/pylon1"))).process(ImmutableMap.of("flip-v", "true"));
IModel gaiaModel = ((OBJModel) model.retexture(ImmutableMap.of("#pylon", "botania:model/pylon2"))).process(ImmutableMap.of("flip-v", "true"));
// All groups are off by default
// OBJState constructor is derp, so the boolean condition is inverted - pass false to turn on a group
final Function<ResourceLocation, TextureAtlasSprite> textureGetter = input -> Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(input.toString());
ImmutableList<String> standardGroups = ImmutableList.of("Crystal", "Crystal_Ring",
"Ring_Panel01", "Ring_Panel02", "Ring_Panel03", "Ring_Panel04",
"Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04");
mana = new PerspectiveWrapper(manaModel.bake(new OBJModel.OBJState(standardGroups, false), Attributes.DEFAULT_BAKED_FORMAT, textureGetter));
// Natura model is just the crystal
natura = new PerspectiveWrapper(naturaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal"), false), Attributes.DEFAULT_BAKED_FORMAT, textureGetter));
gaia = new PerspectiveWrapper(gaiaModel.bake(new OBJModel.OBJState(standardGroups, false), Attributes.DEFAULT_BAKED_FORMAT, textureGetter));
cached = true;
}
@Override public List<BakedQuad> getFaceQuads(EnumFacing p_177551_1_) { return ImmutableList.of(); }
@Override public List<BakedQuad> getGeneralQuads() { return ImmutableList.of(); }
@Override public boolean isAmbientOcclusion() { return false; }
@Override public boolean isGui3d() { return true; }
@Override public boolean isBuiltInRenderer() { return false; }
@Override public TextureAtlasSprite getParticleTexture() { return null; }
@Override public ItemCameraTransforms getItemCameraTransforms() { return ItemCameraTransforms.DEFAULT; }
// Wrapper to transform the model before rendering it, so it looks right in the inventory
private class PerspectiveWrapper implements IPerspectiveAwareModel {
private final IFlexibleBakedModel parent;
public PerspectiveWrapper(IBakedModel pylonModel) {
this.parent = new IFlexibleBakedModel.Wrapper(pylonModel, Attributes.DEFAULT_BAKED_FORMAT);
}
@Override
public Pair<? extends IFlexibleBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) {
switch(cameraTransformType) {
case FIRST_PERSON: return ImmutablePair.of(parent, new TRSRTransformation(new Vector3f(0, 0, 0.4F), null, new Vector3f(0.75F, 0.75F, 0.75F), null).getMatrix());
case GUI: return ImmutablePair.of(parent, TRSRTransformation.blockCenterToCorner(new TRSRTransformation(new Vector3f(0.5F, 0.1F, 0), null, null, null)).getMatrix());
case THIRD_PERSON: return ImmutablePair.of(parent, new TRSRTransformation(new Vector3f(0, -0.2F, 0.5F), null, null, null).getMatrix());
default: return ImmutablePair.of(parent, TRSRTransformation.identity().getMatrix());
}
}
@Override public VertexFormat getFormat() { return Attributes.DEFAULT_BAKED_FORMAT; }
@Override public List<BakedQuad> getFaceQuads(EnumFacing p_177551_1_) { return parent.getFaceQuads(p_177551_1_); }
@Override public List<BakedQuad> getGeneralQuads() { return parent.getGeneralQuads(); }
@Override public boolean isAmbientOcclusion() { return parent.isAmbientOcclusion(); }
@Override public boolean isGui3d() { return parent.isGui3d(); }
@Override public boolean isBuiltInRenderer() { return parent.isBuiltInRenderer(); }
@Override public TextureAtlasSprite getParticleTexture() { return parent.getParticleTexture(); }
@Override public ItemCameraTransforms getItemCameraTransforms() { return parent.getItemCameraTransforms(); }
}
}
@@ -6,7 +6,7 @@
* Botania is Open Source and distributed under the
* Botania License: http://botaniamod.net/license.php
*/
package vazkii.botania.client.render;
package vazkii.botania.client.model;
import com.google.common.base.Function;
import com.google.common.base.Optional;
@@ -42,7 +42,8 @@ import net.minecraftforge.fml.common.FMLLog;
import org.apache.commons.lang3.tuple.Pair;
import vazkii.botania.api.BotaniaAPIClient;
import vazkii.botania.api.state.BotaniaStateProps;
import vazkii.botania.common.block.decor.IFloatingFlower;
import vazkii.botania.api.item.IFloatingFlower;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
import javax.vecmath.Matrix4f;
@@ -72,10 +73,8 @@ public class SpecialFlowerModel implements IModelCustomData {
builder.addAll(blockModels.values());
builder.addAll(itemModels.values());
// Force mini island model to be loaded and baked, for use elsewhere. See FloatingFlowerModel
for (IFloatingFlower.IslandType i : IFloatingFlower.IslandType.values()) {
builder.add(new ModelResourceLocation("botania:miniIsland", "variant=" + i.name().toLowerCase(Locale.ROOT)));
}
// Force island models to be loaded and baked. See FloatingFlowerModel.
builder.addAll(BotaniaAPIClient.getRegisteredIslandTypeModels().values());
return builder.build();
}
@@ -108,10 +107,10 @@ public class SpecialFlowerModel implements IModelCustomData {
}
}
for (Map.Entry<String, ModelResourceLocation> e : BotaniaAPIClient.queuedBlockModels.entrySet()) {
for (Map.Entry<String, ModelResourceLocation> e : BotaniaAPIClient.getRegisteredSubtileBlockModels().entrySet()) {
blockBuilder.put(Optional.of(e.getKey()), e.getValue());
}
for (Map.Entry<String, ModelResourceLocation> e : BotaniaAPIClient.queuedItemModels.entrySet()) {
for (Map.Entry<String, ModelResourceLocation> e : BotaniaAPIClient.getRegisteredSubtileItemModels().entrySet()) {
itemBuilder.put(Optional.of(e.getKey()), e.getValue());
}
@@ -286,6 +285,8 @@ public class SpecialFlowerModel implements IModelCustomData {
@Override
public IBakedModel handleBlockState(IBlockState state) {
if (state.getBlock() != ModBlocks.specialFlower)
return Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel();
refreshBakedModels();
IExtendedBlockState extendedState = ((IExtendedBlockState) state);
IBakedModel ret = bakedBlockModels.get(extendedState.getValue(BotaniaStateProps.SUBTILE_ID));
@@ -14,7 +14,6 @@ import java.util.Random;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
@@ -22,17 +21,15 @@ import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.core.handler.RenderEventHandler;
import vazkii.botania.client.core.handler.MiscellaneousIcons;
import vazkii.botania.client.core.helper.IconHelper;
import vazkii.botania.client.core.helper.ShaderHelper;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.common.entity.EntityBabylonWeapon;
import vazkii.botania.common.item.relic.ItemKingKey;
public class RenderBabylonWeapon extends Render<EntityBabylonWeapon> {
@@ -62,7 +59,7 @@ public class RenderBabylonWeapon extends Render<EntityBabylonWeapon> {
GlStateManager.scale(s, s, s);
GlStateManager.rotate(-90F, 0F, 1F, 0F);
GlStateManager.rotate(45F, 0F, 0F, 1F);
TextureAtlasSprite icon = RenderEventHandler.INSTANCE.kingKeyWeaponIcons[weapon.getVariety()];
TextureAtlasSprite icon = MiscellaneousIcons.INSTANCE.kingKeyWeaponIcons[weapon.getVariety()];
GlStateManager.color(1F, 1F, 1F, chargeMul);
float f = icon.getMinU();
float f1 = icon.getMaxU();
@@ -10,26 +10,14 @@
*/
package vazkii.botania.client.render.entity;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.core.handler.RenderEventHandler;
import vazkii.botania.client.core.handler.MiscellaneousIcons;
import vazkii.botania.common.entity.EntityCorporeaSpark;
import vazkii.botania.common.item.ItemCorporeaSpark;
public class RenderCorporeaSpark extends RenderSparkBase<EntityCorporeaSpark> {
@@ -39,7 +27,7 @@ public class RenderCorporeaSpark extends RenderSparkBase<EntityCorporeaSpark> {
@Override
public TextureAtlasSprite getBaseIcon(EntityCorporeaSpark entity) {
return entity.isMaster() ? RenderEventHandler.INSTANCE.corporeaWorldIconMaster : RenderEventHandler.INSTANCE.corporeaWorldIcon;
return entity.isMaster() ? MiscellaneousIcons.INSTANCE.corporeaWorldIconMaster : MiscellaneousIcons.INSTANCE.corporeaWorldIcon;
}
@Override
@@ -54,7 +42,7 @@ public class RenderCorporeaSpark extends RenderSparkBase<EntityCorporeaSpark> {
@Override
public TextureAtlasSprite getSpinningIcon(EntityCorporeaSpark entity) {
return RenderEventHandler.INSTANCE.corporeaIconStar;
return MiscellaneousIcons.INSTANCE.corporeaIconStar;
}
@Override
@@ -10,13 +10,10 @@
*/
package vazkii.botania.client.render.entity;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelPlayer;
import net.minecraft.client.renderer.entity.RenderBiped;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.resources.DefaultPlayerSkin;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.ARBShaderObjects;
@@ -63,7 +60,7 @@ public class RenderDoppleganger extends RenderBiped<EntityDoppleganger> {
};
public RenderDoppleganger(RenderManager renderManager) {
super(renderManager, new ModelPlayer(0.0F, false), 0F); // todo 1.8 was ModelBiped(0.5)
super(renderManager, new ModelPlayer(0.0F, false), 0F);
}
@Override
@@ -13,12 +13,8 @@ package vazkii.botania.client.render.entity;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.common.entity.EntityManaStorm;
@@ -12,7 +12,6 @@ package vazkii.botania.client.render.entity;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.RenderWither;
import net.minecraft.entity.Entity;
import net.minecraft.entity.boss.BossStatus;
import net.minecraft.entity.boss.EntityWither;
import net.minecraft.util.ResourceLocation;
@@ -10,12 +10,10 @@
*/
package vazkii.botania.client.render.entity;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.ARBShaderObjects;
@@ -43,8 +41,8 @@ public class RenderPixie extends RenderLiving<EntityPixie> {
}
};
public RenderPixie() {
super(Minecraft.getMinecraft().getRenderManager(), new ModelPixie(), 0.25F);
public RenderPixie(RenderManager renderManager) {
super(renderManager, new ModelPixie(), 0.25F);
//setRenderPassModel(new ModelPixie());
shadowSize = 0.0F;
}
@@ -10,12 +10,16 @@
*/
package vazkii.botania.client.render.entity;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.RenderMinecart;
import net.minecraft.entity.item.EntityMinecart;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import vazkii.botania.api.state.enums.PoolVariant;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.render.tile.RenderTilePool;
import vazkii.botania.common.block.tile.mana.TilePool;
import vazkii.botania.common.entity.EntityPoolMinecart;
public class RenderPoolMinecart extends RenderMinecart<EntityPoolMinecart> {
@@ -26,8 +30,9 @@ public class RenderPoolMinecart extends RenderMinecart<EntityPoolMinecart> {
@Override
protected void func_180560_a(EntityPoolMinecart poolCart, float p_147910_2_, IBlockState state) {
RenderTilePool.forceVariant = PoolVariant.DEFAULT;
RenderTilePool.forceManaNumber = poolCart.getMana();
super.func_180560_a(poolCart, p_147910_2_, state);
TileEntityRendererDispatcher.instance.getSpecialRendererByClass(TilePool.class).renderTileEntityAt(null, poolCart.posX, poolCart.posY, poolCart.posZ, ClientTickHandler.partialTicks, -1);
}
@@ -0,0 +1,32 @@
/**
* This class was created by <williewillus>. 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.client.render.entity;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.RenderSnowball;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
// Same as RenderSnowball, but ItemStack sensitive
public class RenderSnowballStack<T extends Entity> extends RenderSnowball<T> {
private final ItemStack stack;
public RenderSnowballStack(RenderManager renderManagerIn, ItemStack stack, RenderItem render) {
super(renderManagerIn, stack.getItem(), render);
this.stack = stack;
}
@Override
public ItemStack func_177082_d(T entity) {
return stack;
}
}
@@ -12,9 +12,8 @@ package vazkii.botania.client.render.entity;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import vazkii.botania.client.core.handler.RenderEventHandler;
import vazkii.botania.client.core.handler.MiscellaneousIcons;
import vazkii.botania.common.entity.EntitySpark;
import vazkii.botania.common.item.ItemSparkUpgrade;
public class RenderSpark extends RenderSparkBase<EntitySpark> {
@@ -25,7 +24,7 @@ public class RenderSpark extends RenderSparkBase<EntitySpark> {
@Override
public TextureAtlasSprite getSpinningIcon(EntitySpark entity) {
int upgrade = entity.getUpgrade() - 1;
return upgrade >= 0 && upgrade < RenderEventHandler.INSTANCE.sparkUpgradeIcons.length ? RenderEventHandler.INSTANCE.sparkUpgradeIcons[upgrade] : null;
return upgrade >= 0 && upgrade < MiscellaneousIcons.INSTANCE.sparkUpgradeIcons.length ? MiscellaneousIcons.INSTANCE.sparkUpgradeIcons[upgrade] : null;
}
}
@@ -25,9 +25,8 @@ import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.core.handler.RenderEventHandler;
import vazkii.botania.client.core.handler.MiscellaneousIcons;
import vazkii.botania.common.entity.EntitySpark;
import vazkii.botania.common.item.ItemSpark;
public class RenderSparkBase<T extends Entity> extends RenderEntity {
@@ -82,7 +81,7 @@ public class RenderSparkBase<T extends Entity> extends RenderEntity {
}
public TextureAtlasSprite getBaseIcon(T entity) {
return RenderEventHandler.INSTANCE.sparkWorldIcon;
return MiscellaneousIcons.INSTANCE.sparkWorldIcon;
}
public void colorSpinningIcon(T entity, float a) {
@@ -17,14 +17,11 @@ import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import vazkii.botania.common.entity.EntityThornChakram;
import vazkii.botania.common.item.ModItems;
// Basically a bit of an extension of RenderSnowball
public class RenderThornChakram extends Render<EntityThornChakram> {
@@ -99,12 +99,14 @@ public class RenderLexicon implements IItemRenderer {
font.drawString(StatCollector.translateToLocal("botaniamisc.lexiconcover0"), 0, 0, 0x79ff92);
GlStateManager.translate(0F, 10F, 0F);
font.drawString(EnumChatFormatting.UNDERLINE + StatCollector.translateToLocal("botaniamisc.lexiconcover1"), 0, 0, 0x79ff92);
font.drawString(StatCollector.translateToLocal("botaniamisc.lexiconcover1"), 0, 0, 0x79ff92);
GlStateManager.translate(0F, 50F, 0F);
font.drawString(StatCollector.translateToLocal("botaniamisc.lexiconcover2"), 0, 0, 0x79ff92);
GlStateManager.translate(0F, 10F, 0F);
font.drawString(EnumChatFormatting.ITALIC + StatCollector.translateToLocal("botaniamisc.lexiconcover3"), 0, 0, 0x79ff92);
font.drawString(EnumChatFormatting.UNDERLINE + "" + EnumChatFormatting.ITALIC + StatCollector.translateToLocal("botaniamisc.lexiconcover3"), 0, 0, 0x79ff92);
if(bevo || saice) {
GlStateManager.translate(0F, 10F, 0F);
font.drawString(StatCollector.translateToLocal("botaniamisc.lexiconcover" + (bevo ? 4 : 5)), 0, 0, 0x79ff92);
@@ -17,22 +17,27 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.tileentity.TileEntity;
import org.lwjgl.opengl.GL11;
import vazkii.botania.api.state.BotaniaStateProps;
import vazkii.botania.api.state.enums.AlfPortalState;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.core.handler.RenderEventHandler;
import vazkii.botania.common.block.BlockAlfPortal;
import vazkii.botania.client.core.handler.MiscellaneousIcons;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.tile.TileAlfPortal;
public class RenderTileAlfPortal extends TileEntitySpecialRenderer {
public class RenderTileAlfPortal extends TileEntitySpecialRenderer<TileAlfPortal> {
@Override
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f, int digProgress) {
TileAlfPortal portal = (TileAlfPortal) tileentity;
int meta = portal.getBlockMetadata();
if(meta == 0)
public void renderTileEntityAt(TileAlfPortal portal, double d0, double d1, double d2, float f, int digProgress) {
if (portal != null && portal.getWorld() != null && !portal.getWorld().isBlockLoaded(portal.getPos(), false)) {
return;
}
AlfPortalState state = portal.getWorld().getBlockState(portal.getPos()).getValue(BotaniaStateProps.ALFPORTAL_STATE);
if(state == AlfPortalState.OFF)
return;
GlStateManager.pushMatrix();
@@ -49,18 +54,18 @@ public class RenderTileAlfPortal extends TileEntitySpecialRenderer {
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
if(meta == 2) {
if(state == AlfPortalState.ON_X) {
GlStateManager.translate(1.25F, 0F, 1.75F);
GlStateManager.rotate(90F, 0F, 1F, 0F);
}
GlStateManager.disableCull();
GlStateManager.disableLighting();
renderIcon(0, 0, RenderEventHandler.INSTANCE.alfPortalTex, 3, 3, 240);
renderIcon(0, 0, MiscellaneousIcons.INSTANCE.alfPortalTex, 3, 3, 240);
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GlStateManager.translate(0F, 0F, 0.5F);
renderIcon(0, 0, RenderEventHandler.INSTANCE.alfPortalTex, 3, 3, 240);
renderIcon(0, 0, MiscellaneousIcons.INSTANCE.alfPortalTex, 3, 3, 240);
GlStateManager.enableCull();
GlStateManager.enableAlpha();
@@ -10,35 +10,27 @@
*/
package vazkii.botania.client.render.tile;
import java.awt.Color;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.client.model.ModelAltar;
import vazkii.botania.common.block.tile.TileAltar;
public class RenderTileAltar extends TileEntitySpecialRenderer {
public class RenderTileAltar extends TileEntitySpecialRenderer<TileAltar> {
private static final ResourceLocation[] textures = new ResourceLocation[] {
new ResourceLocation(LibResources.MODEL_ALTAR),
@@ -58,8 +50,10 @@ public class RenderTileAltar extends TileEntitySpecialRenderer {
public static int forceMeta = -1;
@Override
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float pticks, int digProgress) {
TileAltar altar = (TileAltar) tileentity;
public void renderTileEntityAt(TileAltar altar, double d0, double d1, double d2, float pticks, int digProgress) {
if (altar != null && altar.getWorld() != null && !altar.getWorld().isBlockLoaded(altar.getPos(), false)) {
return;
}
GlStateManager.pushMatrix();
GlStateManager.enableRescaleNormal();
@@ -10,30 +10,26 @@
*/
package vazkii.botania.client.render.tile;
import java.awt.Color;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import vazkii.botania.api.item.IAvatarWieldable;
import vazkii.botania.api.state.BotaniaStateProps;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.client.model.ModelAvatar;
import vazkii.botania.common.block.tile.TileAvatar;
public class RenderTileAvatar extends TileEntitySpecialRenderer {
public class RenderTileAvatar extends TileEntitySpecialRenderer<TileAvatar> {
private static final float[] ROTATIONS = new float[] {
180F, 0F, 90F, 270F
@@ -43,8 +39,10 @@ public class RenderTileAvatar extends TileEntitySpecialRenderer {
private static final ModelAvatar model = new ModelAvatar();
@Override
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float pticks, int digProgress) {
TileAvatar avatar = (TileAvatar) tileentity;
public void renderTileEntityAt(TileAvatar avatar, double d0, double d1, double d2, float pticks, int digProgress) {
if (avatar != null && avatar.getWorld() != null && !avatar.getWorld().isBlockLoaded(avatar.getPos(), false)) {
return;
}
GlStateManager.pushMatrix();
GlStateManager.enableRescaleNormal();
@@ -52,13 +50,23 @@ public class RenderTileAvatar extends TileEntitySpecialRenderer {
GlStateManager.translate(d0, d1, d2);
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
int meta = avatar.getWorld() != null ? avatar.getBlockMetadata() : 0;
EnumFacing facing = avatar != null && avatar.getWorld() != null
? avatar.getWorld().getBlockState(avatar.getPos()).getValue(BotaniaStateProps.CARDINALS)
: EnumFacing.SOUTH;
GlStateManager.translate(0.5F, 1.6F, 0.5F);
GlStateManager.scale(1F, -1F, -1F);
GlStateManager.rotate(ROTATIONS[Math.max(Math.min(ROTATIONS.length - 1, meta - 2), 0)], 0F, 1F, 0F);
GlStateManager.rotate(ROTATIONS[Math.max(Math.min(ROTATIONS.length - 1, facing.getIndex() - 2), 0)], 0F, 1F, 0F);
model.render();
if (avatar == null) {
GlStateManager.color(1F, 1F, 1F);
GlStateManager.scale(1F, -1F, -1F);
GlStateManager.enableRescaleNormal();
GlStateManager.popMatrix();
return;
}
ItemStack stack = avatar.getStackInSlot(0);
if(stack != null) {
GlStateManager.pushMatrix();
@@ -13,17 +13,13 @@ package vazkii.botania.client.render.tile;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.client.model.ModelBellows;
import vazkii.botania.common.block.tile.mana.TileBellows;
public class RenderTileBellows extends TileEntitySpecialRenderer {
public class RenderTileBellows extends TileEntitySpecialRenderer<TileBellows> {
private static final float[] ROTATIONS = new float[] {
180F, 0F, 90F, 270F
@@ -33,21 +29,23 @@ public class RenderTileBellows extends TileEntitySpecialRenderer {
private static final ModelBellows model = new ModelBellows();
@Override
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f, int digProgress) {
TileBellows bellows = (TileBellows) tileentity;
public void renderTileEntityAt(TileBellows bellows, double d0, double d1, double d2, float f, int digProgress) {
if (bellows != null && bellows.getWorld() != null && !bellows.getWorld().isBlockLoaded(bellows.getPos(), false)) {
return;
}
GlStateManager.pushMatrix();
GlStateManager.enableRescaleNormal();
GlStateManager.color(1F, 1F, 1F, 1F);
GlStateManager.translate(d0, d1, d2);
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
int meta = bellows.getWorld() != null ? bellows.getBlockMetadata() : 0;
int meta = bellows != null && bellows.getWorld() != null ? bellows.getBlockMetadata() : 0;
GlStateManager.translate(0.5F, 1.5F, 0.5F);
GlStateManager.scale(1F, -1F, -1F);
GlStateManager.rotate(ROTATIONS[Math.max(Math.min(ROTATIONS.length, meta - 2), 0)], 0F, 1F, 0F);
model.render(Math.max(0.1F, 1F - (bellows.movePos + bellows.moving * f + 0.1F)));
model.render(Math.max(0.1F, 1F - (bellows == null ? 0 : (bellows.movePos + bellows.moving * f + 0.1F))));
GlStateManager.color(1F, 1F, 1F);
GlStateManager.scale(1F, -1F, -1F);
GlStateManager.enableRescaleNormal();
@@ -10,32 +10,20 @@
*/
package vazkii.botania.client.render.tile;
import java.awt.Color;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.ForgeHooksClient;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.client.model.ModelBrewery;
import vazkii.botania.common.block.tile.TileBrewery;
public class RenderTileBrewery extends TileEntitySpecialRenderer {
public class RenderTileBrewery extends TileEntitySpecialRenderer<TileBrewery> {
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_BREWERY);
ModelBrewery model = new ModelBrewery();
@@ -43,8 +31,8 @@ public class RenderTileBrewery extends TileEntitySpecialRenderer {
public static boolean rotate = true;
@Override
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f, int digProgress) {
brewery = (TileBrewery) tileentity;
public void renderTileEntityAt(TileBrewery brewery, double d0, double d1, double d2, float f, int digProgress) {
this.brewery = brewery;
GlStateManager.pushMatrix();
GlStateManager.enableRescaleNormal();
GlStateManager.color(1F, 1F, 1F, 1F);
@@ -10,28 +10,27 @@
*/
package vazkii.botania.client.render.tile;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.client.resources.model.IBakedModel;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.client.model.ModelCocoon;
import vazkii.botania.common.block.tile.TileCocoon;
public class RenderTileCocoon extends TileEntitySpecialRenderer {
public class RenderTileCocoon extends TileEntitySpecialRenderer<TileCocoon> {
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_COCOON);
ModelCocoon model = new ModelCocoon();
@Override
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f, int digProgress) {
TileCocoon cocoon = (TileCocoon) tileentity;
public void renderTileEntityAt(TileCocoon cocoon, double d0, double d1, double d2, float f, int digProgress) {
float rot = 0F;
float modval = 60F - (float) cocoon.timePassed / (float) TileCocoon.TOTAL_TIME * 30F;
if(cocoon.timePassed % modval < 10) {
@@ -45,12 +44,14 @@ public class RenderTileCocoon extends TileEntitySpecialRenderer {
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GlStateManager.color(1F, 1F, 1F, 1F);
GlStateManager.translate(d0, d1, d2);
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
GlStateManager.rotate(90F, 1F, 0F, 0F);
GlStateManager.translate(0.5F, -0.5F - 3F / 16F, -0.5F + 1F / 16F);
GlStateManager.rotate(rot, 0F, 1F, 0F);
model.render();
GlStateManager.translate(d0, d1, d2 + 1);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
GlStateManager.translate(0.5F, 0, 0F);
GlStateManager.rotate(rot, 1F, 0F, 0F); // todo 1.8 fixme looks a little weird compared to 1.7
GlStateManager.translate(-0.5F, 0, 0F);
IBlockState state = cocoon.getWorld().getBlockState(cocoon.getPos());
IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelForState(state);
Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightness(model, state, 1.0F, false);
GlStateManager.color(1F, 1F, 1F);
GlStateManager.enableRescaleNormal();
GlStateManager.popMatrix();
Loaded 100 of 569 files, more files were not shown because too many files have changed in this diff. Show more