Examples of PressureNetwork


Examples of k4unl.minecraft.Hydraulicraft.api.PressureNetwork

    @Override
    public void firstTick(){}//Same deal, although nice, I think it would be better to make the implementer make a 'firstTick' call themselves if they need. Simpler the better (less methods).

    @Override
    public void updateNetwork(float oldPressure){//Copied straight from TileHydraulicPump... Needs to be better >.<.
        PressureNetwork newNetwork = null;
        PressureNetwork foundNetwork = null;
        PressureNetwork endNetwork = null;
        //This block can merge networks!
        for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
            foundNetwork = PressureNetwork.getNetworkInDir(worldObj, xCoord, yCoord, zCoord, dir);
            if(foundNetwork != null) {
                if(endNetwork == null) {
                    endNetwork = foundNetwork;
                } else {
                    newNetwork = foundNetwork;
                }
                //  connectedSides.add(dir);
            }

            if(newNetwork != null && endNetwork != null) {
                //Hmm.. More networks!? What's this!?
                endNetwork.mergeNetwork(newNetwork);
                newNetwork = null;
            }
        }

        if(endNetwork != null) {
            pNetwork = endNetwork;
            pNetwork.addMachine(this, oldPressure, ForgeDirection.UP);
            //Log.info("Found an existing network (" + pNetwork.getRandomNumber() + ") @ " + xCoord + "," + yCoord + "," + zCoord);
        } else {
            pNetwork = new PressureNetwork(this, oldPressure, ForgeDirection.UP);
            //Log.info("Created a new network (" + pNetwork.getRandomNumber() + ") @ " + xCoord + "," + yCoord + "," + zCoord);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.