Package mods.railcraft.common.fluids.tanks

Examples of mods.railcraft.common.fluids.tanks.StandardTank


    public void processGuiUpdate(int messageId, int data) {
        int tankIndex = messageId / NETWORK_DATA;

        if (tankIndex >= tanks.size())
            return;
        StandardTank tank = tanks.get(tankIndex);
        FluidStack fluidStack = tank.getFluid();
        if (fluidStack == null) {
            fluidStack = new FluidStack(-1, 0);
            tank.setFluid(fluidStack);
        }
        int fluidId = fluidStack.fluidID;
        int amount = fluidStack.amount;
        int color = tank.colorCache;
        boolean newLiquid = false;
        switch (messageId % NETWORK_DATA) {
            case 0:
                fluidId = data;
                newLiquid = true;
                break;
            case 1:
                amount = data;
                break;
            case 2:
                color = data;
                break;
        }
        if (newLiquid) {
            fluidStack = new FluidStack(fluidId, 0);
            tank.setFluid(fluidStack);
        }
        fluidStack.amount = amount;
        tank.colorCache = color;
    }
View Full Code Here

TOP

Related Classes of mods.railcraft.common.fluids.tanks.StandardTank

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.