Package pneumaticCraft.common.network

Examples of pneumaticCraft.common.network.PacketUpdatePressureModule


            if(new Rectangle(guiLeft + 11, guiTop + 41, 158, 15).contains(mouseX, mouseY)) {
                module.higherBound = (float)(mouseX - 6 - (guiLeft + 11)) / (158 - 11) * module.maxValue;
                if(module.higherBound < -1) module.higherBound = -1;
                if(module.higherBound > module.maxValue) module.higherBound = module.maxValue;
                //higherBoundField.setText(PneumaticCraftUtils.roundNumberTo(module.higherBound, 1));
                NetworkHandler.sendToServer(new PacketUpdatePressureModule(module, 1, module.higherBound));
            } else if(new Rectangle(guiLeft + 11, guiTop + 55, 158, 15).contains(mouseX, mouseY)) {
                module.lowerBound = (float)(mouseX - 6 - (guiLeft + 11)) / (158 - 11) * module.maxValue;
                if(module.lowerBound < -1) module.lowerBound = -1;
                if(module.lowerBound > module.maxValue) module.lowerBound = module.maxValue;
                // lowerBoundField.setText(PneumaticCraftUtils.roundNumberTo(module.lowerBound, 1));
                NetworkHandler.sendToServer(new PacketUpdatePressureModule(module, 0, module.lowerBound));
            }
        }

        drawTexturedModalRect(scrollbarLowerBoundX, guiTop + 55, 183, 0, 15, 12);
        drawTexturedModalRect(scrollbarHigherBoundX, guiTop + 41, 183, 0, 15, 12);
View Full Code Here


            try {
                module.lowerBound = Float.parseFloat(lowerBoundField.getText());
                if(module.lowerBound < -1) module.lowerBound = -1;
                if(module.lowerBound > 30) module.lowerBound = 30;
                //   lowerBoundField.setText(module.lowerBound + "");
                NetworkHandler.sendToServer(new PacketUpdatePressureModule(module, 0, module.lowerBound));
            } catch(Exception e) {}
        }

        wasFocused = higherBoundField.isFocused();
        higherBoundField.mouseClicked(par1, par2, par3);
        if(wasFocused && !higherBoundField.isFocused()) {
            try {
                module.higherBound = Float.parseFloat(higherBoundField.getText());
                if(module.higherBound < -1) module.higherBound = -1;
                if(module.higherBound > 30) module.higherBound = 30;
                //  higherBoundField.setText(module.higherBound + "");
                NetworkHandler.sendToServer(new PacketUpdatePressureModule(module, 1, module.higherBound));
            } catch(Exception e) {}
        }
    }
View Full Code Here

TOP

Related Classes of pneumaticCraft.common.network.PacketUpdatePressureModule

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.