Package pneumaticCraft.common.block.tubes

Examples of pneumaticCraft.common.block.tubes.TubeModule


    @Override
    public void handleServerSide(REQ message, EntityPlayer player){
        TileEntity te = player.worldObj.getTileEntity(message.x, message.y, message.z);
        //TODO add code for FMP support.
        if(te instanceof TileEntityPressureTube) {
            TubeModule module = ((TileEntityPressureTube)te).modules[message.moduleSide.ordinal()];
            if(module != null) {
                onModuleUpdate(module, message, player);
                if(!player.worldObj.isRemote) NetworkHandler.sendToAllAround(message, player.worldObj);
            }
        }
View Full Code Here


    }

    @Override
    @SideOnly(Side.CLIENT)
    public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4){
        TubeModule module = ModuleRegistrator.getModule(moduleName);
        module.addItemDescription(par3List);
        par3List.add(EnumChatFormatting.DARK_GRAY + "In line: " + (module.isInline() ? "Yes" : "No"));
    }
View Full Code Here

        if(!world.isRemote) {
            if(player.getCurrentEquippedItem() != null) {
                if(player.getCurrentEquippedItem().getItem() instanceof ItemTubeModule) {
                    TileEntityPressureTube pressureTube = (TileEntityPressureTube)world.getTileEntity(x, y, z);
                    if(pressureTube.modules[par6] == null) {
                        TubeModule module = ModuleRegistrator.getModule(((ItemTubeModule)player.getCurrentEquippedItem().getItem()).moduleName);
                        pressureTube.setModule(module, ForgeDirection.getOrientation(par6));
                        onNeighborBlockChange(world, x, y, z, this);
                        world.notifyBlocksOfNeighborChange(x, y, z, this, ForgeDirection.getOrientation(par6).getOpposite().ordinal());
                        if(!player.capabilities.isCreativeMode) player.getCurrentEquippedItem().stackSize--;
                        world.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, Block.soundTypeGlass.getStepResourcePath(), Block.soundTypeGlass.getVolume() * 5.0F, Block.soundTypeGlass.getPitch() * .9F);
                        return true;
                    }
                } else if(player.getCurrentEquippedItem().getItem() == Itemss.advancedPCB) {
                    TubeModule module = BlockPressureTube.getLookedModule(world, x, y, z, player);
                    if(module != null && !module.isUpgraded() && module.canUpgrade()) {
                        if(!world.isRemote) {
                            module.upgrade();
                            if(!player.capabilities.isCreativeMode) player.getCurrentEquippedItem().stackSize--;
                        }
                        return true;
                    }
                }
            }

        }
        if(!player.isSneaking()) {
            TubeModule module = getLookedModule(world, x, y, z, player);
            if(module != null) {
                return module.onActivated(player);
            }
        }
        return false;
    }
View Full Code Here

        modules = new TubeModule[6];
        NBTTagList moduleList = nbt.getTagList("modules", 10);
        for(int i = 0; i < moduleList.tagCount(); i++) {
            NBTTagCompound moduleTag = moduleList.getCompoundTagAt(i);
            TubeModule module = ModuleRegistrator.getModule(moduleTag.getString("type"));
            module.readFromNBT(moduleTag);
            setModule(module, ForgeDirection.getOrientation(moduleTag.getInteger("side")));
        }
    }
View Full Code Here

        if(dir != ForgeDirection.UNKNOWN) {
            NBTTagList moduleList = accessor.getNBTData().getTagList("modules", 10);
            for(int i = 0; i < moduleList.tagCount(); i++) {
                NBTTagCompound moduleTag = moduleList.getCompoundTagAt(i);
                if(dir == ForgeDirection.getOrientation(moduleTag.getInteger("side"))) {
                    TubeModule module = ModuleRegistrator.getModule(moduleTag.getString("type"));
                    module.readFromNBT(moduleTag);
                    module.addInfo(currenttip);
                }
            }
        }
        return currenttip;
    }
View Full Code Here

TOP

Related Classes of pneumaticCraft.common.block.tubes.TubeModule

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.