本文整理汇总了Java中net.minecraft.item.ItemStack.hasEffect方法的典型用法代码示例。如果您正苦于以下问题:Java ItemStack.hasEffect方法的具体用法?Java ItemStack.hasEffect怎么用?Java ItemStack.hasEffect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.item.ItemStack
的用法示例。
在下文中一共展示了ItemStack.hasEffect方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderItem
import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public void renderItem(ItemStack stack, IBakedModel model) {
if (!stack.isEmpty()) {
if (model.isBuiltInRenderer() && !(stack.getItem() instanceof ItemDankNullHolder)) {
Minecraft.getMinecraft().getItemRenderer().renderItem(EasyMappings.player(), stack, ItemCameraTransforms.TransformType.NONE);
}
else {
RenderModel.render(model, stack);
if (stack.hasEffect()) {
if ((stack.getItem() instanceof ItemDankNull)) {
if (!Options.superShine) {
GlintEffectRenderer.apply(model, stack.getItemDamage());
}
else {
GlintEffectRenderer.apply2(model, DankNullUtils.getColor(stack.getItemDamage(), false));
}
}
else {
GlintEffectRenderer.apply(model, -1);
}
}
}
}
}
示例2: renderItem
import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public void renderItem(ItemStack stack, IBakedModel model)
{
if (stack != null)
{
GlStateManager.pushMatrix();
GlStateManager.translate(-0.5F, -0.5F, -0.5F);
if (model.isBuiltInRenderer())
{
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.enableRescaleNormal();
TileEntityItemStackRenderer.instance.renderByItem(stack);
}
else
{
this.renderModel(model, stack);
if (stack.hasEffect())
{
this.renderEffect(model);
}
}
GlStateManager.popMatrix();
}
}
示例3: renderItem
import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
@Override
public void renderItem(ItemStack stack, TransformType transformType) {
if (stack.isEmpty() || !(stack.getItem() instanceof ItemDankNullPanel)) {
return;
}
IBakedModel model = getModel(stack);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.enableLighting();
GlStateManager.enableBlend();
GlStateManager.enableRescaleNormal();
if (stack.isOnItemFrame()) {
GlStateManager.scale(1.25D, 1.25D, 1.25D);
GlStateManager.translate(-0.1D, -0.1D, -0.25D);
}
GlStateManager.pushMatrix();
RenderModel.render(model, stack);
if (stack.hasEffect()) {
if (Options.superShine) {
GlintEffectRenderer.apply2(model, DankNullUtils.getColor(stack.getMetadata(), false));
}
else {
GlintEffectRenderer.apply(model, stack.getMetadata());
}
}
GlStateManager.popMatrix();
GlStateManager.disableRescaleNormal();
}
示例4: renderItem
import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public void renderItem(ItemStack stack, IBakedModel model)
{
if (stack != null)
{
GlStateManager.pushMatrix();
GlStateManager.scale(0.5F, 0.5F, 0.5F);
if (model.isBuiltInRenderer())
{
GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(-0.5F, -0.5F, -0.5F);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.enableRescaleNormal();
TileEntityItemStackRenderer.instance.renderByItem(stack);
}
else
{
GlStateManager.translate(-0.5F, -0.5F, -0.5F);
this.renderModel(model, stack);
if (stack.hasEffect())
{
this.renderEffect(model);
}
}
GlStateManager.popMatrix();
}
}
示例5: renderItem
import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public void renderItem(ItemStack stack, IBakedModel model)
{
if (stack != null)
{
GlStateManager.pushMatrix();
GlStateManager.scale(0.5F, 0.5F, 0.5F);
if (model.isBuiltInRenderer())
{
GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(-0.5F, -0.5F, -0.5F);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.enableRescaleNormal();
TileEntityItemStackRenderer.instance.renderByItem(stack);
}
else
{
if (Config.isCustomItems())
{
model = CustomItems.getCustomItemModel(stack, model, this.modelLocation);
}
GlStateManager.translate(-0.5F, -0.5F, -0.5F);
this.renderModel(model, stack);
if (stack.hasEffect() && (!Config.isCustomItems() || !CustomItems.renderCustomEffect(this, stack, model)))
{
this.renderEffect(model);
}
}
GlStateManager.popMatrix();
}
}
示例6: renderItem
import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public void renderItem(ItemStack stack, IBakedModel model)
{
if (!stack.func_190926_b())
{
GlStateManager.pushMatrix();
GlStateManager.translate(-0.5F, -0.5F, -0.5F);
if (model.isBuiltInRenderer())
{
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.enableRescaleNormal();
TileEntityItemStackRenderer.instance.renderByItem(stack);
}
else
{
if (Config.isCustomItems())
{
model = CustomItems.getCustomItemModel(stack, model, this.modelLocation);
this.modelLocation = null;
}
this.renderModel(model, stack);
if (stack.hasEffect() && (!Config.isCustomItems() || !CustomItems.renderCustomEffect(this, stack, model)))
{
this.renderEffect(model);
}
}
GlStateManager.popMatrix();
}
}
示例7: renderItem
import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
@Override
public void renderItem(ItemRenderType type, ItemStack stack, Object... data) {
TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();
ResourceLocation resource = textureManager.getResourceLocation(stack.getItemSpriteNumber());
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
ItemStack usingItem = player.getItemInUse();
int useRemaining = player.getItemInUseCount();
ItemBow bow = (ItemBow) stack.getItem();
IIcon icon = bow.getIcon(stack, 0);
if (usingItem != null && usingItem == stack) {
int charge = stack.getMaxItemUseDuration() - useRemaining;
if (charge >= 18)
icon = bow.getItemIconForUseDuration(2);
else if (charge > 13)
icon = bow.getItemIconForUseDuration(1);
else if (charge > 0)
icon = bow.getItemIconForUseDuration(0);
}
if (icon == null)
icon = ((TextureMap) textureManager.getTexture(resource)).getAtlasSprite("missingno");
OpenGLHelper.pushMatrix();
textureManager.bindTexture(resource);
OpenGLHelper.colour(bow.getColorFromItemStack(stack, 0));
OpenGLHelper.disableLighting();
OpenGLHelper.enableAlpha();
OpenGLHelper.enableBlend();
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
renderItem.renderIcon(0, 0, icon, 16, 16);
OpenGLHelper.enableLighting();
OpenGLHelper.disableAlpha();
OpenGLHelper.disableBlend();
if (stack.hasEffect(0))
renderItem.renderEffect(textureManager, 0, 0);
OpenGLHelper.popMatrix();
}
示例8: renderArmorLayer
import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
private void renderArmorLayer(EntityLivingBase entityLivingBaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale, EntityEquipmentSlot slotIn)
{
ItemStack itemstack = this.getItemStackFromSlot(entityLivingBaseIn, slotIn);
if (itemstack != null && itemstack.getItem() instanceof ItemArmor)
{
ItemArmor itemarmor = (ItemArmor)itemstack.getItem();
if (itemarmor.getEquipmentSlot() == slotIn)
{
T t = this.getModelFromSlot(slotIn);
t = getArmorModelHook(entityLivingBaseIn, itemstack, slotIn, t);
t.setModelAttributes(this.renderer.getMainModel());
t.setLivingAnimations(entityLivingBaseIn, limbSwing, limbSwingAmount, partialTicks);
this.setModelSlotVisible(t, slotIn);
boolean flag = this.isLegSlot(slotIn);
this.renderer.bindTexture(this.getArmorResource(entityLivingBaseIn, itemstack, slotIn, null));
{
if (itemarmor.hasOverlay(itemstack)) // Allow this for anything, not only cloth
{
int i = itemarmor.getColor(itemstack);
float f = (float)(i >> 16 & 255) / 255.0F;
float f1 = (float)(i >> 8 & 255) / 255.0F;
float f2 = (float)(i & 255) / 255.0F;
GlStateManager.color(this.colorR * f, this.colorG * f1, this.colorB * f2, this.alpha);
t.render(entityLivingBaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
this.renderer.bindTexture(this.getArmorResource(entityLivingBaseIn, itemstack, slotIn, "overlay"));
}
{ // Non-colored
GlStateManager.color(this.colorR, this.colorG, this.colorB, this.alpha);
t.render(entityLivingBaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
} // Default
if (!this.skipRenderGlint && itemstack.hasEffect())
{
renderEnchantedGlint(this.renderer, entityLivingBaseIn, t, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale);
}
}
}
}
}