Package mods.railcraft.common.util.misc

Examples of mods.railcraft.common.util.misc.EnumColor


        int meta = world.getBlockMetadata(x, y, z);
        if (meta == EnumPost.EMBLEM.ordinal()) {
            TileEntity tile = world.getTileEntity(x, y, z);
            if (tile instanceof TilePostEmblem) {
                TilePostEmblem post = (TilePostEmblem) tile;
                EnumColor color = post.getColor();
                if (color != null && BlockPostMetal.textures != null)
                    return BlockPostMetal.textures[color.ordinal()];
            }
        }
        return super.getIcon(world, x, y, z, side);
    }
View Full Code Here


    }

    @Override
    public IIcon getIcon(ItemStack stack, int pass) {
        if (stack.getItemDamage() == EnumPost.EMBLEM.ordinal()) {
            EnumColor color = InvTools.getItemColor(stack);
            if (color != null && BlockPostMetal.textures != null)
                return BlockPostMetal.textures[color.ordinal()];
        }
        return super.getIcon(stack, pass);
    }
View Full Code Here

            if (color != null) {
                color = null;
                needsUpdate = true;
            }
        } else {
            EnumColor c = EnumColor.fromId(cByte);
            if (color != c) {
                color = c;
                needsUpdate = true;
            }
        }
View Full Code Here

    public int testCarts(List<EntityMinecart> carts) {
        for (EntityMinecart cart : carts) {
            if (cart instanceof EntityLocomotive) {
                EntityLocomotive loco = (EntityLocomotive) cart;
                ItemStack primary = getFilters().getStackInSlot(0);
                EnumColor pColor = InvTools.getItemColor(primary);
                if (pColor != null && pColor.ordinal() != loco.getPrimaryColor()) {
                    continue;
                }
                ItemStack secondary = getFilters().getStackInSlot(1);
                EnumColor sColor = InvTools.getItemColor(secondary);
                if (sColor != null && sColor.ordinal() != loco.getSecondaryColor()) {
                    continue;
                }
                return FULL_POWER;
            }
        }
View Full Code Here

    }

    @Override
    @SideOnly(Side.CLIENT)
    public int getColorFromItemStack(ItemStack stack, int pass) {
        EnumColor color = InvTools.getItemColor(stack);
        if (color != null)
            return color.getHexColor();
        return super.getColorFromItemStack(stack, pass);
    }
View Full Code Here

        else
            modelName = LocalizationPlugin.translate("railcraft.gui.locomotive.tip.item.model.default");
        String format = LocalizationPlugin.translate("railcraft.gui.locomotive.tip.item.model");
        info.add(String.format(format, modelName));

        EnumColor primary = getPrimaryColor(stack);
        format = LocalizationPlugin.translate("railcraft.gui.locomotive.tip.item.primary");
        info.add(String.format(format, primary.getTranslatedName()));

        EnumColor secondary = getSecondaryColor(stack);
        format = LocalizationPlugin.translate("railcraft.gui.locomotive.tip.item.secondary");
        info.add(String.format(format, secondary.getTranslatedName()));

        float whistle = getWhistlePitch(stack);
        format = LocalizationPlugin.translate("railcraft.gui.locomotive.tip.item.whistle");
        info.add(String.format(format, whistle < 0 ? "???" : String.format("%.2f", whistle)));
View Full Code Here

        return items;
    }

    @Override
    public boolean recolourBlock(int cID) {
        EnumColor c = EnumColor.fromId(15 - cID);
        if (color != c) {
            color = c;
            markBlockForUpdate();
            return true;
        }
View Full Code Here

    }

    @Override
    public void readPacketData(DataInputStream data) throws IOException {
        super.readPacketData(data);
        EnumColor c = EnumColor.fromId(data.readByte());
        tankManager.readPacketData(data);
        if (color != c) {
            color = c;
            markBlockForUpdate();
        }
View Full Code Here

TOP

Related Classes of mods.railcraft.common.util.misc.EnumColor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.