当前位置: 首页>>代码示例>>Java>>正文


Java EntitySheep.fleeceColorTable方法代码示例

本文整理汇总了Java中net.minecraft.entity.passive.EntitySheep.fleeceColorTable方法的典型用法代码示例。如果您正苦于以下问题:Java EntitySheep.fleeceColorTable方法的具体用法?Java EntitySheep.fleeceColorTable怎么用?Java EntitySheep.fleeceColorTable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.entity.passive.EntitySheep的用法示例。


在下文中一共展示了EntitySheep.fleeceColorTable方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderEquippedGlove

import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
@SubscribeEvent
public void renderEquippedGlove(final RenderPlayerEvent.Specials.Post event) {
    if (event.entityPlayer == null) {
        return;
    }
    final ItemStack heldItem = event.entityPlayer.getHeldItem();
    if (heldItem == null || heldItem.getItem() != ExtraUtils.glove) {
        return;
    }
    final int dmg = heldItem.getItemDamage();
    final RenderPlayer renderplayer = event.renderer;
    float[] col = EntitySheep.fleeceColorTable[ItemGlove.getColIndex(1, dmg)];
    GL11.glColor3f(col[0], col[1], col[2]);
    Minecraft.getMinecraft().getTextureManager().bindTexture(RenderItemGlove.glove1);
    renderplayer.modelBipedMain.bipedRightArm.render(0.0625f);
    col = EntitySheep.fleeceColorTable[ItemGlove.getColIndex(0, dmg)];
    GL11.glColor3f(col[0], col[1], col[2]);
    Minecraft.getMinecraft().getTextureManager().bindTexture(RenderItemGlove.glove2);
    renderplayer.modelBipedMain.bipedRightArm.render(0.0625f);
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:21,代码来源:RenderItemGlove.java

示例2: getColorFromItemStack

import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
@Override
public int getColorFromItemStack(ItemStack itemStack, int pass) {
    int cachedColor = colorCache[itemStack.getItemDamage()];
    if (cachedColor == 0) {
        float[] colorArray = EntitySheep.fleeceColorTable[itemStack.getItemDamage()];
        Color color = new Color(colorArray[0], colorArray[1], colorArray[2]).brighter();
        colorCache[itemStack.getItemDamage()] = color.getRGB();
    }
    return cachedColor;
}
 
开发者ID:AgileMods,项目名称:MateriaMuto,代码行数:11,代码来源:ItemAlchemicalBag.java

示例3: handleDyeRecipe

import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
private void handleDyeRecipe(ItemStack stack, boolean usage) {
	boolean isDye = LOTRItemDye.isItemDye(stack) != -1;
	if ((!usage && !isDyed(stack)) || (isDye && !usage) || (!isDye && !itemsToDye.contains(stack.getItem())))
		return;

	ExtendedCachedShapelessRecipe rec = null;

	List<List<?>> ingredients = new ArrayList<>();
	List<Object> results = new ArrayList<>();

	if (!usage && !isDye) {
		results.add(stack.copy());

		int color = getDyeColor(stack);
		int dye = -1;

		float r = (color >> 16 & 0xFF) / 255.0F;
		float g = (color >> 8 & 0xFF) / 255.0F;
		float b = (color & 0xFF) / 255.0F;
		
		for (int i = 0; i < EntitySheep.fleeceColorTable.length; i++) {
			float tmpR = EntitySheep.fleeceColorTable[i][0];
			float tmpG = EntitySheep.fleeceColorTable[i][1];
			float tmpB = EntitySheep.fleeceColorTable[i][2];
			if (r == tmpR && g == tmpG && tmpB == b) {
				dye = i;
				break;
			}
		}

		List<Object> dyes = new ArrayList<>();

		final int finalDye = dye;

		if (dye != -1) {
			NeiLotrUtil.getDyes().forEach(dyeStack -> {
				int dyeColor = BlockColored.func_150031_c(LOTRItemDye.isItemDye(dyeStack));
				if (finalDye == dyeColor)
					dyes.add(dyeStack.copy());
			});
		}
		ItemStack ingred = stack.copy();
		removeDye(ingred);
		ingredients.add(Arrays.asList(ingred));
		ingredients.add(dyes);
	}

	rec = new ExtendedCachedShapelessRecipe(ingredients, results);

	arecipes.add(rec);
}
 
开发者ID:CraftedMods,项目名称:nei-lotr,代码行数:52,代码来源:AbstractDyeRecipeHandler.java

示例4: updateSegments

import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
private void updateSegments() {
	int x = xCoord;
	int y = yCoord;
	int z = zCoord;
	segments.clear();
	TileEntityNewBeacon.BeamSegment beamsegment = new TileEntityNewBeacon.BeamSegment(EntitySheep.fleeceColorTable[0]);
	segments.add(beamsegment);
	boolean flag = true;

	for (int i = y + 1; i < worldObj.getActualHeight(); i++) {
		Block iblockstate = worldObj.getBlock(x, i, z);
		float[] colours;

		if (iblockstate == Blocks.stained_glass)
			colours = EntitySheep.fleeceColorTable[worldObj.getBlockMetadata(x, i, z)];
		else {
			if (iblockstate != Blocks.stained_glass_pane) {
				if (iblockstate.getLightOpacity() >= 15) {
					segments.clear();
					break;
				}

				beamsegment.func_177262_a();
				continue;
			}

			colours = EntitySheep.fleeceColorTable[worldObj.getBlockMetadata(x, i, z)];
		}

		if (!flag)
			colours = new float[] { (beamsegment.func_177263_b()[0] + colours[0]) / 2.0F, (beamsegment.func_177263_b()[1] + colours[1]) / 2.0F, (beamsegment.func_177263_b()[2] + colours[2]) / 2.0F };

		if (Arrays.equals(colours, beamsegment.func_177263_b()))
			beamsegment.func_177262_a();
		else {
			beamsegment = new TileEntityNewBeacon.BeamSegment(colours);
			segments.add(beamsegment);
		}

		flag = false;
	}
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:43,代码来源:TileEntityNewBeacon.java

示例5: renderItem

import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
public void renderItem(final IItemRenderer.ItemRenderType type, final ItemStack item, final Object... data) {
    if (type == IItemRenderer.ItemRenderType.EQUIPPED) {
        return;
    }
    GL11.glEnable(2896);
    GL11.glEnable(2929);
    final EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
    GL11.glPushMatrix();
    GL11.glEnable(32826);
    GL11.glTranslatef(0.5f, 0.5f, 0.5f);
    final float p_78440_1_ = this.renderTickTime;
    final float f1 = 1.0f;
    final float f2 = 0.8f;
    final float f3 = 2.5f;
    GL11.glScalef(f3, f3, f3);
    float f4 = player.getSwingProgress(p_78440_1_);
    float f5 = MathHelper.sin(f4 * f4 * 3.1415927f);
    float f6 = MathHelper.sin(MathHelper.sqrt_float(f4) * 3.1415927f);
    GL11.glRotatef(f6 * 80.0f, 1.0f, 0.0f, 0.0f);
    GL11.glRotatef(f6 * 20.0f, 0.0f, 0.0f, 1.0f);
    GL11.glRotatef(f5 * 20.0f, 0.0f, 1.0f, 0.0f);
    GL11.glRotatef(-45.0f, 0.0f, 1.0f, 0.0f);
    GL11.glTranslatef(-0.7f * f2, 0.65f * f2 + (1.0f - f1) * 0.6f, 0.9f * f2);
    f4 = player.getSwingProgress(p_78440_1_);
    f5 = MathHelper.sin(f4 * 3.1415927f);
    f6 = MathHelper.sin(MathHelper.sqrt_float(f4) * 3.1415927f);
    GL11.glTranslatef(f6 * 0.4f, -MathHelper.sin(MathHelper.sqrt_float(f4) * 3.1415927f * 2.0f) * 0.2f, f5 * 0.2f);
    f4 = player.getSwingProgress(p_78440_1_);
    f5 = MathHelper.sin(f4 * 3.1415927f);
    f6 = MathHelper.sin(MathHelper.sqrt_float(f4) * 3.1415927f);
    GL11.glTranslatef(-f6 * 0.3f, MathHelper.sin(MathHelper.sqrt_float(f4) * 3.1415927f * 2.0f) * 0.4f, -f5 * 0.4f);
    GL11.glTranslatef(0.8f * f2, -0.75f * f2 - (1.0f - f1) * 0.6f, -0.9f * f2);
    GL11.glRotatef(45.0f, 0.0f, 1.0f, 0.0f);
    GL11.glEnable(32826);
    f4 = player.getSwingProgress(p_78440_1_);
    f5 = MathHelper.sin(f4 * f4 * 3.1415927f);
    f6 = MathHelper.sin(MathHelper.sqrt_float(f4) * 3.1415927f);
    GL11.glRotatef(f6 * 70.0f, 0.0f, 1.0f, 0.0f);
    GL11.glRotatef(-f5 * 20.0f, 0.0f, 0.0f, 1.0f);
    Minecraft.getMinecraft().getTextureManager().bindTexture(player.getLocationSkin());
    GL11.glTranslatef(-1.0f, 3.6f, 3.5f);
    GL11.glRotatef(120.0f, 0.0f, 0.0f, 1.0f);
    GL11.glRotatef(200.0f, 1.0f, 0.0f, 0.0f);
    GL11.glRotatef(-135.0f, 0.0f, 1.0f, 0.0f);
    GL11.glScalef(1.0f, 1.0f, 1.0f);
    GL11.glTranslatef(5.6f, 0.0f, 0.0f);
    final RenderPlayer renderplayer = (RenderPlayer)RenderManager.instance.getEntityRenderObject((Entity)player);
    final float f7 = 1.0f;
    GL11.glScalef(f7, f7, f7);
    renderplayer.renderFirstPersonArm((EntityPlayer)player);
    GL11.glColor3f(1.0f, 1.0f, 1.0f);
    renderplayer.modelBipedMain.onGround = 0.0f;
    renderplayer.modelBipedMain.setRotationAngles(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0625f, (Entity)player);
    renderplayer.modelBipedMain.bipedRightArm.render(0.0625f);
    final int dmg = item.getItemDamage();
    float[] col = EntitySheep.fleeceColorTable[ItemGlove.getColIndex(1, dmg)];
    GL11.glColor3f(col[0], col[1], col[2]);
    Minecraft.getMinecraft().getTextureManager().bindTexture(RenderItemGlove.glove1);
    renderplayer.modelBipedMain.bipedRightArm.render(0.0625f);
    col = EntitySheep.fleeceColorTable[ItemGlove.getColIndex(0, dmg)];
    GL11.glColor3f(col[0], col[1], col[2]);
    Minecraft.getMinecraft().getTextureManager().bindTexture(RenderItemGlove.glove2);
    renderplayer.modelBipedMain.bipedRightArm.render(0.0625f);
    GL11.glPopMatrix();
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:66,代码来源:RenderItemGlove.java

示例6: getCraftingResult

import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
@Override
public ItemStack getCraftingResult(InventoryCrafting crafting) {
    ItemStack itemstack = null;
    int[] aint = new int[3];
    int i = 0;
    int j = 0;
    ItemForcePack forcePack = null;
    int k;
    int l;
    float f;
    float f1;
    int l1;

    for (k = 0; k < crafting.getSizeInventory(); ++k) {
        ItemStack itemstack1 = crafting.getStackInSlot(k);

        if (itemstack1 != null) {
            if (itemstack1.getItem() instanceof ItemForcePack) {
                forcePack = (ItemForcePack) itemstack1.getItem();

                if (itemstack != null) {
                    return null;
                }

                itemstack = itemstack1.copy();
                itemstack.stackSize = 1;

                if (forcePack.hasColor(itemstack1)) {
                    l = forcePack.getColor(itemstack);
                    f = (float) (l >> 16 & 255) / 255.0F;
                    f1 = (float) (l >> 8 & 255) / 255.0F;
                    float f2 = (float) (l & 255) / 255.0F;
                    i = (int) ((float) i + Math.max(f, Math.max(f1, f2)) * 255.0F);
                    aint[0] = (int) ((float) aint[0] + f * 255.0F);
                    aint[1] = (int) ((float) aint[1] + f1 * 255.0F);
                    aint[2] = (int) ((float) aint[2] + f2 * 255.0F);
                    ++j;
                }
            } else {
                if (itemstack1.getItem() != Items.dye) {
                    return null;
                }

                float[] afloat = EntitySheep.fleeceColorTable[BlockColored.func_150032_b(itemstack1.getItemDamage())];
                int j1 = (int) (afloat[0] * 255.0F);
                int k1 = (int) (afloat[1] * 255.0F);
                l1 = (int) (afloat[2] * 255.0F);
                i += Math.max(j1, Math.max(k1, l1));
                aint[0] += j1;
                aint[1] += k1;
                aint[2] += l1;
                ++j;
            }
        }
    }

    if (forcePack == null) {
        return null;
    } else {
        k = aint[0] / j;
        int i1 = aint[1] / j;
        l = aint[2] / j;
        f = (float) i / (float) j;
        f1 = (float) Math.max(k, Math.max(i1, l));
        k = (int) ((float) k * f / f1);
        i1 = (int) ((float) i1 * f / f1);
        l = (int) ((float) l * f / f1);
        l1 = (k << 8) + i1;
        l1 = (l1 << 8) + l;
        forcePack.setNBTTagColor(itemstack, l1);
        return itemstack;
    }
}
 
开发者ID:austinv11,项目名称:DartCraft2,代码行数:74,代码来源:RecipeDyePack.java

示例7: getCraftingResult

import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
public ItemStack getCraftingResult(InventoryCrafting p_77572_1_) {
    ItemStack itemstack = null;
    int[] aint = new int[3];
    int i = 0;
    int j = 0;
    ItemVividOrb orb = null;
    int k;
    int l;
    float f;
    float f1;
    int l1;

    for (k = 0; k < p_77572_1_.getSizeInventory(); ++k) {
        ItemStack itemstack1 = p_77572_1_.getStackInSlot(k);

        if (itemstack1 != null) {
            if (itemstack1.getItem() == FarragoMod.VIVID_ORB) {
                orb = (ItemVividOrb)itemstack1.getItem();

                itemstack = itemstack1.copy();
                itemstack.stackSize = 1;

                if (orb.hasColor(itemstack1)) {
                    l = orb.getColorFromItemStack(itemstack, 0);
                    f = (float)(l >> 16 & 255) / 255.0F;
                    f1 = (float)(l >> 8 & 255) / 255.0F;
                    float f2 = (float)(l & 255) / 255.0F;
                    i = (int)((float)i + Math.max(f, Math.max(f1, f2)) * 255.0F);
                    aint[0] = (int)((float)aint[0] + f * 255.0F);
                    aint[1] = (int)((float)aint[1] + f1 * 255.0F);
                    aint[2] = (int)((float)aint[2] + f2 * 255.0F);
                    ++j;
                }
            } else {
            	int color = -1;
            	int[] ids = OreDictionary.getOreIDs(itemstack1);
            	for (int x = 0; x < ids.length; x++) {
            		String nm = OreDictionary.getOreName(ids[x]);
            		if (nm.startsWith("dye") && dyes.containsKey(nm.substring(3))) {
            			color = dyes.get(nm.substring(3));
            			break;
            		}
            	}
            	if (color == -1) return null;
            	
                float[] afloat = EntitySheep.fleeceColorTable[BlockColored.func_150032_b(color)];
                int j1 = (int)(afloat[0] * 255.0F);
                int k1 = (int)(afloat[1] * 255.0F);
                l1 = (int)(afloat[2] * 255.0F);
                i += Math.max(j1, Math.max(k1, l1));
                aint[0] += j1;
                aint[1] += k1;
                aint[2] += l1;
                ++j;
            }
        }
    }

    if (orb == null) {
        return null;
    } else {
        k = aint[0] / j;
        int i1 = aint[1] / j;
        l = aint[2] / j;
        f = (float)i / (float)j;
        f1 = (float)Math.max(k, Math.max(i1, l));
        k = (int)((float)k * f / f1);
        i1 = (int)((float)i1 * f / f1);
        l = (int)((float)l * f / f1);
        l1 = (k << 8) + i1;
        l1 = (l1 << 8) + l;
        orb.setColor(itemstack, l1);
        return itemstack;
    }
}
 
开发者ID:unascribed,项目名称:Farrago,代码行数:76,代码来源:RecipesVividOrbDyes.java

示例8: getColorFromItemStack

import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
@Override
  @SideOnly(Side.CLIENT)
  public int getColorFromItemStack(ItemStack stack, int pass)
  {
PhysisToolMaterial mat = PhysisToolMaterial.getMaterialFromItemStack(stack);
if (mat != null) {// && mat.hastint) {
	int[] tints = mat.getHeadTints();
	int shafttint = mat.getShaftTint();
	if (pass == 0) {
		if (stack.stackTagCompound.hasKey(HANDLETAG)) {
			int woolcol = stack.stackTagCompound.getInteger(HANDLETAG);
			
			if (woolcol < EntitySheep.fleeceColorTable.length && woolcol >= 0) {
				float[] col = EntitySheep.fleeceColorTable[woolcol];
				
				return new Color(col[0], col[1], col[2]).getRGB();
			}
		}
		return 0x6B6B6B;
	}
	else if (pass == 1) {
       	return shafttint;
       }
       else if (pass == 2) {
       	return tints[0];
       }
       else if (pass == 3) {
       	return tints[1];
       }
       else if (pass == 4) {
       	return tints[3];
       }
       else if (pass == 5) {
       	return tints[4];
       }
       else if (pass == 6) {
       	return tints[6];
       }
       else if (pass == 7) {
       	return tints[7];
       } 
       else if (pass == 8) {
       	return tints[9];
       }
}
return 0xFFFFFF;
  }
 
开发者ID:TTFTCUTS,项目名称:ShadowsOfPhysis,代码行数:48,代码来源:ItemTrowel.java

示例9: getCraftingResult

import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
public ItemStack getCraftingResult(InventoryCrafting p_77572_1_) {
    ItemStack itemstack = null;
    int[] aint = new int[3];
    int i = 0;
    int j = 0;
    ItemCollar collar = null;
    int k;
    int l;
    float f;
    float f1;
    int l1;

    for (k = 0; k < p_77572_1_.getSizeInventory(); ++k) {
        ItemStack itemstack1 = p_77572_1_.getStackInSlot(k);

        if (itemstack1 != null) {
            if (itemstack1.getItem() == PowerWolvesMod.COLLAR) {
                collar = (ItemCollar)itemstack1.getItem();

                itemstack = itemstack1.copy();
                itemstack.stackSize = 1;

                if (collar.hasColor(itemstack1)) {
                    l = collar.getColorFromItemStack(itemstack, 0);
                    f = (float)(l >> 16 & 255) / 255.0F;
                    f1 = (float)(l >> 8 & 255) / 255.0F;
                    float f2 = (float)(l & 255) / 255.0F;
                    i = (int)((float)i + Math.max(f, Math.max(f1, f2)) * 255.0F);
                    aint[0] = (int)((float)aint[0] + f * 255.0F);
                    aint[1] = (int)((float)aint[1] + f1 * 255.0F);
                    aint[2] = (int)((float)aint[2] + f2 * 255.0F);
                    ++j;
                }
            } else {
                if (itemstack1.getItem() != Items.dye) {
                    return null;
                }

                float[] afloat = EntitySheep.fleeceColorTable[BlockColored.func_150032_b(itemstack1.getItemDamage())];
                int j1 = (int)(afloat[0] * 255.0F);
                int k1 = (int)(afloat[1] * 255.0F);
                l1 = (int)(afloat[2] * 255.0F);
                i += Math.max(j1, Math.max(k1, l1));
                aint[0] += j1;
                aint[1] += k1;
                aint[2] += l1;
                ++j;
            }
        }
    }

    if (collar == null) {
        return null;
    } else {
        k = aint[0] / j;
        int i1 = aint[1] / j;
        l = aint[2] / j;
        f = (float)i / (float)j;
        f1 = (float)Math.max(k, Math.max(i1, l));
        k = (int)((float)k * f / f1);
        i1 = (int)((float)i1 * f / f1);
        l = (int)((float)l * f / f1);
        l1 = (k << 8) + i1;
        l1 = (l1 << 8) + l;
        collar.setColor(itemstack, l1);
        return itemstack;
    }
}
 
开发者ID:unascribed,项目名称:PowerWolves,代码行数:69,代码来源:RecipesCollarDyes.java


注:本文中的net.minecraft.entity.passive.EntitySheep.fleeceColorTable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。