/**
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under the
* Botania License: http://botaniamod.net/license.php
*
* File Created @ [22/10/2016, 17:28:51 (GMT)]
*/
package vazkii.botania.common.item.equipment.bauble;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import vazkii.botania.api.item.IBaubleRender.Helper;
import vazkii.botania.api.item.IBaubleRender.RenderType;
import vazkii.botania.client.core.handler.MiscellaneousIcons;
import vazkii.botania.client.core.helper.IconHelper;
import vazkii.botania.common.lib.LibItemNames;
public class ItemSuperCloudPendant extends ItemCloudPendant {
public ItemSuperCloudPendant() {
super(LibItemNames.SUPER_CLOUD_PENDANT);
}
@Override
public int getMaxAllowedJumps() {
return 3;
}
@Override
@SideOnly(Side.CLIENT)
public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) {
if(type == RenderType.BODY) {
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
Helper.rotateIfSneaking(player);
boolean armor = !player.getItemStackFromSlot(EntityEquipmentSlot.CHEST).isEmpty();
GlStateManager.rotate(180F, 1F, 0F, 0F);
GlStateManager.translate(-0.2F, -0.45F, armor ? 0.2F : 0.15F);
GlStateManager.scale(0.5F, 0.5F, 0.5F);
TextureAtlasSprite gemIcon = MiscellaneousIcons.INSTANCE.nimbusGem;
float f = gemIcon.getMinU();
float f1 = gemIcon.getMaxU();
float f2 = gemIcon.getMinV();
float f3 = gemIcon.getMaxV();
IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, gemIcon.getIconWidth(), gemIcon.getIconHeight(), 1F / 32F);
}
}
}