Compare commits

...
84 Commits
Author SHA1 Message Date
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
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
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
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
Vincent Lee 2ddf71d76f Cleanup 2016-01-05 21:41:07 -06:00
Vincent Lee 34fae04641 Made API dediserver-safe. Remove icon methods from SubTileSignature. 2016-01-05 21:39:56 -06:00
Vincent Lee dc6af948d9 Don't use a sideonly client method. Closes #18 2016-01-05 21:23:50 -06:00
Vincent Lee 3fe2a0006c Change crystal bow draw animation to better reflect when it's fully charged 2016-01-05 19:51:41 -06:00
Vincent Lee 89dac440c8 Change starfield item model to match upstream 2016-01-05 19:27:54 -06:00
Vincent Lee 5797d18d9b Fix a bunch of coloring mistakes. Fix flower particles because I'm dumb 2016-01-05 19:24:30 -06:00
Vincent Lee 52cf3df27e Fix tessellator bugs, fix alf portal crash 2016-01-05 17:15:22 -06:00
Vincent Lee b976ed5df1 Cleanup JEI integration, add copyleft. 2016-01-05 17:01:46 -06:00
Vincent Lee e727cb7f2b Merge branch 'jei' into MC18 2016-01-05 16:51:18 -06:00
Vincent Lee 8e6dc7c637 JEI integration complete (runic altar, mana infusion) 2016-01-05 16:51:03 -06:00
Vincent Lee 28249d1e33 Elven trade integration 2016-01-05 15:36:10 -06:00
Vincent Lee b24585b13d Update a bunch of recipes to take vanilla blocks and items. Also remove prismarine lex entry and move infusion recipe to mana pool page. 2016-01-05 12:25:53 -06: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
Vincent Lee 86880bfd49 Fix helmet of revealing inv model 2016-01-05 00:05:09 -06:00
Vincent Lee c8c50f9af0 Future is now part 1: conversions recipes to vanilla 2016-01-04 23:29:50 -06:00
Vincent Lee 0e301a4e33 Fix apothecary light level crash, tiny potato render crash. Closes #17 2016-01-04 22:47:47 -06:00
Vincent Lee 10d095d656 Finish pure daisy integration 2016-01-04 22:46:24 -06:00
Vincent Lee 9bf2e0c555 Semi working petal apothecary itnegration 2016-01-04 22:34:45 -06:00
Vincent Lee 95118696ce Half complete petal apothecary 2016-01-04 20:57:14 -06:00
Vincent Lee ab4f6f6433 workaround for pylon enchant power. closes #16 2016-01-04 19:58:54 -06: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
Vincent Lee 46c13be698 Fix rotations and nameplates for tiny potato 2016-01-04 14:09:18 -06:00
Vincent Lee ad58fb1855 Partial tiny potato 2016-01-04 12:18:19 -06:00
Vincent Lee 12ae7ed3d1 Fix thaumcraft integration crashing 2016-01-04 10:01:04 -06: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
Vincent Lee 6cf82eb98d Rudimentary pure daisy integration 2016-01-03 23:43:24 -06:00
Vincent Lee b10a642297 Brewery recipe support 2016-01-03 22:02:02 -06:00
Vincent Lee 75ab210227 Item models fully working. TESRs may be changed in future 2016-01-03 19:59:27 -06:00
Vincent Lee 0b27d9d0b5 Attempt at json pool model 2016-01-03 19:29:09 -06:00
Vincent Lee 3c102bbc75 Move mc dep ver out of @Mod 2016-01-02 23:32:55 -06:00
Vincent Lee 4e1065855e Some formatting cleanups. Add copyleft header to all new classes 2016-01-02 23:21:55 -06: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
Vincent Lee 3eb67e3fea Corporea index and cube item model 2016-01-02 19:43:41 -06:00
Vincent Lee 5d80b7d9ce Fix thaumcraft 5 goggles of revealing integration. closes #14 2016-01-02 19:07:52 -06:00
Vasco Lavos 820c042f40 Update contributors.properties 2016-01-02 23:42:17 +00:00
Vincent Lee f7e5054bf4 Fix armor rendering - thanks primetoxinz for the find! 2016-01-01 16:05:17 -06:00
Vincent Lee 906fb74ec0 Fix santaweave inv icons 2016-01-01 15:35:08 -06: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
277 changed files with 4219 additions and 1273 deletions

No files matched your search

+2 -10
View File
@@ -10,7 +10,7 @@ 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 --
* Most things left untouched to make patches from upstream easier
@@ -25,12 +25,4 @@ sorry :/ The systems needed to dynamically switch out the textures like that is
* Quartz stair textures may be assigned incorrectly - resource pack authors check me
* Glass pane inner faces are not getting culled (vanilla bug?)
* Some item forms of technical/non-user blocks are removed
* Full list: [all double slab items, all solid vine items]
-- Todo --
* JSON models for everything (tedious/med-hard)
* Migrate the PlayerRender events (baubles, etc.) to LayerRenderers (med)
* For rendering arbitrary icons (that DO NOT HAVE AN ITEM) in a 3D style (manaResource icons, etc.)
- Sub to texture stitch and bake our own model there to use?
- This remains the largest portion of what is left
- Where is the method to render an arbitrary baked model?
* Full list: [all double slab items, all solid vine items]
-14
View File
@@ -1,14 +0,0 @@
altar
up-down
west-south-east-north
base textures pillar tex
northsouth face cup (1 always faces south)
eastwest face cup (blue always faces east)
cupbase 2
cubbase
water-lava texture simply one level below top of cup
+6
View File
@@ -21,6 +21,9 @@ repositories {
name = "chickenbones"
url = "http://chickenbones.net/maven/"
}
maven {
url "http://dvs1.progwml6.com/files/maven"
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
@@ -46,6 +49,7 @@ minecraft {
replace 'GRADLE:VERSION', config.version
replaceIn 'LibMisc.java' //I may have missed another file, though I can only find it in here.
useDepAts = true
}
//This here is for SCP
@@ -67,6 +71,8 @@ dependencies {
//compile "codechicken:NotEnoughItems:1.8-1.0.5.104:dev"
//compile "codechicken:ForgeMultipart:1.7.10-1.1.1.320:dev"
deobfCompile "mezz.jei:jei_1.8.9:2.13.7.64"
//and a bit more for SCP
sshAntTask "org.apache.ant:ant-jsch:1.7.1", "jsch:jsch:0.1.29"
}
+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.1688
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
@@ -0,0 +1,75 @@
package vazkii.botania.api;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import vazkii.botania.api.subtile.SubTileEntity;
import java.util.Collections;
import java.util.Map;
/**
* Class for API calls that must be made clientside
*/
@SideOnly(Side.CLIENT)
public final class BotaniaAPIClient {
private static final Map<String, ModelResourceLocation> queuedBlockModels = Maps.newHashMap();
private static final Map<String, ModelResourceLocation> queuedItemModels = 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
*
* @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);
}
/**
* 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
*
* @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"
*/
public static void registerSubtileModel(String subTileName, ModelResourceLocation model) {
registerSubtileModel(subTileName, model, new ModelResourceLocation(model.getResourceDomain() + ":" + model.getResourcePath(), "inventory"));
}
// Convenience overloads for the above two calls
public static void registerSubtileModel(Class<? extends SubTileEntity> clazz, ModelResourceLocation model) {
registerSubtileModel(BotaniaAPI.getSubTileStringMapping(clazz), model);
}
public static void registerSubtileModel(Class<? extends SubTileEntity> clazz, ModelResourceLocation model, ModelResourceLocation itemModel) {
registerSubtileModel(BotaniaAPI.getSubTileStringMapping(clazz), model, itemModel);
}
/**
* @return An immutable view of the registered subtile block model map
*/
public static Map<String, ModelResourceLocation> getRegisteredSubtileBlockModels() {
return Collections.unmodifiableMap(queuedBlockModels);
}
/**
* @return An immutable view of the registered subtile item model map
*/
public static Map<String, ModelResourceLocation> getRegisteredSubtileItemModels() {
return Collections.unmodifiableMap(queuedItemModels);
}
private BotaniaAPIClient() {}
}
@@ -15,6 +15,7 @@ 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;
@@ -27,6 +28,8 @@ import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import vazkii.botania.api.boss.IBotaniaBoss;
import vazkii.botania.api.lexicon.LexiconPage;
import vazkii.botania.api.lexicon.multiblock.MultiblockSet;
@@ -134,13 +137,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
@@ -15,6 +15,7 @@ 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 +86,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();
@@ -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.
@@ -185,4 +185,5 @@ public class Multiblock {
public MultiblockComponent getComponentForLocation(BlockPos pos) {
return locationCache.get(pos);
}
}
@@ -35,4 +35,5 @@ public class MultiblockSet {
public Multiblock getForFacing(EnumFacing facing) {
return mbs.get(facing);
}
}
@@ -24,13 +24,10 @@ import vazkii.botania.api.BotaniaAPI;
*/
public class ColorSwitchingComponent extends MultiblockComponent {
private final PropertyEnum colorProp;
private final PropertyEnum<EnumDyeColor> colorProp;
public ColorSwitchingComponent(BlockPos relPos, Block block, PropertyEnum colorProp) {
public ColorSwitchingComponent(BlockPos relPos, Block block, PropertyEnum<EnumDyeColor> colorProp) {
super(relPos, block.getDefaultState());
if (colorProp.getValueClass() != EnumDyeColor.class) {
throw new IllegalArgumentException("Must be EnumDyeColor");
}
this.colorProp = colorProp;
}
@@ -58,7 +58,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() {
@@ -88,4 +88,5 @@ public class MultiblockComponent {
public boolean shouldDoFancyRender() {
return doFancyRender;
}
}
@@ -0,0 +1,26 @@
package vazkii.botania.api.lexicon.multiblock.component;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.tileentity.TileEntity;
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());
}
}
@@ -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);
}
@@ -1,3 +1,11 @@
/**
* 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 com.google.common.base.Predicate;
@@ -11,19 +19,20 @@ import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.util.EnumFacing;
import vazkii.botania.api.state.enums.*;
import vazkii.botania.common.block.decor.IFloatingFlower;
import javax.annotation.Nullable;
/**
* Holds all Botania block state properties. Use these to set botania blockstates
*/
public class BotaniaStateProps {
/** The property for specialFlower **/
/** Unlisted properties **/
// The property for specialFlower subtile id
public static final PropertyString SUBTILE_ID = new PropertyString("subtile_id");
// The property for platform held blockstate id
public static final PropertyState HELD_STATE = new PropertyState("held_state");
/** Common properties to all blocks to use **/
// The 16 Minecraft colors
@@ -130,6 +139,7 @@ public class BotaniaStateProps {
// 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>() {
@@ -162,5 +172,9 @@ 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,43 @@
/**
* 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.minecraft.block.state.IBlockState;
import net.minecraftforge.common.property.IUnlistedProperty;
// An unlisted property that holds an IBlockState. Used for platform rendering
public class PropertyState implements IUnlistedProperty<IBlockState> {
private final String name;
public PropertyState(String name) {
this.name = name;
}
@Override
public String getName() {
return name;
}
@Override
public boolean isValid(IBlockState value) {
return true;
}
@Override
public Class<IBlockState> getType() {
return IBlockState.class;
}
@Override
public String valueToString(IBlockState value) {
return value.toString();
}
}
@@ -1,8 +1,16 @@
/**
* 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;
import vazkii.botania.api.subtile.SubTileEntity;
// An unlisted property that holds a String, used for subtile rendering
public class PropertyString implements IUnlistedProperty<String> {
private final String name;
@@ -1,3 +1,11 @@
/**
* 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.enums;
import net.minecraft.util.IStringSerializable;
@@ -13,4 +21,5 @@ public enum AlfPortalState implements IStringSerializable {
public String getName() {
return name().toLowerCase(Locale.ROOT);
}
}
@@ -1,3 +1,11 @@
/**
* 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.enums;
import net.minecraft.util.IStringSerializable;
@@ -16,4 +24,5 @@ public enum AltGrassVariant implements IStringSerializable {
public String getName() {
return this.name().toLowerCase(Locale.ROOT);
}
}
@@ -1,3 +1,11 @@
/**
* 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.enums;
import net.minecraft.util.IStringSerializable;
@@ -20,4 +28,5 @@ public enum AltarVariant implements IStringSerializable {
public String getName() {
return name().toLowerCase(Locale.ROOT);
}
}
@@ -1,3 +1,11 @@
/**
* 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.enums;
import net.minecraft.util.IStringSerializable;
@@ -26,4 +34,5 @@ public enum BiomeBrickVariant implements IStringSerializable {
public String getName() {
return name().toLowerCase(Locale.ROOT);
}
}
@@ -1,3 +1,11 @@
/**
* 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.enums;
import net.minecraft.util.IStringSerializable;
@@ -26,4 +34,5 @@ public enum BiomeStoneVariant implements IStringSerializable {
public String getName() {
return name().toLowerCase(Locale.ROOT);
}
}
@@ -0,0 +1,31 @@
/**
* 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.enums;
import net.minecraft.util.IStringSerializable;
import java.util.Locale;
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() {
return name().toLowerCase(Locale.ROOT);
}
}
@@ -1,3 +1,11 @@
/**
* 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.enums;
import net.minecraft.util.IStringSerializable;
@@ -12,4 +20,5 @@ public enum CrateVariant implements IStringSerializable {
public String getName() {
return name().toLowerCase(Locale.ROOT);
}
}
@@ -1,3 +1,11 @@
/**
* 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.enums;
import net.minecraft.util.IStringSerializable;
@@ -26,4 +34,5 @@ public enum CustomBrickVariant implements IStringSerializable {
public String getName() {
return name().toLowerCase(Locale.ROOT);
}
}
@@ -1,3 +1,11 @@
/**
* 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.enums;
import net.minecraft.util.IStringSerializable;
@@ -13,4 +21,5 @@ public enum DrumVariant implements IStringSerializable {
public String getName() {
return name().toLowerCase(Locale.ROOT);
}
}
@@ -1,3 +1,11 @@
/**
* 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.enums;
import net.minecraft.util.IStringSerializable;
@@ -14,4 +22,5 @@ public enum EndBrickVariant implements IStringSerializable {
public String getName() {
return name().toLowerCase(Locale.ROOT);
}
}
@@ -1,3 +1,11 @@
/**
* 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.enums;
import net.minecraft.util.IStringSerializable;
@@ -26,4 +34,5 @@ public enum FutureStoneVariant implements IStringSerializable {
public String getName() {
return name().toLowerCase(Locale.ROOT);
}
}
@@ -1,3 +1,11 @@
/**
* 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.enums;
import net.minecraft.util.IStringSerializable;
@@ -15,4 +23,5 @@ public enum LivingRockVariant implements IStringSerializable {
public String getName() {
return name().toLowerCase(Locale.ROOT);
}
}
@@ -1,3 +1,11 @@
/**
* 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.enums;
import net.minecraft.util.IStringSerializable;
@@ -16,4 +24,5 @@ public enum LivingWoodVariant implements IStringSerializable {
public String getName() {
return name().toLowerCase(Locale.ROOT);
}
}
@@ -1,3 +1,11 @@
/**
* 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.enums;
import net.minecraft.util.IStringSerializable;
@@ -12,4 +20,5 @@ public enum LuminizerVariant implements IStringSerializable {
public String getName() {
return name().toLowerCase(Locale.ROOT);
}
}
@@ -1,3 +1,11 @@
/**
* 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.enums;
import net.minecraft.util.IStringSerializable;
@@ -13,4 +21,5 @@ public enum PlatformVariant implements IStringSerializable {
public String getName() {
return name().toLowerCase(Locale.ROOT);
}
}
@@ -1,3 +1,11 @@
/**
* 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.enums;
import net.minecraft.util.IStringSerializable;
@@ -14,4 +22,5 @@ public enum PoolVariant implements IStringSerializable {
public String getName() {
return name().toLowerCase(Locale.ROOT);
}
}
@@ -0,0 +1,24 @@
/**
* 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.enums;
import net.minecraft.util.IStringSerializable;
import java.util.Locale;
public enum PotatoVariant implements IStringSerializable {
DEFAULT,
HALLOWEEN,
GRAYSCALE;
@Override
public String getName() {
return name().toLowerCase(Locale.ROOT);
}
}
@@ -1,3 +1,11 @@
/**
* 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.enums;
import net.minecraft.util.IStringSerializable;
@@ -13,4 +21,5 @@ public enum PrismarineVariant implements IStringSerializable {
public String getName() {
return name().toLowerCase(Locale.ROOT);
}
}
@@ -1,3 +1,11 @@
/**
* 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.enums;
import net.minecraft.util.IStringSerializable;
@@ -13,4 +21,5 @@ public enum PylonVariant implements IStringSerializable {
public String getName() {
return name().toLowerCase(Locale.ROOT);
}
}
@@ -1,3 +1,11 @@
/**
* 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.enums;
import net.minecraft.util.IStringSerializable;
@@ -15,4 +23,5 @@ public enum QuartzVariant implements IStringSerializable {
public String getName() {
return name().toLowerCase(Locale.ROOT);
}
}
@@ -1,3 +1,11 @@
/**
* 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.enums;
import net.minecraft.util.IStringSerializable;
@@ -14,4 +22,5 @@ public enum SpreaderVariant implements IStringSerializable {
public String getName() {
return name().toLowerCase(Locale.ROOT);
}
}
@@ -1,3 +1,11 @@
/**
* 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.enums;
import net.minecraft.util.IStringSerializable;
@@ -15,4 +23,5 @@ public enum StorageVariant implements IStringSerializable {
public String getName() {
return name().toLowerCase(Locale.ROOT);
}
}
@@ -17,6 +17,7 @@ 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 +95,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());
}
/**
@@ -10,15 +10,11 @@
*/
package vazkii.botania.api.subtile.signature;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.item.ItemStack;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
@@ -38,16 +34,6 @@ public class BasicSignature extends SubTileSignature {
this.name = name;
}
@Override
public void registerIcons(TextureMap register) {
BotaniaAPI.internalHandler.registerBasicSignatureIcons(name, register);
}
@Override
public TextureAtlasSprite getIconForStack(ItemStack stack) {
return BotaniaAPI.internalHandler.getSubTileIconForName(name);
}
@Override
public String getUnlocalizedNameForStack(ItemStack stack) {
return unlocalizedName("");
@@ -24,16 +24,6 @@ public abstract class SubTileSignature {
public static final String SPECIAL_FLOWER_PREFIX = "flower.";
/**
* Equivalent to Block.registerBlockIcons.
*/
public abstract void registerIcons(TextureMap map);
// todo 1.8 evaluate need for these two
/**
* Gets the icon to display for the flower item.
*/
public abstract TextureAtlasSprite getIconForStack(ItemStack stack);
/**
* Gets the display name for the flower item.
*/
@@ -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;
@@ -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> {
@@ -101,7 +94,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();
@@ -132,7 +125,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();
@@ -153,7 +146,7 @@ public final class ContributorFancinessHandler implements LayerRenderer<EntityPl
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();
@@ -102,9 +102,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 +115,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);
@@ -150,27 +150,27 @@ public class LightningHandler {
int b = (color & 0xFF);
int a = (int) (mainalpha * rendersegment.light * new Color(color).getAlpha());
tessellator.getWorldRenderer().pos(endvec.x - diff2.x, endvec.y - diff2.y, endvec.z - diff2.z).lightmap(0xF0, 0xF0).tex(0.5, 0).color(r, g, b, a).endVertex();
tessellator.getWorldRenderer().pos(startvec.x - diff1.x, startvec.y - diff1.y, startvec.z - diff1.z).lightmap(0xF0, 0xF0).tex(0.5, 0).color(r, g, b, a).endVertex();
tessellator.getWorldRenderer().pos(startvec.x + diff1.x, startvec.y + diff1.y, startvec.z + diff1.z).lightmap(0xF0, 0xF0).tex(0.5, 1).color(r, g, b, a).endVertex();
tessellator.getWorldRenderer().pos(endvec.x + diff2.x, endvec.y + diff2.y, endvec.z + diff2.z).lightmap(0xF0, 0xF0).tex(0.5, 1).color(r, g, b, a).endVertex();
tessellator.getWorldRenderer().pos(endvec.x - diff2.x, endvec.y - diff2.y, endvec.z - diff2.z).tex(0.5, 0).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex();
tessellator.getWorldRenderer().pos(startvec.x - diff1.x, startvec.y - diff1.y, startvec.z - diff1.z).tex(0.5, 0).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex();
tessellator.getWorldRenderer().pos(startvec.x + diff1.x, startvec.y + diff1.y, startvec.z + diff1.z).tex(0.5, 1).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex();
tessellator.getWorldRenderer().pos(endvec.x + diff2.x, endvec.y + diff2.y, endvec.z + diff2.z).tex(0.5, 1).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex();
if(rendersegment.next == null) {
Vector3 roundend = rendersegment.endpoint.point.copy().add(rendersegment.diff.copy().normalize().multiply(width));
tessellator.getWorldRenderer().pos(roundend.x - diff2.x, roundend.y - diff2.y, roundend.z - diff2.z).lightmap(0xF0, 0xF0).tex(0, 0).color(r, g, b, a).endVertex();
tessellator.getWorldRenderer().pos(endvec.x - diff2.x, endvec.y - diff2.y, endvec.z - diff2.z).lightmap(0xF0, 0xF0).tex(0.5, 0).color(r, g, b, a).endVertex();
tessellator.getWorldRenderer().pos(endvec.x + diff2.x, endvec.y + diff2.y, endvec.z + diff2.z).lightmap(0xF0, 0xF0).tex(0.5, 1).color(r, g, b, a).endVertex();
tessellator.getWorldRenderer().pos(roundend.x + diff2.x, roundend.y + diff2.y, roundend.z + diff2.z).lightmap(0xF0, 0xF0).tex(0, 1).color(r, g, b, a).endVertex();
tessellator.getWorldRenderer().pos(roundend.x - diff2.x, roundend.y - diff2.y, roundend.z - diff2.z).tex(0, 0).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex();
tessellator.getWorldRenderer().pos(endvec.x - diff2.x, endvec.y - diff2.y, endvec.z - diff2.z).tex(0.5, 0).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex();
tessellator.getWorldRenderer().pos(endvec.x + diff2.x, endvec.y + diff2.y, endvec.z + diff2.z).tex(0.5, 1).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex();
tessellator.getWorldRenderer().pos(roundend.x + diff2.x, roundend.y + diff2.y, roundend.z + diff2.z).tex(0, 1).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex();
}
if(rendersegment.prev == null) {
Vector3 roundend = rendersegment.startpoint.point.copy().subtract(rendersegment.diff.copy().normalize().multiply(width));
tessellator.getWorldRenderer().pos(startvec.x - diff1.x, startvec.y - diff1.y, startvec.z - diff1.z).lightmap(0xF0, 0xF0).tex(0.5, 0).color(r, g, b, a).endVertex();
tessellator.getWorldRenderer().pos(roundend.x - diff1.x, roundend.y - diff1.y, roundend.z - diff1.z).lightmap(0xF0, 0xF0).tex(0, 0).color(r, g, b, a).endVertex();
tessellator.getWorldRenderer().pos(roundend.x + diff1.x, roundend.y + diff1.y, roundend.z + diff1.z).lightmap(0xF0, 0xF0).tex(0, 1).color(r, g, b, a).endVertex();
tessellator.getWorldRenderer().pos(startvec.x + diff1.x, startvec.y + diff1.y, startvec.z + diff1.z).lightmap(0xF0, 0xF0).tex(0.5, 1).color(r, g, b, a).endVertex();
tessellator.getWorldRenderer().pos(startvec.x - diff1.x, startvec.y - diff1.y, startvec.z - diff1.z).tex(0.5, 0).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex();
tessellator.getWorldRenderer().pos(roundend.x - diff1.x, roundend.y - diff1.y, roundend.z - diff1.z).tex(0, 0).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex();
tessellator.getWorldRenderer().pos(roundend.x + diff1.x, roundend.y + diff1.y, roundend.z + diff1.z).tex(0, 1).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex();
tessellator.getWorldRenderer().pos(startvec.x + diff1.x, startvec.y + diff1.y, startvec.z + diff1.z).tex(0.5, 1).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex();
}
}
}
@@ -1,3 +1,11 @@
/**
* 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;
@@ -11,16 +19,19 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.apache.commons.lang3.text.WordUtils;
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 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,
@@ -41,8 +52,9 @@ public class RenderEventHandler {
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;
@@ -65,11 +77,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 +120,12 @@ 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, "items");
}
}
private RenderEventHandler() {}
private MiscellaneousIcons() {}
}
@@ -1,11 +1,17 @@
/**
* 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.ImmutableList;
import com.google.common.collect.Iterables;
import net.minecraft.block.Block;
import net.minecraft.block.BlockDoublePlant;
import net.minecraft.block.BlockFlower;
import net.minecraft.block.BlockRailPowered;
import net.minecraft.block.BlockSlab;
import net.minecraft.block.BlockWall;
import net.minecraft.block.state.IBlockState;
@@ -20,11 +26,15 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.client.model.ModelLoaderRegistry;
import net.minecraftforge.client.model.obj.OBJLoader;
import net.minecraftforge.fml.common.registry.GameData;
import vazkii.botania.api.render.SpecialFlowerModel;
import vazkii.botania.api.BotaniaAPIClient;
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;
@@ -38,9 +48,11 @@ import vazkii.botania.api.state.enums.FutureStoneVariant;
import vazkii.botania.api.state.enums.LivingRockVariant;
import vazkii.botania.api.state.enums.LivingWoodVariant;
import vazkii.botania.api.state.enums.LuminizerVariant;
import vazkii.botania.api.state.enums.PoolVariant;
import vazkii.botania.api.state.enums.PrismarineVariant;
import vazkii.botania.api.state.enums.PylonVariant;
import vazkii.botania.api.state.enums.StorageVariant;
import vazkii.botania.client.core.proxy.ClientProxy;
import vazkii.botania.client.model.FloatingFlowerModel;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.ModFluffBlocks;
@@ -87,28 +99,37 @@ 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;
import static vazkii.botania.common.item.ModItems.*;
import java.util.Collection;
import java.util.List;
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));
@@ -132,9 +153,11 @@ public final class ModelHandler {
registerAltars();
registerQuartzBlocks();
registerLuminizers();
registerPools();
/** Normal Items **/
registerStandardItems();
registerTESRItems();
registerManaResources();
registerRunes();
registerBows();
@@ -142,57 +165,6 @@ public final class ModelHandler {
registerBrews();
/** Special Item Meshers **/
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.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.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.registerItemVariants(infiniteFruit,
new ModelResourceLocation("botania:infiniteFruit", "inventory"),
new ModelResourceLocation("botania:infiniteFruitBoot", "inventory"));
@@ -204,17 +176,6 @@ public final class ModelHandler {
}
});
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"));
@@ -236,138 +197,276 @@ public final class ModelHandler {
: 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.registerItemVariants(tornadoRod,
new ModelResourceLocation("botania:tornadoRod", "inventory"),
new ModelResourceLocation("botania:tornadoRod_flying", "inventory"));
ModelLoader.setCustomMeshDefinition(tornadoRod, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
return ((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, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
String path = "botania:twigWand";
return new ModelResourceLocation(path + (ItemTwigWand.getBindMode(stack) ? "_bind" : ""), "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");
}
});
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(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:spawnerMoverFull", "inventory");
} else {
return new ModelResourceLocation("botania:spawnerMover", "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");
}
});
}
private static void registerSubtiles() {
SpecialFlowerModel.register(SubTileManastar.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_MANASTAR));
SpecialFlowerModel.register(SubTilePureDaisy.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_PUREDAISY));
BotaniaAPIClient.registerSubtileModel(SubTileManastar.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_MANASTAR));
BotaniaAPIClient.registerSubtileModel(SubTilePureDaisy.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_PUREDAISY));
SpecialFlowerModel.register(SubTileDaybloom.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_DAYBLOOM));
SpecialFlowerModel.register(SubTileDecor.Daybloom.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_DAYBLOOM + "Decor"));
SpecialFlowerModel.register(SubTileDaybloom.Prime.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_DAYBLOOM_PRIME));
SpecialFlowerModel.register(SubTileEndoflame.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_ENDOFLAME));
SpecialFlowerModel.register(SubTileHydroangeas.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HYDROANGEAS));
SpecialFlowerModel.register(SubTileDecor.Hydroangeas.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HYDROANGEAS + "Decor"));
SpecialFlowerModel.register(SubTileThermalily.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_THERMALILY));
SpecialFlowerModel.register(SubTileNightshade.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_NIGHTSHADE));
SpecialFlowerModel.register(SubTileDecor.Nightshade.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_NIGHTSHADE + "Decor"));
SpecialFlowerModel.register(SubTileNightshade.Prime.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_NIGHTSHADE_PRIME));
SpecialFlowerModel.register(SubTileArcaneRose.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_ARCANE_ROSE));
SpecialFlowerModel.register(SubTileMunchdew.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_MUNCHDEW));
SpecialFlowerModel.register(SubTileEntropinnyum.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_ENTROPINNYUM));
SpecialFlowerModel.register(SubTileKekimurus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_KEKIMURUS));
SpecialFlowerModel.register(SubTileGourmaryllis.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_GOURMARYLLIS));
SpecialFlowerModel.register(SubTileNarslimmus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_NARSLIMMUS));
SpecialFlowerModel.register(SubTileSpectrolus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_SPECTROLUS));
SpecialFlowerModel.register(SubTileDandelifeon.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_DANDELIFEON));
SpecialFlowerModel.register(SubTileRafflowsia.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_RAFFLOWSIA));
BotaniaAPIClient.registerSubtileModel(SubTileDaybloom.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_DAYBLOOM));
BotaniaAPIClient.registerSubtileModel(SubTileDecor.Daybloom.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_DAYBLOOM + "Decor"));
BotaniaAPIClient.registerSubtileModel(SubTileDaybloom.Prime.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_DAYBLOOM_PRIME));
BotaniaAPIClient.registerSubtileModel(SubTileEndoflame.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_ENDOFLAME));
BotaniaAPIClient.registerSubtileModel(SubTileHydroangeas.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HYDROANGEAS));
BotaniaAPIClient.registerSubtileModel(SubTileDecor.Hydroangeas.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HYDROANGEAS + "Decor"));
BotaniaAPIClient.registerSubtileModel(SubTileThermalily.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_THERMALILY));
BotaniaAPIClient.registerSubtileModel(SubTileNightshade.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_NIGHTSHADE));
BotaniaAPIClient.registerSubtileModel(SubTileDecor.Nightshade.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_NIGHTSHADE + "Decor"));
BotaniaAPIClient.registerSubtileModel(SubTileNightshade.Prime.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_NIGHTSHADE_PRIME));
BotaniaAPIClient.registerSubtileModel(SubTileArcaneRose.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_ARCANE_ROSE));
BotaniaAPIClient.registerSubtileModel(SubTileMunchdew.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_MUNCHDEW));
BotaniaAPIClient.registerSubtileModel(SubTileEntropinnyum.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_ENTROPINNYUM));
BotaniaAPIClient.registerSubtileModel(SubTileKekimurus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_KEKIMURUS));
BotaniaAPIClient.registerSubtileModel(SubTileGourmaryllis.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_GOURMARYLLIS));
BotaniaAPIClient.registerSubtileModel(SubTileNarslimmus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_NARSLIMMUS));
BotaniaAPIClient.registerSubtileModel(SubTileSpectrolus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_SPECTROLUS));
BotaniaAPIClient.registerSubtileModel(SubTileDandelifeon.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_DANDELIFEON));
BotaniaAPIClient.registerSubtileModel(SubTileRafflowsia.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_RAFFLOWSIA));
SpecialFlowerModel.register(SubTileBellethorn.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_BELLETHORN));
SpecialFlowerModel.register(SubTileBellethorn.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_BELLETHORN + "Chibi"));
SpecialFlowerModel.register(SubTileDreadthorn.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_DREADTHORN));
SpecialFlowerModel.register(SubTileHeiseiDream.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HEISEI_DREAM));
SpecialFlowerModel.register(SubTileTigerseye.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_TIGERSEYE));
SpecialFlowerModel.register(SubTileJadedAmaranthus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_JADED_AMARANTHUS));
SpecialFlowerModel.register(SubTileOrechid.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_ORECHID));
SpecialFlowerModel.register(SubTileOrechidIgnem.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_ORECHID_IGNEM));
SpecialFlowerModel.register(SubTileFallenKanade.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_FALLEN_KANADE));
SpecialFlowerModel.register(SubTileExoflame.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_EXOFLAME));
SpecialFlowerModel.register(SubTileAgricarnation.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_AGRICARNATION));
SpecialFlowerModel.register(SubTileAgricarnation.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_AGRICARNATION + "Chibi"));
SpecialFlowerModel.register(SubTileHopperhock.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HOPPERHOCK));
SpecialFlowerModel.register(SubTileHopperhock.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HOPPERHOCK + "Chibi"));
SpecialFlowerModel.register(SubTileTangleberrie.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_TANGLEBERRIE));
SpecialFlowerModel.register(SubTileJiyuulia.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_JIYUULIA));
SpecialFlowerModel.register(SubTileRannuncarpus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_RANNUNCARPUS));
SpecialFlowerModel.register(SubTileRannuncarpus.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_RANNUNCARPUS + "Chibi"));
SpecialFlowerModel.register(SubTileHyacidus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HYACIDUS));
SpecialFlowerModel.register(SubTilePollidisiac.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_POLLIDISIAC));
SpecialFlowerModel.register(SubTileClayconia.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_CLAYCONIA));
SpecialFlowerModel.register(SubTileLoonuim.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_LOONIUM));
SpecialFlowerModel.register(SubTileDaffomill.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_DAFFOMILL));
SpecialFlowerModel.register(SubTileVinculotus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_VINCULOTUS));
SpecialFlowerModel.register(SubTileSpectranthemum.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_SPECTRANTHEMUM));
SpecialFlowerModel.register(SubTileMedumone.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_MEDUMONE));
SpecialFlowerModel.register(SubTileMarimorphosis.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_MARIMORPHOSIS));
SpecialFlowerModel.register(SubTileMarimorphosis.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_MARIMORPHOSIS + "Chibi"));
SpecialFlowerModel.register(SubTileBubbell.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_BUBBELL));
SpecialFlowerModel.register(SubTileBubbell.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_BUBBELL + "Chibi"));
SpecialFlowerModel.register(SubTileSolegnolia.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_SOLEGNOLIA));
SpecialFlowerModel.register(SubTileSolegnolia.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_SOLEGNOLIA + "Chibi"));
BotaniaAPIClient.registerSubtileModel(SubTileBellethorn.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_BELLETHORN));
BotaniaAPIClient.registerSubtileModel(SubTileBellethorn.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_BELLETHORN + "Chibi"));
BotaniaAPIClient.registerSubtileModel(SubTileDreadthorn.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_DREADTHORN));
BotaniaAPIClient.registerSubtileModel(SubTileHeiseiDream.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HEISEI_DREAM));
BotaniaAPIClient.registerSubtileModel(SubTileTigerseye.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_TIGERSEYE));
BotaniaAPIClient.registerSubtileModel(SubTileJadedAmaranthus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_JADED_AMARANTHUS));
BotaniaAPIClient.registerSubtileModel(SubTileOrechid.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_ORECHID));
BotaniaAPIClient.registerSubtileModel(SubTileOrechidIgnem.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_ORECHID_IGNEM));
BotaniaAPIClient.registerSubtileModel(SubTileFallenKanade.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_FALLEN_KANADE));
BotaniaAPIClient.registerSubtileModel(SubTileExoflame.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_EXOFLAME));
BotaniaAPIClient.registerSubtileModel(SubTileAgricarnation.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_AGRICARNATION));
BotaniaAPIClient.registerSubtileModel(SubTileAgricarnation.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_AGRICARNATION + "Chibi"));
BotaniaAPIClient.registerSubtileModel(SubTileHopperhock.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HOPPERHOCK));
BotaniaAPIClient.registerSubtileModel(SubTileHopperhock.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HOPPERHOCK + "Chibi"));
BotaniaAPIClient.registerSubtileModel(SubTileTangleberrie.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_TANGLEBERRIE));
BotaniaAPIClient.registerSubtileModel(SubTileJiyuulia.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_JIYUULIA));
BotaniaAPIClient.registerSubtileModel(SubTileRannuncarpus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_RANNUNCARPUS));
BotaniaAPIClient.registerSubtileModel(SubTileRannuncarpus.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_RANNUNCARPUS + "Chibi"));
BotaniaAPIClient.registerSubtileModel(SubTileHyacidus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HYACIDUS));
BotaniaAPIClient.registerSubtileModel(SubTilePollidisiac.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_POLLIDISIAC));
BotaniaAPIClient.registerSubtileModel(SubTileClayconia.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_CLAYCONIA));
BotaniaAPIClient.registerSubtileModel(SubTileLoonuim.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_LOONIUM));
BotaniaAPIClient.registerSubtileModel(SubTileDaffomill.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_DAFFOMILL));
BotaniaAPIClient.registerSubtileModel(SubTileVinculotus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_VINCULOTUS));
BotaniaAPIClient.registerSubtileModel(SubTileSpectranthemum.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_SPECTRANTHEMUM));
BotaniaAPIClient.registerSubtileModel(SubTileMedumone.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_MEDUMONE));
BotaniaAPIClient.registerSubtileModel(SubTileMarimorphosis.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_MARIMORPHOSIS));
BotaniaAPIClient.registerSubtileModel(SubTileMarimorphosis.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_MARIMORPHOSIS + "Chibi"));
BotaniaAPIClient.registerSubtileModel(SubTileBubbell.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_BUBBELL));
BotaniaAPIClient.registerSubtileModel(SubTileBubbell.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_BUBBELL + "Chibi"));
BotaniaAPIClient.registerSubtileModel(SubTileSolegnolia.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_SOLEGNOLIA));
BotaniaAPIClient.registerSubtileModel(SubTileSolegnolia.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_SOLEGNOLIA + "Chibi"));
}
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.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.spreader, SpreaderVariant.class, "variant");
registerVariantsDefaulted(ModFluffBlocks.stone, FutureStoneVariant.class, "variant");
registerVariantsDefaulted(ModBlocks.storage, StorageVariant.class, "variant");
}
private static void registerStandardItems() {
@@ -378,6 +477,7 @@ public final class ModelHandler {
registerItemModel(manaCookie);
registerItemModel(manasteelHelm);
registerItemModel(manasteelHelmRevealing);
registerItemModel(manasteelChest);
registerItemModel(manasteelLegs);
registerItemModel(manasteelBoots);
@@ -388,6 +488,7 @@ public final class ModelHandler {
registerItemModel(manasteelShears);
registerItemModel(elementiumHelm);
registerItemModel(elementiumHelmRevealing);
registerItemModel(elementiumChest);
registerItemModel(elementiumLegs);
registerItemModel(elementiumBoots);
@@ -398,11 +499,6 @@ public final class ModelHandler {
registerItemModel(elementiumShears);
registerItemModel(elementiumSword);
registerItemModel(manaweaveHelm);
registerItemModel(manaweaveChest);
registerItemModel(manaweaveLegs);
registerItemModel(manaweaveBoots);
registerItemModel(terrasteelHelm);
registerItemModel(terrasteelHelmRevealing);
registerItemModel(terrasteelChest);
@@ -414,7 +510,6 @@ public final class ModelHandler {
registerItemModel(starSword);
registerItemModel(thunderSword);
registerItemModel(glassPick);
registerItemModel(twigWand);
registerItemModel(flowerBag);
registerItemModel(fertilizer);
@@ -434,9 +529,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);
@@ -495,7 +587,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);
@@ -519,6 +612,36 @@ public final class ModelHandler {
registerItemModelMetas(grassHorn, LibItemNames.GRASS_HORN, 3);
}
// Only for models that absolutely can't be converted to JSON. Use VERY sparingly
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);
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() {
Item item = manaResource;
for (int i = 0; i < LibItemNames.MANA_RESOURCE_NAMES.length; i++) {
@@ -591,7 +714,7 @@ public final class ModelHandler {
}
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) {
@@ -606,23 +729,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());
@@ -914,6 +1042,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()) {
@@ -961,4 +1104,5 @@ public final class ModelHandler {
}
private ModelHandler() {}
}
@@ -21,6 +21,7 @@ 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;
@@ -36,6 +37,7 @@ import vazkii.botania.api.lexicon.multiblock.Multiblock;
import vazkii.botania.api.lexicon.multiblock.MultiblockSet;
import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import vazkii.botania.api.state.BotaniaStateProps;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.lib.LibObfuscation;
@@ -51,11 +53,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,6 +70,21 @@ 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) {
@@ -34,16 +34,12 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraft.world.WorldSettings.GameType;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.client.model.ModelLoaderRegistry;
import net.minecraftforge.common.MinecraftForge;
import vazkii.botania.api.item.IExtendedPlayerController;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.lexicon.multiblock.IMultiblockRenderHook;
import vazkii.botania.api.lexicon.multiblock.Multiblock;
import vazkii.botania.api.lexicon.multiblock.MultiblockSet;
import vazkii.botania.api.lexicon.multiblock.component.AnyComponent;
import vazkii.botania.api.render.SpecialFlowerModel;
import vazkii.botania.api.wiki.IWikiProvider;
import vazkii.botania.api.wiki.WikiHooks;
import vazkii.botania.client.challenge.ModChallenges;
@@ -59,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;
@@ -99,15 +95,12 @@ 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;
import vazkii.botania.client.render.tile.RenderTileTeruTeruBozu;
import vazkii.botania.client.render.tile.RenderTileTinyPotato;
import vazkii.botania.client.render.world.SkyblockRenderEvents;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.tile.TileAlfPortal;
import vazkii.botania.common.block.tile.TileAltar;
import vazkii.botania.common.block.tile.TileAvatar;
@@ -123,7 +116,6 @@ 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;
@@ -160,7 +152,6 @@ import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibObfuscation;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.fml.common.Optional;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
@@ -186,7 +177,7 @@ public class ClientProxy extends CommonProxy {
super.preInit(event);
MinecraftForge.EVENT_BUS.register(RenderEventHandler.INSTANCE);
MinecraftForge.EVENT_BUS.register(MiscellaneousIcons.INSTANCE);
ModelHandler.registerModels();
}
@@ -232,65 +223,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());
@@ -302,7 +234,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());
@@ -317,7 +249,7 @@ 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());
@@ -474,7 +406,7 @@ public class ClientProxy extends CommonProxy {
}
}
private static boolean noclipEnabled = true;
private static boolean noclipEnabled = false;
private static boolean corruptSparkle = false;
@Override
@@ -93,7 +93,7 @@ public class FXWisp extends EntityFX {
if(!queuedDepthIgnoringRenders.isEmpty()) {
GlStateManager.disableDepth();
tessellator.getWorldRenderer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_LMAP_COLOR);
tessellator.getWorldRenderer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);
for(FXWisp wisp : queuedDepthIgnoringRenders)
wisp.renderQueued(tessellator, false);
tessellator.draw();
@@ -0,0 +1,80 @@
/**
* 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.integration.jei;
import mezz.jei.api.IItemRegistry;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.IModPlugin;
import mezz.jei.api.IModRegistry;
import mezz.jei.api.IRecipeRegistry;
import mezz.jei.api.JEIPlugin;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.client.integration.jei.brewery.BreweryRecipeCategory;
import vazkii.botania.client.integration.jei.brewery.BreweryRecipeHandler;
import vazkii.botania.client.integration.jei.elventrade.ElvenTradeRecipeCategory;
import vazkii.botania.client.integration.jei.elventrade.ElvenTradeRecipeHandler;
import vazkii.botania.client.integration.jei.manapool.ManaPoolRecipeCategory;
import vazkii.botania.client.integration.jei.manapool.ManaPoolRecipeHandler;
import vazkii.botania.client.integration.jei.petalapothecary.PetalApothecaryRecipeCategory;
import vazkii.botania.client.integration.jei.petalapothecary.PetalApothecaryRecipeHandler;
import vazkii.botania.client.integration.jei.puredaisy.PureDaisyRecipeCategory;
import vazkii.botania.client.integration.jei.puredaisy.PureDaisyRecipeHandler;
import vazkii.botania.client.integration.jei.runicaltar.RunicAltarRecipeCategory;
import vazkii.botania.client.integration.jei.runicaltar.RunicAltarRecipeHandler;
@JEIPlugin
public class JEIBotaniaPlugin implements IModPlugin {
private IJeiHelpers jeiHelpers;
@Override
public boolean isModLoaded() {
return true;
}
@Override
public void onJeiHelpersAvailable(IJeiHelpers jeiHelpers) {
this.jeiHelpers = jeiHelpers;
}
@Override
public void onItemRegistryAvailable(IItemRegistry itemRegistry) {}
@Override
public void register(IModRegistry registry) {
registry.addRecipeCategories(
new BreweryRecipeCategory(jeiHelpers.getGuiHelper()),
new PureDaisyRecipeCategory(jeiHelpers.getGuiHelper()),
new PetalApothecaryRecipeCategory(jeiHelpers.getGuiHelper()),
new ElvenTradeRecipeCategory(jeiHelpers.getGuiHelper()),
new RunicAltarRecipeCategory(jeiHelpers.getGuiHelper()),
new ManaPoolRecipeCategory(jeiHelpers.getGuiHelper())
);
registry.addRecipeHandlers(
new BreweryRecipeHandler(),
new PureDaisyRecipeHandler(),
new PetalApothecaryRecipeHandler(),
new ElvenTradeRecipeHandler(),
new RunicAltarRecipeHandler(),
new ManaPoolRecipeHandler()
);
registry.addRecipes(BotaniaAPI.brewRecipes);
registry.addRecipes(BotaniaAPI.pureDaisyRecipes);
registry.addRecipes(BotaniaAPI.petalRecipes);
registry.addRecipes(BotaniaAPI.elvenTradeRecipes);
registry.addRecipes(BotaniaAPI.runeAltarRecipes);
registry.addRecipes(BotaniaAPI.manaInfusionRecipes);
}
@Override
public void onRecipeRegistryAvailable(IRecipeRegistry recipeRegistry) {}
}
@@ -0,0 +1,92 @@
/**
* 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.integration.jei.brewery;
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;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import javax.annotation.Nonnull;
import java.util.Collection;
import java.util.List;
public class BreweryRecipeCategory implements IRecipeCategory {
private final IDrawableStatic background;
private final String localizedName;
public BreweryRecipeCategory(IGuiHelper guiHelper) {
ResourceLocation location = new ResourceLocation("botania", "textures/gui/neiBrewery.png");
background = guiHelper.createDrawable(location, 0, 0, 166, 65, 0, 0, 0, 0);
localizedName = StatCollector.translateToLocal("botania.nei.brewery");
}
@Nonnull
@Override
public String getUid() {
return "botania.brewery";
}
@Nonnull
@Override
public String getTitle() {
return localizedName;
}
@Nonnull
@Override
public IDrawable getBackground() {
return background;
}
@Override
public void drawExtras(Minecraft minecraft) {}
@Override
public void drawAnimations(Minecraft minecraft) {}
@Override
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
if (!(recipeWrapper instanceof BreweryRecipeWrapper))
return;
BreweryRecipeWrapper wrapper = ((BreweryRecipeWrapper) recipeWrapper);
List inputs = wrapper.getInputs();
recipeLayout.getItemStacks().init(0, true, 39, 41);
if (inputs.get(0) instanceof ItemStack) {
recipeLayout.getItemStacks().set(0, ((ItemStack) inputs.get(0)));
} else {
recipeLayout.getItemStacks().set(0, ((Collection<ItemStack>) inputs.get(0)));
}
int index = 1, posX = 60;
for (Object o : wrapper.getInputs()) {
recipeLayout.getItemStacks().init(index, true, posX, 6);
if (o instanceof ItemStack) {
recipeLayout.getItemStacks().set(index, ((ItemStack) o));
} else if (o instanceof Collection) {
recipeLayout.getItemStacks().set(index, ((Collection<ItemStack>) o));
}
index++;
posX += 18;
}
recipeLayout.getItemStacks().init(7, false, 87, 41);
recipeLayout.getItemStacks().set(7, wrapper.getOutputs().get(0));
}
}
@@ -0,0 +1,42 @@
/**
* 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.integration.jei.brewery;
import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper;
import vazkii.botania.api.recipe.RecipeBrew;
import javax.annotation.Nonnull;
public class BreweryRecipeHandler implements IRecipeHandler<RecipeBrew> {
@Nonnull
@Override
public Class<RecipeBrew> getRecipeClass() {
return RecipeBrew.class;
}
@Nonnull
@Override
public String getRecipeCategoryUid() {
return "botania.brewery";
}
@Nonnull
@Override
public IRecipeWrapper getRecipeWrapper(@Nonnull RecipeBrew recipe) {
return new BreweryRecipeWrapper(recipe);
}
@Override
public boolean isRecipeValid(@Nonnull RecipeBrew recipe) {
return recipe.getInputs().size() <= 6;
}
}
@@ -0,0 +1,67 @@
/**
* 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.integration.jei.brewery;
import com.google.common.collect.ImmutableList;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
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;
import java.util.List;
public class BreweryRecipeWrapper implements IRecipeWrapper {
private final List input;
private final ItemStack output;
public BreweryRecipeWrapper(RecipeBrew recipeBrew) {
ImmutableList.Builder builder = ImmutableList.builder();
builder.add(new ItemStack(ModItems.vial));
for (Object o : recipeBrew.getInputs()) {
if (o instanceof ItemStack) {
builder.add(o);
}
if (o instanceof String) {
builder.add(OreDictionary.getOres(((String) o)));
}
}
input = builder.build();
output = recipeBrew.getOutput(new ItemStack(ModItems.vial)).copy();
}
@Override
public List getInputs() {
return input;
}
@Override
public List<ItemStack> getOutputs() {
return ImmutableList.of(output);
}
@Override
public List<FluidStack> getFluidInputs() { return ImmutableList.of(); }
@Override
public List<FluidStack> getFluidOutputs() { return ImmutableList.of(); }
@Override
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {}
@Override
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {}
}
@@ -0,0 +1,111 @@
/**
* 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.integration.jei.elventrade;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.recipe.IRecipeCategory;
import mezz.jei.api.recipe.IRecipeWrapper;
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.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
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.MiscellaneousIcons;
import javax.annotation.Nonnull;
import java.util.Collection;
public class ElvenTradeRecipeCategory implements IRecipeCategory {
private final String localizedName;
private final IDrawable background;
private final IDrawable overlay;
public ElvenTradeRecipeCategory(IGuiHelper guiHelper) {
localizedName = StatCollector.translateToLocal("botania.nei.elvenTrade");
background = guiHelper.createBlankDrawable(145, 95);
overlay = guiHelper.createDrawable(new ResourceLocation("botania", "textures/gui/elvenTradeOverlay.png"), 0, 15, 140, 90);
}
@Nonnull
@Override
public String getUid() {
return "botania.elvenTrade";
}
@Nonnull
@Override
public String getTitle() {
return localizedName;
}
@Nonnull
@Override
public IDrawable getBackground() {
return background;
}
@Override
public void drawExtras(Minecraft minecraft) {
GlStateManager.enableAlpha();
GlStateManager.enableBlend();
overlay.draw(minecraft, 0, 4);
GlStateManager.disableBlend();
GlStateManager.disableAlpha();
}
@Override
public void drawAnimations(Minecraft minecraft) {
minecraft.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
TextureAtlasSprite sprite = MiscellaneousIcons.INSTANCE.alfPortalTex;
Tessellator tess = Tessellator.getInstance();
WorldRenderer wr = tess.getWorldRenderer();
wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
int startX = 22;
int startY = 25;
int stopX = 70;
int stopY = 73;
wr.pos(startX, startY, 0).tex(sprite.getMinU(), sprite.getMinV()).endVertex();
wr.pos(startX, stopY, 0).tex(sprite.getMinU(), sprite.getMaxV()).endVertex();
wr.pos(stopX, stopY, 0).tex(sprite.getMaxU(), sprite.getMaxV()).endVertex();
wr.pos(stopX, startY, 0).tex(sprite.getMaxU(), sprite.getMinV()).endVertex();
tess.draw();
}
@Override
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
if (!(recipeWrapper instanceof ElvenTradeRecipeWrapper))
return;
ElvenTradeRecipeWrapper wrapper = ((ElvenTradeRecipeWrapper) recipeWrapper);
int index = 0, posX = 42;
for (Object o : wrapper.getInputs()) {
recipeLayout.getItemStacks().init(index, true, posX, 0);
if (o instanceof Collection) {
recipeLayout.getItemStacks().set(index, ((Collection<ItemStack>) o));
} else {
recipeLayout.getItemStacks().set(index, ((ItemStack) o));
}
index++;
posX += 18;
}
recipeLayout.getItemStacks().init(index, false, 93, 41);
recipeLayout.getItemStacks().set(index, wrapper.getOutputs().get(0));
}
}
@@ -0,0 +1,42 @@
/**
* 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.integration.jei.elventrade;
import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper;
import vazkii.botania.api.recipe.RecipeElvenTrade;
import javax.annotation.Nonnull;
public class ElvenTradeRecipeHandler implements IRecipeHandler<RecipeElvenTrade> {
@Nonnull
@Override
public Class<RecipeElvenTrade> getRecipeClass() {
return RecipeElvenTrade.class;
}
@Nonnull
@Override
public String getRecipeCategoryUid() {
return "botania.elvenTrade";
}
@Nonnull
@Override
public IRecipeWrapper getRecipeWrapper(@Nonnull RecipeElvenTrade recipe) {
return new ElvenTradeRecipeWrapper(recipe);
}
@Override
public boolean isRecipeValid(@Nonnull RecipeElvenTrade recipe) {
return true;
}
}
@@ -0,0 +1,67 @@
/**
* 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.integration.jei.elventrade;
import com.google.common.collect.ImmutableList;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.OreDictionary;
import vazkii.botania.api.recipe.RecipeElvenTrade;
import javax.annotation.Nonnull;
import java.util.List;
public class ElvenTradeRecipeWrapper implements IRecipeWrapper {
private final List input;
private final ItemStack output;
public ElvenTradeRecipeWrapper(RecipeElvenTrade recipe) {
ImmutableList.Builder builder = ImmutableList.builder();
for (Object o : recipe.getInputs()) {
if (o instanceof ItemStack) {
builder.add(o);
}
if (o instanceof String) {
builder.add(OreDictionary.getOres(((String) o)));
}
}
input = builder.build();
output = recipe.getOutput();
}
@Override
public List getInputs() {
return input;
}
@Override
public List<ItemStack> getOutputs() {
return ImmutableList.of(output);
}
@Override
public List<FluidStack> getFluidInputs() {
return ImmutableList.of();
}
@Override
public List<FluidStack> getFluidOutputs() {
return ImmutableList.of();
}
@Override
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {}
@Override
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {}
}
@@ -0,0 +1,105 @@
/**
* 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.integration.jei.manapool;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.recipe.IRecipeCategory;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import vazkii.botania.common.block.ModBlocks;
import javax.annotation.Nonnull;
import java.util.Collection;
public class ManaPoolRecipeCategory implements IRecipeCategory {
private final IDrawable background;
private final String localizedName;
private final IDrawable overlay;
public ManaPoolRecipeCategory(IGuiHelper guiHelper) {
background = guiHelper.createBlankDrawable(168, 64);
localizedName = StatCollector.translateToLocal("botania.nei.manaPool");
overlay = guiHelper.createDrawable(new ResourceLocation("botania", "textures/gui/pureDaisyOverlay.png"),
0, 0, 64, 46);
}
@Nonnull
@Override
public String getUid() {
return "botania.manaPool";
}
@Nonnull
@Override
public String getTitle() {
return localizedName;
}
@Nonnull
@Override
public IDrawable getBackground() {
return background;
}
@Override
public void drawExtras(Minecraft minecraft) {
GlStateManager.enableAlpha();
GlStateManager.enableBlend();
overlay.draw(minecraft, 48, 0);
GlStateManager.disableBlend();
GlStateManager.disableAlpha();
}
@Override
public void drawAnimations(Minecraft minecraft) {}
@Override
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
if (!(recipeWrapper instanceof ManaPoolRecipeWrapper))
return;
ManaPoolRecipeWrapper wrapper = ((ManaPoolRecipeWrapper) recipeWrapper);
int index = 0;
recipeLayout.getItemStacks().init(index, true, 40, 12);
if (wrapper.getInputs().get(0) instanceof Collection) {
recipeLayout.getItemStacks().set(index, ((Collection<ItemStack>) wrapper.getInputs().get(0)));
} else {
recipeLayout.getItemStacks().set(index, ((ItemStack) wrapper.getInputs().get(0)));
}
index++;
if (wrapper.getInputs().size() > 1) {
// Has catalyst
recipeLayout.getItemStacks().init(index, true, 20, 12);
recipeLayout.getItemStacks().set(index, ((ItemStack) wrapper.getInputs().get(1)));
index++;
}
recipeLayout.getItemStacks().init(index, true, 70, 12);
recipeLayout.getItemStacks().set(index, new ItemStack(ModBlocks.pool, 1, 0));
index++;
recipeLayout.getItemStacks().init(index, false, 99, 12);
if (wrapper.getOutputs().get(0) instanceof Collection) {
recipeLayout.getItemStacks().set(index, ((Collection<ItemStack>) wrapper.getOutputs().get(0)));
} else {
recipeLayout.getItemStacks().set(index, ((ItemStack) wrapper.getOutputs().get(0)));
}
}
}
@@ -0,0 +1,42 @@
/**
* 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.integration.jei.manapool;
import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper;
import vazkii.botania.api.recipe.RecipeManaInfusion;
import javax.annotation.Nonnull;
public class ManaPoolRecipeHandler implements IRecipeHandler<RecipeManaInfusion> {
@Nonnull
@Override
public Class<RecipeManaInfusion> getRecipeClass() {
return RecipeManaInfusion.class;
}
@Nonnull
@Override
public String getRecipeCategoryUid() {
return "botania.manaPool";
}
@Nonnull
@Override
public IRecipeWrapper getRecipeWrapper(@Nonnull RecipeManaInfusion recipe) {
return new ManaPoolRecipeWrapper(recipe);
}
@Override
public boolean isRecipeValid(@Nonnull RecipeManaInfusion recipe) {
return recipe.getManaToConsume() <= 100000;
}
}
@@ -0,0 +1,82 @@
/**
* 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.integration.jei.manapool;
import com.google.common.collect.ImmutableList;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.OreDictionary;
import vazkii.botania.api.recipe.RecipeManaInfusion;
import vazkii.botania.client.core.handler.HUDHandler;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.tile.mana.TilePool;
import javax.annotation.Nonnull;
import java.util.List;
public class ManaPoolRecipeWrapper implements IRecipeWrapper {
private final List input;
private final ItemStack output;
private final int mana;
public ManaPoolRecipeWrapper(RecipeManaInfusion recipe) {
ImmutableList.Builder builder = ImmutableList.builder();
if (recipe.getInput() instanceof ItemStack) {
builder.add(recipe.getInput());
} else if (recipe.getInput() instanceof String) {
builder.add(OreDictionary.getOres(((String) recipe.getInput())));
}
if (recipe.isAlchemy()) {
builder.add(new ItemStack(ModBlocks.alchemyCatalyst));
} else if (recipe.isConjuration()) {
builder.add(new ItemStack(ModBlocks.conjurationCatalyst));
}
input = builder.build();
output = recipe.getOutput();
mana = recipe.getManaToConsume();
}
@Override
public List getInputs() {
return input;
}
@Override
public List getOutputs() {
return ImmutableList.of(output);
}
@Override
public List<FluidStack> getFluidInputs() {
return ImmutableList.of();
}
@Override
public List<FluidStack> getFluidOutputs() {
return ImmutableList.of();
}
@Override
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
GlStateManager.enableAlpha();
HUDHandler.renderManaBar(28, 50, 0x0000FF, 0.75F, mana, TilePool.MAX_MANA / 10);
GlStateManager.disableAlpha();
}
@Override
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {}
}
@@ -0,0 +1,109 @@
/**
* 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.integration.jei.petalapothecary;
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;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
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.*;
import java.util.Collection;
public class PetalApothecaryRecipeCategory implements IRecipeCategory {
private final IDrawableStatic background;
private final String localizedName;
private final IDrawableStatic overlay;
public PetalApothecaryRecipeCategory(IGuiHelper guiHelper) {
background = guiHelper.createBlankDrawable(150, 110);
localizedName = StatCollector.translateToLocal("botania.nei.petalApothecary");
overlay = guiHelper.createDrawable(new ResourceLocation("botania", "textures/gui/petalOverlay.png"),
0, 0, 150, 110);
}
@Nonnull
@Override
public String getUid() {
return "botania.petals";
}
@Nonnull
@Override
public String getTitle() {
return localizedName;
}
@Nonnull
@Override
public IDrawable getBackground() {
return background;
}
@Override
public void drawExtras(Minecraft minecraft) {
GlStateManager.enableAlpha();
GlStateManager.enableBlend();
overlay.draw(minecraft);
GlStateManager.disableBlend();
GlStateManager.disableAlpha();
}
@Override
public void drawAnimations(Minecraft minecraft) {}
@Override
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
if (!(recipeWrapper instanceof PetalApothecaryRecipeWrapper))
return;
PetalApothecaryRecipeWrapper wrapper = ((PetalApothecaryRecipeWrapper) recipeWrapper);
recipeLayout.getItemStacks().init(0, true, 64, 52);
recipeLayout.getItemStacks().set(0, new ItemStack(ModBlocks.altar));
int index = 1;
double angleBetweenEach = 360.0 / wrapper.getInputs().size();
Point point = new Point(64, 20), center = new Point(64, 52);
for (Object o : wrapper.getInputs()) {
recipeLayout.getItemStacks().init(index, true, point.x, point.y);
if (o instanceof Collection) {
recipeLayout.getItemStacks().set(index, ((Collection<ItemStack>) o));
}
if (o instanceof ItemStack) {
recipeLayout.getItemStacks().set(index, ((ItemStack) o));
}
index += 1;
point = rotatePointAbout(point, center, angleBetweenEach);
}
recipeLayout.getItemStacks().init(index, false, 103, 17);
recipeLayout.getItemStacks().set(index, wrapper.getOutputs().get(0));
}
private Point rotatePointAbout(Point in, Point about, double degrees) {
double rad = degrees * Math.PI / 180.0;
double newX = Math.cos(rad) * (in.x - about.x) - Math.sin(rad) * (in.y - about.y) + about.x;
double newY = Math.sin(rad) * (in.x - about.x) + Math.cos(rad) * (in.y - about.y) + about.y;
return new Point(((int) newX), ((int) newY));
}
}
@@ -0,0 +1,42 @@
/**
* 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.integration.jei.petalapothecary;
import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper;
import vazkii.botania.api.recipe.RecipePetals;
import javax.annotation.Nonnull;
public class PetalApothecaryRecipeHandler implements IRecipeHandler<RecipePetals> {
@Nonnull
@Override
public Class<RecipePetals> getRecipeClass() {
return RecipePetals.class;
}
@Nonnull
@Override
public String getRecipeCategoryUid() {
return "botania.petals";
}
@Nonnull
@Override
public IRecipeWrapper getRecipeWrapper(@Nonnull RecipePetals recipe) {
return new PetalApothecaryRecipeWrapper(recipe);
}
@Override
public boolean isRecipeValid(@Nonnull RecipePetals recipe) {
return recipe.getInputs().size() <= 16;
}
}
@@ -0,0 +1,67 @@
/**
* 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.integration.jei.petalapothecary;
import com.google.common.collect.ImmutableList;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.OreDictionary;
import vazkii.botania.api.recipe.RecipePetals;
import javax.annotation.Nonnull;
import java.util.List;
public class PetalApothecaryRecipeWrapper implements IRecipeWrapper {
private final List input;
private final ItemStack output;
public PetalApothecaryRecipeWrapper(RecipePetals recipe) {
ImmutableList.Builder builder = ImmutableList.builder();
for (Object o : recipe.getInputs()) {
if (o instanceof ItemStack) {
builder.add(o);
}
if (o instanceof String) {
builder.add(OreDictionary.getOres(((String) o)));
}
}
input = builder.build();
output = recipe.getOutput();
}
@Override
public List getInputs() {
return input;
}
@Override
public List<ItemStack> getOutputs() {
return ImmutableList.of(output);
}
@Override
public List<FluidStack> getFluidInputs() {
return ImmutableList.of();
}
@Override
public List<FluidStack> getFluidOutputs() {
return ImmutableList.of();
}
@Override
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {}
@Override
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {}
}
@@ -0,0 +1,109 @@
/**
* 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.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;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
import vazkii.botania.common.lib.LibBlockNames;
import javax.annotation.Nonnull;
import java.util.Collection;
public class PureDaisyRecipeCategory implements IRecipeCategory {
private final IDrawable background;
private final String localizedName;
private final IDrawable overlay;
public PureDaisyRecipeCategory(IGuiHelper guiHelper) {
background = guiHelper.createBlankDrawable(168, 64);
localizedName = StatCollector.translateToLocal("botania.nei.pureDaisy");
overlay = guiHelper.createDrawable(new ResourceLocation("botania", "textures/gui/pureDaisyOverlay.png"),
0, 0, 64, 46);
}
@Nonnull
@Override
public String getUid() {
return "botania.pureDaisy";
}
@Nonnull
@Override
public String getTitle() {
return localizedName;
}
@Nonnull
@Override
public IDrawable getBackground() {
return background;
}
@Override
public void drawExtras(Minecraft minecraft) {
GlStateManager.enableAlpha();
GlStateManager.enableBlend();
overlay.draw(minecraft, 48, 0);
GlStateManager.disableBlend();
GlStateManager.disableAlpha();
}
@Override
public void drawAnimations(Minecraft minecraft) {}
@Override
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
if (!(recipeWrapper instanceof PureDaisyRecipeWrapper))
return;
PureDaisyRecipeWrapper wrapper = ((PureDaisyRecipeWrapper) recipeWrapper);
boolean inputFluid = wrapper.getInputs().isEmpty();
boolean outputFluid = wrapper.getOutputs().isEmpty();
if (inputFluid) {
recipeLayout.getFluidStacks().init(0, true, 40, 12, 16, 16, 1000, false, null);
recipeLayout.getFluidStacks().set(0, wrapper.getFluidInputs().get(0));
} else {
recipeLayout.getItemStacks().init(0, true, 40, 12);
if (wrapper.getInputs().get(0) instanceof Collection) {
recipeLayout.getItemStacks().set(0, ((Collection<ItemStack>) wrapper.getInputs().get(0)));
} else {
recipeLayout.getItemStacks().set(0, ((ItemStack) wrapper.getInputs().get(0)));
}
}
recipeLayout.getItemStacks().init(1, true, 70, 12);
recipeLayout.getItemStacks().set(1, ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_PUREDAISY));
if (outputFluid) {
recipeLayout.getFluidStacks().init(2, false, 99, 12, 16, 16, 1000, false, null);
recipeLayout.getFluidStacks().set(2, wrapper.getFluidOutputs().get(0));
} else {
recipeLayout.getItemStacks().init(2, false, 99, 12);
if (wrapper.getOutputs().get(0) instanceof Collection) {
recipeLayout.getItemStacks().set(2, ((Collection<ItemStack>) wrapper.getOutputs().get(0)));
} else {
recipeLayout.getItemStacks().set(2, ((ItemStack) wrapper.getOutputs().get(0)));
}
}
}
}
@@ -0,0 +1,42 @@
/**
* 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.integration.jei.puredaisy;
import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper;
import vazkii.botania.api.recipe.RecipePureDaisy;
import javax.annotation.Nonnull;
public class PureDaisyRecipeHandler implements IRecipeHandler<RecipePureDaisy> {
@Nonnull
@Override
public Class<RecipePureDaisy> getRecipeClass() {
return RecipePureDaisy.class;
}
@Nonnull
@Override
public String getRecipeCategoryUid() {
return "botania.pureDaisy";
}
@Nonnull
@Override
public IRecipeWrapper getRecipeWrapper(@Nonnull RecipePureDaisy recipe) {
return new PureDaisyRecipeWrapper(recipe);
}
@Override
public boolean isRecipeValid(@Nonnull RecipePureDaisy recipe) {
return true;
}
}
@@ -0,0 +1,77 @@
/**
* 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.integration.jei.puredaisy;
import com.google.common.collect.ImmutableList;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.OreDictionary;
import vazkii.botania.api.recipe.RecipePureDaisy;
import javax.annotation.Nonnull;
import java.util.List;
public class PureDaisyRecipeWrapper implements IRecipeWrapper {
private List inputs = ImmutableList.of();
private List outputs = ImmutableList.of();
private List<FluidStack> fluidInputs = ImmutableList.of();
private List<FluidStack> fluidOutputs = ImmutableList.of();
public PureDaisyRecipeWrapper(RecipePureDaisy recipe) {
if (recipe.getInput() instanceof String) {
inputs = ImmutableList.of(OreDictionary.getOres(((String) recipe.getInput())));
} else if (recipe.getInput() instanceof Block) {
Block b = ((Block) recipe.getInput());
if (FluidRegistry.lookupFluidForBlock(b) != null) {
fluidInputs = ImmutableList.of(new FluidStack(FluidRegistry.lookupFluidForBlock(b), 1000));
} else {
inputs = ImmutableList.of(new ItemStack(b, 1, b.getMetaFromState(b.getDefaultState())));
}
}
Block outBlock = recipe.getOutputState().getBlock();
if (FluidRegistry.lookupFluidForBlock(outBlock) != null) {
fluidOutputs = ImmutableList.of(new FluidStack(FluidRegistry.lookupFluidForBlock(outBlock), 1000));
} else {
outputs = ImmutableList.of(new ItemStack(outBlock, 1, outBlock.getMetaFromState(recipe.getOutputState())));
}
}
@Override
public List getInputs() {
return inputs;
}
@Override
public List getOutputs() {
return outputs;
}
@Override
public List<FluidStack> getFluidInputs() {
return fluidInputs;
}
@Override
public List<FluidStack> getFluidOutputs() {
return fluidOutputs;
}
@Override
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {}
@Override
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {}
}
@@ -0,0 +1,106 @@
/**
* 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.integration.jei.runicaltar;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.recipe.IRecipeCategory;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import vazkii.botania.common.block.ModBlocks;
import javax.annotation.Nonnull;
import java.awt.*;
import java.util.Collection;
public class RunicAltarRecipeCategory implements IRecipeCategory {
private final IDrawable background;
private final String localizedName;
private final IDrawable overlay;
public RunicAltarRecipeCategory(IGuiHelper guiHelper) {
background = guiHelper.createBlankDrawable(150, 110);
localizedName = StatCollector.translateToLocal("botania.nei.runicAltar");
overlay = guiHelper.createDrawable(new ResourceLocation("botania", "textures/gui/petalOverlay.png"),
0, 0, 150, 110);
}
@Nonnull
@Override
public String getUid() {
return "botania.runicAltar";
}
@Nonnull
@Override
public String getTitle() {
return localizedName;
}
@Nonnull
@Override
public IDrawable getBackground() {
return background;
}
@Override
public void drawExtras(Minecraft minecraft) {
GlStateManager.enableAlpha();
GlStateManager.enableBlend();
overlay.draw(minecraft);
GlStateManager.disableBlend();
GlStateManager.disableAlpha();
}
@Override
public void drawAnimations(Minecraft minecraft) {}
@Override
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
if (!(recipeWrapper instanceof RunicAltarRecipeWrapper))
return;
RunicAltarRecipeWrapper wrapper = ((RunicAltarRecipeWrapper) recipeWrapper);
recipeLayout.getItemStacks().init(0, true, 64, 52);
recipeLayout.getItemStacks().set(0, new ItemStack(ModBlocks.runeAltar));
int index = 1;
double angleBetweenEach = 360.0 / wrapper.getInputs().size();
Point point = new Point(64, 20), center = new Point(64, 52);
for (Object o : wrapper.getInputs()) {
recipeLayout.getItemStacks().init(index, true, point.x, point.y);
if (o instanceof Collection) {
recipeLayout.getItemStacks().set(index, ((Collection<ItemStack>) o));
}
if (o instanceof ItemStack) {
recipeLayout.getItemStacks().set(index, ((ItemStack) o));
}
index += 1;
point = rotatePointAbout(point, center, angleBetweenEach);
}
recipeLayout.getItemStacks().init(index, false, 103, 17);
recipeLayout.getItemStacks().set(index, wrapper.getOutputs().get(0));
}
private Point rotatePointAbout(Point in, Point about, double degrees) {
double rad = degrees * Math.PI / 180.0;
double newX = Math.cos(rad) * (in.x - about.x) - Math.sin(rad) * (in.y - about.y) + about.x;
double newY = Math.sin(rad) * (in.x - about.x) + Math.cos(rad) * (in.y - about.y) + about.y;
return new Point(((int) newX), ((int) newY));
}
}
@@ -0,0 +1,42 @@
/**
* 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.integration.jei.runicaltar;
import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper;
import vazkii.botania.api.recipe.RecipeRuneAltar;
import javax.annotation.Nonnull;
public class RunicAltarRecipeHandler implements IRecipeHandler<RecipeRuneAltar> {
@Nonnull
@Override
public Class<RecipeRuneAltar> getRecipeClass() {
return RecipeRuneAltar.class;
}
@Nonnull
@Override
public String getRecipeCategoryUid() {
return "botania.runicAltar";
}
@Nonnull
@Override
public IRecipeWrapper getRecipeWrapper(@Nonnull RecipeRuneAltar recipe) {
return new RunicAltarRecipeWrapper(recipe);
}
@Override
public boolean isRecipeValid(@Nonnull RecipeRuneAltar recipe) {
return recipe.getInputs().size() <= 16;
}
}
@@ -0,0 +1,76 @@
/**
* 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.integration.jei.runicaltar;
import com.google.common.collect.ImmutableList;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.OreDictionary;
import vazkii.botania.api.recipe.RecipeRuneAltar;
import vazkii.botania.client.core.handler.HUDHandler;
import vazkii.botania.common.block.tile.mana.TilePool;
import javax.annotation.Nonnull;
import java.util.List;
public class RunicAltarRecipeWrapper implements IRecipeWrapper {
private final List input;
private final ItemStack output;
private final int manaUsage;
public RunicAltarRecipeWrapper(RecipeRuneAltar recipe) {
ImmutableList.Builder builder = ImmutableList.builder();
for (Object o : recipe.getInputs()) {
if (o instanceof ItemStack) {
builder.add(o);
}
if (o instanceof String) {
builder.add(OreDictionary.getOres(((String) o)));
}
}
input = builder.build();
output = recipe.getOutput();
manaUsage = recipe.getManaUsage();
}
@Override
public List getInputs() {
return input;
}
@Override
public List<ItemStack> getOutputs() {
return ImmutableList.of(output);
}
@Override
public List<FluidStack> getFluidInputs() {
return ImmutableList.of();
}
@Override
public List<FluidStack> getFluidOutputs() {
return ImmutableList.of();
}
@Override
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
GlStateManager.enableAlpha();
HUDHandler.renderManaBar(28, 113, 0x0000FF, 0.75F, manaUsage, TilePool.MAX_MANA / 10);
GlStateManager.disableAlpha();
}
@Override
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {}
}
@@ -1,3 +1,11 @@
/**
* 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;
@@ -42,6 +50,7 @@ import java.util.List;
import java.util.Map;
public class FloatingFlowerModel implements ISmartItemModel, ISmartBlockModel, IResourceManagerReloadListener {
public static final FloatingFlowerModel INSTANCE = new FloatingFlowerModel();
private static Table<IFloatingFlower.IslandType, String, CompositeBakedModel> CACHE = HashBasedTable.create();
@@ -87,6 +96,7 @@ 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();
@@ -168,58 +178,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(); }
// 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; }
@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; }
}
@@ -51,13 +51,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 +81,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;
@@ -16,6 +16,7 @@ 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;
@@ -63,32 +64,31 @@ public class ModelPylon implements IPylonModel {
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 +105,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)
@@ -141,4 +145,5 @@ public class ModelPylon implements IPylonModel {
for (BakedQuad bakedquad : quads)
LightUtil.renderQuadColor(renderer, bakedquad, color);
}
}
@@ -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,140 @@
/**
* 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.http.annotation.Immutable;
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 = new Function<ResourceLocation, TextureAtlasSprite>() {
@Override
public TextureAtlasSprite apply(ResourceLocation input) {
return 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(); }
}
}
@@ -1,11 +1,18 @@
package vazkii.botania.api.render;
/**
* 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.base.Optional;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import net.minecraft.block.state.IBlockState;
@@ -33,9 +40,8 @@ import net.minecraftforge.client.model.TRSRTransformation;
import net.minecraftforge.common.property.IExtendedBlockState;
import net.minecraftforge.fml.common.FMLLog;
import org.apache.commons.lang3.tuple.Pair;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.BotaniaAPIClient;
import vazkii.botania.api.state.BotaniaStateProps;
import vazkii.botania.api.subtile.SubTileEntity;
import vazkii.botania.common.block.decor.IFloatingFlower;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
@@ -48,53 +54,8 @@ import java.util.Map;
public class SpecialFlowerModel implements IModelCustomData {
/**
* 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 register(String subTileName, ModelResourceLocation model, ModelResourceLocation itemModel) {
queuedBlockModels.put(subTileName, model);
queuedItemModels.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.
* 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"
*/
public static void register(String subTileName, ModelResourceLocation model) {
register(subTileName, model, new ModelResourceLocation(model.getResourceDomain() + ":" + model.getResourcePath(), "inventory"));
}
public static void register(Class<? extends SubTileEntity> clazz, ModelResourceLocation model) {
register(BotaniaAPI.getSubTileStringMapping(clazz), model);
}
public static void register(Class<? extends SubTileEntity> clazz, ModelResourceLocation model, ModelResourceLocation itemModel) {
register(BotaniaAPI.getSubTileStringMapping(clazz), model, itemModel);
}
/**
* Internal implementation
**/
// SpecialFlowerModel for when there are no blockModels registered for a subtile
public static final SpecialFlowerModel INSTANCE = new SpecialFlowerModel(ImmutableMap.<Optional<String>, ModelResourceLocation>of(), ImmutableMap.<Optional<String>, ModelResourceLocation>of());
// Models registered from the externel API thus far
private static final Map<String, ModelResourceLocation> queuedBlockModels = Maps.newHashMap();
private static final Map<String, ModelResourceLocation> queuedItemModels = Maps.newHashMap();
private final ImmutableMap<Optional<String>, ModelResourceLocation> blockModels;
private final ImmutableMap<Optional<String>, ModelResourceLocation> itemModels;
@@ -111,7 +72,7 @@ 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 <TODO>
// 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)));
}
@@ -147,10 +108,10 @@ public class SpecialFlowerModel implements IModelCustomData {
}
}
for (Map.Entry<String, ModelResourceLocation> e : 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 : queuedItemModels.entrySet()) {
for (Map.Entry<String, ModelResourceLocation> e : BotaniaAPIClient.getRegisteredSubtileItemModels().entrySet()) {
itemBuilder.put(Optional.of(e.getKey()), e.getValue());
}
@@ -214,6 +175,7 @@ public class SpecialFlowerModel implements IModelCustomData {
private void refreshBakedModels() {
if (baseModel == null) {
// If not done already, steal all the real baked models and cache them
ModelManager manager = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager();
baseModel = getBlockModel(manager, Optional.<String>absent());
@@ -327,9 +289,6 @@ public class SpecialFlowerModel implements IModelCustomData {
refreshBakedModels();
IExtendedBlockState extendedState = ((IExtendedBlockState) state);
IBakedModel ret = bakedBlockModels.get(extendedState.getValue(BotaniaStateProps.SUBTILE_ID));
if (ret == null) {
System.out.println("Warning: no flower model for subtile: " + extendedState.getValue(BotaniaStateProps.SUBTILE_ID));
}
return ret == null ? Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel() : ret;
}
@@ -346,14 +305,13 @@ public class SpecialFlowerModel implements IModelCustomData {
@Override
public IBakedModel handleItemState(ItemStack stack) {
refreshBakedModels();
//System.out.println("calling smart item");
IBakedModel item = bakedItemModels.get(ItemBlockSpecialFlower.getType(stack));
if (item == null) {
System.out.println("Missing item model, selecting block model");
item = bakedBlockModels.get(ItemBlockSpecialFlower.getType(stack));
}
return item == null ? Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel() : item;
}
}
}
@@ -211,21 +211,21 @@ public class ModelArmorElementium extends ModelBiped {
@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
helm.showModel = slot == 0;
body.showModel = slot == 1;
armR.showModel = slot == 1;
armL.showModel = slot == 1;
legR.showModel = slot == 2;
legL.showModel = slot == 2;
bootL.showModel = slot == 3;
bootR.showModel = slot == 3;
helm.showModel = slot == 3; // 1.8: now reversed. Yay mojang.
body.showModel = slot == 2;
armR.showModel = slot == 2;
armL.showModel = slot == 2;
legR.showModel = slot == 1;
legL.showModel = slot == 1;
bootL.showModel = slot == 0;
bootR.showModel = slot == 0;
bipedHeadwear.showModel = false;
bipedHead = helm;
bipedBody = body;
bipedRightArm = armR;
bipedLeftArm = armL;
if(slot == 2) {
if(slot == 1) {
bipedRightLeg = legR;
bipedLeftLeg = legL;
} else {
@@ -240,6 +240,7 @@ public class ModelArmorElementium extends ModelBiped {
public void prepareForRender(Entity entity) {
EntityLivingBase living = (EntityLivingBase) entity;
isSneak = living != null ? living.isSneaking() : false;
isChild = living != null ? living.isChild() : false;
if(living != null && living instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) living;
@@ -141,21 +141,21 @@ public class ModelArmorManasteel extends ModelBiped {
@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
helm.showModel = slot == 0;
body.showModel = slot == 1;
armR.showModel = slot == 1;
armL.showModel = slot == 1;
legR.showModel = slot == 2;
legL.showModel = slot == 2;
bootL.showModel = slot == 3;
bootR.showModel = slot == 3;
helm.showModel = slot == 3; // 1.8: now reversed. yay mojang.
body.showModel = slot == 2;
armR.showModel = slot == 2;
armL.showModel = slot == 2;
legR.showModel = slot == 1;
legL.showModel = slot == 1;
bootL.showModel = slot == 0;
bootR.showModel = slot == 0;
bipedHeadwear.showModel = false;
bipedHead = helm;
bipedBody = body;
bipedRightArm = armR;
bipedLeftArm = armL;
if(slot == 2) {
if(slot == 1) {
bipedRightLeg = legR;
bipedLeftLeg = legL;
} else {
@@ -170,6 +170,7 @@ public class ModelArmorManasteel extends ModelBiped {
public void prepareForRender(Entity entity) {
EntityLivingBase living = (EntityLivingBase) entity;
isSneak = living != null ? living.isSneaking() : false;
isChild = living != null ? living.isChild() : false;
if(living != null && living instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) living;
@@ -141,21 +141,21 @@ public class ModelArmorManaweave extends ModelBiped {
@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
helm.showModel = slot == 0;
body.showModel = slot == 1;
armR.showModel = slot == 1;
armL.showModel = slot == 1;
legR.showModel = slot == 2;
legL.showModel = slot == 2;
bootL.showModel = slot == 3;
bootR.showModel = slot == 3;
helm.showModel = slot == 3; // 1.8: now reversed. yay mojang.
body.showModel = slot == 2;
armR.showModel = slot == 2;
armL.showModel = slot == 2;
legR.showModel = slot == 1;
legL.showModel = slot == 1;
bootL.showModel = slot == 0;
bootR.showModel = slot == 0;
bipedHeadwear.showModel = false;
bipedHead = helm;
bipedBody = body;
bipedRightArm = armR;
bipedLeftArm = armL;
if(slot == 2) {
if(slot == 1) {
bipedRightLeg = legR;
bipedLeftLeg = legL;
} else {
@@ -170,6 +170,7 @@ public class ModelArmorManaweave extends ModelBiped {
public void prepareForRender(Entity entity) {
EntityLivingBase living = (EntityLivingBase) entity;
isSneak = living != null ? living.isSneaking() : false;
isChild = living != null ? living.isChild() : false;
if(living != null && living instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) living;
@@ -232,21 +232,21 @@ public class ModelArmorTerrasteel extends ModelBiped {
@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
helm.showModel = slot == 0;
body.showModel = slot == 1;
armr.showModel = slot == 1;
armL.showModel = slot == 1;
legR.showModel = slot == 2;
legL.showModel = slot == 2;
bootL.showModel = slot == 3;
bootR.showModel = slot == 3;
helm.showModel = slot == 3; // 1.8: now reversed. yay mojang.
body.showModel = slot == 2;
armr.showModel = slot == 2;
armL.showModel = slot == 2;
legR.showModel = slot == 1;
legL.showModel = slot == 1;
bootL.showModel = slot == 0;
bootR.showModel = slot == 0;
bipedHeadwear.showModel = false;
bipedHead = helm;
bipedBody = body;
bipedRightArm = armr;
bipedLeftArm = armL;
if(slot == 2) {
if(slot == 1) {
bipedRightLeg = legR;
bipedLeftLeg = legL;
} else {
@@ -261,6 +261,7 @@ public class ModelArmorTerrasteel extends ModelBiped {
public void prepareForRender(Entity entity) {
EntityLivingBase living = (EntityLivingBase) entity;
isSneak = living != null ? living.isSneaking() : false;
isChild = living != null ? living.isChild() : false;
if(living != null && living instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) living;
@@ -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
@@ -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) {
@@ -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,28 @@ 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) {
AlfPortalState state;
if (portal.getWorld().getBlockState(portal.getPos()).getBlock() != ModBlocks.alfPortal) {
state = AlfPortalState.OFF;
} else {
state = portal.getWorld().getBlockState(portal.getPos()).getValue(BotaniaStateProps.ALFPORTAL_STATE);
}
if(state == AlfPortalState.OFF)
return;
GlStateManager.pushMatrix();
@@ -49,18 +55,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();
@@ -38,7 +38,7 @@ 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,9 +58,7 @@ 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) {
GlStateManager.pushMatrix();
GlStateManager.enableRescaleNormal();
GlStateManager.color(1F, 1F, 1F, 1F);
@@ -33,7 +33,7 @@ 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,22 +43,28 @@ 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) {
GlStateManager.pushMatrix();
GlStateManager.enableRescaleNormal();
GlStateManager.color(1F, 1F, 1F, 1F);
GlStateManager.translate(d0, d1, d2);
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
int meta = avatar.getWorld() != null ? avatar.getBlockMetadata() : 0;
int meta = avatar != null && avatar.getWorld() != null ? avatar.getBlockMetadata() : 0;
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);
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();
@@ -23,7 +23,7 @@ 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 +33,19 @@ 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) {
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();
@@ -35,7 +35,7 @@ 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 +43,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);
@@ -23,15 +23,13 @@ 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) {
@@ -32,25 +32,26 @@ import vazkii.botania.client.model.ModelCrystalCube;
import vazkii.botania.common.block.tile.corporea.TileCorporeaCrystalCube;
import vazkii.botania.common.lib.LibObfuscation;
public class RenderTileCorporeaCrystalCube extends TileEntitySpecialRenderer {
public class RenderTileCorporeaCrystalCube extends TileEntitySpecialRenderer<TileCorporeaCrystalCube> {
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_CRYSTAL_CUBE);
ModelCrystalCube model = new ModelCrystalCube();
EntityItem entity = null;
@Override
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f, int digProgress) {
TileCorporeaCrystalCube cube = (TileCorporeaCrystalCube) tileentity;
public void renderTileEntityAt(TileCorporeaCrystalCube cube, double d0, double d1, double d2, float f, int digProgress) {
ItemStack stack = null;
if (cube != null) {
if(entity == null)
entity = new EntityItem(cube.getWorld(), cube.getPos().getX(), cube.getPos().getY(), cube.getPos().getZ(), new ItemStack(Blocks.stone));
if(entity == null)
entity = new EntityItem(cube.getWorld(), cube.getPos().getX(), cube.getPos().getY(), cube.getPos().getZ(), new ItemStack(Blocks.stone));
ObfuscationReflectionHelper.setPrivateValue(EntityItem.class, entity, ClientTickHandler.ticksInGame, LibObfuscation.AGE);
ItemStack stack = cube.getRequestTarget();
entity.setEntityItemStack(stack);
ObfuscationReflectionHelper.setPrivateValue(EntityItem.class, entity, ClientTickHandler.ticksInGame, LibObfuscation.AGE);
stack = cube.getRequestTarget();
entity.setEntityItemStack(stack);
}
double time = ClientTickHandler.ticksInGame + f;
double worldTicks = tileentity.getWorld() == null ? 0 : time;
double worldTicks = cube == null || cube.getWorld() == null ? 0 : time;
Minecraft mc = Minecraft.getMinecraft();
GlStateManager.pushMatrix();
@@ -23,15 +23,15 @@ import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.common.block.tile.corporea.TileCorporeaIndex;
public class RenderTileCorporeaIndex extends TileEntitySpecialRenderer {
public class RenderTileCorporeaIndex extends TileEntitySpecialRenderer<TileCorporeaIndex> {
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_CORPOREA_INDEX);
ModelEnderCrystal crystal = new ModelEnderCrystal(0F, false);
public static boolean move = true;
@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partticks, int digProgress) {
TileCorporeaIndex index = (TileCorporeaIndex) tile;
public void renderTileEntityAt(TileCorporeaIndex index, double x, double y, double z, float partticks, int digProgress) {
move = index != null;
GlStateManager.pushMatrix();
GlStateManager.translate(x + 0.5, y, z + 0.5);
@@ -44,7 +44,7 @@ public class RenderTileCorporeaIndex extends TileEntitySpecialRenderer {
crystal.render(null, 0F, rotation, translation, 0F, 0F, 1F / 16F);
GlStateManager.scale(1F / scale, 1F / scale, 1F / scale);
if(index.closeby > 0F) {
if(index != null && index.closeby > 0F) {
float starScale = 0.02F;
float starRadius = (float) TileCorporeaIndex.RADIUS * index.closeby + (index.closeby == 1F ? 0F : index.hasCloseby ? partticks : -partticks) * 0.2F;
double rads = (index.ticksWithCloseby + partticks) * 2 * Math.PI / 180;
@@ -15,32 +15,27 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderItem;
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.tileentity.TileEntitySpecialRenderer;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
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.client.core.helper.ShaderHelper;
import vazkii.botania.common.block.mana.BlockEnchanter;
import vazkii.botania.common.block.tile.TileEnchanter;
import vazkii.botania.common.lib.LibObfuscation;
public class RenderTileEnchanter extends TileEntitySpecialRenderer {
public class RenderTileEnchanter extends TileEntitySpecialRenderer<TileEnchanter> {
EntityItem item;
@Override
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f, int digProgress) {
TileEnchanter enchanter = (TileEnchanter) tileentity;
public void renderTileEntityAt(TileEnchanter enchanter, double d0, double d1, double d2, float f, int digProgress) {
float alphaMod = 0F;
if(enchanter.stage == 2)
@@ -101,7 +96,7 @@ public class RenderTileEnchanter extends TileEntitySpecialRenderer {
}
ShaderHelper.useShader(ShaderHelper.enchanterRune);
renderIcon(0, 0, RenderEventHandler.INSTANCE.enchanterOverlay, 5, 5, 240);
renderIcon(0, 0, MiscellaneousIcons.INSTANCE.enchanterOverlay, 5, 5, 240);
ShaderHelper.releaseShader();
}
@@ -33,6 +33,7 @@ import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.model.FloatingFlowerModel;
import vazkii.botania.client.model.ModelMiniIsland;
import vazkii.botania.common.block.decor.IFloatingFlower;
import vazkii.botania.common.block.tile.TileFloatingFlower;
public class RenderTileFloatingFlower extends TileEntitySpecialRenderer {
@@ -26,43 +26,41 @@ import vazkii.botania.client.lib.LibResources;
import vazkii.botania.client.model.ModelHourglass;
import vazkii.botania.common.block.tile.TileHourglass;
public class RenderTileHourglass extends TileEntitySpecialRenderer {
public class RenderTileHourglass extends TileEntitySpecialRenderer<TileHourglass> {
ResourceLocation texture = new ResourceLocation(LibResources.MODEL_HOURGLASS);
ModelHourglass model = new ModelHourglass();
@Override
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float ticks, int digProgress) {
TileHourglass hourglass = (TileHourglass) tileentity;
public void renderTileEntityAt(TileHourglass hourglass, double d0, double d1, double d2, float ticks, int digProgress) {
GlStateManager.pushMatrix();
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);
int wtime = tileentity.getWorld() == null ? 0 : ClientTickHandler.ticksInGame;
boolean hasWorld = hourglass != null && hourglass.getWorld() != null;
int wtime = !hasWorld ? 0 : ClientTickHandler.ticksInGame;
if(wtime != 0)
wtime += new Random(tileentity.getPos().hashCode()).nextInt(360);
wtime += new Random(hourglass.getPos().hashCode()).nextInt(360);
float time = wtime == 0 ? 0 : wtime + ticks;
float x = 0.5F + (float) Math.cos(time * 0.05F) * 0.025F;
float y = 0.55F + (float) (Math.sin(time * 0.04F) + 1F) * 0.05F;
float z = 0.5F + (float) Math.sin(time * 0.05F) * 0.025F;
ItemStack stack = hourglass.getStackInSlot(0);
ItemStack stack = hasWorld ? hourglass.getStackInSlot(0) : null;
float fract1 = stack == null ? 0 : hourglass.timeFraction;
float fract2 = stack == null ? 0 : 1F - hourglass.timeFraction;
GlStateManager.translate(x, y, z);
float rot = hourglass.flip ? 180F : 1F;
if(hourglass.flipTicks > 0)
float rot = hasWorld && hourglass.flip ? 180F : 1F;
if(hasWorld && hourglass.flipTicks > 0)
rot += (hourglass.flipTicks - ticks) * (180F / 4F);
GlStateManager.rotate(rot, 0F, 0F, 1F);
GlStateManager.scale(1F, -1F, -1F);
model.render(fract1, fract2, hourglass.flip, hourglass.getColor());
model.render(fract1, fract2, hasWorld && hourglass.flip, hasWorld ? hourglass.getColor() : 0);
GlStateManager.scale(1F, -1F, -1F);
GlStateManager.popMatrix();
}
@@ -32,7 +32,7 @@ import vazkii.botania.client.lib.LibResources;
import vazkii.botania.client.model.ModelIncensePlate;
import vazkii.botania.common.block.tile.TileIncensePlate;
public class RenderTileIncensePlate extends TileEntitySpecialRenderer {
public class RenderTileIncensePlate extends TileEntitySpecialRenderer<TileIncensePlate> {
private static final float[] ROTATIONS = new float[] {
180F, 0F, 90F, 270F
@@ -42,9 +42,7 @@ public class RenderTileIncensePlate extends TileEntitySpecialRenderer {
ModelIncensePlate model = new ModelIncensePlate();
@Override
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float ticks, int digProgress) {
TileIncensePlate plate = (TileIncensePlate) tileentity;
public void renderTileEntityAt(TileIncensePlate plate, double d0, double d1, double d2, float ticks, int digProgress) {
EnumFacing facing = plate.getWorld() != null ? plate.getWorld().getBlockState(plate.getPos()).getValue(BotaniaStateProps.CARDINALS) : EnumFacing.SOUTH;
GlStateManager.pushMatrix();
@@ -53,11 +51,11 @@ public class RenderTileIncensePlate extends TileEntitySpecialRenderer {
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);
// Minecraft.getMinecraft().renderEngine.bindTexture(texture);
GlStateManager.translate(0.5F, 1.5F, 0.5F);
GlStateManager.scale(1F, -1F, -1F);
GlStateManager.rotate(ROTATIONS[Math.max(Math.min(ROTATIONS.length, facing.getIndex() - 2), 0)], 0F, 1F, 0F);
model.render();
// model.render();
GlStateManager.scale(1F, -1F, -1F);
ItemStack stack = plate.getStackInSlot(0);
@@ -13,27 +13,24 @@ package vazkii.botania.client.render.tile;
import net.minecraft.client.Minecraft;
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.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 org.lwjgl.opengl.GL12;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.core.handler.RenderEventHandler;
import vazkii.botania.client.core.handler.MiscellaneousIcons;
import vazkii.botania.client.core.helper.ShaderHelper;
import vazkii.botania.common.block.BlockLightRelay;
import vazkii.botania.common.block.tile.TileLightRelay;
public class RenderTileLightRelay extends TileEntitySpecialRenderer {
public class RenderTileLightRelay extends TileEntitySpecialRenderer<TileLightRelay> {
@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float pticks, int digProgress) {
public void renderTileEntityAt(TileLightRelay tile, double x, double y, double z, float pticks, int digProgress) {
Minecraft mc = Minecraft.getMinecraft();
TextureAtlasSprite iicon = tile.getBlockMetadata() > 0 ? RenderEventHandler.INSTANCE.lightRelayWorldIconRed : RenderEventHandler.INSTANCE.lightRelayWorldIcon;
TextureAtlasSprite iicon = tile.getBlockMetadata() > 0 ? MiscellaneousIcons.INSTANCE.lightRelayWorldIconRed : MiscellaneousIcons.INSTANCE.lightRelayWorldIcon;
GlStateManager.pushMatrix();
GlStateManager.translate(x + 0.5, y + 0.3, z + 0.5);
@@ -87,13 +84,12 @@ public class RenderTileLightRelay extends TileEntitySpecialRenderer {
float f5 = 0.5F;
float f6 = 0.25F;
p_77026_1_.getWorldRenderer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
//p_77026_1_.getWorldRenderer().putNormal(0.0F, 1.0F, 0.0F);
p_77026_1_.getWorldRenderer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_NORMAL);
//p_77026_1_.getWorldRenderer().setBrightness(240);
p_77026_1_.getWorldRenderer().pos(0.0F - f5, 0.0F - f6, 0.0D).tex(f, f3).endVertex();
p_77026_1_.getWorldRenderer().pos(f4 - f5, 0.0F - f6, 0.0D).tex(f1, f3).endVertex();
p_77026_1_.getWorldRenderer().pos(f4 - f5, f4 - f6, 0.0D).tex(f1, f2).endVertex();
p_77026_1_.getWorldRenderer().pos(0.0F - f5, f4 - f6, 0.0D).tex(f, f2).endVertex();
p_77026_1_.getWorldRenderer().pos(0.0F - f5, 0.0F - f6, 0.0D).tex(f, f3).normal(0, 1, 0).endVertex();
p_77026_1_.getWorldRenderer().pos(f4 - f5, 0.0F - f6, 0.0D).tex(f1, f3).normal(0, 1, 0).endVertex();
p_77026_1_.getWorldRenderer().pos(f4 - f5, f4 - f6, 0.0D).tex(f1, f2).normal(0, 1, 0).endVertex();
p_77026_1_.getWorldRenderer().pos(0.0F - f5, f4 - f6, 0.0D).tex(f, f2).normal(0, 1, 0).endVertex();
p_77026_1_.draw();
}
Loaded 100 of 277 files, more files were not shown because too many files have changed in this diff. Show more