Package mods.railcraft.common.carts

Examples of mods.railcraft.common.carts.EntityLocomotive


    public static final LocomotiveRenderer INSTANCE = new LocomotiveRenderer();

    @Override
    public boolean render(IRenderer renderer, EntityMinecart cart, float light, float time) {
        EntityLocomotive loco = (EntityLocomotive) cart;

        int primaryColor = EnumColor.fromId(loco.getPrimaryColor()).getHexColor();
        int secondaryColor = EnumColor.fromId(loco.getSecondaryColor()).getHexColor();

        String emblem = loco.getEmblem();
        ResourceLocation emblemTexture = null;
        if (emblem != null && !emblem.equals("") && EmblemToolsClient.packageManager != null)
            emblemTexture = EmblemToolsClient.packageManager.getEmblemTextureLocation(emblem);

        LocomotiveRenderType renderType = loco.getRenderType();
        mods.railcraft.api.carts.locomotive.LocomotiveModelRenderer locoRenderer = renderType.getRenderer(loco.getModel());

        locoRenderer.renderLocomotive(renderer, cart, primaryColor, secondaryColor, emblemTexture, light, time);
        return false;
    }
View Full Code Here


            return;
        Train train = LinkageManager.instance().getTrain((EntityMinecart) entiyPlayer.ridingEntity);
        if (binding == LOCOMOTIVE_INCREASE_SPEED) {
            for (EntityMinecart cart : train) {
                if (cart instanceof EntityLocomotive) {
                    EntityLocomotive loco = (EntityLocomotive) cart;
                    if (loco.canControl(entiyPlayer.getGameProfile()))
                        loco.increaseSpeed();
                }
            }
        } else if (binding == LOCOMOTIVE_DECREASE_SPEED) {
            for (EntityMinecart cart : train) {
                if (cart instanceof EntityLocomotive) {
                    EntityLocomotive loco = (EntityLocomotive) cart;
                    if (loco.canControl(entiyPlayer.getGameProfile()))
                        loco.decreaseSpeed();
                }
            }
        } else if (binding == LOCOMOTIVE_MODE_CHANGE) {
            for (EntityMinecart cart : train) {
                if (cart instanceof EntityLocomotive) {
                    EntityLocomotive loco = (EntityLocomotive) cart;
                    if (loco.canControl(entiyPlayer.getGameProfile())) {
                        LocoMode mode = loco.getMode();
                        if (mode == LocoMode.RUNNING)
                            loco.setMode(LocoMode.IDLE);
                        else
                            loco.setMode(LocoMode.RUNNING);
                    }
                }
            }
        } else if (binding == LOCOMOTIVE_WHISTLE)
            for (EntityMinecart cart : train) {
                if (cart instanceof EntityLocomotive) {
                    EntityLocomotive loco = (EntityLocomotive) cart;
                    loco.whistle();
                    break;
                }
            }
    }
View Full Code Here

    @Override
    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

TOP

Related Classes of mods.railcraft.common.carts.EntityLocomotive

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.