本文整理汇总了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);
}
示例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;
}
示例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);
}
示例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;
}
}
示例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();
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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;
}
}