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


Java ItemDye.field_150922_c方法代码示例

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


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

示例1: drawButton

import net.minecraft.item.ItemDye; //导入方法依赖的package包/类
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
  super.drawButton(mc, mouseX, mouseY);
  if (visible) {
    Tessellator tes = Tessellator.instance;
    tes.startDrawingQuads();

    int x = xPosition + 2;
    int y = yPosition + 2;

    GL11.glDisable(GL11.GL_TEXTURE_2D);

    int col = ItemDye.field_150922_c[colorIndex];
    tes.setColorOpaque_I(col);
    tes.addVertex(x, y + height - 4, zLevel);
    tes.addVertex(x + width - 4, y + height - 4, zLevel);
    tes.addVertex(x + width - 4, y + 0, zLevel);
    tes.addVertex(x, y + 0, zLevel);

    tes.draw();

    GL11.glEnable(GL11.GL_TEXTURE_2D);

  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderCore,代码行数:26,代码来源:ColorButton.java

示例2: getPlasticMeta

import net.minecraft.item.ItemDye; //导入方法依赖的package包/类
public static int getPlasticMeta(FluidStack plastic){
    int[] dyeColors = ItemDye.field_150922_c;
    int[] plasticColor = getColor3(plastic);
    int bestMatching = -1;
    double closestGap = Double.MAX_VALUE;
    List<ItemStack> plasticTypes = new ArrayList<ItemStack>();
    ((ItemPlasticPlants)Itemss.plasticPlant).addSubItems(plasticTypes);

    for(ItemStack s : plasticTypes) {
        int i = s.getItemDamage();
        double gap = Math.pow(plasticColor[0] - (dyeColors[i] >> 16), 2) + Math.pow(plasticColor[1] - (dyeColors[i] >> 8 & 255), 2) + Math.pow(plasticColor[2] - (dyeColors[i] & 255), 2);
        if(gap < closestGap) {
            closestGap = gap;
            bestMatching = i;
        }
    }
    return bestMatching;
}
 
开发者ID:MineMaarten,项目名称:PneumaticCraft,代码行数:19,代码来源:FluidPlastic.java

示例3: getRandomFirework

import net.minecraft.item.ItemDye; //导入方法依赖的package包/类
public static EntityFireworkRocket getRandomFirework(World world, BlockCoord pos) {
  ItemStack firework = new ItemStack(Items.fireworks);
  firework.stackTagCompound = new NBTTagCompound();
  NBTTagCompound expl = new NBTTagCompound();
  expl.setBoolean("Flicker", true);
  expl.setBoolean("Trail", true);

  int[] colors = new int[rand.nextInt(8) + 1];
  for (int i = 0; i < colors.length; i++) {
    colors[i] = ItemDye.field_150922_c[rand.nextInt(16)];
  }
  expl.setIntArray("Colors", colors);
  byte type = (byte) (rand.nextInt(3) + 1);
  type = type == 3 ? 4 : type;
  expl.setByte("Type", type);

  NBTTagList explosions = new NBTTagList();
  explosions.appendTag(expl);

  NBTTagCompound fireworkTag = new NBTTagCompound();
  fireworkTag.setTag("Explosions", explosions);
  fireworkTag.setByte("Flight", (byte) 1);
  firework.stackTagCompound.setTag("Fireworks", fireworkTag);

  EntityFireworkRocket e = new EntityFireworkRocket(world, pos.x + 0.5, pos.y + 0.5, pos.z + 0.5, firework);
  return e;
}
 
开发者ID:SleepyTrousers,项目名称:EnderCore,代码行数:28,代码来源:EntityUtil.java

示例4: PaintingTexture

import net.minecraft.item.ItemDye; //导入方法依赖的package包/类
public PaintingTexture() {
  super(DEFAULT_WIDTH, DEFAULT_HEIGHT);

  Arrays.fill(this.pixels, Color.WHITE.getRGB());
  final int max = Math.min(ItemDye.field_150922_c.length, this.pixels.length);
  for (int i = 0; i < max; ++i) {
    this.pixels[i] = (ItemDye.field_150922_c[i] | 0xff000000);
  }
}
 
开发者ID:twothe,项目名称:DaVincing,代码行数:10,代码来源:PaintingTexture.java

示例5: getColorFromItemStack

import net.minecraft.item.ItemDye; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack par1ItemStack, int par2)
{
    int damage = par1ItemStack.getItemDamage();
    if (damage>=0 && damage < ItemDye.field_150922_c.length)
    {
        return ItemDye.field_150922_c[15-damage];
    }
    return 16777215;
}
 
开发者ID:Quetzi,项目名称:BluePower,代码行数:11,代码来源:ItemCanvasBag.java

示例6: getColorFromItemStack

import net.minecraft.item.ItemDye; //导入方法依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack itemStack, int colour) {

    int damage = itemStack.getItemDamage();
    if (damage >= 0 && damage < ItemDye.field_150922_c.length) { return ItemDye.field_150922_c[15 - damage]; }
    return 16777215;
}
 
开发者ID:Quetzi,项目名称:BluePower,代码行数:9,代码来源:ItemLumar.java

示例7: getColorFromItemStack

import net.minecraft.item.ItemDye; //导入方法依赖的package包/类
@Override
public int getColorFromItemStack(ItemStack stack, int pass)
{
	int colour = this.getColour(stack);
	if (colour < 16)
		return ItemDye.field_150922_c[colour];
	else
		return Color.YELLOW.getRGB();
}
 
开发者ID:MikeLydeamore,项目名称:IlluminatedBows,代码行数:10,代码来源:ItemFocusColoured.java

示例8: getColorFromItemStack

import net.minecraft.item.ItemDye; //导入方法依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack par1ItemStack, int par2) {

	if((colorState < 16) && (colorState >= 0)){
		return ItemDye.field_150922_c[colorState];
	}

	return 0xffffff;
}
 
开发者ID:ArtixAllMighty,项目名称:rpginventory,代码行数:11,代码来源:ItemRpgInvArmor.java

示例9: getVanillaDmgValue

import net.minecraft.item.ItemDye; //导入方法依赖的package包/类
/**
 * Returns vanilla dye metadata value for OreDictionary dye ItemStack.
 *
 * @param itemStack
 * @return
 */
public static int getVanillaDmgValue(ItemStack itemStack)
{
    int color = getColor(itemStack);

    for (int idx = 0; idx < ItemDye.field_150922_c.length; ++idx) {
        if (color == ItemDye.field_150922_c[idx]) {
            return 15 - idx;
        }
    }

    return 15;
}
 
开发者ID:Mineshopper,项目名称:carpentersblocks,代码行数:19,代码来源:DyeHandler.java

示例10: addDye

import net.minecraft.item.ItemDye; //导入方法依赖的package包/类
public static void addDye(FluidStack plastic, int dyeMetadata){
    if(!Fluids.areFluidsEqual(plastic.getFluid(), Fluids.plastic)) throw new IllegalArgumentException("Given fluid stack isn't mixable! " + plastic);
    int dyeColor = ItemDye.field_150922_c[dyeMetadata];
    int[] dyeColors = new int[]{dyeColor >> 16, dyeColor >> 8 & 255, dyeColor & 255};
    int[] plasticColor = getColor3(plastic);
    double ratio = PneumaticValues.PLASTIC_MIX_RATIO / (PneumaticValues.PLASTIC_MIX_RATIO * (plastic.amount / 1000D));
    for(int i = 0; i < 3; i++) {
        plasticColor[i] = (int)(ratio * dyeColors[i] + (1 - ratio) * plasticColor[i]);
    }
    if(plastic.tag == null) plastic.tag = new NBTTagCompound();
    plastic.tag.setInteger("color", (plasticColor[0] << 16) + (plasticColor[1] << 8) + plasticColor[2]);
}
 
开发者ID:MineMaarten,项目名称:PneumaticCraft,代码行数:13,代码来源:FluidPlastic.java

示例11: getDyeRenderColor

import net.minecraft.item.ItemDye; //导入方法依赖的package包/类
public static int getDyeRenderColor(final int color) {
	return color < 0 || color > 15 ? ItemDye.field_150922_c[DEFAULT_COLOR]
			: ItemDye.field_150922_c[color];
}
 
开发者ID:OreCruncher,项目名称:ThermalRecycling,代码行数:5,代码来源:DyeHelper.java

示例12: getColor

import net.minecraft.item.ItemDye; //导入方法依赖的package包/类
private int getColor(int dmg, int mask) {
  if (dmg < 16) {
    return ItemDye.field_150922_c[dmg] | mask;
  }
  return 0xffffff;
}
 
开发者ID:twothe,项目名称:DaVincing,代码行数:7,代码来源:PaintTool.java

示例13: getModifiedColor

import net.minecraft.item.ItemDye; //导入方法依赖的package包/类
@Override
public Color getModifiedColor(Color oldColor, ItemStack item) {
    int rgb = ItemDye.field_150922_c[item.getItemDamage()];
    java.awt.Color c = new java.awt.Color(rgb);
    return new Color(c.getRed(), c.getGreen(), c.getBlue());
}
 
开发者ID:meew0,项目名称:AdvancedPotions,代码行数:7,代码来源:ItemHandlerDye.java

示例14: render

import net.minecraft.item.ItemDye; //导入方法依赖的package包/类
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, int Meta, boolean On)
{
    Color Border = new Color(86, 65, 40);

    super.render(entity, f, f1, f2, f3, f4, f5);
    setRotationAngles(f, f1, f2, f3, f4, f5, entity);

    GL11.glPushMatrix();
    GL11.glColor4f(Border.getRed() / (float)255, Border.getGreen() / (float)255, Border.getBlue() / (float)255, 1F);

    Shape1.render(f5);
    Shape2.render(f5);
    Shape3.render(f5);
    Shape4.render(f5);
    Shape5.render(f5);
    Shape6.render(f5);
    Shape7.render(f5);
    Shape8.render(f5);
    Shape9.render(f5);
    Shape10.render(f5);
    Shape11.render(f5);
    Shape12.render(f5);

    GL11.glPushMatrix();

    Color c = new Color(ItemDye.field_150922_c[15 - Meta]);
    int r = c.getRed();
    int g = c.getGreen();
    int b = c.getBlue();

    int Change = 45;

    if(!On){
        r -= Change;
        g -= Change;
        b -= Change;
    }


    if(r > 255)
    r = 255;
else if(r < 0)
    r = 0;

    if(g > 255)
        g = 255;
    else if(g < 0)
        g = 0;

    if(b > 255)
        b = 255;
    else if(b < 0)
        b = 0;

    GL11.glPushMatrix();

    if(On)
    GL11.glDisable(GL11.GL_LIGHTING);

    GL11.glColor4f(r / (float)255, g / (float)255, b / (float)255, 1F);
    Shape13.render(f5);

    GL11.glEnable(GL11.GL_LIGHTING);

    GL11.glPopMatrix();
    GL11.glPopMatrix();
    GL11.glPopMatrix();



}
 
开发者ID:tm1990,项目名称:CircuitMod,代码行数:72,代码来源:LampModel.java

示例15: init

import net.minecraft.item.ItemDye; //导入方法依赖的package包/类
public static void init() {

        basalt = new BlockStoneOre(Refs.BASALT_NAME);
        marble = new BlockStoneOre(Refs.MARBLE_NAME);
        basalt_cobble = new BlockStoneOre(Refs.BASALTCOBBLE_NAME);
        basalt_brick = new BlockStoneOre(Refs.BASALTBRICK_NAME);
        marble_brick = new BlockStoneOre(Refs.MARBLEBRICK_NAME);
        cracked_basalt = new BlockCrackedBasalt(Refs.CRACKED_BASALT);
        basaltbrick_cracked = new BlockStoneOre(Refs.CRACKEDBASALTBRICK_NAME);
        basalt_brick_small = new BlockStoneOre(Refs.SMALLBASALTBRICK_NAME);
        marble_brick_small = new BlockStoneOre(Refs.SMALLMARBLEBRICK_NAME);
        fancy_basalt = new BlockStoneOre(Refs.CHISELEDBASALTBRICK_NAME);
        fancy_marble = new BlockStoneOre(Refs.CHISELEDMARBLEBRICK_NAME);
        marble_tile = new BlockStoneOreConnected(Refs.MARBLETILE_NAME);
        basalt_tile = new BlockStoneOreConnected(Refs.BASALTTILE_NAME);
        marble_paver = new BlockStoneOre(Refs.MARBLEPAVER_NAME);
        basalt_paver = new BlockStoneOre(Refs.BASALTPAVER_NAME);

        nikolite_ore = new BlockItemOre(Refs.NIKOLITEORE_NAME);
        ruby_ore = new BlockItemOre(Refs.RUBYORE_NAME);
        sapphire_ore = new BlockItemOre(Refs.SAPPHIREORE_NAME);
        amethyst_ore = new BlockItemOre(Refs.AMETHYSTORE_NAME);
        copper_ore = new BlockStoneOre(Refs.COPPERORE_NAME);
        silver_ore = new BlockStoneOre(Refs.SILVERORE_NAME);
        tin_ore = new BlockStoneOre(Refs.TINORE_NAME);
        tungsten_ore = new BlockStoneOre(Refs.TUNGSTENORE_NAME);

        ruby_block = new BlockStoneOre(Refs.RUBYBLOCK_NAME);
        sapphire_block = new BlockStoneOre(Refs.SAPPHIREBLOCK_NAME);
        amethyst_block = new BlockStoneOre(Refs.AMETHYSTBLOCK_NAME);
        nikolite_block = new BlockStoneOre(Refs.NIKOLITEBLOCK_NAME);
        copper_block = new BlockStoneOre(Refs.COPPERBLOCK_NAME);
        silver_block = new BlockStoneOre(Refs.SILVERBLOCK_NAME);
        tin_block = new BlockStoneOre(Refs.TINBLOCK_NAME);
        tungsten_block = new BlockStoneOre(Refs.TUNGSTENBLOCK_NAME);

        flax_crop = new BlockCrop().setBlockName(Refs.FLAXCROP_NAME);
        indigo_flower = new BlockCustomFlower(Refs.INDIGOFLOWER_NAME);

        alloy_furnace = new BlockAlloyFurnace();
        sorting_machine = new BlockSortingMachine();
        block_breaker = new BlockBlockBreaker();
        igniter = new BlockIgniter();
        buffer = new BlockBuffer();
        Deployer = new BlockDeployer();
        project_table = new BlockProjectTable();
        transposer = new BlockTransposer();
        ejector = new BlockEjector();
        relay = new BlockRelay();

        cpu = new BlockCPU();
        monitor = new BlockMonitor();
        disk_drive = new BlockDiskDrive();
        io_expander = new BlockIOExpander();

        engine = new BlockEngine();
        kinetic_generator = new BlockKineticGenerator();
        windmill = new BlockWindmill();
        
        blockLamp = new Block[ItemDye.field_150922_c.length];
        blockLampInverted = new Block[ItemDye.field_150922_c.length];
        
        for (int i = 0; i < ItemDye.field_150922_c.length; i++){
            blockLamp[i] = new BlockLamp(false, ItemDye.field_150921_b[i].toLowerCase(), ItemDye.field_150922_c[i]);
        }
        for (int i = 0; i < ItemDye.field_150922_c.length; i++){
            blockLampInverted[i] = new BlockLamp(true, ItemDye.field_150921_b[i].toLowerCase(), ItemDye.field_150922_c[i]);
        }
        
        registerBlocks();
        initModDependantBlocks();
    }
 
开发者ID:Quetzi,项目名称:BluePower,代码行数:73,代码来源:BPBlocks.java


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